diff options
Diffstat (limited to 'app/led.c')
-rw-r--r-- | app/led.c | 76 |
1 files changed, 70 insertions, 6 deletions
@@ -1,29 +1,83 @@ #include "project.h" -#define LED (GPIO6) -#define LED_PORT GPIOA - +#define LED1 (GPIO8) +#define LED1_PORT GPIOE +#define LED2 (GPIO9) +#define LED2_PORT GPIOE +#define LED3 (GPIO10) +#define LED3_PORT GPIOE +#define LED4 (GPIO11) +#define LED4_PORT GPIOE +#define LED5 (GPIO10) +#define LED5_PORT GPIOB +#define LED6 (GPIO11) +#define LED6_PORT GPIOB +#define LED7 (GPIO12) +#define LED7_PORT GPIOB +#define LED8 (GPIO13) +#define LED8_PORT GPIOB +#define LED9 (GPIO0) +#define LED9_PORT GPIOD +#define LED10 (GPIO1) +#define LED10_PORT GPIOD static unsigned led_ms; void led_init (void) { + MAP_OUTPUT_PP (LED1); + MAP_OUTPUT_PP (LED2); + MAP_OUTPUT_PP (LED3); + MAP_OUTPUT_PP (LED4); + MAP_OUTPUT_PP (LED5); + MAP_OUTPUT_PP (LED6); + MAP_OUTPUT_PP (LED7); + MAP_OUTPUT_PP (LED8); + MAP_OUTPUT_PP (LED9); + MAP_OUTPUT_PP (LED10); + + SET (LED1); + SET (LED2); + SET (LED3); + SET (LED4); + SET (LED5); + SET (LED6); + SET (LED7); + SET (LED8); + SET (LED9); + SET (LED10); + +} + +void led1_set (int v) +{ + if (!v) SET (LED1); + else CLEAR (LED1); +} - MAP_OUTPUT_PP (LED); +void led2_set (int v) +{ + if (!v) SET (LED2); + else CLEAR (LED2); } +void led3_set (int v) +{ + if (!v) SET (LED3); + else CLEAR (LED3); +} void led_clear (void) { - SET (LED); + SET (LED4); } void led_set() { - CLEAR (LED); + CLEAR (LED4); } void led_blink (unsigned ms) @@ -43,3 +97,13 @@ led_tick (void) if (!led_ms) led_clear(); } + +void led_slow_tick (void) +{ + static int c; + + + c++; + c &= 7; +} + |