flash: use 16-bit counters.
This commit is contained in:
@@ -42,13 +42,14 @@ flash1pMegaWritePage:
|
||||
ldi xl, LOW(flashPageBuffer)
|
||||
ldi xh, HIGH(flashPageBuffer)
|
||||
ldi r24, LOW(PAGESIZE)
|
||||
ldi r25, HIGH(PAGESIZE)
|
||||
flash1pMegaWritePages_loop:
|
||||
ld r0, X+ ; read source data from buffer (low)
|
||||
ld r1, X+ ; read source data from buffer (high)
|
||||
ldi r20, (1<<SPMEN) ; enable next SPM, write R1:R0 into temp page buffer
|
||||
rcall flashDoSpm ; (R16)
|
||||
adiw zh:zl, 2
|
||||
dec r24
|
||||
sbiw r25:r24, 1
|
||||
brne flash1pMegaWritePages_loop
|
||||
|
||||
subi zl, LOW(PAGESIZE*2) ; point back to begin of page
|
||||
|
||||
Reference in New Issue
Block a user