Merge pull request #2294 from adamgreig/g4-flash

STM32: Enable flash support for STM32G4
This commit is contained in:
Ulf Lilleengen 2023-12-16 06:41:21 +00:00 committed by GitHub
commit 2a7a44477e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"
)] )]