mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 03:06:33 +00:00
Add RTC logging to energy
This commit is contained in:
parent
c92d51f050
commit
5b1aff5141
@ -127,7 +127,7 @@ typedef struct {
|
||||
} TRtcReboot;
|
||||
TRtcReboot RtcReboot;
|
||||
#ifdef ESP32
|
||||
RTC_NOINIT_ATTR TRtcReboot RtcDataReboot;
|
||||
static RTC_NOINIT_ATTR TRtcReboot RtcDataReboot;
|
||||
#endif // ESP32
|
||||
|
||||
typedef struct {
|
||||
@ -154,7 +154,7 @@ typedef struct {
|
||||
} TRtcSettings;
|
||||
TRtcSettings RtcSettings;
|
||||
#ifdef ESP32
|
||||
RTC_NOINIT_ATTR TRtcSettings RtcDataSettings;
|
||||
static RTC_NOINIT_ATTR TRtcSettings RtcDataSettings;
|
||||
#endif // ESP32
|
||||
|
||||
struct TIME_T {
|
||||
|
@ -347,6 +347,7 @@ void Energy200ms(void)
|
||||
if (!Energy.kWhtoday_offset_init && (RtcTime.day_of_year == Settings->energy_kWhdoy)) {
|
||||
for (uint32_t i = 0; i < 3; i++) {
|
||||
Energy.kWhtoday_offset[i] = Settings->energy_kWhtoday_ph[i];
|
||||
// RtcSettings.energy_kWhtoday_ph[i] = 0;
|
||||
}
|
||||
Energy.kWhtoday_offset_init = true;
|
||||
}
|
||||
@ -1107,6 +1108,13 @@ void EnergySnsInit(void)
|
||||
XnrgCall(FUNC_INIT);
|
||||
|
||||
if (TasmotaGlobal.energy_driver) {
|
||||
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR("NRG: Rtc valid %d, kWhtoday_ph Rtc %d/%d/%d, Set %d/%d/%d"),
|
||||
RtcSettingsValid(),
|
||||
RtcSettings.energy_kWhtoday_ph[0],RtcSettings.energy_kWhtoday_ph[1],RtcSettings.energy_kWhtoday_ph[2],
|
||||
Settings->energy_kWhtoday_ph[0],Settings->energy_kWhtoday_ph[1],Settings->energy_kWhtoday_ph[2]
|
||||
);
|
||||
|
||||
for (uint32_t i = 0; i < 3; i++) {
|
||||
// Energy.kWhtoday_offset[i] = 0; // Reset by EnergyDrvInit()
|
||||
// 20220805 - Change from https://github.com/arendst/Tasmota/issues/16118
|
||||
|
Loading…
x
Reference in New Issue
Block a user