summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcpldcpu <cpldcpu@gmail.com>2013-12-28 12:26:53 +0100
committercpldcpu <cpldcpu@gmail.com>2013-12-28 12:26:53 +0100
commit713142dceff2f12ebbb62f2196d8aed348504299 (patch)
tree04f86da1b03df74453449344988a1b2d4d218caf
parentcdd64a20189750fcdb5fbdadf131351907f6e712 (diff)
downloadmicronucleus-713142dceff2f12ebbb62f2196d8aed348504299.tar.gz
micronucleus-713142dceff2f12ebbb62f2196d8aed348504299.tar.bz2
micronucleus-713142dceff2f12ebbb62f2196d8aed348504299.zip
firmware: move increment idlePolls to main again
-rw-r--r--firmware/bootloaderconfig.h6
-rw-r--r--firmware/main.c3
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);