Skip to content

Commit

Permalink
ESP32 remove restart energy logging if no energy monitoring is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
arendst committed Nov 24, 2023
1 parent ad83141 commit 2cee622
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ All notable changes to this project will be documented in this file.
- ESP32-C3 ledlink functionality regression from v13.1.0.2
- Berry parser error in specific cases (#20059)
- ``changeUIntScale`` for linearity when expanding range (#20089)
- ESP32 remove restart energy logging if no energy monitoring is selected

### Removed

Expand Down
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- Zero-Cross Dimmer for ESP32 with Core3 [#19929](https://github.com/arendst/Tasmota/issues/19929)
- ``changeUIntScale`` for linearity when expanding range [#20089](https://github.com/arendst/Tasmota/issues/20089)
- ESP32 I2C allow bus2 support when bus1 is not enabled
- ESP32 remove restart energy logging if no energy monitoring is selected
- ESP32 IR receive with Arduino Core 3 [#19904](https://github.com/arendst/Tasmota/issues/19904)
- ESP32-C3 ledlink functionality regression from v13.1.0.2
- Berry parser error in specific cases [#20059](https://github.com/arendst/Tasmota/issues/20059)
Expand Down
9 changes: 5 additions & 4 deletions tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1379,9 +1379,6 @@ void EnergyDrvInit(void) {
Energy = (tEnergy*)calloc(sizeof(tEnergy), 1); // Need calloc to reset registers to 0/false
if (!Energy) { return; }

EnergySettingsLoad(0);
EnergyRtcSettingsLoad();

Energy->value = nullptr;
// Energy->voltage_common = false;
// Energy->frequency_common = false;
Expand All @@ -1399,9 +1396,13 @@ void EnergyDrvInit(void) {
Energy->power_on = true;

TasmotaGlobal.energy_driver = ENERGY_NONE;
XnrgCall(FUNC_PRE_INIT); // Find first energy driver
XnrgCall(FUNC_PRE_INIT); // Find first energy driver
if (TasmotaGlobal.energy_driver) {
EnergySettingsLoad(0);
EnergyRtcSettingsLoad();
AddLog(LOG_LEVEL_INFO, PSTR("NRG: Init driver %d"), TasmotaGlobal.energy_driver);
} else {
free(Energy); // No energy driver found so release memory
}
}

Expand Down

0 comments on commit 2cee622

Please sign in to comment.