X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/a7b795ca288038b9b99c6afe5d15cf2ddd4dac3f..d8fa6a36ffba80be398c90641b3e7e7a79d56d43:/avr/mmc.asm diff --git a/avr/mmc.asm b/avr/mmc.asm index f43af1c..38fdfe0 100644 --- a/avr/mmc.asm +++ b/avr/mmc.asm @@ -57,13 +57,20 @@ #define RES_NOTRDY 3 /* 3: Not Ready */ #define RES_PARERR 4 /* 4: Invalid Parameter */ + +#define SPI_MODE_0 (0< 1 printstring "SPI_CLK_SLOW " .endif - ldi temp,(1< 1 printstring "SPI_CLK_FAST " .endif - ldi temp,(1< 3 + printnewline + rcall printhex + printstring " " +.endif out SPDR,_255 ;Start shift in next byte. mmc_rcv_rl: sbiw yl,1 @@ -571,11 +583,18 @@ mmc_rcv_rl: st z+,temp spi_waitm in temp,SPDR +.if MMC_DEBUG > 3 + rcall printhex + printstring " " +.endif out SPDR,_255 rjmp mmc_rcv_rl mmc_rcv_rle: st z+,temp ;Store last byte in buffer +.if MMC_DEBUG > 3 + printnewline +.endif rcall spi_wait ; while SPI module shifts in crc part1. rcall spi_rcvr ;Read second crc.