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 <benmmeadors@gmail.com>
This commit is contained in:
charminULTRA 2023-06-26 20:59:44 -04:00 committed by GitHub
parent ccb682bbb8
commit 44a906dd01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions

7
src/graphics/RAKled.h Normal file
View File

@ -0,0 +1,7 @@
#include "main.h"
#ifdef RAK4630
#include <NCP5623.h>
extern NCP5623 rgb;
#endif

View File

@ -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;

View File

@ -11,7 +11,7 @@
#include "main.h"
#ifdef RAK4630
#include <NCP5623.h>
#include <graphics/RAKled.h>
NCP5623 rgb;
uint8_t red = 0;