avr/apps/ma_light: adapted to latest changes. works now.
This commit is contained in:
46
avr/apps/ma_light/README
Normal file
46
avr/apps/ma_light/README
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
App for Motion Activated Light
|
||||||
|
==============================
|
||||||
|
==============================
|
||||||
|
|
||||||
|
|
||||||
|
1. Values
|
||||||
|
======
|
||||||
|
|
||||||
|
1.1 MALRGBWVALUE
|
||||||
|
----------------
|
||||||
|
|
||||||
|
RGB Value for activated light:
|
||||||
|
aqhome-tool setValue -N nodes/XXXXXXXX/MALRGBWVALUE -v GRWB
|
||||||
|
|
||||||
|
Example:
|
||||||
|
Set color of LED strip to blue (half intensity)
|
||||||
|
aqhome-tool setValue -N nodes/12345678/MALRGBWVALUE -v 0x80
|
||||||
|
|
||||||
|
|
||||||
|
1.2 MALONTIME
|
||||||
|
-------------
|
||||||
|
On-Time after activation:
|
||||||
|
aqhome-tool setValue -N nodes/XXXXXXXX/MALONTIME TIME_IN_1/10_SECS
|
||||||
|
|
||||||
|
Example:
|
||||||
|
Keep light on after activation for 20 seconds
|
||||||
|
aqhome-tool setValue -N nodes/12345678/MALONTIME -v 200
|
||||||
|
|
||||||
|
|
||||||
|
1.3. MALSOURCE1, MALSOURCE2
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
Sources for Motion Messages:
|
||||||
|
aqhome-tool setValue -N nodes/XXXXXXXX/MALSOURCE1 -v VVNN
|
||||||
|
aqhome-tool setValue -N nodes/XXXXXXXX/MALSOURCE2 -v VVNN
|
||||||
|
|
||||||
|
VVNN is a 16-bit value, lower 8 bit contain the source node address, higher 8 bit contain the
|
||||||
|
value id to react to.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
React to value report messages with value id 7 from node with address 2
|
||||||
|
aqhome-tool setValue -N nodes/12345678/MALSOURCE1 -v 0x0702
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@ appMotionLightReadConfFromEeprom_end:
|
|||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine appMotionLightWriteConfToEeprom
|
; @routine appMotionLightWriteConfToEeprom
|
||||||
;
|
;
|
||||||
; @clobbers r15, r16, r17, X
|
; @clobbers r16, r17, X
|
||||||
|
|
||||||
appMotionLightWriteConfToEeprom:
|
appMotionLightWriteConfToEeprom:
|
||||||
push r15
|
push r15
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ AppMotionLight_OnPacketReceived_set:
|
|||||||
AppMotionLight_OnPacketReceived_clcRet:
|
AppMotionLight_OnPacketReceived_clcRet:
|
||||||
clc ; unexpected message
|
clc ; unexpected message
|
||||||
ret
|
ret
|
||||||
AppMotionLight_OnPacketReceived_setRGBW:
|
AppMotionLight_OnPacketReceived_setRGBW: ; "setValue nodes/XXXXXXXX/MALRGBWVALUE GRWB"
|
||||||
sts appMotionLightColor, r18
|
sts appMotionLightColor, r18
|
||||||
sts appMotionLightColor+1, r19
|
sts appMotionLightColor+1, r19
|
||||||
sts appMotionLightColor+2, r20
|
sts appMotionLightColor+2, r20
|
||||||
@@ -72,25 +72,23 @@ AppMotionLight_OnPacketReceived_setRGBW:
|
|||||||
rcall appMotionLightStartTimer ; immediately ON with new color (r16)
|
rcall appMotionLightStartTimer ; immediately ON with new color (r16)
|
||||||
rcall appMotionLightTurnOn ; (r16, r17, r18, r19, r20, r21, r23)
|
rcall appMotionLightTurnOn ; (r16, r17, r18, r19, r20, r21, r23)
|
||||||
rjmp AppMotionLight_OnPacketReceived_sendAck
|
rjmp AppMotionLight_OnPacketReceived_sendAck
|
||||||
AppMotionLight_OnPacketReceived_setOnTime:
|
AppMotionLight_OnPacketReceived_setOnTime: ; "setValue nodes/XXXXXXXX/MALONTIME n" (n in 1/10 secs)
|
||||||
sts appMotionLightOnTime, r18
|
sts appMotionLightOnTime, r18
|
||||||
sts appMotionLightOnTime+1, r19
|
sts appMotionLightOnTime+1, r19
|
||||||
rjmp AppMotionLight_OnPacketReceived_sendAck
|
rjmp AppMotionLight_OnPacketReceived_sendAck
|
||||||
AppMotionLight_OnPacketReceived_setSource1:
|
AppMotionLight_OnPacketReceived_setSource1: ; setValue "nodes/XXXXXXXX/MALSOURCE1 0xVVNN" (VV=value id, NN=node addr)
|
||||||
sts appMotionLightSources, r18 ; peerAddr
|
sts appMotionLightSources, r18 ; peerAddr
|
||||||
sts appMotionLightSources+1, r19 ; valueId
|
sts appMotionLightSources+1, r19 ; valueId
|
||||||
rjmp AppMotionLight_OnPacketReceived_sendAck
|
rjmp AppMotionLight_OnPacketReceived_sendAck
|
||||||
AppMotionLight_OnPacketReceived_setSource2:
|
AppMotionLight_OnPacketReceived_setSource2: ; setValue "nodes/XXXXXXXX/MALSOURCE2 0xVVNN" (VV=value id, NN=node addr)
|
||||||
sts appMotionLightSources+APP_MOTIONLIGHT_SOURCE_SIZE, r18 ; peerAddr
|
sts appMotionLightSources+APP_MOTIONLIGHT_SOURCE_SIZE, r18 ; peerAddr
|
||||||
sts appMotionLightSources+APP_MOTIONLIGHT_SOURCE_SIZE+1, r19 ; valueId
|
sts appMotionLightSources+APP_MOTIONLIGHT_SOURCE_SIZE+1, r19 ; valueId
|
||||||
AppMotionLight_OnPacketReceived_sendAck:
|
AppMotionLight_OnPacketReceived_sendAck:
|
||||||
push xl
|
push xl
|
||||||
push xh
|
push xh
|
||||||
mov r16, r22 ; src address
|
|
||||||
ldi r23, NETMSG_CMD_VALUE_SET_ACK
|
ldi r23, NETMSG_CMD_VALUE_SET_ACK
|
||||||
clr r17
|
|
||||||
rcall Main_SendValueResponse ; (clobbers all, including Y)
|
rcall Main_SendValueResponse ; (clobbers all, including Y)
|
||||||
rcall appMotionLightWriteConfToEeprom
|
rcall appMotionLightWriteConfToEeprom ; (r16, r17, X)
|
||||||
pop xh
|
pop xh
|
||||||
pop xl
|
pop xl
|
||||||
sec
|
sec
|
||||||
|
|||||||
Reference in New Issue
Block a user