mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
fix kernel debug input
for whatever reason, by default, uarts in litex are configured not to drain a fifo when you read them -- they only drain after you write EV_PENDING.
This commit is contained in:
parent
b6039361cf
commit
d42658a65d
1 changed files with 9 additions and 5 deletions
|
|
@ -102,12 +102,16 @@ impl Uart {
|
||||||
if unsafe { DEBUG_OUTPUT.is_none() } {
|
if unsafe { DEBUG_OUTPUT.is_none() } {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let uart_csr = CSR::new(crate::debug::SUPERVISOR_UART_ADDR as *mut u32);
|
let mut uart_csr = CSR::new(crate::debug::SUPERVISOR_UART_ADDR as *mut u32);
|
||||||
// If EV_PENDING_RX is 1, return the pending character.
|
// If EV_PENDING_RX is 1, return the pending character.
|
||||||
// Otherwise, return None.
|
// Otherwise, return None.
|
||||||
match uart_csr.rf(utra::uart::RXEMPTY_RXEMPTY) {
|
match uart_csr.rf(utra::uart::EV_PENDING_RX) {
|
||||||
1 => None,
|
0 => None,
|
||||||
_ => Some(uart_csr.r(utra::uart::RXTX) as u8),
|
_ => {
|
||||||
|
let ret = Some(uart_csr.r(utra::uart::RXTX) as u8);
|
||||||
|
uart_csr.wfo(utra::uart::EV_PENDING_RX, 1);
|
||||||
|
ret
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -157,7 +161,7 @@ pub fn irq(_irq_number: usize, _arg: *mut usize) {
|
||||||
while let Some(b) = uart.getc() {
|
while let Some(b) = uart.getc() {
|
||||||
process_irq_character(b);
|
process_irq_character(b);
|
||||||
}
|
}
|
||||||
uart.acknowledge_irq();
|
// uart.acknowledge_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn process_irq_character(b: u8) {
|
fn process_irq_character(b: u8) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue