mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-14 06:23:07 +01:00
allow to control LEB brightness via config UI
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#define GWSERIAL_TYPE_TX 4
|
||||
#include <GwConfigItem.h>
|
||||
#include <HardwareSerial.h>
|
||||
#include "GwAppInfo.h"
|
||||
#include "GwUserTasks.h"
|
||||
|
||||
//general definitions for M5AtomLite
|
||||
@@ -230,4 +231,13 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef GWLED_FASTLED
|
||||
#define CFGMODE_ledBrightness GwConfigInterface::NORMAL
|
||||
#ifdef GWLED_BRIGHTNESS
|
||||
#define CFGDEFAULT_ledBrightness GWSTRINGIFY(GWLED_BRIGHTNESS)
|
||||
#endif
|
||||
#else
|
||||
#define CFGMODE_ledBrightness GwConfigInterface::HIDDEN
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -38,11 +38,7 @@ void handleLeds(void *param){
|
||||
#else
|
||||
FastLED.addLeds<GWLED_TYPE,GWLED_PIN>(leds,1);
|
||||
#endif
|
||||
#ifdef GWLED_BRIGHTNESS
|
||||
uint8_t brightness=GWLED_BRIGHTNESS;
|
||||
#else
|
||||
uint8_t brightness=128; //50%
|
||||
#endif
|
||||
uint8_t brightness=api->getConfig()->getInt(GwConfigDefinitions::ledBrightness,128);
|
||||
GwLedMode currentMode=mode;
|
||||
leds[0]=colorFromMode(currentMode);
|
||||
FastLED.setBrightness(brightness);
|
||||
|
||||
Reference in New Issue
Block a user