avr: reorder code (only need to load X if there is still something to do).
This commit is contained in:
@@ -55,14 +55,15 @@ Stats_Run:
|
|||||||
in r15, SREG
|
in r15, SREG
|
||||||
push r15
|
push r15
|
||||||
cli
|
cli
|
||||||
|
|
||||||
|
lds r17, statsRemaining
|
||||||
|
tst r17 ; some left?
|
||||||
|
breq Stats_Run_done ; nope, jump to end
|
||||||
|
|
||||||
ldi xl, LOW(com2SendBuffer)
|
ldi xl, LOW(com2SendBuffer)
|
||||||
ldi xh, HIGH(com2SendBuffer)
|
ldi xh, HIGH(com2SendBuffer)
|
||||||
ldi r16, 0xff ; broadcast
|
ldi r16, 0xff ; broadcast
|
||||||
|
|
||||||
lds r17, statsRemaining
|
|
||||||
tst r17
|
|
||||||
breq Stats_Run_done
|
|
||||||
|
|
||||||
cpi r17, STATS_POS_RECV
|
cpi r17, STATS_POS_RECV
|
||||||
brne Stats_Run_l1
|
brne Stats_Run_l1
|
||||||
rcall CPRO_WriteComRecvStats
|
rcall CPRO_WriteComRecvStats
|
||||||
|
|||||||
Reference in New Issue
Block a user