Compare commits

...

2 Commits

Author SHA1 Message Date
Siwat Sirichai 520fd76b91 Update ESPMegaCommon.hpp 2024-06-28 22:17:13 +07:00
Siwat Sirichai c2e45490b0 energy load error handling 2024-06-28 22:16:44 +07:00
2 changed files with 4 additions and 1 deletions

View File

@ -84,6 +84,9 @@ void CurrentTransformerCard::saveEnergy(){
} }
void CurrentTransformerCard::loadEnergy(){ void CurrentTransformerCard::loadEnergy(){
this->fram->read(this->framAddress, (uint8_t*)&this->energy, sizeof(this->energy)); this->fram->read(this->framAddress, (uint8_t*)&this->energy, sizeof(this->energy));
if (this->energy < 0 || isnan(this->energy)) {
this->energy = 0;
}
} }
void CurrentTransformerCard::setEnergyAutoSave(bool autoSave){ void CurrentTransformerCard::setEnergyAutoSave(bool autoSave){

View File

@ -1,3 +1,3 @@
#pragma once #pragma once
#define SDK_VESRION "2.9.3" #define SDK_VESRION "2.9.4"