Change LED blinking rate when tests finish

pull/391/head
Mihail Stoyanov 2014-07-04 20:32:14 +03:00
parent ac85b9f6a0
commit 2018e40f3c
2 changed files with 7 additions and 10 deletions

View File

@ -1,11 +1,11 @@
#include "test_env.h" #include "test_env.h"
void led_blink(PinName led) { void led_blink(PinName led, float delay) {
if (led != NC) { if (led != NC) {
DigitalOut myled(led); DigitalOut myled(led);
while (1) { while (1) {
myled = !myled; myled = !myled;
wait(1.0); wait(delay);
} }
} }
while(1); while(1);
@ -13,15 +13,12 @@ void led_blink(PinName led) {
void notify_completion(bool success) { void notify_completion(bool success) {
if (success) { if (success) {
printf("{{success}}" NL ); printf("{{success}}" NL);
} else { } else {
printf("{{failure}}" NL ); printf("{{failure}}" NL);
} }
printf("{{end}}" NL); printf("{{end}}" NL);
#ifdef LED4
led_blink(success ? LED1 : LED4); led_blink(LED1, success ? 1.0 : 0.1);
#else
led_blink(success ? LED1 : NC);
#endif
} }

View File

@ -6,7 +6,7 @@
#define NL "\n" #define NL "\n"
void led_blink(void); void led_blink(PinName led, float delay);
void notify_completion(bool success); void notify_completion(bool success);