led.cpp: bugfix 2nd LED

This commit is contained in:
Verkehrsrot 2019-03-24 16:18:08 +01:00
parent e18f9fdcae
commit 0dcb9b9e2b

View File

@ -108,23 +108,23 @@ void switch_LED(uint8_t state) {
} }
void switch_LED1(uint8_t state) { void switch_LED1(uint8_t state) {
#if (HAS_LED1 != NOT_A_PIN) #ifdef HAS_TWO_LED
if (state == LED_ON) { if (state == LED_ON) {
// switch LED on // switch LED on
#ifdef LED1_ACTIVE_LOW #ifdef LED1_ACTIVE_LOW
digitalWrite(HAS_LED1, LOW); digitalWrite(HAS_TWO_LED, LOW);
#else #else
digitalWrite(HAS_LED1, HIGH); digitalWrite(HAS_TWO_LED, HIGH);
#endif #endif
} else if (state == LED_OFF) { } else if (state == LED_OFF) {
// switch LED off // switch LED off
#ifdef LED1_ACTIVE_LOW #ifdef LED1_ACTIVE_LOW
digitalWrite(HAS_LED1, HIGH); digitalWrite(HAS_TWO_LED, HIGH);
#else #else
digitalWrite(HAS_LED1, LOW); digitalWrite(HAS_TWO_LED, LOW);
#endif #endif
} }
#endif #endif // HAS_TWO_LED
} }
void blink_LED(uint16_t set_color, uint16_t set_blinkduration) { void blink_LED(uint16_t set_color, uint16_t set_blinkduration) {
@ -157,7 +157,7 @@ void ledLoop(void *parameter) {
// No custom blink, check LoRaWAN state // No custom blink, check LoRaWAN state
} else { } else {
#if(HAS_LORA) #if (HAS_LORA)
// LED indicators for viusalizing LoRaWAN state // LED indicators for viusalizing LoRaWAN state
if (LMIC.opmode & (OP_JOINING | OP_REJOIN)) { if (LMIC.opmode & (OP_JOINING | OP_REJOIN)) {
LEDColor = COLOR_YELLOW; LEDColor = COLOR_YELLOW;