mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
tiny bit of cleanup & docs
This commit is contained in:
parent
1f3c16aea8
commit
55b940fe74
3 changed files with 10 additions and 10 deletions
|
|
@ -342,9 +342,7 @@ pub(crate) fn main_hw() -> ! {
|
||||||
if matches!(view, Views::MassStorage) {
|
if matches!(view, Views::MassStorage) {
|
||||||
if ums_device.poll(&mut [&mut ums]) {
|
if ums_device.poll(&mut [&mut ums]) {
|
||||||
log::debug!("ums device had something to do!")
|
log::debug!("ums device had something to do!")
|
||||||
//Some(fido_class.interface::<RawFidoInterface<'_, _>, _>())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -407,15 +407,16 @@ impl<B: UsbBus, BD: BlockDevice> Scsi<'_, B, BD> {
|
||||||
self.request_sense_response.additional_sense_code = additional_sense_code;
|
self.request_sense_response.additional_sense_code = additional_sense_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Update is called by the IRQ handler, whenever a new event is available on one of
|
||||||
|
/// the endpoints allocated to the USB mass storage device.
|
||||||
fn update(&mut self) -> Result<(), Error> {
|
fn update(&mut self) -> Result<(), Error> {
|
||||||
// Send anything that's already queued
|
|
||||||
//accept_would_block(
|
|
||||||
// self.inner.write()
|
|
||||||
// .map_err(|e| e.into())
|
|
||||||
//)?;
|
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
|
// This loop will automatically re-poll for read data after a single update
|
||||||
|
// originating from an incoming IRQ. This is necessary because when a new packet
|
||||||
|
// comes in while processing the current packet, a second IRQ is not fired.
|
||||||
|
//
|
||||||
|
// The loop exits if it polls twice and finds no new packets pending.
|
||||||
loop {
|
loop {
|
||||||
// print!("p{}", i);
|
|
||||||
// Read new data if available
|
// Read new data if available
|
||||||
match accept_would_block(
|
match accept_would_block(
|
||||||
self.inner.read()
|
self.inner.read()
|
||||||
|
|
@ -435,6 +436,7 @@ impl<B: UsbBus, BD: BlockDevice> Scsi<'_, B, BD> {
|
||||||
self.inner.write()
|
self.inner.write()
|
||||||
.map_err(|e| e.into())
|
.map_err(|e| e.into())
|
||||||
)?;
|
)?;
|
||||||
|
// exit the loop if we blocked more than twice
|
||||||
if i > 1 {
|
if i > 1 {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue