allow to control LEB brightness via config UI
This commit is contained in:
parent
d1032bc231
commit
723713b69d
|
@ -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);
|
||||
|
|
|
@ -156,6 +156,16 @@
|
|||
"description": "log level at the USB port",
|
||||
"category":"system"
|
||||
},
|
||||
{
|
||||
"name":"ledBrightness",
|
||||
"label":"led brightness",
|
||||
"type":"number",
|
||||
"default":64,
|
||||
"min":0,
|
||||
"max":255,
|
||||
"description":"the brightness of the led (0..255)",
|
||||
"category":"system"
|
||||
},
|
||||
{
|
||||
"name": "minXdrInterval",
|
||||
"label":"min XDR interval",
|
||||
|
|
Loading…
Reference in New Issue