diff options
Diffstat (limited to 'firmware/bootloaderconfig.h')
-rw-r--r-- | firmware/bootloaderconfig.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index 3133368..641a9e0 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -207,16 +207,25 @@ these macros are defined, the boot loader uses them. /* max 6200ms to not overflow idlePolls variable */ -#define AUTO_EXIT_MS 5000 +#define AUTO_EXIT_MS 6000 //#define AUTO_EXIT_CONDITION() (idlePolls > (AUTO_EXIT_MS * 10UL)) // uncomment for chips with clkdiv8 enabled in fuses //#define LOW_POWER_MODE 1 // restore cpu speed calibration back to 8/16mhz instead of 8.25/16.5mhz -//#define RESTORE_OSCCAL 1 +// #define RESTORE_OSCCAL // set clock prescaler to a value before running user program //#define SET_CLOCK_PRESCALER _BV(CLKPS0) /* divide by 2 for 8mhz */ +// Specific configuration for the Nanite +// Nanite has both LED and tactile button connected to control pin. +// LED will turn on when output=low and act as external pull up otherwise +// button shorts to GND + +//#define NANITE +#define NANITE_CTRLPIN PB5 + + #ifdef BUILD_JUMPER_MODE #define START_JUMPER_PIN 5 #define digitalRead(pin) (PINB & _BV(pin)) @@ -234,10 +243,17 @@ these macros are defined, the boot loader uses them. PORTB = 0; } #endif /* __ASSEMBLER__ */ + +#elif defined NANITE + #define bootLoaderInit() + #define bootLoaderExit() + #define bootLoaderCondition() (++idlePolls < (AUTO_EXIT_MS * 10UL)) + #define bootLoaderStartCondition() (!(PINB & _BV(NANITE_CTRLPIN))) + #else #define bootLoaderInit() #define bootLoaderExit() - #define bootLoaderCondition() (idlePolls < (AUTO_EXIT_MS * 10UL)) + #define bootLoaderCondition() (++idlePolls < (AUTO_EXIT_MS * 10UL)) #if LOW_POWER_MODE // only starts bootloader if USB D- is pulled high on startup - by putting your pullup in to an external connector // you can avoid ever entering an out of spec clock speed or waiting on bootloader when that pullup isn't there |