avr: reorganized common code.

This commit is contained in:
Martin Preuss
2026-04-20 23:56:52 +02:00
parent 2d2105ae00
commit abe218e7b0
12 changed files with 281 additions and 155 deletions

View File

@@ -60,7 +60,6 @@ Eeprom_ReadByte_ret:
; ---------------------------------------------------------------------------
; @routine Eeprom_CheckAddr
;
;
; @param X EEPROM Address to validate
; @return CFLAG set if address okay, cleared if out of range
; @clobbers r16
@@ -75,6 +74,30 @@ Eeprom_CheckAddr:
; ---------------------------------------------------------------------------
; @routine Eeprom_ReadBytes
;
; @param X EEPROM Address to read from
; @param Y address in SDRAM to write to
; @param R17 number of bytes to copy
; @clobbers r16, r17, X, Y
Eeprom_ReadBytes:
Eeprom_ReadBytes_loop:
rcall Eeprom_ReadByte ; r16=byte read (none)
brcc Eeprom_ReadBytes_done
st Y+, r16
adiw xh:xl, 1
dec r17
brne Eeprom_ReadBytes_loop
sec
Eeprom_ReadBytes_done:
ret
; @end
#endif ; AQH_AVR_COMMON_EEPROM_R_H