mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-09 14:42:05 +00:00
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:
parent
ccb682bbb8
commit
44a906dd01
7
src/graphics/RAKled.h
Normal file
7
src/graphics/RAKled.h
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
#ifdef RAK4630
|
||||||
|
#include <NCP5623.h>
|
||||||
|
extern NCP5623 rgb;
|
||||||
|
|
||||||
|
#endif
|
10
src/main.cpp
10
src/main.cpp
@ -19,6 +19,7 @@
|
|||||||
#include "detect/ScanI2CTwoWire.h"
|
#include "detect/ScanI2CTwoWire.h"
|
||||||
#include "detect/axpDebug.h"
|
#include "detect/axpDebug.h"
|
||||||
#include "detect/einkScan.h"
|
#include "detect/einkScan.h"
|
||||||
|
#include "graphics/RAKled.h"
|
||||||
#include "graphics/Screen.h"
|
#include "graphics/Screen.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mesh/generated/meshtastic/config.pb.h"
|
#include "mesh/generated/meshtastic/config.pb.h"
|
||||||
@ -360,6 +361,15 @@ void setup()
|
|||||||
// Only one supported RGB LED currently
|
// Only one supported RGB LED currently
|
||||||
rgb_found = i2cScanner->find(ScanI2C::DeviceType::NCP5623);
|
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)
|
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||||
auto acc_info = i2cScanner->firstAccelerometer();
|
auto acc_info = i2cScanner->firstAccelerometer();
|
||||||
accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found;
|
accelerometer_found = acc_info.type != ScanI2C::DeviceType::NONE ? acc_info.address : accelerometer_found;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#ifdef RAK4630
|
#ifdef RAK4630
|
||||||
#include <NCP5623.h>
|
#include <graphics/RAKled.h>
|
||||||
NCP5623 rgb;
|
NCP5623 rgb;
|
||||||
|
|
||||||
uint8_t red = 0;
|
uint8_t red = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user