From 67039d6a1334e65db2e7dd4d5e97a81474d0ee71 Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Sun, 29 Dec 2013 18:48:45 +0100 Subject: fireware: Bugfix: no slowndown after timer overflow --- firmware/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/main.c b/firmware/main.c index 8394e7e..4673384 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -304,17 +304,18 @@ int main(void) { clearEvents(); usbPoll(); - + idlePolls++; // Try to execute program if bootloader exit condition is met - if (AUTO_EXIT_MS&&(idlePolls>AUTO_EXIT_MS*10L)) fireEvent(EVENT_EXECUTE); + if (AUTO_EXIT_MS&&(idlePolls==AUTO_EXIT_MS*10L)) fireEvent(EVENT_EXECUTE); + LED_MACRO( ((uint8_t*)&idlePolls)[1] ); // Wait for USB traffic to finish before a blocking event is executed // All events will render the MCU unresponsive to USB traffic for a while. if (events) _delay_ms(2); - + if (isEvent(EVENT_ERASE_APPLICATION)) eraseApplication(); if (isEvent(EVENT_WRITE_PAGE)) writeFlashPage(); -- cgit v1.2.3