diff options
Diffstat (limited to 'app/led.c')
-rw-r--r-- | app/led.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/app/led.c b/app/led.c new file mode 100644 index 0000000..825bd0d --- /dev/null +++ b/app/led.c @@ -0,0 +1,38 @@ +#include "project.h" + +#define LED (GPIO3) +#define LED_PORT GPIOB + + +void +led_init (void) +{ + + MAP_OUTPUT_PP (LED); +} + + +void +led_clear (void) +{ + CLEAR (LED); +} + +void +led_set() +{ + gpio_set (LED_PORT, LED); +} + +void +led_slow_tick (void) +{ + static int c; + + c = !c; + + if (c) + led_set(); + else + led_clear(); +} |