update deps

This commit is contained in:
2025-09-13 14:43:54 -06:00
parent 1994d74a17
commit 59f6bf8ef7
8 changed files with 133 additions and 88 deletions

View File

@@ -31,20 +31,20 @@ defmt = [
]
[dependencies]
embassy-executor = { version = "0.7", features = [
embassy-executor = { version = "0.9", features = [
"arch-cortex-m",
"executor-interrupt",
"executor-thread",
"nightly",
] }
embassy-rp = { version = "0.4.0", features = [
embassy-rp = { version = "0.8.0", features = [
"critical-section-impl",
"unstable-pac",
"time-driver",
] }
embassy-usb = "0.4.0"
embassy-futures = "0.1.1"
embassy-time = { version = "0.4.0", features = ["generic-queue-8"] }
embassy-usb = "0.5.1"
embassy-futures = "0.1.2"
embassy-time = { version = "0.5.0", features = ["generic-queue-8"] }
embassy-embedded-hal = "0.3.1"
embassy-sync = { version = "0.7" }
trouble-host = { version = "0.1", features = [
@@ -65,6 +65,7 @@ cortex-m = { version = "0.7.7" }
cortex-m-rt = "0.7.5"
panic-probe = "0.3"
portable-atomic = { version = "1.11", features = ["critical-section"] }
assign-resources = "0.5.0"
defmt = { version = "0.3", optional = true }
defmt-rtt = "0.4.2"

View File

@@ -1,4 +1,5 @@
use embassy_rp::{
Peri,
gpio::{Level, Output},
peripherals::{PIN_13, PIN_14, PIN_15, SPI1},
spi::{Async, Spi},
@@ -30,9 +31,9 @@ pub static FRAMEBUFFER: LazyLock<Mutex<CriticalSectionRawMutex, FB>> =
pub async fn init_display(
spi: Spi<'static, SPI1, Async>,
cs: PIN_13,
data: PIN_14,
reset: PIN_15,
cs: Peri<'static, PIN_13>,
data: Peri<'static, PIN_14>,
reset: Peri<'static, PIN_15>,
) -> DISPLAY {
let spi_device = ExclusiveDevice::new(spi, Output::new(cs, Level::Low), Delay).unwrap();
let mut display = ST7365P::new(

View File

@@ -17,8 +17,6 @@ mod ui;
mod usb;
mod utils;
use core::sync::atomic::Ordering;
use crate::{
display::{FRAMEBUFFER, clear_fb, display_handler, init_display},
elf::load_binary,
@@ -31,14 +29,15 @@ use crate::{
usb::usb_handler,
};
use abi_sys::EntryFn;
use alloc::vec::Vec;
use {defmt_rtt as _, panic_probe as _};
use assign_resources::assign_resources;
use defmt::unwrap;
use embassy_executor::{Executor, Spawner};
use embassy_futures::join::{join, join3, join4, join5};
use embassy_rp::{
Peri,
gpio::{Input, Level, Output, Pull},
i2c::{self, I2c},
multicore::{Stack, spawn_core1},
@@ -157,34 +156,32 @@ async fn userland_task() {
}
struct Display {
spi: SPI1,
clk: PIN_10,
mosi: PIN_11,
miso: PIN_12,
dma1: DMA_CH0,
dma2: DMA_CH1,
cs: PIN_13,
data: PIN_14,
reset: PIN_15,
spi: Peri<'static, SPI1>,
clk: Peri<'static, PIN_10>,
mosi: Peri<'static, PIN_11>,
miso: Peri<'static, PIN_12>,
dma1: Peri<'static, DMA_CH0>,
dma2: Peri<'static, DMA_CH1>,
cs: Peri<'static, PIN_13>,
data: Peri<'static, PIN_14>,
reset: Peri<'static, PIN_15>,
}
struct Sd {
spi: SPI0,
clk: PIN_18,
mosi: PIN_19,
miso: PIN_16,
cs: PIN_17,
det: PIN_22,
spi: Peri<'static, SPI0>,
clk: Peri<'static, PIN_18>,
mosi: Peri<'static, PIN_19>,
miso: Peri<'static, PIN_16>,
cs: Peri<'static, PIN_17>,
det: Peri<'static, PIN_22>,
}
struct Mcu {
i2c: I2C1,
clk: PIN_7,
data: PIN_6,
i2c: Peri<'static, I2C1>,
clk: Peri<'static, PIN_7>,
data: Peri<'static, PIN_6>,
}
#[embassy_executor::task]
async fn kernel_task(display: Display, sd: Sd, mcu: Mcu, usb: USB) {
async fn kernel_task(display: Display, sd: Sd, mcu: Mcu, usb: Peri<'static, USB>) {
// MCU i2c bus for peripherals
let mut config = i2c::Config::default();
config.frequency = 400_000;

View File

@@ -5,7 +5,9 @@ use embassy_rp::{
i2c::{Async, I2c},
peripherals::I2C1,
};
use embassy_sync::{blocking_mutex::raw::NoopRawMutex, lazy_lock::LazyLock, mutex::Mutex};
use embassy_sync::{
blocking_mutex::raw::CriticalSectionRawMutex, lazy_lock::LazyLock, mutex::Mutex,
};
use embassy_time::Timer;
pub mod keyboard;
@@ -15,7 +17,7 @@ use crate::peripherals::keyboard::{configure_keyboard, read_keyboard_fifo};
const MCU_ADDR: u8 = 0x1F;
type I2CBUS = I2c<'static, I2C1, Async>;
pub static PERIPHERAL_BUS: LazyLock<Mutex<NoopRawMutex, Option<I2CBUS>>> =
pub static PERIPHERAL_BUS: LazyLock<Mutex<CriticalSectionRawMutex, Option<I2CBUS>>> =
LazyLock::new(|| Mutex::new(None));
const REG_ID_VER: u8 = 0x01;

View File

@@ -23,8 +23,8 @@ impl<'d, 's, D: Driver<'d>> MassStorageClass<'d, D> {
let mut interface = function.interface();
let mut alt = interface.alt_setting(0x08, SUBCLASS_SCSI, 0x50, None);
let bulk_out = alt.endpoint_bulk_out(BULK_ENDPOINT_PACKET_SIZE as u16);
let bulk_in = alt.endpoint_bulk_in(BULK_ENDPOINT_PACKET_SIZE as u16);
let bulk_out = alt.endpoint_bulk_out(None, BULK_ENDPOINT_PACKET_SIZE as u16);
let bulk_in = alt.endpoint_bulk_in(None, BULK_ENDPOINT_PACKET_SIZE as u16);
Self { bulk_out, bulk_in }
}

View File

@@ -3,7 +3,7 @@ use core::str::FromStr;
use embassy_rp::gpio::{Input, Output};
use embassy_rp::peripherals::SPI0;
use embassy_rp::spi::{Blocking, Spi};
use embassy_sync::blocking_mutex::raw::NoopRawMutex;
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
use embassy_sync::lazy_lock::LazyLock;
use embassy_sync::mutex::Mutex;
use embassy_time::Delay;
@@ -25,7 +25,7 @@ type Vol<'a> = Volume<'a, SD, DummyTimeSource, MAX_DIRS, MAX_FILES, MAX_VOLUMES>
type Dir<'a> = Directory<'a, SD, DummyTimeSource, MAX_DIRS, MAX_FILES, MAX_VOLUMES>;
pub type File<'a> = SdFile<'a, SD, DummyTimeSource, MAX_DIRS, MAX_FILES, MAX_VOLUMES>;
pub static SDCARD: LazyLock<Mutex<NoopRawMutex, Option<SdCard>>> =
pub static SDCARD: LazyLock<Mutex<CriticalSectionRawMutex, Option<SdCard>>> =
LazyLock::new(|| Mutex::new(None));
pub struct DummyTimeSource {}

View File

@@ -1,16 +1,10 @@
use crate::{
TASK_STATE, TASK_STATE_CHANGED, TaskState,
scsi::MassStorageClass,
storage::{SDCARD, SdCard},
};
use crate::{TASK_STATE, TASK_STATE_CHANGED, TaskState, scsi::MassStorageClass};
use embassy_futures::{
join::join,
select::{select, select3},
};
use embassy_rp::{peripherals::USB, usb::Driver};
use embassy_sync::{blocking_mutex::raw::ThreadModeRawMutex, signal::Signal};
use embassy_usb::{Builder, Config};
use portable_atomic::AtomicBool;
pub async fn usb_handler(driver: Driver<'static, USB>) {
let mut config = Config::new(0xc0de, 0xbabe);