Rewrite readRes1, consolidate res1 commands
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
.export _SD_command
|
||||
.export _SD_readRes1
|
||||
|
||||
.importzp sp
|
||||
|
||||
@@ -30,3 +31,24 @@ arg_loop: ; send ARG
|
||||
rts
|
||||
|
||||
.endproc
|
||||
|
||||
; uint8_t SD_readRes1 (void)
|
||||
|
||||
.proc _SD_readRes1: near
|
||||
; Try to read/write up to 8 times, then return value
|
||||
|
||||
ldx #$08
|
||||
|
||||
tryread:
|
||||
lda #$ff
|
||||
jsr _spi_exchange
|
||||
cmp #$ff
|
||||
bne end
|
||||
dex
|
||||
bne tryread
|
||||
|
||||
end:
|
||||
rts
|
||||
|
||||
|
||||
.endproc
|
||||
Reference in New Issue
Block a user