Commit 7f930549 authored by Eric Duminil's avatar Eric Duminil
Browse files

Save timers to config

parent e2fb6ded
Pipeline #5790 failed with stage
in 1 minute and 46 seconds
...@@ -305,6 +305,7 @@ namespace sensor { ...@@ -305,6 +305,7 @@ namespace sensor {
Serial.println(F("s (change will only be applied after next measurement).")); Serial.println(F("s (change will only be applied after next measurement)."));
scd30.setMeasurementInterval(timestep); scd30.setMeasurementInterval(timestep);
config::measurement_timestep = timestep; config::measurement_timestep = timestep;
config::save();
led_effects::showKITTWheel(color::green, 1); led_effects::showKITTWheel(color::green, 1);
} }
} }
......
...@@ -176,6 +176,7 @@ namespace csv_writer { ...@@ -176,6 +176,7 @@ namespace csv_writer {
Serial.print(F("Setting CSV Interval to : ")); Serial.print(F("Setting CSV Interval to : "));
Serial.print(config::csv_interval); Serial.print(config::csv_interval);
Serial.println("s."); Serial.println("s.");
config::save();
led_effects::showKITTWheel(color::green, 1); led_effects::showKITTWheel(color::green, 1);
} }
......
...@@ -239,6 +239,7 @@ namespace lorawan { ...@@ -239,6 +239,7 @@ namespace lorawan {
Serial.print(F("Setting LoRa sending interval to : ")); Serial.print(F("Setting LoRa sending interval to : "));
Serial.print(config::lorawan_sending_interval); Serial.print(config::lorawan_sending_interval);
Serial.println("s."); Serial.println("s.");
config::save();
led_effects::showKITTWheel(color::green, 1); led_effects::showKITTWheel(color::green, 1);
} }
} }
......
...@@ -188,6 +188,7 @@ namespace mqtt { ...@@ -188,6 +188,7 @@ namespace mqtt {
Serial.print(F("Setting MQTT sending interval to : ")); Serial.print(F("Setting MQTT sending interval to : "));
Serial.print(config::mqtt_sending_interval); Serial.print(config::mqtt_sending_interval);
Serial.println("s."); Serial.println("s.");
config::save();
led_effects::showKITTWheel(color::green, 1); led_effects::showKITTWheel(color::green, 1);
} }
......
...@@ -292,6 +292,9 @@ namespace config { ...@@ -292,6 +292,9 @@ namespace config {
float &temperature_offset = web_config::temperatureOffsetParam.value(); // [K] Sign isn't relevant. float &temperature_offset = web_config::temperatureOffsetParam.value(); // [K] Sign isn't relevant.
bool &wifi_active = web_config::ampelWifiParam.value(); bool &wifi_active = web_config::ampelWifiParam.value();
void save() {
web_config::iotWebConf->saveConfig();
}
// LEDs // LEDs
uint8_t &max_brightness = web_config::maxBrightnessParam.value(); uint8_t &max_brightness = web_config::maxBrightnessParam.value();
......
...@@ -19,6 +19,7 @@ namespace config { ...@@ -19,6 +19,7 @@ namespace config {
extern float &temperature_offset; // [K] Sign isn't relevant. extern float &temperature_offset; // [K] Sign isn't relevant.
extern bool &wifi_active; // [true / false] extern bool &wifi_active; // [true / false]
void save(); // Save config to EEPROM
// LED // LED
extern uint8_t &max_brightness; extern uint8_t &max_brightness;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment