...

Dependencies:   mbed EthernetInterface mbed-rtos

Fork of FOTA_K64F by Erik -

main.cpp

Committer:
Sissors
Date:
2016-04-24
Revision:
9:56ed3a56ecc3
Parent:
8:00cefe0d59ed
Child:
11:0f4df7636ef7

File content as of revision 9:56ed3a56ecc3:

#include "mbed.h"
#include "bootloader.h"

DigitalIn sw(PTA4);
DigitalOut LED(LED_BLUE);

int main() 
{
    printf("Hello :)\r\n");
    
    //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();
        }
    }
}