Rebooting and flashing a node now works!

This commit is contained in:
Martin Preuss
2023-04-21 23:38:44 +02:00
parent 76e58b6fec
commit 97016b21b9
20 changed files with 468 additions and 14 deletions

View File

@@ -76,6 +76,12 @@ CPRO_OnPacketReceived:
brne CPRO_OnPacketReceived_l1
rjmp cproHandlePing
CPRO_OnPacketReceived_l1:
#ifndef BASE_SYSTEM
cpi r16, CPRO_CMD_REBOOT_REQUEST
brne CPRO_OnPacketReceived_l2
rjmp cproHandleReboot
#endif
CPRO_OnPacketReceived_l2:
#ifdef MODULES_COM_WITH_ADDR_PROTO
rjmp CPRO_Address_OnPacketReceived
#else
@@ -102,6 +108,39 @@ cproHandlePing_notHandled:
ret
; ---------------------------------------------------------------------------
; Compare the UID from a message against out own UID.
;
;IN:
; - X: pointer to UID in a message to compare against out own uid
; OUT:
; - CFLAG set if matches, cleared otherwise
; REGS: r16, r18, r19, r20, r21, X
cproCheckUidInMsg:
push xl
push xh
rcall Utils_ReadUid
pop xh
pop xl
ld r16, X+
cp r16, r18
brne cproCheckUidInMsg_notMe
ld r16, X+
cp r16, r19
brne cproCheckUidInMsg_notMe
ld r16, X+
cp r16, r20
brne cproCheckUidInMsg_notMe
ld r16, X+
cp r16, r21
brne cproCheckUidInMsg_notMe
sec
ret
cproCheckUidInMsg_notMe:
clc
ret
CPRO_END:
.equ MODULE_SIZE_CPRO = CPRO_END-CPRO_BEGIN