Bayley Wang
/
flash_configuration
flash based config testing
Diff: main.cpp
- Revision:
- 2:cfc39b0843ae
- Parent:
- 1:df6bbacb7bb9
- Child:
- 3:82c00c8e2cb4
diff -r df6bbacb7bb9 -r cfc39b0843ae main.cpp --- a/main.cpp Thu Mar 02 07:04:47 2017 +0000 +++ b/main.cpp Thu Mar 02 07:36:56 2017 +0000 @@ -3,11 +3,13 @@ #include "PreferenceWriter.h" #include "FlashWriter.h" #include "CommandProcessor.h" +#include "config.h" Serial pc(USBTX, USBRX); PreferenceWriter pref(6); +DigitalOut led(LED1); -int index = 0; +int index = 0, mode = MODE_RUN; char linebuf[128]; void rxCallback() { @@ -32,12 +34,23 @@ } } +void commutate() { + if (mode != MODE_RUN) { + led = 0; + } else { + led = 1; + } +} + int main() { pc.baud(115200); pc.attach(rxCallback); pc.printf("%s\n", "Serial Configuration Test"); pc.printf("%s", ">"); + Ticker tick; + tick.attach_us(commutate, 200); + for(;;) { } }