diff options
| author | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-25 22:09:28 +0200 |
|---|---|---|
| committer | Rasmus Melchior Jacobsen <[email protected]> | 2023-05-25 22:09:28 +0200 |
| commit | 344e28360ff55771379202ecd06eb0cb1db38a29 (patch) | |
| tree | 3d03e5ed3449f081e0f24d076c3dfb6d7bc05c20 | |
| parent | 983f01016becd0ab51fb542ec2c1ca6745df60cc (diff) | |
More blocking rename
| -rw-r--r-- | embassy-stm32/src/flash/common.rs | 12 | ||||
| -rw-r--r-- | embassy-stm32/src/flash/f0.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/flash/f3.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/flash/l.rs | 2 | ||||
| -rw-r--r-- | embassy-stm32/src/flash/other.rs | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/embassy-stm32/src/flash/common.rs b/embassy-stm32/src/flash/common.rs index 1ea65c0b6..0729771a1 100644 --- a/embassy-stm32/src/flash/common.rs +++ b/embassy-stm32/src/flash/common.rs | |||
| @@ -92,7 +92,7 @@ impl interrupt::Handler<crate::interrupt::FLASH> for InterruptHandler { | |||
| 92 | } | 92 | } |
| 93 | } | 93 | } |
| 94 | 94 | ||
| 95 | pub(super) fn read_blocking(base: u32, size: u32, offset: u32, bytes: &mut [u8]) -> Result<(), Error> { | 95 | pub(super) fn blocking_read(base: u32, size: u32, offset: u32, bytes: &mut [u8]) -> Result<(), Error> { |
| 96 | if offset + bytes.len() as u32 > size { | 96 | if offset + bytes.len() as u32 > size { |
| 97 | return Err(Error::Size); | 97 | return Err(Error::Size); |
| 98 | } | 98 | } |
| @@ -255,11 +255,11 @@ impl<MODE> embedded_storage::nor_flash::NorFlash for Flash<'_, MODE> { | |||
| 255 | const ERASE_SIZE: usize = MAX_ERASE_SIZE; | 255 | const ERASE_SIZE: usize = MAX_ERASE_SIZE; |
| 256 | 256 | ||
| 257 | fn write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Self::Error> { | 257 | fn write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Self::Error> { |
| 258 | self.write_blocking(offset, bytes) | 258 | self.blocking_write(offset, bytes) |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error> { | 261 | fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error> { |
| 262 | self.erase_blocking(from, to) | 262 | self.blocking_erase(from, to) |
| 263 | } | 263 | } |
| 264 | } | 264 | } |
| 265 | 265 | ||
| @@ -289,7 +289,7 @@ foreach_flash_region! { | |||
| 289 | const READ_SIZE: usize = READ_SIZE; | 289 | const READ_SIZE: usize = READ_SIZE; |
| 290 | 290 | ||
| 291 | fn read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error> { | 291 | fn read(&mut self, offset: u32, bytes: &mut [u8]) -> Result<(), Self::Error> { |
| 292 | self.read_blocking(offset, bytes) | 292 | self.blocking_read(offset, bytes) |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | fn capacity(&self) -> usize { | 295 | fn capacity(&self) -> usize { |
| @@ -302,11 +302,11 @@ foreach_flash_region! { | |||
| 302 | const ERASE_SIZE: usize = $erase_size; | 302 | const ERASE_SIZE: usize = $erase_size; |
| 303 | 303 | ||
| 304 | fn write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Self::Error> { | 304 | fn write(&mut self, offset: u32, bytes: &[u8]) -> Result<(), Self::Error> { |
| 305 | self.write_blocking(offset, bytes) | 305 | self.blocking_write(offset, bytes) |
| 306 | } | 306 | } |
| 307 | 307 | ||
| 308 | fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error> { | 308 | fn erase(&mut self, from: u32, to: u32) -> Result<(), Self::Error> { |
| 309 | self.erase_blocking(from, to) | 309 | self.blocking_erase(from, to) |
| 310 | } | 310 | } |
| 311 | } | 311 | } |
| 312 | }; | 312 | }; |
diff --git a/embassy-stm32/src/flash/f0.rs b/embassy-stm32/src/flash/f0.rs index cd17486e6..22e08e91a 100644 --- a/embassy-stm32/src/flash/f0.rs +++ b/embassy-stm32/src/flash/f0.rs | |||
| @@ -36,7 +36,7 @@ pub(crate) unsafe fn disable_blocking_write() { | |||
| 36 | pac::FLASH.cr().write(|w| w.set_pg(false)); | 36 | pac::FLASH.cr().write(|w| w.set_pg(false)); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | pub(crate) unsafe fn write_blocking(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { | 39 | pub(crate) unsafe fn blocking_write(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { |
| 40 | let mut address = start_address; | 40 | let mut address = start_address; |
| 41 | for chunk in buf.chunks(2) { | 41 | for chunk in buf.chunks(2) { |
| 42 | write_volatile(address as *mut u16, u16::from_le_bytes(chunk.try_into().unwrap())); | 42 | write_volatile(address as *mut u16, u16::from_le_bytes(chunk.try_into().unwrap())); |
diff --git a/embassy-stm32/src/flash/f3.rs b/embassy-stm32/src/flash/f3.rs index 4ce391288..e05734703 100644 --- a/embassy-stm32/src/flash/f3.rs +++ b/embassy-stm32/src/flash/f3.rs | |||
| @@ -36,7 +36,7 @@ pub(crate) unsafe fn disable_blocking_write() { | |||
| 36 | pac::FLASH.cr().write(|w| w.set_pg(false)); | 36 | pac::FLASH.cr().write(|w| w.set_pg(false)); |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | pub(crate) unsafe fn write_blocking(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { | 39 | pub(crate) unsafe fn blocking_write(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { |
| 40 | let mut address = start_address; | 40 | let mut address = start_address; |
| 41 | for chunk in buf.chunks(2) { | 41 | for chunk in buf.chunks(2) { |
| 42 | write_volatile(address as *mut u16, u16::from_le_bytes(chunk.try_into().unwrap())); | 42 | write_volatile(address as *mut u16, u16::from_le_bytes(chunk.try_into().unwrap())); |
diff --git a/embassy-stm32/src/flash/l.rs b/embassy-stm32/src/flash/l.rs index c2394e0c9..e27accb01 100644 --- a/embassy-stm32/src/flash/l.rs +++ b/embassy-stm32/src/flash/l.rs | |||
| @@ -57,7 +57,7 @@ pub(crate) unsafe fn disable_blocking_write() { | |||
| 57 | pac::FLASH.cr().write(|w| w.set_pg(false)); | 57 | pac::FLASH.cr().write(|w| w.set_pg(false)); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | pub(crate) unsafe fn write_blocking(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { | 60 | pub(crate) unsafe fn blocking_write(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { |
| 61 | let mut address = start_address; | 61 | let mut address = start_address; |
| 62 | for val in buf.chunks(4) { | 62 | for val in buf.chunks(4) { |
| 63 | write_volatile(address as *mut u32, u32::from_le_bytes(val.try_into().unwrap())); | 63 | write_volatile(address as *mut u32, u32::from_le_bytes(val.try_into().unwrap())); |
diff --git a/embassy-stm32/src/flash/other.rs b/embassy-stm32/src/flash/other.rs index e569951f9..73266177f 100644 --- a/embassy-stm32/src/flash/other.rs +++ b/embassy-stm32/src/flash/other.rs | |||
| @@ -24,7 +24,7 @@ pub(crate) unsafe fn enable_blocking_write() { | |||
| 24 | pub(crate) unsafe fn disable_blocking_write() { | 24 | pub(crate) unsafe fn disable_blocking_write() { |
| 25 | unimplemented!(); | 25 | unimplemented!(); |
| 26 | } | 26 | } |
| 27 | pub(crate) unsafe fn write_blocking(_start_address: u32, _buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { | 27 | pub(crate) unsafe fn blocking_write(_start_address: u32, _buf: &[u8; WRITE_SIZE]) -> Result<(), Error> { |
| 28 | unimplemented!(); | 28 | unimplemented!(); |
| 29 | } | 29 | } |
| 30 | pub(crate) unsafe fn erase_sector_blocking(_sector: &FlashSector) -> Result<(), Error> { | 30 | pub(crate) unsafe fn erase_sector_blocking(_sector: &FlashSector) -> Result<(), Error> { |
