diff --git a/src/hal/eboxtube.h b/src/hal/eboxtube.h index 86a69d7d..e95b6940 100644 --- a/src/hal/eboxtube.h +++ b/src/hal/eboxtube.h @@ -14,7 +14,8 @@ #define CFG_sx1276_radio 1 #define HAS_LED (22) // Green LED on board -#define HAS_RGB_LED SmartLed rgb_led(LED_WS2812, 1, GPIO_NUM_2) // WS2812B RGB LED on board +#define RGB_LED_COUNT 1 // we have 1 LED +#define HAS_RGB_LED SmartLed rgb_led(LED_WS2812, RGB_LED_COUNT, GPIO_NUM_2) // WS2812B RGB LED on board #define HAS_BUTTON (0) // button "FLASH" on board #define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature diff --git a/src/hal/lopy4.h b/src/hal/lopy4.h index e0736229..4e625dfa 100644 --- a/src/hal/lopy4.h +++ b/src/hal/lopy4.h @@ -21,7 +21,8 @@ #define CFG_sx1276_radio 1 #define HAS_LED NOT_A_PIN // LoPy4 has no on board mono LED, we use on board RGB LED -#define HAS_RGB_LED SmartLed rgb_led(LED_WS2812, 1, GPIO_NUM_0) // WS2812B RGB LED on GPIO0 (P2) +#define RGB_LED_COUNT 1 // we have 1 LEDs +#define HAS_RGB_LED SmartLed rgb_led(LED_WS2812, RGB_LED_COUNT, GPIO_NUM_0) // WS2812B RGB LED on GPIO0 (P2) #define BOARD_HAS_PSRAM // use extra 4MB extern RAM // Note: Pins for LORA chip SPI interface come from board file pins_arduino.h diff --git a/src/hal/m5fire.h b/src/hal/m5fire.h index 969c05ee..0e53a8a1 100644 --- a/src/hal/m5fire.h +++ b/src/hal/m5fire.h @@ -39,6 +39,7 @@ #define HAS_LED NOT_A_PIN // no on board LED (?) #define RGB_LED_COUNT 10 + #define HAS_RGB_LED SmartLed rgb_led(LED_SK6812, RGB_LED_COUNT, GPIO_NUM_15) // LED_SK6812 RGB LED on GPIO15 #define HAS_BUTTON (39) // on board button A diff --git a/src/hal/ttgov1.h b/src/hal/ttgov1.h index 448327e4..bdf42be6 100644 --- a/src/hal/ttgov1.h +++ b/src/hal/ttgov1.h @@ -37,6 +37,6 @@ // Pins for LORA chip SPI interface come from board file, we need some // additional definitions for LMIC #define LORA_IO1 (33) -#define LORA_IO2 LMIC_UNUSED_PIN +#define LORA_IO2 (32) // ref.: https://www.thethingsnetwork.org/forum/t/big-esp32-sx127x-topic-part-3/18436 #endif diff --git a/src/led.cpp b/src/led.cpp index 64d33d2e..4936eff4 100644 --- a/src/led.cpp +++ b/src/led.cpp @@ -63,6 +63,7 @@ RGBColor rgb_hsl2rgb(float h, float s, float l) { } void rgb_set_color(uint16_t hue) { + int i = RGB_LED_COUNT; if (hue == COLOR_NONE) { // set Off for (int i = 0; i < RGB_LED_COUNT; i++)