summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorcpldcpu <cpldcpu@gmail.com>2013-12-31 13:34:12 +0100
committercpldcpu <cpldcpu@gmail.com>2013-12-31 13:34:12 +0100
commit8f6ccdaccf624a3e2c727ff4e6ad2c7dc479b51b (patch)
tree6912621d66bd0d7a9612d86e21c3511978884c2d /firmware
parent5b94559c7226774bda746f640b351bec07fe842f (diff)
downloadmicronucleus-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.c9
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) {