mirror of https://github.com/ARMmbed/mbed-os.git
Change LED blinking rate when tests finish
parent
ac85b9f6a0
commit
2018e40f3c
|
@ -1,11 +1,11 @@
|
|||
#include "test_env.h"
|
||||
|
||||
void led_blink(PinName led) {
|
||||
void led_blink(PinName led, float delay) {
|
||||
if (led != NC) {
|
||||
DigitalOut myled(led);
|
||||
while (1) {
|
||||
myled = !myled;
|
||||
wait(1.0);
|
||||
wait(delay);
|
||||
}
|
||||
}
|
||||
while(1);
|
||||
|
@ -13,15 +13,12 @@ void led_blink(PinName led) {
|
|||
|
||||
void notify_completion(bool success) {
|
||||
if (success) {
|
||||
printf("{{success}}" NL );
|
||||
printf("{{success}}" NL);
|
||||
} else {
|
||||
printf("{{failure}}" NL );
|
||||
printf("{{failure}}" NL);
|
||||
}
|
||||
|
||||
printf("{{end}}" NL);
|
||||
#ifdef LED4
|
||||
led_blink(success ? LED1 : LED4);
|
||||
#else
|
||||
led_blink(success ? LED1 : NC);
|
||||
#endif
|
||||
|
||||
led_blink(LED1, success ? 1.0 : 0.1);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#define NL "\n"
|
||||
|
||||
void led_blink(void);
|
||||
void led_blink(PinName led, float delay);
|
||||
|
||||
void notify_completion(bool success);
|
||||
|
||||
|
|
Loading…
Reference in New Issue