From 44a906dd01488f66cca5a4fea347fb1e05f2e3cc Mon Sep 17 00:00:00 2001 From: charminULTRA Date: Mon, 26 Jun 2023 20:59:44 -0400 Subject: [PATCH] RAK14001 LED - Turn on to 50% at boot (#2571) * Addition of RAK 14001 functionality to start and stay on for boot * Fixing via Trunk --------- Co-authored-by: Ben Meadors --- src/graphics/RAKled.h | 7 +++++++ src/main.cpp | 10 ++++++++++ src/modules/ExternalNotificationModule.cpp | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 src/graphics/RAKled.h diff --git a/src/graphics/RAKled.h b/src/graphics/RAKled.h new file mode 100644 index 000000000..06e2a717f --- /dev/null +++ b/src/graphics/RAKled.h @@ -0,0 +1,7 @@ +#include "main.h" + +#ifdef RAK4630 +#include +extern NCP5623 rgb; + +#endif \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 937f9091a..c867930d0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,6 +19,7 @@ #include "detect/ScanI2CTwoWire.h" #include "detect/axpDebug.h" #include "detect/einkScan.h" +#include "graphics/RAKled.h" #include "graphics/Screen.h" #include "main.h" #include "mesh/generated/meshtastic/config.pb.h" @@ -360,6 +361,15 @@ void setup() // Only one supported RGB LED currently rgb_found = i2cScanner->find(ScanI2C::DeviceType::NCP5623); +// Start the RGB LED at 50% +#ifdef RAK4630 + if (rgb_found.type == ScanI2C::NCP5623) { + rgb.begin(); + rgb.setCurrent(10); + rgb.setColor(128, 128, 128); + } +#endif + #if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) auto acc_info = i2cScanner->firstAccelerometer(); accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found; diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 7dbf78a08..82701cdc0 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -11,7 +11,7 @@ #include "main.h" #ifdef RAK4630 -#include +#include NCP5623 rgb; uint8_t red = 0;