Add led_state function to led module

This commit is contained in:
iabdalkader 2014-02-01 19:08:04 +02:00
parent 21d35baa7b
commit a55ec77a9d
2 changed files with 13 additions and 1 deletions

View File

@ -34,7 +34,7 @@ void led_init(enum led_color color)
led=color;
/* Call back LED function every 1 second */
systick_sched_task(led_cb, 1000);
// systick_sched_task(led_cb, 1000);
}
@ -46,3 +46,14 @@ void led_set_color(enum led_color color)
/* turn off old LED */
GPIO_SetBits(GPIOD, old_pin);
}
void led_state(enum led_color id, int state)
{
if (state) {
/* turn off old LED */
GPIO_ResetBits(GPIOD, id);
} else {
/* turn off old LED */
GPIO_SetBits(GPIOD, id);
}
}

View File

@ -9,4 +9,5 @@ enum led_color {
void led_init(enum led_color color);
void led_set_color(enum led_color color);
void led_state(enum led_color color, int state);
#endif //__RGB_LED_H__