diff options
author | Christian Pointner <equinox@spreadspace.org> | 2017-09-02 18:44:43 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2017-09-02 18:44:43 +0200 |
commit | 6265e46a54402744f9e8d66ddfd325a30ffef8f0 (patch) | |
tree | 0da9e9e419f234190d1c9504a98c002a6960ebc9 /lib | |
parent | rename devminumum board to stm8blue (diff) |
fix programmer and led pin for stm8blue
Diffstat (limited to 'lib')
-rw-r--r-- | lib/led.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -33,11 +33,15 @@ #define LED_DIR 0 #endif +#ifdef LED_PINNUM +#define LED_MASK (1<<LED_PINNUM) +#endif + void led_init(void) { #if LED_CNT >= 1 led_off(); - LED_GPIO->DDR |= 1<<LED_PINNUM; + LED_GPIO->DDR |= LED_MASK; #endif } @@ -45,9 +49,9 @@ void led_on(void) { #if LED_CNT >= 1 #if LED_DIR == 1 - LED_GPIO->ODR |= 1<<LED_PINNUM; + LED_GPIO->ODR |= LED_MASK; #else - LED_GPIO->ODR &= ~(1<<LED_PINNUM); + LED_GPIO->ODR &= ~LED_MASK; #endif #endif } @@ -56,9 +60,9 @@ void led_off(void) { #if LED_CNT >= 1 #if LED_DIR == 1 - LED_GPIO->ODR &= ~(1<<LED_PINNUM); + LED_GPIO->ODR &= ~(LED_MASK); #else - LED_GPIO->ODR |= 1<<LED_PINNUM; + LED_GPIO->ODR |= LED_MASK; #endif #endif } @@ -66,6 +70,6 @@ void led_off(void) void led_toggle(void) { #if LED_CNT >= 1 - LED_GPIO->ODR ^= 1<<LED_PINNUM; + LED_GPIO->ODR ^= LED_MASK; #endif } |