*_blocking -> blocking_*

This commit is contained in:
Rasmus Melchior Jacobsen
2023-05-25 21:46:26 +02:00
parent 860b519f99
commit 9eca19b49d
9 changed files with 59 additions and 59 deletions

View File

@ -43,7 +43,7 @@ pub(crate) unsafe fn enable_blocking_write() {
pub(crate) unsafe fn disable_blocking_write() {}
pub(crate) unsafe fn write_blocking(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> {
pub(crate) unsafe fn blocking_write(start_address: u32, buf: &[u8; WRITE_SIZE]) -> Result<(), Error> {
// We cannot have the write setup sequence in begin_write as it depends on the address
let bank = if start_address < BANK1_REGION.end() {
pac::FLASH.bank(0)
@ -64,7 +64,7 @@ pub(crate) unsafe fn write_blocking(start_address: u32, buf: &[u8; WRITE_SIZE])
write_volatile(address as *mut u32, u32::from_le_bytes(val.try_into().unwrap()));
address += val.len() as u32;
res = Some(wait_ready_blocking(bank));
res = Some(blocking_wait_ready(bank));
bank.sr().modify(|w| {
if w.eop() {
w.set_eop(true);
@ -84,7 +84,7 @@ pub(crate) unsafe fn write_blocking(start_address: u32, buf: &[u8; WRITE_SIZE])
res.unwrap()
}
pub(crate) unsafe fn erase_sector_blocking(sector: &FlashSector) -> Result<(), Error> {
pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), Error> {
let bank = pac::FLASH.bank(sector.bank as usize);
bank.cr().modify(|w| {
w.set_ser(true);
@ -95,7 +95,7 @@ pub(crate) unsafe fn erase_sector_blocking(sector: &FlashSector) -> Result<(), E
w.set_start(true);
});
let ret: Result<(), Error> = wait_ready_blocking(bank);
let ret: Result<(), Error> = blocking_wait_ready(bank);
bank.cr().modify(|w| w.set_ser(false));
bank_clear_all_err(bank);
ret
@ -142,7 +142,7 @@ unsafe fn bank_clear_all_err(bank: pac::flash::Bank) {
});
}
unsafe fn wait_ready_blocking(bank: pac::flash::Bank) -> Result<(), Error> {
unsafe fn blocking_wait_ready(bank: pac::flash::Bank) -> Result<(), Error> {
loop {
let sr = bank.sr().read();