avr: started reworking COM module.

- sending and receiving now basically works again, but too often the
  read buffer is in use when trying to receive a message.
This commit is contained in:
Martin Preuss
2023-04-12 15:30:38 +02:00
parent 0feceeb96e
commit 024d40fc95
21 changed files with 1816 additions and 1926 deletions

View File

@@ -158,9 +158,12 @@ timerInitTimers_loop:
mov r18, xl
or r18, xh
breq timerInitTimers_end
mov r18, r20
or r18, r21
breq timerInitTimers_writeInitial
add r20, r16 ; add counter pos in table so that not all timers elapse at the same time
adc r21, r17
timerInitTimers_writeInitial:
st X+, r20
st X, r21
inc r16
@@ -173,7 +176,6 @@ timerInitTimers_end:
timerRunTimers:
; TODO: incremenent uptime counter
ldi xl, LOW(timerModuleCounterSecs)
ldi xh, HIGH(timerModuleCounterSecs)
rcall Utils_IncrementCounter32
@@ -187,7 +189,7 @@ timerRunTimers_loop:
mov r16, r22
andi r16, TIMER_FLAGS_IF_ADDR
breq timerRunTimers_l1 ; no need to check address
lds r16, comAddress ; check address
lds r16, com2Address ; check address
tst r16
breq timerRunTimers_loop ; no address, ignore counter
timerRunTimers_l1: