platform/minimal-net: Print out pseudo LED status.
This commit is contained in:
parent
a571b663b0
commit
0ca8a57f39
|
@ -37,6 +37,7 @@
|
||||||
* Adam Dunkels <adam@sics.se>
|
* Adam Dunkels <adam@sics.se>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
#include "dev/leds.h"
|
#include "dev/leds.h"
|
||||||
static unsigned char leds;
|
static unsigned char leds;
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -55,6 +56,15 @@ leds_arch_get(void)
|
||||||
void
|
void
|
||||||
leds_arch_set(unsigned char l)
|
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;
|
leds = l;
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue