platform/minimal-net: Print out pseudo LED status.

This commit is contained in:
Robert Quattlebaum 2012-06-13 09:17:32 -07:00
parent a571b663b0
commit 0ca8a57f39

View file

@ -37,6 +37,7 @@
* Adam Dunkels <adam@sics.se>
*/
#include <stdio.h>
#include "dev/leds.h"
static unsigned char leds;
/*---------------------------------------------------------------------------*/
@ -55,6 +56,15 @@ leds_arch_get(void)
void
leds_arch_set(unsigned char l)
{
int i;
for(i = 0; i < 8 && ((1 << i) & LEDS_ALL); i++) {
if(((1 << i) & leds) && !((1 << i) & l)) {
printf("LED %d OFF\n", i);
} else if(!((1 << i) & leds) && ((1 << i) & l)) {
printf("LED %d ON\n", i);
}
}
leds = l;
}
/*---------------------------------------------------------------------------*/