immediately apply ontime setting.
This commit is contained in:
@@ -54,11 +54,11 @@ AppMotionLight_OnPacketReceived_turnOn:
|
||||
AppMotionLight_OnPacketReceived_checkBrightness:
|
||||
lds r16, appMotionLightLSourceValue ; check last brightness reported
|
||||
lds r17, appMotionLightLSourceValue+1
|
||||
lds r24, appMotionLightLastBrightness
|
||||
lds r25, appMotionLightLastBrightness+1
|
||||
lds r24, appMotionLightLastBrightness ; r25:r24>r17:r16?
|
||||
lds r25, appMotionLightLastBrightness+1 ; appMotionLightLastBrightness>appMotionLightLSourceValue?
|
||||
sub r16, r24
|
||||
sbc r17, r25
|
||||
brcs AppMotionLight_OnPacketReceived_secRet ; too bright to turn on
|
||||
brcs AppMotionLight_OnPacketReceived_secRet ; yes, too bright to turn on
|
||||
AppMotionLight_OnPacketReceived_checkTimer:
|
||||
lds r16, appMotionLightTimer ; time up?
|
||||
lds r17, appMotionLightTimer+1
|
||||
@@ -102,6 +102,12 @@ AppMotionLight_OnPacketReceived_setBValue: ; "setValue nodes
|
||||
AppMotionLight_OnPacketReceived_setOnTime: ; "setValue nodes/XXXXXXXX/MALONTIME n" (n in 1/10 secs)
|
||||
sts appMotionLightOnTime, r18
|
||||
sts appMotionLightOnTime+1, r19
|
||||
lds r16, appMotionLightTimer ; timer active?
|
||||
lds r17, appMotionLightTimer+1
|
||||
or r16, r17
|
||||
breq AppMotionLight_OnPacketReceived_sendAck ; nope, just set it and leave
|
||||
sts appMotionLightTimer, r18 ; restart timer with new value
|
||||
sts appMotionLightTimer+1, r19
|
||||
rjmp AppMotionLight_OnPacketReceived_sendAck
|
||||
AppMotionLight_OnPacketReceived_setSource1: ; setValue "nodes/XXXXXXXX/MALSOURCE1 0xVVNN" (VV=value id, NN=node addr)
|
||||
sts appMotionLightSources, r18 ; peerAddr
|
||||
|
||||
Reference in New Issue
Block a user