Align with new bind_interrupt

This commit is contained in:
Rasmus Melchior Jacobsen
2023-05-25 13:42:42 +02:00
parent 15636f05f5
commit 7371eefa86
25 changed files with 71 additions and 40 deletions

View File

@ -4,7 +4,7 @@
use defmt::{info, unwrap};
use embassy_executor::Spawner;
use embassy_stm32::{flash::Flash, interrupt};
use embassy_stm32::flash::Flash;
use {defmt_rtt as _, panic_probe as _};
#[embassy_executor::main]
@ -14,7 +14,7 @@ async fn main(_spawner: Spawner) {
// Once can also call `into_regions()` to get access to NorFlash implementations
// for each of the unique characteristics.
let mut f = Flash::new(p.FLASH, interrupt::take!(FLASH));
let mut f = Flash::new_blocking_only(p.FLASH);
// Sector 5
test_flash(&mut f, 128 * 1024, 128 * 1024);

View File

@ -5,17 +5,21 @@
use defmt::{info, unwrap};
use embassy_executor::Spawner;
use embassy_time::{Timer, Duration};
use embassy_stm32::flash::Flash;
use embassy_stm32::flash::{Flash, InterruptHandler};
use embassy_stm32::gpio::{AnyPin, Level, Output, Pin, Speed};
use embassy_stm32::{interrupt};
use embassy_stm32::bind_interrupts;
use {defmt_rtt as _, panic_probe as _};
bind_interrupts!(struct Irqs {
FLASH => InterruptHandler;
});
#[embassy_executor::main]
async fn main(spawner: Spawner) {
let p = embassy_stm32::init(Default::default());
info!("Hello Flash!");
let mut f = Flash::new(p.FLASH, interrupt::take!(FLASH));
let mut f = Flash::new(p.FLASH, Irqs);
// Led should blink uninterrupted during ~2sec erase operation
spawner.spawn(blinky(p.PB7.degrade())).unwrap();