...
Dependencies: mbed EthernetInterface mbed-rtos
Fork of FOTA_K64F by
main.cpp@11:0f4df7636ef7, 2017-03-14 (annotated)
- Committer:
- wmmihaa
- Date:
- Tue Mar 14 14:06:21 2017 +0000
- Revision:
- 11:0f4df7636ef7
- Parent:
- 9:56ed3a56ecc3
microServiceBus.node
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Sissors | 0:9396d3376435 | 1 | #include "mbed.h" |
wmmihaa | 11:0f4df7636ef7 | 2 | #include "EthernetInterface.h" |
Sissors | 7:4ab0430d06e3 | 3 | #include "bootloader.h" |
Sissors | 1:782a3ddc329e | 4 | |
Sissors | 9:56ed3a56ecc3 | 5 | DigitalIn sw(PTA4); |
Sissors | 9:56ed3a56ecc3 | 6 | DigitalOut LED(LED_BLUE); |
Sissors | 9:56ed3a56ecc3 | 7 | |
Sissors | 1:782a3ddc329e | 8 | int main() |
Sissors | 7:4ab0430d06e3 | 9 | { |
wmmihaa | 11:0f4df7636ef7 | 10 | EthernetInterface eth; |
wmmihaa | 11:0f4df7636ef7 | 11 | eth.init(); //Use DHCP |
wmmihaa | 11:0f4df7636ef7 | 12 | eth.connect(); |
wmmihaa | 11:0f4df7636ef7 | 13 | printf("Welcome to microServiceBus Start up\r\n"); |
wmmihaa | 11:0f4df7636ef7 | 14 | while (1) { |
wmmihaa | 11:0f4df7636ef7 | 15 | printf("Entering bootloader\r\n"); |
wmmihaa | 11:0f4df7636ef7 | 16 | write_flash(); |
wmmihaa | 11:0f4df7636ef7 | 17 | } |
wmmihaa | 11:0f4df7636ef7 | 18 | |
wmmihaa | 11:0f4df7636ef7 | 19 | /* |
Sissors | 9:56ed3a56ecc3 | 20 | //Blink LED, and when SW3 is pressed go to bootloader |
Sissors | 9:56ed3a56ecc3 | 21 | //I don't know atm if the bootloader would work from interrupt context |
Sissors | 9:56ed3a56ecc3 | 22 | while (1) { |
Sissors | 9:56ed3a56ecc3 | 23 | LED = !LED; |
Sissors | 9:56ed3a56ecc3 | 24 | wait(0.25); |
Sissors | 9:56ed3a56ecc3 | 25 | if (sw == 0) { |
Sissors | 9:56ed3a56ecc3 | 26 | printf("Entering bootloader\r\n"); |
Sissors | 9:56ed3a56ecc3 | 27 | write_flash(); |
Sissors | 9:56ed3a56ecc3 | 28 | } |
wmmihaa | 11:0f4df7636ef7 | 29 | }*/ |
Sissors | 1:782a3ddc329e | 30 | } |
Sissors | 7:4ab0430d06e3 | 31 | |
Sissors | 7:4ab0430d06e3 | 32 |