2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

Wraparound corrected for power reset

git-svn-id: https://svn.fhem.de/fhem/trunk@2238 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2012-12-01 09:24:09 +00:00
parent 64912c084e
commit 85400e444a

View File

@ -136,8 +136,9 @@ CUL_EM_Parse($$)
}
# correct counter wraparound
if($total_cnt< $total_cnt_last) {
$basis_cnt += 65536;
if($total_cnt < $total_cnt_last) {
# check: real wraparound or reset only
$basis_cnt += ($total_cnt_last > 65000 ? 65536 : $total_cnt_last);
$readings{basis} = $basis_cnt;
}