From 05f1f75c9fecfa10c6ae07ccf080f47145d66810 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 2 Apr 2018 03:13:01 +0200 Subject: [PATCH] Fixed RGB Led after transmit --- src/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 56e63ed0..76adecee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -159,13 +159,14 @@ void lorawan_loop(void * pvParameters) { } else if (LMIC.opmode & (OP_TXDATA | OP_TXRXPEND)) { color = COLOR_BLUE; new_led_state = ((millis() % 500) < 20) ? HIGH : LOW; - } // This should not happen so indicate a pb - if ( LMIC.opmode & (OP_TXDATA | OP_TXRXPEND | OP_JOINING | OP_REJOIN) == 0 ) { + } else if ( LMIC.opmode & (OP_TXDATA | OP_TXRXPEND | OP_JOINING | OP_REJOIN) == 0 ) { color = COLOR_RED; // Heartbeat long blink 200ms on each 2 seconds new_led_state = ((millis() % 2000) < 200) ? HIGH : LOW; + } else { + rgb_set_color(COLOR_NONE); } // led need to change state ? // avoid digitalWrite() for nothing