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 | #define GWSERIAL_TYPE_TX 4 | ||||||
| #include <GwConfigItem.h> | #include <GwConfigItem.h> | ||||||
| #include <HardwareSerial.h> | #include <HardwareSerial.h> | ||||||
|  | #include "GwAppInfo.h" | ||||||
| #include "GwUserTasks.h" | #include "GwUserTasks.h" | ||||||
| 
 | 
 | ||||||
| //general definitions for M5AtomLite
 | //general definitions for M5AtomLite
 | ||||||
|  | @ -230,4 +231,13 @@ | ||||||
|   #endif |   #endif | ||||||
| #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 | #endif | ||||||
|  |  | ||||||
|  | @ -38,11 +38,7 @@ void handleLeds(void *param){ | ||||||
|     #else |     #else | ||||||
|     FastLED.addLeds<GWLED_TYPE,GWLED_PIN>(leds,1); |     FastLED.addLeds<GWLED_TYPE,GWLED_PIN>(leds,1); | ||||||
|     #endif |     #endif | ||||||
|     #ifdef GWLED_BRIGHTNESS |     uint8_t brightness=api->getConfig()->getInt(GwConfigDefinitions::ledBrightness,128); | ||||||
|     uint8_t brightness=GWLED_BRIGHTNESS; |  | ||||||
|     #else |  | ||||||
|     uint8_t brightness=128; //50%
 |  | ||||||
|     #endif |  | ||||||
|     GwLedMode currentMode=mode; |     GwLedMode currentMode=mode; | ||||||
|     leds[0]=colorFromMode(currentMode); |     leds[0]=colorFromMode(currentMode); | ||||||
|     FastLED.setBrightness(brightness); |     FastLED.setBrightness(brightness); | ||||||
|  |  | ||||||
|  | @ -156,6 +156,16 @@ | ||||||
|         "description": "log level at the USB port", |         "description": "log level at the USB port", | ||||||
|         "category":"system" |         "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", |         "name": "minXdrInterval", | ||||||
|         "label":"min XDR interval", |         "label":"min XDR interval", | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 andreas
						andreas