diff options
author | cpldcpu <cpldcpu@gmail.com> | 2013-12-31 13:34:12 +0100 |
---|---|---|
committer | cpldcpu <cpldcpu@gmail.com> | 2013-12-31 13:34:12 +0100 |
commit | 8f6ccdaccf624a3e2c727ff4e6ad2c7dc479b51b (patch) | |
tree | 6912621d66bd0d7a9612d86e21c3511978884c2d /firmware | |
parent | 5b94559c7226774bda746f640b351bec07fe842f (diff) | |
download | micronucleus-8f6ccdaccf624a3e2c727ff4e6ad2c7dc479b51b.tar.gz micronucleus-8f6ccdaccf624a3e2c727ff4e6ad2c7dc479b51b.tar.bz2 micronucleus-8f6ccdaccf624a3e2c727ff4e6ad2c7dc479b51b.zip |
firmware: leavebootloader does never return
The compiler does only understand this when inserting an infinite loop.
Saves two bytes and prevents a warning.
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/firmware/main.c b/firmware/main.c index ad0b7a2..efef481 100644 --- a/firmware/main.c +++ b/firmware/main.c @@ -261,10 +261,11 @@ static inline void leaveBootloader(void) { nop(); } #endif - - // jump to application reset vector at end of flash - asm volatile ("rjmp __vectors - 4"); - } + + asm volatile ("rjmp __vectors - 4"); // jump to application reset vector at end of flash + + for (;;); // Make sure function does not return to help compiler optimize +} int main(void) { |