bootloader: Jump to application code after serial communication is done.
authorTilman Sauerbeck <tilman@code-monkey.de>
Sun, 7 Jul 2019 07:57:47 +0000 (09:57 +0200)
committerTilman Sauerbeck <tilman@code-monkey.de>
Sun, 5 Jan 2020 19:38:11 +0000 (20:38 +0100)
src/bootloader/main.rs

index f54b4bcea02d8dbf161bf9f50fefb31e4a140699..d83702e734c5369c31cbabd84d6174e7aff12825 100644 (file)
@@ -33,6 +33,10 @@ mod bootloader;
 use common::clock;
 use common::usb_serial;
 
+extern {
+    fn jump_to_application(address: u32);
+}
+
 const APPLICATION_ADDR: u32 = 0x0;
 
 #[no_mangle]
@@ -44,8 +48,9 @@ pub unsafe extern fn main() {
 
         let mut b = bootloader::Bootloader::new();
 
-        loop {
-            b.run();
+        while b.run() {
         }
     }
+
+    jump_to_application(__application_addr);
 }