altos/stmf0: Fix external interrupts
authorKeith Packard <keithp@keithp.com>
Wed, 13 Apr 2016 13:11:44 +0000 (06:11 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 20 Apr 2016 03:21:30 +0000 (23:21 -0400)
Missing a reserved address in the registers broke everything nicely,
but the priority values were also wrong - stm32f0 exposes 8 bits per
priority, like the stm32l, but it uses only the top two bits.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stmf0/ao_arch.h
src/stmf0/ao_exti.h
src/stmf0/ao_exti_stm.c
src/stmf0/stm32f0.h

index 26a34c85f57c658056181caac2286d8e479e5818..2597cadc735e8accb7285536d735386fa8069a76 100644 (file)
@@ -131,10 +131,10 @@ extern const uint32_t ao_radio_cal;
 #define AO_TIM91011_CLK                (2 * AO_PCLK2)
 #endif
 
-#define AO_STM_NVIC_HIGH_PRIORITY      4
-#define AO_STM_NVIC_CLOCK_PRIORITY     6
-#define AO_STM_NVIC_MED_PRIORITY       8
-#define AO_STM_NVIC_LOW_PRIORITY       10
+#define AO_STM_NVIC_HIGH_PRIORITY      (0 << 6)
+#define AO_STM_NVIC_CLOCK_PRIORITY     (1 << 6)
+#define AO_STM_NVIC_MED_PRIORITY       (2 << 6)
+#define AO_STM_NVIC_LOW_PRIORITY       (3 << 6)
 
 void ao_lcd_stm_init(void);
 
index ebea224d03d48934507e3673d5d049ba9bc2324e..192611bd501f01759dae1fefd8509b0a98675042 100644 (file)
@@ -28,7 +28,7 @@
 #define AO_EXTI_PIN_NOCONFIGURE        64
 
 void
-ao_exti_setup(struct stm_gpio *gpio, uint8_t pin, uint8_t mode, void (*callback)());
+ao_exti_setup(struct stm_gpio *gpio, uint8_t pin, uint8_t mode, void (*callback)(void));
 
 void
 ao_exti_set_mode(struct stm_gpio *gpio, uint8_t pin, uint8_t mode);
index 906392e60f4ce0ce2f1985d5c520917f16cca6ed..910afcf7de8814e0897cd46d02bca3a481a66a15 100644 (file)
@@ -110,7 +110,7 @@ ao_exti_set_mode(struct stm_gpio *gpio, uint8_t pin, uint8_t mode) {
        (void) gpio;
 
        uint32_t        mask = 1 << pin;
-       
+
        if (mode & AO_EXTI_MODE_RISING)
                stm_exti.rtsr |= mask;
        else
index 30b45b1585a71ca3b1c14ea7ce298efb2b5afead..33eb9c88ced11d2a77225a2fd247a5ff5db4efe5 100644 (file)
@@ -837,8 +837,11 @@ isr(tim7)
 
 struct stm_syscfg {
        vuint32_t       cfgr1;
+       uint32_t        reserved_04;
        vuint32_t       exticr[4];
        vuint32_t       cfgr2;
+       uint8_t         reserved_1c[0x80-0x1c];
+       vuint32_t       itline[31];
 };
 
 extern struct stm_syscfg stm_syscfg;