Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 2:5d467e30afbd
- Parent:
- 1:6c11c89de66c
- Child:
- 3:e5c2bfd464f7
--- a/main.cpp Fri Oct 20 13:53:00 2017 +0000 +++ b/main.cpp Fri Sep 13 12:54:24 2019 +0000 @@ -4,9 +4,20 @@ #define RELEASED 0 #define PRESSED 1 +#ifdef TARGET_NUCLEO_F429ZI +#define ONBOARD +#endif + +#ifdef ONBOARD +DigitalOut red_led(LED3); //CountUp is in its critical section +DigitalOut yellow_led(LED2); //CountDown is in its critical section +DigitalOut green_led(LED1); //counter != 0 +#else DigitalOut red_led(PE_15); //CountUp is in its critical section DigitalOut yellow_led(PB_10); //CountDown is in its critical section DigitalOut green_led(PB_11); //counter != 0 +#endif + DigitalIn button(USER_BUTTON); //Shared mutable state @@ -75,7 +86,7 @@ if (button == PRESSED) { //VERSION 2: short delay allowing main to be preempted - you might want to tweak this value - t1.attach_us(callback(&countDown), 100); + t1.attach_us(&countDown, 15); } else { //VERSION 1: 2s - ENOUGH TIME FOR COUNTUP TO FINISH t1.attach(&countDown, 2);