From 879c621394b4b7cf7f96242c4ae347812c17bf8e Mon Sep 17 00:00:00 2001 From: Rasmus Melchior Jacobsen Date: Tue, 23 May 2023 22:49:27 +0200 Subject: [PATCH] Ensure FlashRegion can only be created within this crate --- embassy-stm32/build.rs | 1 + embassy-stm32/src/flash/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/embassy-stm32/build.rs b/embassy-stm32/build.rs index a00c6c41..ca0c36c2 100644 --- a/embassy-stm32/build.rs +++ b/embassy-stm32/build.rs @@ -206,6 +206,7 @@ fn main() { erase_size: #erase_size, write_size: #write_size, erase_value: #erase_value, + _ensure_internal: (), }; }); diff --git a/embassy-stm32/src/flash/mod.rs b/embassy-stm32/src/flash/mod.rs index f6efa775..b93270ae 100644 --- a/embassy-stm32/src/flash/mod.rs +++ b/embassy-stm32/src/flash/mod.rs @@ -19,6 +19,7 @@ pub struct FlashRegion { pub erase_size: u32, pub write_size: u32, pub erase_value: u8, + pub(crate) _ensure_internal: (), } #[derive(Debug, PartialEq)]