Wraparound corrected for power reset
git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@2238 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user