mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
have the -fpga variant use the debug UART for console output
we only can watch one uart in the simulation environment (for now)
This commit is contained in:
parent
64a48e275a
commit
99088936bb
2 changed files with 7 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
use core::fmt::{Error, Write};
|
use core::fmt::{Error, Write};
|
||||||
|
|
||||||
|
#[cfg(feature = "cramium-soc")]
|
||||||
use cramium_hal::udma;
|
use cramium_hal::udma;
|
||||||
|
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
|
@ -33,10 +34,10 @@ pub static mut DEFAULT_UART_ADDR: *mut usize = 0x0000_0000 as *mut usize;
|
||||||
impl Uart {
|
impl Uart {
|
||||||
pub fn putc(&self, c: u8) {
|
pub fn putc(&self, c: u8) {
|
||||||
assert!(unsafe { DEFAULT_UART_ADDR } as usize != 0);
|
assert!(unsafe { DEFAULT_UART_ADDR } as usize != 0);
|
||||||
let mut uart_csr = CSR::new(unsafe { DEFAULT_UART_ADDR as *mut u32 });
|
let mut uart_csr = utralib::CSR::new(unsafe { DEFAULT_UART_ADDR as *mut u32 });
|
||||||
|
|
||||||
while uart_csr.r(utra::duart::SFR_SR) != 0 {}
|
while uart_csr.r(utralib::utra::duart::SFR_SR) != 0 {}
|
||||||
uart_csr.wo(utra::duart::SFR_TXD, c as u32);
|
uart_csr.wo(utralib::utra::duart::SFR_TXD, c as u32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
use core::fmt::{Error, Write};
|
use core::fmt::{Error, Write};
|
||||||
|
#[cfg(feature = "cramium-soc")]
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
|
|
||||||
|
#[cfg(feature = "cramium-soc")]
|
||||||
use cramium_hal::board::UART_DMA_TX_BUF_PHYS;
|
use cramium_hal::board::UART_DMA_TX_BUF_PHYS;
|
||||||
|
#[cfg(feature = "cramium-soc")]
|
||||||
use cramium_hal::udma;
|
use cramium_hal::udma;
|
||||||
use utralib::generated::*;
|
use utralib::generated::*;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue