From 16c1092c688200cba1231dbfebbac52b4d178c03 Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Mon, 7 Oct 2013 01:17:39 +0200 Subject: Reduce accesses to global variable idlePolls saves 8 bytes --- firmware/bootloaderconfig.h | 2 +- firmware/main.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/firmware/bootloaderconfig.h b/firmware/bootloaderconfig.h index 3133368..a23ea5a 100644 --- a/firmware/bootloaderconfig.h +++ b/firmware/bootloaderconfig.h @@ -237,7 +237,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 fb03923..6b281d9 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -441,7 +441,6 @@ int main(void) { do { usbPoll(); _delay_us(100); - idlePolls++; // these next two freeze the chip for ~ 4.5ms, breaking usb protocol // and usually both of these will activate in the same loop, so host -- cgit v1.2.3