block_device: added empty implementation, will be needed once we figure out mass storage

This commit is contained in:
Gianguido Sorà 2023-01-04 17:22:13 +01:00
parent 110641ff76
commit 3300a1b87d
No known key found for this signature in database
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,17 @@
pub struct BlockDevice{}
impl usbd_scsi::BlockDevice for BlockDevice {
const BLOCK_BYTES: usize = 512;
fn read_block(&self, lba: u32, block: &mut [u8]) -> Result<(), usbd_scsi::BlockDeviceError> {
Err(usbd_scsi::BlockDeviceError::HardwareError)
}
fn write_block(&mut self, lba: u32, block: &[u8]) -> Result<(), usbd_scsi::BlockDeviceError> {
Err(usbd_scsi::BlockDeviceError::WriteError)
}
fn max_lba(&self) -> u32 {
512
}
}

View file

@ -20,6 +20,8 @@ mod spinal_udc;
use packed_struct::PackedStructSlice;
#[cfg(any(feature="precursor", feature="renode"))]
use spinal_udc::*;
#[cfg(any(feature="precursor", feature="renode"))]
mod block_device;
#[cfg(not(target_os = "xous"))]
mod hosted;