From 8f6ccdaccf624a3e2c727ff4e6ad2c7dc479b51b Mon Sep 17 00:00:00 2001 From: cpldcpu Date: Tue, 31 Dec 2013 13:34:12 +0100 Subject: firmware: leavebootloader does never return The compiler does only understand this when inserting an infinite loop. Saves two bytes and prevents a warning. --- firmware/main.c | 9 +++++---- 1 file 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) { -- cgit v1.2.3