LibreSolar / charge-controller-firmware

Firmware for Libre Solar MPPT/PWM charge controllers
https://libre.solar/charge-controller-firmware/
Apache License 2.0
144 stars 71 forks source link

Check total energy calculation #83

Closed martinjaeger closed 4 years ago

martinjaeger commented 4 years ago

The total energy should be stored in EEPROM and continued to accumulate after reset / power-down of the device.

The current implementation probably does not work as intended: https://github.com/LibreSolar/charge-controller-firmware/blob/b87d223dff16d56ed724951a34e400a50947a4da/src/device_status.cpp#L35

The static variables are initialized before the EEPROM content is read, so they are most probably always 0.

martinjaeger commented 4 years ago

This was fixed in 0c01c3d0132f39bade9b82f7244fabc536b8a66e already.