diff options
Diffstat (limited to 'openpcd/firmware/src/led.c')
-rw-r--r-- | openpcd/firmware/src/led.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/openpcd/firmware/src/led.c b/openpcd/firmware/src/led.c index 83e7ce7..b3dcfc7 100644 --- a/openpcd/firmware/src/led.c +++ b/openpcd/firmware/src/led.c @@ -1,5 +1,5 @@ -#include <include/types.h> +#include <sys/types.h> #include <include/lib_AT91SAM7.h> #include "openpcd.h" #include "dbgu.h" @@ -7,11 +7,11 @@ static int led2port(int led) { if (led == 1) - return OPENPCD_LED1; + return OPENPCD_PIO_LED1; else if (led == 2) - return OPENPCD_LED2; + return OPENPCD_PIO_LED2; else - return -1; + return 0; } void led_switch(int led, int on) @@ -47,12 +47,14 @@ int led_toggle(int led) led_switch(led, 0); else led_switch(led, 1); + + return !on; } void led_init(void) { - AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_LED1); - AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_LED2); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED1); + AT91F_PIO_CfgOutput(AT91C_BASE_PIOA, OPENPCD_PIO_LED2); led_switch(1, 0); led_switch(2, 0); } |