avr: reorganized common code.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user