From 8a73b0bb09eb96068ff02696eb1055a36349b6bf Mon Sep 17 00:00:00 2001
From: Karl Palsson <karlp@etactica.com>
Date: Fri, 17 Sep 2021 10:07:48 +0000
Subject: gpio: stm32: default to v2

v2 is for everyone except f1, so avoid the yaml spam.

Signed-off-by: Karl Palsson <karlp@etactica.com>
---
 gpio/SConscript | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'gpio')

diff --git a/gpio/SConscript b/gpio/SConscript
index ea352cc..cf33ad4 100644
--- a/gpio/SConscript
+++ b/gpio/SConscript
@@ -11,14 +11,16 @@ periph = env['PLATFORM_SPEC'].get('periph', {})
 if 'stm32_gpio' in periph:
     headers.append('stm32_gpio.h')
     for name, data in periph['stm32_gpio'].items():
+        # Default to v2, ie, everyone but f1
+        real_type = data.get('type', 'v2')
         instances.append({
-            'type': 'STM32_GPIO_%s_t' % data['type'],
+            'type': 'STM32_GPIO_%s_t' % real_type,
             'name': name,
             'args': [data['offset']],
         })
 
-        type_aliases['Pin'] = 'STM32_GPIO_%s_t::Pin' % data['type']
-        type_aliases['PinArray'] = 'STM32_GPIO_%s_t::PinArray' % data['type']
+        type_aliases['Pin'] = 'STM32_GPIO_%s_t::Pin' % real_type
+        type_aliases['PinArray'] = 'STM32_GPIO_%s_t::PinArray' % real_type
 
 env.Jinja2('gpio.h', '../templates/periph_instances.h.j2', headers = headers, instances = instances, aliases = aliases, type_aliases = type_aliases)
 
-- 
cgit v1.2.3