STM32: Enable flash support for STM32G4

This commit is contained in:
Adam Greig 2023-12-16 03:44:15 +00:00
parent ccf602b333
commit f6bc96dfbd
No known key found for this signature in database
GPG key ID: 8B3FE5477B1DD9A0
8 changed files with 10 additions and 10 deletions

View file

@ -79,7 +79,7 @@ pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), E
pub(crate) unsafe fn clear_all_err() { pub(crate) unsafe fn clear_all_err() {
// read and write back the same value. // read and write back the same value.
// This clears all "write 0 to clear" bits. // This clears all "write 1 to clear" bits.
pac::FLASH.sr().modify(|_| {}); pac::FLASH.sr().modify(|_| {});
} }

View file

@ -79,7 +79,7 @@ pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), E
pub(crate) unsafe fn clear_all_err() { pub(crate) unsafe fn clear_all_err() {
// read and write back the same value. // read and write back the same value.
// This clears all "write 0 to clear" bits. // This clears all "write 1 to clear" bits.
pac::FLASH.sr().modify(|_| {}); pac::FLASH.sr().modify(|_| {});
} }

View file

@ -337,7 +337,7 @@ pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), E
pub(crate) fn clear_all_err() { pub(crate) fn clear_all_err() {
// read and write back the same value. // read and write back the same value.
// This clears all "write 0 to clear" bits. // This clears all "write 1 to clear" bits.
pac::FLASH.sr().modify(|_| {}); pac::FLASH.sr().modify(|_| {});
} }

View file

@ -69,7 +69,7 @@ pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), E
pub(crate) unsafe fn clear_all_err() { pub(crate) unsafe fn clear_all_err() {
// read and write back the same value. // read and write back the same value.
// This clears all "write 0 to clear" bits. // This clears all "write 1 to clear" bits.
pac::FLASH.sr().modify(|_| {}); pac::FLASH.sr().modify(|_| {});
} }

View file

@ -92,6 +92,6 @@ pub(crate) unsafe fn wait_ready_blocking() -> Result<(), Error> {
pub(crate) unsafe fn clear_all_err() { pub(crate) unsafe fn clear_all_err() {
// read and write back the same value. // read and write back the same value.
// This clears all "write 0 to clear" bits. // This clears all "write 1 to clear" bits.
pac::FLASH.sr().modify(|_| {}); pac::FLASH.sr().modify(|_| {});
} }

View file

@ -113,7 +113,7 @@ pub(crate) unsafe fn clear_all_err() {
unsafe fn bank_clear_all_err(bank: pac::flash::Bank) { unsafe fn bank_clear_all_err(bank: pac::flash::Bank) {
// read and write back the same value. // read and write back the same value.
// This clears all "write 0 to clear" bits. // This clears all "write 1 to clear" bits.
bank.sr().modify(|_| {}); bank.sr().modify(|_| {});
} }

View file

@ -120,7 +120,7 @@ pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), E
pub(crate) unsafe fn clear_all_err() { pub(crate) unsafe fn clear_all_err() {
// read and write back the same value. // read and write back the same value.
// This clears all "write 0 to clear" bits. // This clears all "write 1 to clear" bits.
pac::FLASH.sr().modify(|_| {}); pac::FLASH.sr().modify(|_| {});
} }

View file

@ -63,13 +63,13 @@ impl FlashRegion {
#[cfg_attr(flash_f3, path = "f3.rs")] #[cfg_attr(flash_f3, path = "f3.rs")]
#[cfg_attr(flash_f4, path = "f4.rs")] #[cfg_attr(flash_f4, path = "f4.rs")]
#[cfg_attr(flash_f7, path = "f7.rs")] #[cfg_attr(flash_f7, path = "f7.rs")]
#[cfg_attr(flash_g0, path = "g0.rs")] #[cfg_attr(any(flash_g0, flash_g4), path = "g.rs")]
#[cfg_attr(flash_h7, path = "h7.rs")] #[cfg_attr(flash_h7, path = "h7.rs")]
#[cfg_attr(flash_h7ab, path = "h7.rs")] #[cfg_attr(flash_h7ab, path = "h7.rs")]
#[cfg_attr( #[cfg_attr(
not(any( not(any(
flash_l0, flash_l1, flash_l4, flash_wl, flash_wb, flash_f0, flash_f3, flash_f4, flash_f7, flash_g0, flash_h7, flash_l0, flash_l1, flash_l4, flash_wl, flash_wb, flash_f0, flash_f3, flash_f4, flash_f7, flash_g0, flash_g4,
flash_h7ab flash_h7, flash_h7ab
)), )),
path = "other.rs" path = "other.rs"
)] )]