Reduced memory consumption. Reduced steps per second to reach the brightness.

This commit is contained in:
Kai Lauterbach 2023-05-11 11:48:07 +02:00
parent 4cb1007062
commit 6e4b75025f
2 changed files with 6 additions and 6 deletions

View file

@ -18,7 +18,7 @@
#define EEPROM_LAST_STATE_ADDRESS 4 // the first "last state" information for the first light #define EEPROM_LAST_STATE_ADDRESS 4 // the first "last state" information for the first light
#define EEPROM_TIMING_DATA_ADDRESS (EEPROM_LAST_STATE_ADDRESS + LIGHTS_COUNT) // Stored data date per light ELE_USED; HH; MM; CH1; CH2; CH3; CH4; #define EEPROM_TIMING_DATA_ADDRESS (EEPROM_LAST_STATE_ADDRESS + LIGHTS_COUNT) // Stored data date per light ELE_USED; HH; MM; CH1; CH2; CH3; CH4;
#define BRI_MOD_STEPS_PER_SEC 25.0 #define BRI_MOD_STEPS_PER_SEC 5
#define TIME_CHECK_INTERVAL_MS (60000UL) // 60 second interval #define TIME_CHECK_INTERVAL_MS (60000UL) // 60 second interval
#define TIME_LIGHTENGINE_INTERVAL_MS (1000UL / BRI_MOD_STEPS_PER_SEC) // BRI_MOD_STEPS_PER_SEC steps per second to in-/decrease the brightness #define TIME_LIGHTENGINE_INTERVAL_MS (1000UL / BRI_MOD_STEPS_PER_SEC) // BRI_MOD_STEPS_PER_SEC steps per second to in-/decrease the brightness

View file

@ -381,7 +381,7 @@ void init_webserver()
server.on("/state", HTTP_PUT, []() server.on("/state", HTTP_PUT, []()
{ // HTTP PUT request used to set a new light state { // HTTP PUT request used to set a new light state
DynamicJsonDocument root(1024); DynamicJsonDocument root(512);
DeserializationError error = deserializeJson(root, server.arg("plain")); DeserializationError error = deserializeJson(root, server.arg("plain"));
if (error) { if (error) {
@ -448,9 +448,9 @@ void init_webserver()
server.on("/state", HTTP_GET, []() server.on("/state", HTTP_GET, []()
{ // HTTP GET request used to fetch current light state { // HTTP GET request used to fetch current light state
uint8_t light = server.arg("light").toInt() - 1; uint8_t light = server.arg("light").toInt() - 1;
DynamicJsonDocument root(1024); DynamicJsonDocument root(512);
root["on"] = light_state[light]; root["on"] = light_state[light];
root["bri"] = bri[light]; root["bri"] = bri[light];
root["curbri"] = (int)current_bri[light]; root["curbri"] = (int)current_bri[light];
root["curpwm"] = current_pwm[light]; root["curpwm"] = current_pwm[light];
String output; String output;
@ -688,7 +688,7 @@ void init_webserver()
ESP.reset(); ESP.reset();
} }
// ***** Generate HTML page ***** // // ***** Generate static HTML page ***** //
String tmp1 = genHMTLTop(); String tmp1 = genHMTLTop();