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() {
...@@ -132,6 +132,10 @@ void Config_StoreSettings() { ...@@ -132,6 +132,10 @@ void Config_StoreSettings() {
#ifdef IDLE_OOZING_PREVENT #ifdef IDLE_OOZING_PREVENT
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;
...@@ -255,6 +259,10 @@ void Config_RetrieveSettings() ...@@ -255,6 +259,10 @@ void Config_RetrieveSettings()
#ifdef IDLE_OOZING_PREVENT #ifdef IDLE_OOZING_PREVENT
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();
...@@ -400,6 +408,10 @@ void Config_ResetDefault() ...@@ -400,6 +408,10 @@ void Config_ResetDefault()
#ifdef IDLE_OOZING_PREVENT #ifdef IDLE_OOZING_PREVENT
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