Replaced FastLED by Adafruit Neopixel

This commit is contained in:
2023-03-02 22:30:42 +01:00
parent cb3d49ad13
commit 34c50df2e9
6 changed files with 335 additions and 160 deletions

View File

@@ -108,6 +108,16 @@ String processor(const String &var)
#else
return "Feature N/A";
#endif
if (var == "LED_MODE_FLASH")
return String(LubeConfig.LED_Mode_Flash);
if (var == "LEDFLASHCHECKED")
return String(LubeConfig.LED_Mode_Flash == true ? "checked" : "");
if (var == "LED_MAX_BRIGHTNESS")
return String(LubeConfig.LED_Max_Brightness);
if (var == "LED_MIN_BRIGHTNESS")
return String(LubeConfig.LED_Min_Brightness);
if (var == "EEPROM_VERSION")
return String(LubeConfig.EEPROM_Version);
if (var == "CONFIG_CHECKSUM")
{
char buffer[7];
@@ -357,6 +367,26 @@ void WebserverPOST_Callback(AsyncWebServerRequest *request)
globals.systemStatus = sysStat_Shutdown;
}
// end: POST Form Maintenance
// begin: POST Form LED Settings
if (p->name() == "ledmaxbrightness")
LubeConfig.LED_Max_Brightness = p->value().toInt();
if (p->name() == "ledminbrightness")
LubeConfig.LED_Min_Brightness = p->value().toInt();
if (p->name() == "ledsave")
{
if (request->hasParam("ledmodeflash", true))
{
AsyncWebParameter *param = request->getParam("ledmodeflash", true);
if (param->value() == "on")
LubeConfig.LED_Mode_Flash = true;
}
else
{
LubeConfig.LED_Mode_Flash = false;
}
globals.requestEEAction = EE_CFG_SAVE;
}
// end: POST Form LED SEttings
}
}
@@ -440,6 +470,7 @@ void WebserverEERestore_Callback(AsyncWebServerRequest *request, const String &f
if (validext)
{
Debug_pushMessage("Restoring EEPROM-Stuff\n");
#warning "please implement EEPROM-Restore"
}
if (final)
@@ -495,6 +526,9 @@ void WebServerEEJSON_Callback(AsyncWebServerRequest *request)
config["CANSource"] = LubeConfig.CANSource;
config["CANSource_Str"] = CANSourceString[LubeConfig.CANSource];
#endif
config["LED_Mode_Flash"] = LubeConfig.LED_Mode_Flash;
config["LED_Max_Brightness"] = LubeConfig.LED_Max_Brightness;
config["LED_Min_Brightness"] = LubeConfig.LED_Min_Brightness;
sprintf(buffer, "0x%08X", LubeConfig.checksum);
config["checksum"] = buffer;