Let flash module be conditionally included

This commit is contained in:
Rasmus Melchior Jacobsen
2023-03-29 13:52:52 +02:00
parent ddbd509865
commit b7dfc8de10
4 changed files with 4 additions and 24 deletions

View File

@ -162,11 +162,13 @@ fn main() {
let regions_len = flash_memory_regions.len();
flash_regions.extend(quote! {
#[cfg(flash)]
pub struct FlashRegions<'d> {
_inner: embassy_hal_common::PeripheralRef<'d, crate::peripherals::FLASH>,
#(#fields),*
}
#[cfg(flash)]
impl<'d> FlashRegions<'d> {
pub(crate) const fn new(p: embassy_hal_common::PeripheralRef<'d, crate::peripherals::FLASH>) -> Self {
Self {