;
; in zh,zl: Pointer to Word within the Sector to read
; in yh..xl: Start sector number (LBA)
-; out xh,xl : word thats been read\r
+; out zh,zl : word thats been read\r
mmcReadWord:
.if MMC_DEBUG > 1
mmc_rcvw_rl:
sbiw yl,1
breq mmc_rcvw_rle
- //st z+,temp
+ cp zl,_0\r
+ cpc zh,_0\r
+ breq mmc_rcvw_sto\r
+\r
+ sbiw zl,1\r
spi_waitm
in temp,SPDR
out SPDR,_255
rjmp mmc_rcvw_rl
+mmc_rcvw_sto:\r
+ mov zl,temp\r
+ spi_waitm
+ in temp,SPDR
+ out SPDR,_255
+ mov zh,temp\r
+\r
+mmc_rcvw_rl2:
+ sbiw yl,1
+ breq mmc_rcvw_rle
+ spi_waitm
+ in temp,SPDR
+ out SPDR,_255
+ rjmp mmc_rcvw_rl2\r
mmc_rcvw_rle:
- //st z+,temp ;Store last byte in buffer
rcall spi_wait ; while SPI module shifts in crc part1.
rcall spi_rcvr ;Read second crc.