Serial: Optimize SER_GET
There is no need to TryToSend before getting the character. We send bytes during SER_PUT, and if interrupted during sending, we still try to do it at the beginning of the next SER_PUT.
This commit is contained in:
@@ -227,14 +227,8 @@ InvBaud:lda #<SER_ERR_BAUD_UNAVAIL
|
||||
; returned.
|
||||
|
||||
SER_GET:
|
||||
ldy SendFreeCnt ; Send data if necessary
|
||||
iny ; Y == $FF?
|
||||
beq :+
|
||||
lda #$00 ; TryHard = false
|
||||
jsr TryToSend
|
||||
|
||||
; Check for buffer empty
|
||||
: lda RecvFreeCnt ; (25)
|
||||
lda RecvFreeCnt ; (25)
|
||||
cmp #$FF
|
||||
bne :+
|
||||
lda #SER_ERR_NO_DATA
|
||||
|
||||
Reference in New Issue
Block a user