Commit 4ca1e30a authored by Simone Primarosa's avatar Simone Primarosa

Added Power Consumption stored in eeprom EEPROM

parent 6abada29
...@@ -41,7 +41,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) { ...@@ -41,7 +41,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
// wrong data being written to the variables. // wrong data being written to the variables.
// ALSO: always make sure the variables in the Store and retrieve sections are in the same order. // ALSO: always make sure the variables in the Store and retrieve sections are in the same order.
#define EEPROM_VERSION "V17" #define EEPROM_VERSION "V18"
#ifdef EEPROM_SETTINGS #ifdef EEPROM_SETTINGS
void Config_StoreSettings() { void Config_StoreSettings() {
...@@ -133,6 +133,10 @@ void Config_StoreSettings() { ...@@ -133,6 +133,10 @@ void Config_StoreSettings() {
EEPROM_WRITE_VAR(i, idleoozing_enabled); EEPROM_WRITE_VAR(i, idleoozing_enabled);
#endif #endif
#if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION)
EEPROM_WRITE_VAR(i, power_consumption_hour);
#endif
int storageSize = i; int storageSize = i;
char ver2[4] = EEPROM_VERSION; char ver2[4] = EEPROM_VERSION;
...@@ -256,6 +260,10 @@ void Config_RetrieveSettings() ...@@ -256,6 +260,10 @@ void Config_RetrieveSettings()
EEPROM_READ_VAR(i, idleoozing_enabled); EEPROM_READ_VAR(i, idleoozing_enabled);
#endif #endif
#if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION)
EEPROM_READ_VAR(i, power_consumption_hour);
#endif
// Call updatePID (similar to when we have processed M301) // Call updatePID (similar to when we have processed M301)
updatePID(); updatePID();
SERIAL_ECHO_START; SERIAL_ECHO_START;
...@@ -401,6 +409,10 @@ void Config_ResetDefault() ...@@ -401,6 +409,10 @@ void Config_ResetDefault()
idleoozing_enabled = true; idleoozing_enabled = true;
#endif #endif
#if defined(POWER_CONSUMPTION) && defined(STORE_CONSUMPTION)
power_consumption_hour = 0;
#endif
SERIAL_ECHO_START; SERIAL_ECHO_START;
SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded"); SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
} }
......
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