Rewrite readRes1, consolidate res1 commands

This commit is contained in:
Byron Lathi
2023-07-23 17:26:40 -07:00
parent 709c60cf36
commit 60072603d9
2 changed files with 36 additions and 24 deletions

View File

@@ -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