Skip to content

Commit 226c097

Browse files
joevtdingusdev
authored andcommitted
escc: Update RR0 if no character is available.
The RR0_RX_CHARACTER_AVAILABLE bit is cleared after the character is read in receive_byte, but clear it anyway in read_reg when there's no character available just in case a character that was available somehow becomes unavailable.
1 parent a18658f commit 226c097

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

devices/serial/escc.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ uint8_t EsccChannel::read_reg(int reg_num)
331331
switch (reg_num) {
332332
case RR0:
333333
if (this->chario->rcv_char_available()) {
334-
this->read_regs[RR0] |= RR0_RX_CHARACTER_AVAILABLE;
334+
return this->read_regs[RR0] |= RR0_RX_CHARACTER_AVAILABLE;
335+
} else {
336+
return this->read_regs[RR0] &= ~RR0_RX_CHARACTER_AVAILABLE;
335337
}
336338
break;
337339
case RR8:

0 commit comments

Comments
 (0)