avr: renamned some filesfrom flash module. handle FLASH_END.

This commit is contained in:
Martin Preuss
2023-04-22 14:47:16 +02:00
parent 1c09127235
commit ebd5829435
4 changed files with 53 additions and 6 deletions

View File

@@ -135,13 +135,14 @@ main:
.include "modules/com2/crc.asm"
.include "modules/com2/packets.asm"
.include "common/crc8.asm"
.include "modules/flash/main.asm"
.include "modules/flash/proto.asm"
.include "modules/flash/bootloader.asm"
.include "modules/flash/flash.asm"
.include "modules/flash/recv.asm"
.include "modules/flash/send.asm"
.include "modules/flash/wait.asm"
.include "modules/flash/hdl_flash_start.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_ready.asm"

View File

@@ -101,10 +101,16 @@ bootLoader:
; try to start firmware
bootLoader_startFirmware:
sbi PORTA, PORTA3 ; LED off
ldi r16, 20
cbi PORTA, PORTA3 ; LED on
ldi r16, 10
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
bootLoader_waitAndRestartBootLoader:
@@ -170,6 +176,8 @@ bootLoaderFlash_loop1:
rcall flashHandleFlashData
rjmp bootLoaderFlash_loop1
bootLoaderFlash_endReceived:
rjmp flashHandleFlashEnd

View 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