avr: reduced code (bootloader now 569 words).

This commit is contained in:
Martin Preuss
2024-09-01 22:29:08 +02:00
parent 8aeb488e2e
commit c2a6d33ff2
8 changed files with 55 additions and 40 deletions

View File

@@ -79,10 +79,8 @@ bootLoader:
cbi COM_DDR_ATTN, COM_PINNUM_ATTN ; set ATTN port as input
sbi DDRA, PORTA3 ; out
cbi PORTA, PORTA3 ; on
cbi DDRA, PORTA2 ; in (debug led)
sbi PORTA, PORTA2 ; pullup on (debug led)
sbi LED_DDR, LED_PINNUM ; out
cbi LED_PORT, LED_PINNUM ; on
rcall flashReadUid
sts flashUid, r18
@@ -101,20 +99,20 @@ bootLoader:
; try to start firmware
bootLoader_startFirmware:
cbi PORTA, PORTA3 ; LED on
cbi LED_PORT, LED_PINNUM ; on
ldi r16, 10
rcall flashWaitForMulti100ms
sbi PORTA, PORTA3 ; LED off
sbi LED_PORT, LED_PINNUM ; off
ldi r16, 3
rcall flashWaitForMulti100ms
cbi PORTA, PORTA3 ; LED on
cbi LED_PORT, LED_PINNUM ; on
ldi r16, 10
rcall flashWaitForMulti100ms
sbi PORTA, PORTA3 ; LED off
sbi LED_PORT, LED_PINNUM ; off
rjmp firmwareStart
bootLoader_waitAndRestartBootLoader:
sbi PORTA, PORTA3 ; LED off
sbi LED_PORT, LED_PINNUM ; off
ldi r16, 20
rcall flashWaitForMulti100ms
rjmp bootLoader