summaryrefslogtreecommitdiff
path: root/src/serial
diff options
context:
space:
mode:
authorChristian Cunningham <c@localhost>2022-08-23 20:37:23 -0700
committerChristian Cunningham <c@localhost>2022-08-23 20:37:23 -0700
commit526abb3e5b3175008cb60f78b645d5e2c0f5072a (patch)
treea125d6358eb847585f7b1a3625eb166c8c96a712 /src/serial
parenta1c8269dc367a6b37986417aa650ec65ac77aae3 (diff)
* cargo fmt
Diffstat (limited to 'src/serial')
-rw-r--r--src/serial/buffer.rs36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/serial/buffer.rs b/src/serial/buffer.rs
index f40771f..b0f704e 100644
--- a/src/serial/buffer.rs
+++ b/src/serial/buffer.rs
@@ -1,35 +1,35 @@
-use crate::sync::NullLock;
use crate::sync::interface::Mutex;
+use crate::sync::NullLock;
use uart_16550::SerialPort;
pub struct Serial {
- buffer: Option<SerialPort>,
+ buffer: Option<SerialPort>,
}
impl Serial {
- pub const fn new() -> Self {
- Serial { buffer: None }
- }
+ pub const fn new() -> Self {
+ Serial { buffer: None }
+ }
}
impl NullLock<Serial> {
- pub fn init(&self) {
- self.lock(|serial| {
- let mut serial_port = unsafe { SerialPort::new(0x3F8) };
- serial_port.init();
- serial.buffer = Some(serial_port);
- });
- }
+ pub fn init(&self) {
+ self.lock(|serial| {
+ let mut serial_port = unsafe { SerialPort::new(0x3F8) };
+ serial_port.init();
+ serial.buffer = Some(serial_port);
+ });
+ }
}
#[doc(hidden)]
pub fn _print(args: ::core::fmt::Arguments) {
- use core::fmt::Write;
- SERIAL1.lock(|serial| {
- if let Some(buffer) = &mut serial.buffer {
- buffer.write_fmt(args).expect("printing to serial failed!");
- }
- })
+ use core::fmt::Write;
+ SERIAL1.lock(|serial| {
+ if let Some(buffer) = &mut serial.buffer {
+ buffer.write_fmt(args).expect("printing to serial failed!");
+ }
+ })
}
/// Prints to the host through the serial interface.