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

@ -12,15 +12,18 @@ pub(super) static REGION_ACCESS: Mutex<CriticalSectionRawMutex, ()> = Mutex::new
impl<'d> Flash<'d> {
pub fn into_regions(self) -> FlashLayout<'d, Async> {
assert!(!self.blocking_only);
family::set_default_layout();
FlashLayout::new(self.inner)
}
pub async fn write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Error> {
assert!(!self.blocking_only);
unsafe { write_chunked(FLASH_BASE as u32, FLASH_SIZE as u32, offset, bytes).await }
}
pub async fn erase(&mut self, from: u32, to: u32) -> Result<(), Error> {
assert!(!self.blocking_only);
unsafe { erase_sectored(FLASH_BASE as u32, from, to).await }
}
}