mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
fix endless loop
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4815 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c3e9a1b874
commit
f95ff09ec2
@ -3582,11 +3582,17 @@ sub CUL_HM_valvePosUpdt(@) {#update valve position periodically to please valve
|
|||||||
my $msgCnt = $hash->{helper}{vd}{msgCnt};
|
my $msgCnt = $hash->{helper}{vd}{msgCnt};
|
||||||
my ($idl,$lo,$hi,$nextTimer);
|
my ($idl,$lo,$hi,$nextTimer);
|
||||||
my $tn = gettimeofday();
|
my $tn = gettimeofday();
|
||||||
|
$hash->{helper}{vd}{next} = ReadingsVal($name,".next",$tn)
|
||||||
|
if (!defined $hash->{helper}{vd}{next});
|
||||||
$hash->{helper}{vd}{nextF} = $hash->{helper}{vd}{next};
|
$hash->{helper}{vd}{nextF} = $hash->{helper}{vd}{next};
|
||||||
|
|
||||||
# int32_t result = (((_address << 8) | messageCounter) * 1103515245 + 12345) >> 16;
|
# int32_t result = (((_address << 8) | messageCounter) * 1103515245 + 12345) >> 16;
|
||||||
# 4e6d = 20077 12996205 = C64E6D
|
# 4e6d = 20077 12996205 = C64E6D
|
||||||
# return (result & 0xFF) + 480;
|
# return (result & 0xFF) + 480;
|
||||||
|
|
||||||
|
if ($tn > ($hash->{helper}{vd}{nextF} + 3000)){# mised 20 periods;
|
||||||
|
Log3 $name,3,"CUL_HM $name virtualTC timer off by:".int($tn - $hash->{helper}{vd}{nextF});
|
||||||
|
$hash->{helper}{vd}{nextF} = $tn;
|
||||||
|
}
|
||||||
do {
|
do {
|
||||||
$msgCnt = ($msgCnt + 1)%255;
|
$msgCnt = ($msgCnt + 1)%255;
|
||||||
$idl = $hash->{helper}{vd}{idl}+$msgCnt;
|
$idl = $hash->{helper}{vd}{idl}+$msgCnt;
|
||||||
@ -3595,6 +3601,7 @@ sub CUL_HM_valvePosUpdt(@) {#update valve position periodically to please valve
|
|||||||
$nextTimer = (($lo+$hi)&0xff)/4 + 120;
|
$nextTimer = (($lo+$hi)&0xff)/4 + 120;
|
||||||
$hash->{helper}{vd}{nextF} += $nextTimer;
|
$hash->{helper}{vd}{nextF} += $nextTimer;
|
||||||
} until ($hash->{helper}{vd}{nextF} > $tn);
|
} until ($hash->{helper}{vd}{nextF} > $tn);
|
||||||
|
|
||||||
$hash->{helper}{vd}{nextM} = $tn+$nextTimer;
|
$hash->{helper}{vd}{nextM} = $tn+$nextTimer;
|
||||||
$hash->{helper}{vd}{msgCnt} = $msgCnt;
|
$hash->{helper}{vd}{msgCnt} = $msgCnt;
|
||||||
if ($hash->{helper}{vd}{cmd}){
|
if ($hash->{helper}{vd}{cmd}){
|
||||||
@ -5720,7 +5727,7 @@ sub CUL_HM_peerUsed($) {# are peers expected?
|
|||||||
|
|
||||||
my $mId = CUL_HM_getMId($hash);
|
my $mId = CUL_HM_getMId($hash);
|
||||||
my $cNo = hex(substr($hash->{DEF}."01",6,2))."p"; #default to channel 01
|
my $cNo = hex(substr($hash->{DEF}."01",6,2))."p"; #default to channel 01
|
||||||
0 if (!$mId || !$culHmModel->{$mId});
|
return 0 if (!$mId || !$culHmModel->{$mId});
|
||||||
foreach my $ls (split ",",$culHmModel->{$mId}{lst}){
|
foreach my $ls (split ",",$culHmModel->{$mId}{lst}){
|
||||||
my ($l,$c) = split":",$ls;
|
my ($l,$c) = split":",$ls;
|
||||||
if ( ($l =~ m/^(p|3|4)$/ && !$c ) # 3,4,p without chanspec
|
if ( ($l =~ m/^(p|3|4)$/ && !$c ) # 3,4,p without chanspec
|
||||||
|
@ -115,9 +115,9 @@ sub HMinfo_autoUpdate($){#in:name, send status-request
|
|||||||
my $name = shift;
|
my $name = shift;
|
||||||
(undef,$name)=split":",$name,2;
|
(undef,$name)=split":",$name,2;
|
||||||
HMinfo_SetFn($defs{$name},$name,"update") if ($name);
|
HMinfo_SetFn($defs{$name},$name,"update") if ($name);
|
||||||
HMinfo_archConfig($defs{$name},$name,"","")
|
# HMinfo_archConfig($defs{$name},$name,"","")
|
||||||
if (AttrVal($name,"autoArchieve",undef) &&
|
# if (AttrVal($name,"autoArchieve",undef) &&
|
||||||
scalar(@{$modules{CUL_HM}{helper}{confUpdt}}));
|
# scalar(@{$modules{CUL_HM}{helper}{confUpdt}}));
|
||||||
InternalTimer(gettimeofday()+$defs{$name}{helper}{autoUpdate},
|
InternalTimer(gettimeofday()+$defs{$name}{helper}{autoUpdate},
|
||||||
"HMinfo_autoUpdate","sUpdt:".$name,0)
|
"HMinfo_autoUpdate","sUpdt:".$name,0)
|
||||||
if (defined $defs{$name}{helper}{autoUpdate});
|
if (defined $defs{$name}{helper}{autoUpdate});
|
||||||
@ -914,7 +914,7 @@ sub HMinfo_SetFn($@) {#########################################################
|
|||||||
,"configCheck","param","peerCheck","peerXref"
|
,"configCheck","param","peerCheck","peerXref"
|
||||||
,"protoEvents","msgStat:view,clear","rssi"
|
,"protoEvents","msgStat:view,clear","rssi"
|
||||||
,"models"
|
,"models"
|
||||||
,"regCheck","register","saveConfig","loadConfig","purgeConfig","update"
|
,"regCheck","register","archConfig:-0,-a","saveConfig","loadConfig","purgeConfig","update"
|
||||||
,"cpRegs"
|
,"cpRegs"
|
||||||
,"tempList"
|
,"tempList"
|
||||||
,"templateChk","templateDef","templateList","templateSet");
|
,"templateChk","templateDef","templateList","templateSet");
|
||||||
@ -1045,7 +1045,7 @@ sub HMinfo_archConfig($$$$) {###################################################
|
|||||||
# save config only if register are complete
|
# save config only if register are complete
|
||||||
my ($hash,$name,$opt,$fn) = @_;
|
my ($hash,$name,$opt,$fn) = @_;
|
||||||
my @eN;
|
my @eN;
|
||||||
if ($opt eq "a"){@eN = HMinfo_getEntities("d","");}
|
if ($opt eq "-a"){@eN = HMinfo_getEntities("d","");}
|
||||||
else {@eN = @{$modules{CUL_HM}{helper}{confUpdt}}}
|
else {@eN = @{$modules{CUL_HM}{helper}{confUpdt}}}
|
||||||
my @names;
|
my @names;
|
||||||
push @names,CUL_HM_getAssChnNames($_) foreach(@eN);
|
push @names,CUL_HM_getAssChnNames($_) foreach(@eN);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user