.

Dependencies:   mbed EthernetInterface mbed-rtos

Fork of Bootloader_K64F by Erik -

main.cpp

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

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();
        }
    }
}