Moved protocol stuff into comproto.asm.

This commit is contained in:
Martin Preuss
2023-02-04 00:56:29 +01:00
parent 2f4fbf8598
commit 5b15b5ef9f
4 changed files with 395 additions and 318 deletions

View File

@@ -139,6 +139,11 @@
reti ; USI_STR
reti ; USI_OVF
.org 0x40
; ---------------------------------------------------------------------------
; Node Id (not overwritten when updating system)
nodeUid: .db 0, 0, 0, 0, 0, 0, 0, 0
; ***************************************************************************
@@ -148,6 +153,7 @@
.include "timer.asm"
.include "led.asm"
.include "com.asm"
.include "comproto.asm"
.include "twimaster.asm"
.include "lcd.asm"
;.include "bmp280.asm"
@@ -180,7 +186,7 @@ ledA3Sram: .byte LED_SRAM_SIZE
ledA3Flash: .db DDRA+0x20, PORTA+0x20, PINA+0x20, (1<<PORTA3)
blinkPattern: .db 5, 5, 5, 5, 5, 10, 0xff, 0xff ; 3 short blinks, 1s pause, restart
blinkPattern2: .db 10, 20, 0xff, 0xff ; 1 long blink, 2s pause, restart
blinkPattern2: .db 10, 20, 0xff, 0xff ; 1 long blink, 2s pause, restart
@@ -287,10 +293,10 @@ onEveryMinute:
#ifdef MODULES_COM
ldi r16, 219
rcall COM_EnqueueComSendStats
rcall CPRO_EnqueueComSendStats
;ldi r16, 219
;rcall COM_EnqueuePing
;rcall CPRO_EnqueuePing
#endif
pop r15
@@ -378,7 +384,7 @@ sendValueMsg:
lds r19, si7021LastTemp+1
ldi r20, 100 ; denominator
clr r21
rcall COM_EnqueueValue
rcall CPRO_EnqueueValue
pop r22
sendValueMsg_checkHum:
mov r16, r22
@@ -392,7 +398,7 @@ sendValueMsg_checkHum:
lds r19, si7021LastHumidity+1
ldi r20, 1 ; denominator
clr r21
rcall COM_EnqueueValue
rcall CPRO_EnqueueValue
pop r22
sendValueMsg_done:
ret