"fix" cramium-fpga target

this doesn't have the udma uart so just bypass that new code
This commit is contained in:
bunnie 2023-09-15 17:10:08 +08:00
parent 661b832d7e
commit 24cfa557af

View file

@ -211,6 +211,8 @@ impl OutputWriter {
/// bytes written. This is mostly compatible with `std::io::Write`, /// bytes written. This is mostly compatible with `std::io::Write`,
/// except it is infallible. /// except it is infallible.
pub fn write(&mut self, buf: &[u8]) -> usize { pub fn write(&mut self, buf: &[u8]) -> usize {
#[cfg(feature="cramium-soc")]
{
// write the whole buffer via DMA, and then idle with yield_slice() for better // write the whole buffer via DMA, and then idle with yield_slice() for better
// concurrency (as opposed to character-by-character polling). // concurrency (as opposed to character-by-character polling).
@ -245,6 +247,12 @@ impl OutputWriter {
writelen writelen
} }
#[cfg(feature="cramium-fpga")]
for c in buf {
self.putc(*c)
}
buf.len()
}
pub fn write_all(&mut self, buf: &[u8]) -> core::result::Result<usize, ()> { pub fn write_all(&mut self, buf: &[u8]) -> core::result::Result<usize, ()> {
Ok(self.write(buf)) Ok(self.write(buf))