mirror of https://github.com/cc65/cc65.git
Changed sta (ptr1,x) to sta (ptr1)
Reset serial status on ser_close Fixed error for saving serial state
This commit is contained in:
parent
8b172e05bc
commit
7d6f3d24d4
|
@ -76,7 +76,8 @@ SER_CLOSE:
|
||||||
; Disable interrupts and stop timer 4 (serial)
|
; Disable interrupts and stop timer 4 (serial)
|
||||||
lda #TXOPEN|RESETERR
|
lda #TXOPEN|RESETERR
|
||||||
sta SERCTL
|
sta SERCTL
|
||||||
stz TIM4CTLA ; Disable count and no reload
|
stz TIM4CTLA ; Disable count and no reload
|
||||||
|
stz SerialStat ; Reset status
|
||||||
|
|
||||||
; Done, return an error code
|
; Done, return an error code
|
||||||
lda #SER_ERR_OK
|
lda #SER_ERR_OK
|
||||||
|
@ -241,8 +242,8 @@ GetByte:
|
||||||
ldy RxPtrOut
|
ldy RxPtrOut
|
||||||
lda RxBuffer,y
|
lda RxBuffer,y
|
||||||
inc RxPtrOut
|
inc RxPtrOut
|
||||||
|
sta (ptr1)
|
||||||
ldx #$00
|
ldx #$00
|
||||||
sta (ptr1,x)
|
|
||||||
txa ; Return code = 0
|
txa ; Return code = 0
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
@ -288,8 +289,8 @@ PutByte:
|
||||||
|
|
||||||
SER_STATUS:
|
SER_STATUS:
|
||||||
lda SerialStat
|
lda SerialStat
|
||||||
|
sta (ptr1)
|
||||||
ldx #$00
|
ldx #$00
|
||||||
sta (ptr1,x)
|
|
||||||
txa ; Return code = 0
|
txa ; Return code = 0
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
@ -327,7 +328,7 @@ SER_IRQ:
|
||||||
and #PAREN ; Parity enabled implies SER_PAR_EVEN or SER_PAR_ODD
|
and #PAREN ; Parity enabled implies SER_PAR_EVEN or SER_PAR_ODD
|
||||||
tay
|
tay
|
||||||
ora #OVERRUN|FRAMERR|RXBRK
|
ora #OVERRUN|FRAMERR|RXBRK
|
||||||
bit SERCTL ; Check presence of relevant error flags in SERCTL
|
and SERCTL ; Check presence of relevant error flags in SERCTL
|
||||||
|
|
||||||
beq @rx_irq ; No errors so far
|
beq @rx_irq ; No errors so far
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue