cargo fix
This commit is contained in:
@@ -1,18 +1,6 @@
|
||||
use core::{pin::Pin, time::Duration};
|
||||
|
||||
use abi_sys::{DrawIterAbi, GetKeyAbi, Pixel, PrintAbi, SleepAbi};
|
||||
use alloc::boxed::Box;
|
||||
use defmt::info;
|
||||
use embassy_futures::block_on;
|
||||
use abi_sys::{DrawIterAbi, GetKeyAbi, PrintAbi, SleepAbi};
|
||||
use embassy_rp::clocks::clk_sys_freq;
|
||||
use embassy_time::Timer;
|
||||
use embedded_graphics::{
|
||||
Drawable,
|
||||
draw_target::DrawTarget,
|
||||
pixelcolor::Rgb565,
|
||||
prelude::{Point, RgbColor, Size},
|
||||
primitives::{PrimitiveStyle, Rectangle, StyledDrawable},
|
||||
};
|
||||
use embedded_graphics::{Pixel, draw_target::DrawTarget, pixelcolor::Rgb565};
|
||||
use shared::keyboard::KeyEvent;
|
||||
|
||||
use crate::{KEY_CACHE, display::FRAMEBUFFER};
|
||||
|
||||
@@ -28,7 +28,7 @@ pub async unsafe fn load_binary(name: &ShortFileName) -> Result<EntryFn, &str> {
|
||||
let mut sd_lock = SDCARD.get().lock().await;
|
||||
let sd = sd_lock.as_mut().unwrap();
|
||||
|
||||
let mut error = "";
|
||||
let error = "";
|
||||
let mut entry = 0;
|
||||
|
||||
let mut header_buf = [0; ELF32_HDR_SIZE];
|
||||
|
||||
@@ -13,7 +13,7 @@ use embedded_graphics::{
|
||||
use embedded_hal_2::digital::OutputPin;
|
||||
use embedded_hal_async::{delay::DelayNs, spi::SpiDevice};
|
||||
use heapless::Vec;
|
||||
use st7365p_lcd::{FrameBuffer, ST7365P};
|
||||
use st7365p_lcd::ST7365P;
|
||||
|
||||
pub const TILE_SIZE: usize = 16; // 16x16 tile
|
||||
pub const TILE_COUNT: usize = (SCREEN_WIDTH / TILE_SIZE) * (SCREEN_HEIGHT / TILE_SIZE); // 400 tiles
|
||||
|
||||
@@ -21,7 +21,7 @@ mod utils;
|
||||
use core::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use crate::{
|
||||
display::{FRAMEBUFFER, clear_fb, display_handler, init_display},
|
||||
display::{FRAMEBUFFER, display_handler, init_display},
|
||||
peripherals::{
|
||||
conf_peripherals,
|
||||
keyboard::{KeyState, read_keyboard_fifo},
|
||||
@@ -29,20 +29,18 @@ use crate::{
|
||||
scsi::MSC_SHUTDOWN,
|
||||
storage::{SDCARD, SdCard},
|
||||
ui::{SELECTIONS, clear_selection, ui_handler},
|
||||
usb::usb_handler,
|
||||
};
|
||||
use abi_sys::{EntryFn, Rgb565, RgbColor};
|
||||
use embedded_graphics::prelude::DrawTarget;
|
||||
use abi_sys::EntryFn;
|
||||
use embedded_graphics::{
|
||||
pixelcolor::Rgb565,
|
||||
prelude::{DrawTarget, RgbColor},
|
||||
};
|
||||
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
|
||||
use defmt::unwrap;
|
||||
use embassy_executor::{Executor, Spawner};
|
||||
use embassy_futures::{
|
||||
join::{join, join3, join5},
|
||||
select::select,
|
||||
yield_now,
|
||||
};
|
||||
use embassy_futures::{join::join, select::select};
|
||||
use embassy_rp::{
|
||||
Peri,
|
||||
gpio::{Input, Level, Output, Pull},
|
||||
@@ -56,7 +54,7 @@ use embassy_rp::{
|
||||
usb as embassy_rp_usb,
|
||||
};
|
||||
use embassy_sync::{
|
||||
blocking_mutex::raw::CriticalSectionRawMutex, channel::Channel, mutex::Mutex, signal::Signal,
|
||||
blocking_mutex::raw::CriticalSectionRawMutex, channel::Channel, signal::Signal,
|
||||
};
|
||||
use embassy_time::{Delay, Timer};
|
||||
use embedded_hal_bus::spi::ExclusiveDevice;
|
||||
@@ -86,7 +84,7 @@ static ENABLE_UI: AtomicBool = AtomicBool::new(true);
|
||||
static UI_CHANGE: Signal<CriticalSectionRawMutex, ()> = Signal::new();
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) {
|
||||
async fn main(_spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
|
||||
spawn_core1(
|
||||
@@ -239,7 +237,7 @@ async fn kernel_task(
|
||||
setup_display(display, spawner).await;
|
||||
setup_sd(sd).await;
|
||||
|
||||
let usb = embassy_rp_usb::Driver::new(usb, Irqs);
|
||||
let _usb = embassy_rp_usb::Driver::new(usb, Irqs);
|
||||
// spawner.spawn(usb_handler(usb)).unwrap();
|
||||
|
||||
loop {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
use core::sync::atomic::AtomicBool;
|
||||
|
||||
use embassy_futures::select::select;
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_sync::lazy_lock::LazyLock;
|
||||
@@ -25,7 +23,7 @@ static mut BLOCK_BUF: LazyLock<[Block; BLOCKS]> =
|
||||
LazyLock::new(|| core::array::from_fn(|_| Block::new()));
|
||||
|
||||
pub struct MassStorageClass<'d, D: Driver<'d>> {
|
||||
temp_sd: Option<SdCard>, // temporarly owns sdcard when scsi is running
|
||||
temp_sd: Option<SdCard>, // temporary owns sdcard when scsi is running
|
||||
ejected: bool,
|
||||
pending_eject: bool,
|
||||
bulk_out: D::EndpointOut,
|
||||
@@ -192,12 +190,15 @@ impl<'d, 's, D: Driver<'d>> MassStorageClass<'d, D> {
|
||||
Err(())
|
||||
}
|
||||
}
|
||||
ScsiCommand::RequestSense { desc, alloc_len } => Ok(()),
|
||||
ScsiCommand::RequestSense {
|
||||
desc: _,
|
||||
alloc_len: _,
|
||||
} => Ok(()),
|
||||
ScsiCommand::ModeSense6 {
|
||||
dbd,
|
||||
page_control,
|
||||
page_code,
|
||||
subpage_code,
|
||||
dbd: _,
|
||||
page_control: _,
|
||||
page_code: _,
|
||||
subpage_code: _,
|
||||
alloc_len,
|
||||
} => {
|
||||
// DBD=0, no block descriptors; total length = 4
|
||||
@@ -213,10 +214,10 @@ impl<'d, 's, D: Driver<'d>> MassStorageClass<'d, D> {
|
||||
self.bulk_in.write(&response[..len]).await.map_err(|_| ())
|
||||
}
|
||||
ScsiCommand::ModeSense10 {
|
||||
dbd,
|
||||
page_control,
|
||||
page_code,
|
||||
subpage_code,
|
||||
dbd: _,
|
||||
page_control: _,
|
||||
page_code: _,
|
||||
subpage_code: _,
|
||||
alloc_len,
|
||||
} => {
|
||||
let response = [
|
||||
@@ -377,6 +378,7 @@ impl<'d, 's, D: Driver<'d>> MassStorageClass<'d, D> {
|
||||
}
|
||||
|
||||
#[repr(C, packed)]
|
||||
#[allow(non_snake_case)]
|
||||
struct CommandBlockWrapper {
|
||||
dCBWSignature: u32,
|
||||
dCBWTag: u32,
|
||||
@@ -387,6 +389,7 @@ struct CommandBlockWrapper {
|
||||
CBWCB: [u8; 16],
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
impl CommandBlockWrapper {
|
||||
fn parse(buf: &[u8]) -> Option<Self> {
|
||||
if buf.len() < 31 {
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
use num_enum::TryFromPrimitive;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum ScsiError {
|
||||
NotReady,
|
||||
}
|
||||
|
||||
/// THE CODE BELOW ORIGINATES FROM: https://github.com/apohrebniak/usbd-storage/blob/master/usbd-storage/src/subclass/scsi.rs
|
||||
|
||||
/// SCSI device subclass code
|
||||
|
||||
@@ -101,7 +101,7 @@ impl SdCard {
|
||||
pub fn write_blocks(&self, blocks: &mut [Block], start_block_idx: BlockIdx) -> Result<(), ()> {
|
||||
let mut res: Result<(), Error> = Ok(());
|
||||
self.volume_mgr.device(|sd| {
|
||||
let res = sd.write(blocks, start_block_idx);
|
||||
res = sd.write(blocks, start_block_idx);
|
||||
DummyTimeSource {}
|
||||
});
|
||||
res.map_err(|_| ())
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::{scsi::MassStorageClass, storage::SdCard};
|
||||
use core::sync::atomic::{AtomicBool, Ordering};
|
||||
use embassy_futures::{join::join, select::select};
|
||||
use embassy_futures::select::select;
|
||||
use embassy_rp::{peripherals::USB, usb::Driver};
|
||||
use embassy_usb::{Builder, Config, UsbDevice};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user