Mikael Hakansson / Mbed 2 deprecated microServiceBus_bootloader

Dependencies:   mbed EthernetInterface mbed-rtos

Fork of FOTA_K64F by Erik -

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "EthernetInterface.h"
00003 #include "bootloader.h"
00004 
00005 DigitalIn sw(PTA4);
00006 DigitalOut LED(LED_BLUE);
00007 
00008 int main() 
00009 {
00010     EthernetInterface eth;
00011     eth.init(); //Use DHCP
00012     eth.connect();
00013     printf("Welcome to microServiceBus Start up\r\n");
00014     while (1) {
00015         printf("Entering bootloader\r\n");
00016         write_flash();
00017     }
00018 
00019     /*
00020     //Blink LED, and when SW3 is pressed go to bootloader
00021     //I don't know atm if the bootloader would work from interrupt context
00022     while (1) {
00023         LED = !LED;
00024         wait(0.25);
00025         if (sw == 0) {
00026             printf("Entering bootloader\r\n");
00027             write_flash();
00028         }
00029     }*/
00030 }
00031  
00032