//----------------------------------------------------------------------------------
// <copyright file="fuses.c" company="LiquidRobotics">
//	Copyright (c) Liquid Robotics Corporation.  All rights reserved.
// </copyright>
//
// <summary>
// 	Sets the fuses for the Float C&C application
// </summary>
//
// <owner>Mike Cookson</owner>
//----------------------------------------------------------------------------------

#include <stdint.h>
#include <stdlib.h>
#include <avr/io.h>
#include <avr/fuse.h>

// set the fuses appropriately
FUSES = {
    // no extra startup time, no 8x divider, no clock out, 8MHz RC oscillator -- EXTERNAL CLOCK
    .low = (FUSE_SUT0 & FUSE_SUT1 & FUSE_CKSEL3 & FUSE_CKSEL2 & FUSE_CKSEL1 & FUSE_CKSEL0),

    // use boot reset, largest boot block size, save eeprom, enable SPI and JTAG
    .high = (FUSE_BOOTRST & FUSE_BOOTSZ0 & FUSE_BOOTSZ1 & FUSE_EESAVE & FUSE_SPIEN & FUSE_JTAGEN),

    // no brownout detector
    .extended = EFUSE_DEFAULT,
};

// no lock bit protection for flash programming. Application section reflashable. Boot section is locked
//LOCKBITS = (LB_MODE_1 & BLB0_MODE_1 & BLB1_MODE_2);

