mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
add missing feature flags to usb device crate
This commit is contained in:
parent
b7c4587505
commit
215f15f138
3 changed files with 16 additions and 9 deletions
|
|
@ -33,8 +33,11 @@ pub(crate) enum Opcode {
|
|||
/// Query if the HID driver was able to start
|
||||
IsSocCompatible,
|
||||
|
||||
#[cfg(feature="mass-storage")]
|
||||
SetBlockDevice,
|
||||
#[cfg(feature="mass-storage")]
|
||||
SetBlockDeviceSID,
|
||||
#[cfg(feature="mass-storage")]
|
||||
ResetBlockDevice,
|
||||
|
||||
/// Handle the USB interrupt
|
||||
|
|
|
|||
|
|
@ -24,24 +24,24 @@ impl UsbHid {
|
|||
conn
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature="mass-storage")]
|
||||
pub fn set_block_device(&self, read_id: usize, write_id: usize, max_lba_id: usize) {
|
||||
send_message(self.conn,
|
||||
Message::new_blocking_scalar(
|
||||
Opcode::SetBlockDevice.to_usize().unwrap(),
|
||||
read_id,
|
||||
write_id,
|
||||
Opcode::SetBlockDevice.to_usize().unwrap(),
|
||||
read_id,
|
||||
write_id,
|
||||
max_lba_id,
|
||||
0,
|
||||
)
|
||||
).unwrap();
|
||||
}
|
||||
|
||||
#[cfg(feature="mass-storage")]
|
||||
pub fn set_block_device_sid(&self, app_sid: xous::SID) {
|
||||
let sid = app_sid.to_u32();
|
||||
send_message(self.conn,
|
||||
Message::new_blocking_scalar(
|
||||
Opcode::SetBlockDeviceSID.to_usize().unwrap(),
|
||||
Opcode::SetBlockDeviceSID.to_usize().unwrap(),
|
||||
sid.0 as usize,
|
||||
sid.1 as usize,
|
||||
sid.2 as usize,
|
||||
|
|
@ -49,11 +49,11 @@ impl UsbHid {
|
|||
)
|
||||
).unwrap();
|
||||
}
|
||||
|
||||
#[cfg(feature="mass-storage")]
|
||||
pub fn reset_block_device(&self) {
|
||||
send_message(self.conn,
|
||||
Message::new_blocking_scalar(
|
||||
Opcode::ResetBlockDevice.to_usize().unwrap(),
|
||||
Opcode::ResetBlockDevice.to_usize().unwrap(),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -226,8 +226,9 @@ pub(crate) fn main_hw() -> ! {
|
|||
let ums_alloc = UsbBusAllocator::new(ums_dev);
|
||||
#[cfg(feature="mass-storage")]
|
||||
let abd = apps_block_device::AppsBlockDevice::new();
|
||||
#[cfg(feature="mass-storage")]
|
||||
let abdcid = abd.conn();
|
||||
|
||||
#[cfg(feature="mass-storage")]
|
||||
let mut ums = usbd_scsi::Scsi::new(
|
||||
&ums_alloc,
|
||||
64,
|
||||
|
|
@ -352,6 +353,7 @@ pub(crate) fn main_hw() -> ! {
|
|||
let opcode: Option<Opcode> = FromPrimitive::from_usize(msg.body.id());
|
||||
log::debug!("{:?}", opcode);
|
||||
match opcode {
|
||||
#[cfg(feature="mass-storage")]
|
||||
Some(Opcode::SetBlockDevice) => msg_blocking_scalar_unpack!(msg, read_id, write_id, max_lba_id, _, {
|
||||
xous::send_message(
|
||||
abdcid,
|
||||
|
|
@ -361,6 +363,7 @@ pub(crate) fn main_hw() -> ! {
|
|||
).unwrap();
|
||||
xous::return_scalar(msg.sender, 0).unwrap();
|
||||
}),
|
||||
#[cfg(feature="mass-storage")]
|
||||
Some(Opcode::SetBlockDeviceSID) => msg_blocking_scalar_unpack!(msg, sid1, sid2, sid3, sid4, {
|
||||
xous::send_message(abdcid,
|
||||
xous::Message::new_blocking_scalar(
|
||||
|
|
@ -369,6 +372,7 @@ pub(crate) fn main_hw() -> ! {
|
|||
).unwrap();
|
||||
xous::return_scalar(msg.sender, 0).unwrap();
|
||||
}),
|
||||
#[cfg(feature="mass-storage")]
|
||||
Some(Opcode::ResetBlockDevice) => msg_blocking_scalar_unpack!(msg, 0, 0, 0, 0, {
|
||||
xous::send_message(abdcid,
|
||||
xous::Message::new_blocking_scalar(
|
||||
|
|
|
|||
Loading…
Reference in a new issue