Newer
Older
use std::io::{stdout, Write};
use crate::serial::SerialDevice;
pub struct StdoutDevice {
}
impl StdoutDevice {
pub fn new(flush: bool) -> Self {
}
}
impl Default for StdoutDevice {
fn default() -> Self {
Self::new(true)
}
}
impl SerialDevice for StdoutDevice {
fn send(&mut self) -> u8 {
0xff
}
fn receive(&mut self, byte: u8) {
print!("{}", byte as char);
if self.flush {
stdout().flush().unwrap();
}
}
}