From 713142dceff2f12ebbb62f2196d8aed348504299 Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Sat, 28 Dec 2013 12:26:53 +0100 Subject: firmware: move increment idlePolls to main again --- firmware/bootloaderconfig.h | 6 ++---- firmware/main.c | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index a3ae665..479d268 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -141,18 +141,16 @@ these macros are defined, the boot loader uses them. #define USB_INTR_PENDING_BIT PCIF #define USB_INTR_VECTOR PCINT0_vect -// Microcontroller Vectortable entries in the flash +// Microcontroller vectortable entries in the flash #define RESET_VECTOR_OFFSET 0 #define USBPLUS_VECTOR_OFFSET 2 - // number of bytes before the boot loader vectors to store the tiny application vector table #define TINYVECTOR_RESET_OFFSET 4 #define TINYVECTOR_USBPLUS_OFFSET 2 #define TINYVECTOR_OSCCAL_OFFSET 6 - /* Example configuration: Port D bit 3 is connected to a jumper which ties * this pin to GND if the boot loader is requested. Initialization allows * several clock cycles for the input voltage to stabilize before @@ -185,7 +183,7 @@ these macros are defined, the boot loader uses them. #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 diff --git a/firmware/main.c b/firmware/main.c index 83c5538..0723c3e 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -326,7 +326,8 @@ int main(void) { #if LED_PRESENT LED_MACRO( ((uint8_t*)&idlePolls)[1] ) #endif - + + idlePolls++; // Try to execute program if bootloader exit condition is met if (!bootLoaderCondition()) fireEvent(EVENT_EXECUTE); -- cgit v1.2.3