avr: added REED_OnPacketReceived
This commit is contained in:
@@ -164,6 +164,37 @@ REED_Run:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine REED_OnPacketReceived @global
|
||||||
|
;
|
||||||
|
; @clobbers any, -X
|
||||||
|
|
||||||
|
REED_OnPacketReceived:
|
||||||
|
adiw xh:xl, 2 ; command
|
||||||
|
ld r16, X
|
||||||
|
sbiw xh:xl, 2
|
||||||
|
cpi r16, CPRO_CMD_VALUE_SET
|
||||||
|
breq REED_OnPacketReceived_set
|
||||||
|
clc ; unexpected msg
|
||||||
|
ret
|
||||||
|
REED_OnPacketReceived_set:
|
||||||
|
rcall CPRO_ReadValue ; (none)
|
||||||
|
cpi r17, VALUE_ID_REED_CONF
|
||||||
|
breq REED_OnPacketReceived_setReedConf
|
||||||
|
clc
|
||||||
|
ret
|
||||||
|
REED_OnPacketReceived_setReedConf:
|
||||||
|
mov r16, r18
|
||||||
|
rcall REED_SetConfig
|
||||||
|
REED_OnPacketReceived_sendAck:
|
||||||
|
ldi r16, CPRO_CMD_VALUE_SET_ACK
|
||||||
|
rcall CPRO_SendSetValueResponse
|
||||||
|
sec
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
REED_Every100ms:
|
REED_Every100ms:
|
||||||
push r15
|
push r15
|
||||||
in r15, SREG
|
in r15, SREG
|
||||||
|
|||||||
Reference in New Issue
Block a user