Pulse meter

This commit is contained in:
Gunnar Skjold
2024-01-26 18:21:51 +01:00
parent 52bc2f6a9b
commit 9a767d9ac4
8 changed files with 38 additions and 9 deletions

View File

@@ -1195,6 +1195,13 @@ bool readHanPort() {
if(pulseMc != NULL) {
pulseMc->onPulse(pulses);
pulses = 0;
if(meterState.getListType() < 3) {
time_t now = time(nullptr);
if(now > FirmwareVersion::BuildEpoch) {
ImpulseAmsData init = ImpulseAmsData(ds.getEstimatedImportCounter());
meterState.apply(init);
}
}
}
if(!mc->loop()) {
meterState.setLastError(mc->getLastError());