diff --git a/embassy-stm32/src/usb/usb.rs b/embassy-stm32/src/usb/usb.rs index 10eb94e6c..cadbb423c 100644 --- a/embassy-stm32/src/usb/usb.rs +++ b/embassy-stm32/src/usb/usb.rs @@ -141,7 +141,7 @@ impl<'d, T: Instance> Driver<'d, T> { unsafe { crate::peripherals::PWR::enable(); - pac::PWR.cr2().modify(|w| w.set_usv(pac::pwr::vals::Usv::VALID)); + pac::PWR.cr2().modify(|w| w.set_usv(true)); } unsafe { diff --git a/stm32-data b/stm32-data index fa294eae7..56d5b8b2a 160000 --- a/stm32-data +++ b/stm32-data @@ -1 +1 @@ -Subproject commit fa294eae79c0f33f4cde1e73b4e69db59f7429e3 +Subproject commit 56d5b8b2aee7026b4f9bcffc427bb8f9d48afeb5 diff --git a/stm32-metapac-gen/src/lib.rs b/stm32-metapac-gen/src/lib.rs index 0d761508f..9bd60cb79 100644 --- a/stm32-metapac-gen/src/lib.rs +++ b/stm32-metapac-gen/src/lib.rs @@ -117,13 +117,12 @@ impl Gen { write!(&mut extra, "pub const CORE_INDEX: usize = {};\n", core_index).unwrap(); let flash = chip.memory.iter().find(|r| r.name == "BANK_1").unwrap(); - write!(&mut extra, "pub const FLASH_BASE: usize = {};\n", flash.address,).unwrap(); - write!(&mut extra, "pub const FLASH_SIZE: usize = {};\n", flash.size,).unwrap(); - if let Some(settings) = &flash.settings { - write!(&mut extra, "pub const ERASE_SIZE: usize = {};\n", settings.erase_size,).unwrap(); - write!(&mut extra, "pub const WRITE_SIZE: usize = {};\n", settings.write_size,).unwrap(); - write!(&mut extra, "pub const ERASE_VALUE: u8 = {};\n", settings.erase_value,).unwrap(); - } + let settings = flash.settings.as_ref().unwrap(); + write!(&mut extra, "pub const FLASH_BASE: usize = {};\n", flash.address).unwrap(); + write!(&mut extra, "pub const FLASH_SIZE: usize = {};\n", flash.size).unwrap(); + write!(&mut extra, "pub const ERASE_SIZE: usize = {};\n", settings.erase_size).unwrap(); + write!(&mut extra, "pub const WRITE_SIZE: usize = {};\n", settings.write_size).unwrap(); + write!(&mut extra, "pub const ERASE_VALUE: u8 = {};\n", settings.erase_value).unwrap(); // Cleanups! transform::sort::Sort {}.run(&mut ir).unwrap();