.

Dependencies:   mbed EthernetInterface mbed-rtos

Fork of Bootloader_K64F by Erik -

Revision:
9:56ed3a56ecc3
Parent:
8:00cefe0d59ed
diff -r 00cefe0d59ed -r 56ed3a56ecc3 main.cpp
--- a/main.cpp	Sat Apr 23 18:24:07 2016 +0000
+++ b/main.cpp	Sun Apr 24 12:46:10 2016 +0000
@@ -1,16 +1,23 @@
 #include "mbed.h"
 #include "bootloader.h"
 
+DigitalIn sw(PTA4);
+DigitalOut LED(LED_BLUE);
+
 int main() 
 {
+    printf("Hello :)\r\n");
     
-    printf("\r\nTestrun!\r\n");   
-    printf("Press any key to continue\r\n");
-    getchar();
-    printf("Starting bootloader\r\n");
-    wait(1);
-    write_flash();
-    while(1);
+    //Blink LED, and when SW3 is pressed go to bootloader
+    //I don't know atm if the bootloader would work from interrupt context
+    while (1) {
+        LED = !LED;
+        wait(0.25);
+        if (sw == 0) {
+            printf("Entering bootloader\r\n");
+            write_flash();
+        }
+    }
 }