diff options
| author | Christian Cunningham <c@localhost> | 2022-08-23 20:56:57 -0700 |
|---|---|---|
| committer | Christian Cunningham <c@localhost> | 2022-08-23 20:56:57 -0700 |
| commit | e83717b454722b8c61844686377c2ac58f18454f (patch) | |
| tree | 3f243026dd102ccc9117481e795e6d8e938fc39b /src/serial/buffer.rs | |
| parent | 526abb3e5b3175008cb60f78b645d5e2c0f5072a (diff) | |
Migrate the processor-independent code
Due to the similarity with my ARM-based OS ghOSt, I am migrating similar code out to a common crate
Not all has been moved out yet
Diffstat (limited to 'src/serial/buffer.rs')
| -rw-r--r-- | src/serial/buffer.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/serial/buffer.rs b/src/serial/buffer.rs index b0f704e..b52728a 100644 --- a/src/serial/buffer.rs +++ b/src/serial/buffer.rs @@ -12,13 +12,11 @@ impl Serial { } } -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); - }); +impl crate::sync::interface::Initializable for Serial { + fn init(&mut self) { + let mut serial_port = unsafe { SerialPort::new(0x3F8) }; + serial_port.init(); + self.buffer = Some(serial_port); } } |
