From 58deb57f21507d0223720cf39d1734ac01fce380 Mon Sep 17 00:00:00 2001 From: Bluebie Date: Fri, 8 Feb 2013 12:05:50 +1100 Subject: upgrade: now automatically reboots in to new bootloader when it's done doing the upgrade and has beeped. --- upgrade/upgrade.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/upgrade/upgrade.c b/upgrade/upgrade.c index dc5d449..2541f09 100644 --- a/upgrade/upgrade.c +++ b/upgrade/upgrade.c @@ -50,6 +50,8 @@ int main(void) { beep(); + reboot(); + return 0; } @@ -156,6 +158,12 @@ void beep(void) { } } +void reboot(void) { + void (*ptrToFunction)(); // pointer to a function + ptrToFunction = 0x0000; + (*ptrToFunction)(); // reset! +} + ////////////// Add padding to start of program so no program code could reasonably be erased while program is running // this never needs to be called - avr-gcc stuff happening: http://www.nongnu.org/avr-libc/user-manual/mem_sections.html -- cgit v1.2.3