MCPcopy Create free account
hub / github.com/LibertyOS-Development/kernel / wait_for_write

Method wait_for_write

src/dev/mouse.rs:298–315  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

296
297
298 fn wait_for_write(&mut self) -> Result<(), &'static str>
299 {
300 let timeout = 100_000;
301 for _ in 0..timeout
302 {
303 let value = unsafe
304 {
305 self.cmdport.read()
306 };
307
308 if (value & 0x2) == 0x0
309 {
310 return Ok(());
311 }
312 }
313
314 Err("[ERR] WAIT FOR MOUSE WRITE TIMEOUT")
315 }
316}

Callers 2

write_cmd_portMethod · 0.80
write_data_portMethod · 0.80

Calls 2

ErrEnum · 0.50
readMethod · 0.45

Tested by

no test coverage detected