mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-30 05:40:55 +00:00
Apply rustfmt
This commit is contained in:
parent
8965a13da4
commit
1e91833118
@ -12,8 +12,8 @@
|
||||
|
||||
use critical_section::{acquire, release, CriticalSection, RestoreState};
|
||||
|
||||
use crate::qmi_cs1::QmiCs1;
|
||||
use crate::pac;
|
||||
use crate::qmi_cs1::QmiCs1;
|
||||
|
||||
/// PSRAM errors.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@ -213,10 +213,7 @@ impl<'d> Psram<'d> {
|
||||
/// Create a new PSRAM driver instance.
|
||||
///
|
||||
/// This will detect the PSRAM device and configure it for memory-mapped access.
|
||||
pub fn new(
|
||||
qmi_cs1: QmiCs1<'d>,
|
||||
config: Config,
|
||||
) -> Result<Self, Error> {
|
||||
pub fn new(qmi_cs1: QmiCs1<'d>, config: Config) -> Result<Self, Error> {
|
||||
let qmi = pac::QMI;
|
||||
let xip = pac::XIP_CTRL;
|
||||
|
||||
|
@ -36,17 +36,13 @@ impl<'d> QmiCs1<'d> {
|
||||
}
|
||||
}
|
||||
|
||||
trait SealedInstance {
|
||||
|
||||
}
|
||||
trait SealedInstance {}
|
||||
|
||||
/// QMI CS1 instance trait.
|
||||
#[allow(private_bounds)]
|
||||
pub trait Instance: SealedInstance + PeripheralType {}
|
||||
|
||||
impl SealedInstance for peripherals::QMI_CS1 {
|
||||
|
||||
}
|
||||
impl SealedInstance for peripherals::QMI_CS1 {}
|
||||
|
||||
impl Instance for peripherals::QMI_CS1 {}
|
||||
|
||||
|
@ -6,11 +6,11 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
|
||||
use core::slice;
|
||||
use defmt::*;
|
||||
use embassy_executor::Spawner;
|
||||
use embassy_time::Timer;
|
||||
use {defmt_rtt as _, panic_probe as _};
|
||||
use core::slice;
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(_spawner: Spawner) {
|
||||
@ -23,13 +23,12 @@ async fn main(_spawner: Spawner) {
|
||||
error!("PSRAM not found");
|
||||
loop {
|
||||
Timer::after_secs(1).await;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
let psram_slice = unsafe {
|
||||
let psram_ptr = psram.base_address();
|
||||
let slice: &'static mut [u8] =
|
||||
slice::from_raw_parts_mut(psram_ptr, psram.size() as usize);
|
||||
let slice: &'static mut [u8] = slice::from_raw_parts_mut(psram_ptr, psram.size() as usize);
|
||||
slice
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user