From 14aa4265db25adb75fdcaf66798a878ae789bf9c Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 15 Sep 2021 13:46:46 +0200 Subject: [PATCH] Ensure linear stride --- stm32-metapac-gen/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/stm32-metapac-gen/src/lib.rs b/stm32-metapac-gen/src/lib.rs index df9f525e..3bfd5297 100644 --- a/stm32-metapac-gen/src/lib.rs +++ b/stm32-metapac-gen/src/lib.rs @@ -415,6 +415,7 @@ pub fn gen(options: Options) { match bi.module.as_str() { "gpio" => { let port_letter = name.chars().skip(4).next().unwrap(); + assert_eq!(0, (p.address as u32 - gpio_base) % gpio_stride); let port_num = (p.address as u32 - gpio_base) / gpio_stride; for pin_num in 0..16 {