Debugging.

This commit is contained in:
Martin Preuss
2023-01-21 18:11:23 +01:00
parent a4b7b7fe21
commit aeee0c6f64

View File

@@ -17,7 +17,7 @@
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
; COM module ; COM module
.equ COM_BIT_LENGTH = 52000 ; 104000=9600, 52000=19200, 26000=38400 .equ COM_BIT_LENGTH = 104000 ; 104000=9600, 52000=19200, 26000=38400
.equ COM_RINGBUFFER_SIZE = 32 ; 32 bytes for now .equ COM_RINGBUFFER_SIZE = 32 ; 32 bytes for now
@@ -121,6 +121,10 @@ main:
ldi yl, LOW(ledA3Sram) ldi yl, LOW(ledA3Sram)
ldi yh, HIGH(ledA3Sram) ldi yh, HIGH(ledA3Sram)
rcall Led_SetPattern rcall Led_SetPattern
ldi r17, 219 ; debug
rcall COM_EnqueuePing ; debug
main_loop: main_loop:
rcall runModulesUntilIdle rcall runModulesUntilIdle
@@ -161,6 +165,8 @@ initModules:
ldi yl, LOW(ledA3Sram) ldi yl, LOW(ledA3Sram)
ldi yh, HIGH(ledA3Sram) ldi yh, HIGH(ledA3Sram)
rcall Led_Init rcall Led_Init
rcall Com_Init
ret ret
@@ -182,9 +188,9 @@ runModulesUntilIdle_Timer: ; repeat this block for every module with run f
rcall Timer_Run ; rcall Timer_Run ;
brcs runModulesUntilIdle_Timer ; brcs runModulesUntilIdle_Timer ;
runModulesUntilIdle_Com: ;runModulesUntilIdle_Com:
rcall Com_Run ; rcall Com_Run
brcs runModulesUntilIdle_Com ; brcs runModulesUntilIdle_Com
ret ret
@@ -227,6 +233,26 @@ onEvery100ms:
; USED: depending on called routines ; USED: depending on called routines
onEverySecond: onEverySecond:
; ldi r17, 219
; rcall COM_EnqueuePing
in r15, SREG ; debug
cli
push r15
ldi r18, 0
rcall comSendPacketRaw
pop r15
out SREG, r15
; in r15, SREG ; debug
; cli
; push r15
; ldi r16, 219
; rcall comSendByte ; 1101 1011
; pop r15
; out SREG, r15
ret ret