avr: reorganized common code.
This commit is contained in:
@@ -101,6 +101,30 @@ Eeprom_WriteByteIfChanged_end:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine Eeprom_WriteBytes @global
|
||||
;
|
||||
; Write bytes into EEPROM (if changed, thus saving on write cycles)
|
||||
;
|
||||
; @param X eeprom address to write to
|
||||
; @param Y address in SDRAM to read from
|
||||
; @param R17 number of bytes to copy
|
||||
; @clobbers r16, r17, r18, X, Y
|
||||
|
||||
Eeprom_WriteBytes:
|
||||
mov r18, r17
|
||||
Eeprom_WriteBytes_loop:
|
||||
ld r16, Y+
|
||||
rcall Eeprom_WriteByteIfChanged
|
||||
brcc Eeprom_WriteBytes_ret
|
||||
adiw xh:xl, 1
|
||||
dec r18
|
||||
brne Eeprom_WriteBytes_loop
|
||||
Eeprom_WriteBytes_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
#endif ; AQH_AVR_COMMON_EEPROM_W_H
|
||||
|
||||
Reference in New Issue
Block a user