aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/gpio.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-09-16 21:39:29 -0400
committerKevin O'Connor <kevin@koconnor.net>2019-10-23 21:34:48 -0400
commita6d90bb95e5fdf56993796660ee559ab5666ad0d (patch)
treee6f2134bfde5265e04f344c7ef066b46366a1a3f /src/stm32/gpio.c
parent2c535106ee5bbbcc019cb0820d1a5fcf0639eb9e (diff)
downloadkutter-a6d90bb95e5fdf56993796660ee559ab5666ad0d.tar.gz
kutter-a6d90bb95e5fdf56993796660ee559ab5666ad0d.tar.xz
kutter-a6d90bb95e5fdf56993796660ee559ab5666ad0d.zip
stm32: Support stm32f042 build from stm32/ directory
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/gpio.c')
-rw-r--r--src/stm32/gpio.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/stm32/gpio.c b/src/stm32/gpio.c
index aab7dd87..58919bdd 100644
--- a/src/stm32/gpio.c
+++ b/src/stm32/gpio.c
@@ -14,7 +14,9 @@
DECL_ENUMERATION_RANGE("pin", "PA0", GPIO('A', 0), 16);
DECL_ENUMERATION_RANGE("pin", "PB0", GPIO('B', 0), 16);
DECL_ENUMERATION_RANGE("pin", "PC0", GPIO('C', 0), 16);
+#ifdef GPIOD
DECL_ENUMERATION_RANGE("pin", "PD0", GPIO('D', 0), 16);
+#endif
#ifdef GPIOE
DECL_ENUMERATION_RANGE("pin", "PE0", GPIO('E', 0), 16);
#endif
@@ -30,7 +32,10 @@ DECL_ENUMERATION_RANGE("pin", "PI0", GPIO('I', 0), 16);
#endif
GPIO_TypeDef * const digital_regs[] = {
- ['A' - 'A'] = GPIOA, GPIOB, GPIOC, GPIOD,
+ ['A' - 'A'] = GPIOA, GPIOB, GPIOC,
+#ifdef GPIOD
+ ['D' - 'A'] = GPIOD,
+#endif
#ifdef GPIOE
['E' - 'A'] = GPIOE,
#endif