avr: renamned some filesfrom flash module. handle FLASH_END.
This commit is contained in:
@@ -135,13 +135,14 @@ main:
|
|||||||
.include "modules/com2/crc.asm"
|
.include "modules/com2/crc.asm"
|
||||||
.include "modules/com2/packets.asm"
|
.include "modules/com2/packets.asm"
|
||||||
.include "common/crc8.asm"
|
.include "common/crc8.asm"
|
||||||
.include "modules/flash/main.asm"
|
.include "modules/flash/bootloader.asm"
|
||||||
.include "modules/flash/proto.asm"
|
.include "modules/flash/flash.asm"
|
||||||
.include "modules/flash/recv.asm"
|
.include "modules/flash/recv.asm"
|
||||||
.include "modules/flash/send.asm"
|
.include "modules/flash/send.asm"
|
||||||
.include "modules/flash/wait.asm"
|
.include "modules/flash/wait.asm"
|
||||||
.include "modules/flash/hdl_flash_start.asm"
|
.include "modules/flash/hdl_flash_start.asm"
|
||||||
.include "modules/flash/hdl_flash_data.asm"
|
.include "modules/flash/hdl_flash_data.asm"
|
||||||
|
.include "modules/flash/hdl_flash_end.asm"
|
||||||
.include "modules/flash/flash_rsp.asm"
|
.include "modules/flash/flash_rsp.asm"
|
||||||
.include "modules/flash/flash_ready.asm"
|
.include "modules/flash/flash_ready.asm"
|
||||||
|
|
||||||
|
|||||||
@@ -101,14 +101,20 @@ bootLoader:
|
|||||||
|
|
||||||
; try to start firmware
|
; try to start firmware
|
||||||
bootLoader_startFirmware:
|
bootLoader_startFirmware:
|
||||||
sbi PORTA, PORTA3 ; LED off
|
cbi PORTA, PORTA3 ; LED on
|
||||||
|
ldi r16, 10
|
||||||
ldi r16, 20
|
|
||||||
rcall flashWaitForMulti100ms
|
rcall flashWaitForMulti100ms
|
||||||
|
sbi PORTA, PORTA3 ; LED off
|
||||||
|
ldi r16, 3
|
||||||
|
rcall flashWaitForMulti100ms
|
||||||
|
cbi PORTA, PORTA3 ; LED on
|
||||||
|
ldi r16, 10
|
||||||
|
rcall flashWaitForMulti100ms
|
||||||
|
sbi PORTA, PORTA3 ; LED off
|
||||||
rjmp firmwareStart
|
rjmp firmwareStart
|
||||||
|
|
||||||
bootLoader_waitAndRestartBootLoader:
|
bootLoader_waitAndRestartBootLoader:
|
||||||
sbi PORTA, PORTA3 ; LED off
|
sbi PORTA, PORTA3 ; LED off
|
||||||
ldi r16, 20
|
ldi r16, 20
|
||||||
rcall flashWaitForMulti100ms
|
rcall flashWaitForMulti100ms
|
||||||
rjmp bootLoader
|
rjmp bootLoader
|
||||||
@@ -170,6 +176,8 @@ bootLoaderFlash_loop1:
|
|||||||
rcall flashHandleFlashData
|
rcall flashHandleFlashData
|
||||||
rjmp bootLoaderFlash_loop1
|
rjmp bootLoaderFlash_loop1
|
||||||
|
|
||||||
|
bootLoaderFlash_endReceived:
|
||||||
|
rjmp flashHandleFlashEnd
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
38
avr/modules/flash/hdl_flash_end.asm
Normal file
38
avr/modules/flash/hdl_flash_end.asm
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
; ***************************************************************************
|
||||||
|
; copyright : (C) 2023 by Martin Preuss
|
||||||
|
; email : martin@libchipcard.de
|
||||||
|
;
|
||||||
|
; ***************************************************************************
|
||||||
|
; * This file is part of the project "AqHome". *
|
||||||
|
; * Please see toplevel file COPYING of that project for license details. *
|
||||||
|
; ***************************************************************************
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ***************************************************************************
|
||||||
|
; code
|
||||||
|
|
||||||
|
|
||||||
|
.cseg
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; Handle FLASH END packet.
|
||||||
|
;
|
||||||
|
; IN:
|
||||||
|
; - X : buffer containing the message
|
||||||
|
; OUT:
|
||||||
|
; - CFLAG: set if message is for us, cleared otherwise
|
||||||
|
; REGS: r16, r18. r19. r20, r21, X (R15, R17, R22)
|
||||||
|
|
||||||
|
flashHandleFlashEnd:
|
||||||
|
rcall flashWaitFor100ms
|
||||||
|
clr r16
|
||||||
|
rcall flashSendFlashResponse ; (R15, R16, R17, R18, R19, R20, R21, R22, X)
|
||||||
|
sec
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user