mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-20 17:52:35 +00:00
Ambient lighting (#2779)
* This was already defined and throwing a ton of warnings * Ambient lighting module feature * Use local instance type
This commit is contained in:
16
src/main.cpp
16
src/main.cpp
@@ -73,6 +73,7 @@ NRF52Bluetooth *nrf52Bluetooth;
|
||||
|
||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||
#include "AccelerometerThread.h"
|
||||
#include "AmbientLightingThread.h"
|
||||
#endif
|
||||
|
||||
using namespace concurrency;
|
||||
@@ -169,6 +170,7 @@ static OSThread *buttonThread;
|
||||
uint32_t ButtonThread::longPressTime = 0;
|
||||
#endif
|
||||
static OSThread *accelerometerThread;
|
||||
static OSThread *ambientLightingThread;
|
||||
SPISettings spiSettings(4000000, MSBFIRST, SPI_MODE0);
|
||||
|
||||
RadioInterface *rIf = NULL;
|
||||
@@ -409,14 +411,6 @@ void setup()
|
||||
// Only one supported RGB LED currently
|
||||
#ifdef HAS_NCP5623
|
||||
rgb_found = i2cScanner->find(ScanI2C::DeviceType::NCP5623);
|
||||
|
||||
// Start the RGB LED at 50%
|
||||
|
||||
if (rgb_found.type == ScanI2C::NCP5623) {
|
||||
rgb.begin();
|
||||
rgb.setCurrent(10);
|
||||
rgb.setColor(128, 128, 128);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||
@@ -521,6 +515,12 @@ void setup()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||
if (rgb_found.type != ScanI2C::DeviceType::NONE) {
|
||||
ambientLightingThread = new AmbientLightingThread(rgb_found.type);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef T_WATCH_S3
|
||||
drv.begin();
|
||||
drv.selectLibrary(1);
|
||||
|
||||
Reference in New Issue
Block a user