Update embassy-stm32
This commit is contained in:
@ -1,6 +1,4 @@
|
||||
use core::marker::PhantomData;
|
||||
|
||||
use embassy_hal_common::unborrow;
|
||||
use embassy_hal_common::{unborrow, Unborrowed};
|
||||
use embedded_storage::nor_flash::{ErrorType, NorFlash, NorFlashError, NorFlashErrorKind, ReadNorFlash};
|
||||
|
||||
pub use crate::pac::{ERASE_SIZE, ERASE_VALUE, FLASH_BASE, FLASH_SIZE, WRITE_SIZE};
|
||||
@ -16,20 +14,16 @@ const FLASH_END: usize = FLASH_BASE + FLASH_SIZE;
|
||||
mod family;
|
||||
|
||||
pub struct Flash<'d> {
|
||||
_inner: FLASH,
|
||||
_phantom: PhantomData<&'d mut FLASH>,
|
||||
_inner: Unborrowed<'d, FLASH>,
|
||||
}
|
||||
|
||||
impl<'d> Flash<'d> {
|
||||
pub fn new(p: impl Unborrow<Target = FLASH>) -> Self {
|
||||
pub fn new(p: impl Unborrow<Target = FLASH> + 'd) -> Self {
|
||||
unborrow!(p);
|
||||
Self {
|
||||
_inner: p,
|
||||
_phantom: PhantomData,
|
||||
}
|
||||
Self { _inner: p }
|
||||
}
|
||||
|
||||
pub fn unlock(p: impl Unborrow<Target = FLASH>) -> Self {
|
||||
pub fn unlock(p: impl Unborrow<Target = FLASH> + 'd) -> Self {
|
||||
let flash = Self::new(p);
|
||||
|
||||
unsafe { family::unlock() };
|
||||
|
Reference in New Issue
Block a user