Apply rustfmt

This commit is contained in:
Magnus Nordlander 2025-08-05 09:58:33 +02:00
parent 8965a13da4
commit 1e91833118
3 changed files with 7 additions and 15 deletions

View File

@ -12,8 +12,8 @@
use critical_section::{acquire, release, CriticalSection, RestoreState}; use critical_section::{acquire, release, CriticalSection, RestoreState};
use crate::qmi_cs1::QmiCs1;
use crate::pac; use crate::pac;
use crate::qmi_cs1::QmiCs1;
/// PSRAM errors. /// PSRAM errors.
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
@ -213,10 +213,7 @@ impl<'d> Psram<'d> {
/// Create a new PSRAM driver instance. /// Create a new PSRAM driver instance.
/// ///
/// This will detect the PSRAM device and configure it for memory-mapped access. /// This will detect the PSRAM device and configure it for memory-mapped access.
pub fn new( pub fn new(qmi_cs1: QmiCs1<'d>, config: Config) -> Result<Self, Error> {
qmi_cs1: QmiCs1<'d>,
config: Config,
) -> Result<Self, Error> {
let qmi = pac::QMI; let qmi = pac::QMI;
let xip = pac::XIP_CTRL; let xip = pac::XIP_CTRL;

View File

@ -36,17 +36,13 @@ impl<'d> QmiCs1<'d> {
} }
} }
trait SealedInstance { trait SealedInstance {}
}
/// QMI CS1 instance trait. /// QMI CS1 instance trait.
#[allow(private_bounds)] #[allow(private_bounds)]
pub trait Instance: SealedInstance + PeripheralType {} pub trait Instance: SealedInstance + PeripheralType {}
impl SealedInstance for peripherals::QMI_CS1 { impl SealedInstance for peripherals::QMI_CS1 {}
}
impl Instance for peripherals::QMI_CS1 {} impl Instance for peripherals::QMI_CS1 {}

View File

@ -6,11 +6,11 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
use core::slice;
use defmt::*; use defmt::*;
use embassy_executor::Spawner; use embassy_executor::Spawner;
use embassy_time::Timer; use embassy_time::Timer;
use {defmt_rtt as _, panic_probe as _}; use {defmt_rtt as _, panic_probe as _};
use core::slice;
#[embassy_executor::main] #[embassy_executor::main]
async fn main(_spawner: Spawner) { async fn main(_spawner: Spawner) {
@ -23,13 +23,12 @@ async fn main(_spawner: Spawner) {
error!("PSRAM not found"); error!("PSRAM not found");
loop { loop {
Timer::after_secs(1).await; Timer::after_secs(1).await;
}; }
}; };
let psram_slice = unsafe { let psram_slice = unsafe {
let psram_ptr = psram.base_address(); let psram_ptr = psram.base_address();
let slice: &'static mut [u8] = let slice: &'static mut [u8] = slice::from_raw_parts_mut(psram_ptr, psram.size() as usize);
slice::from_raw_parts_mut(psram_ptr, psram.size() as usize);
slice slice
}; };