summaryrefslogtreecommitdiff
path: root/src/stm/ao_exti_stm.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-06-02 16:53:46 -0700
committerKeith Packard <keithp@keithp.com>2012-06-02 16:53:46 -0700
commit8d425ffba84ec6f632e8c0d44105de73242a86a9 (patch)
tree078232e95317498b78f4d7817b2319ad9568c928 /src/stm/ao_exti_stm.c
parent1353b277f8314fbddef81c743bd6ea229364fd18 (diff)
altos: Route correct GPIO line to interrupt controller
Which GPIO a particular pin interrupt comes from is selected by the SYSCFG EXTICR registers; set these when an exti interrupt is configured. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm/ao_exti_stm.c')
-rw-r--r--src/stm/ao_exti_stm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/stm/ao_exti_stm.c b/src/stm/ao_exti_stm.c
index 013d453b..2108e8b5 100644
--- a/src/stm/ao_exti_stm.c
+++ b/src/stm/ao_exti_stm.c
@@ -51,8 +51,12 @@ ao_exti_setup (struct stm_gpio *gpio, uint8_t pin, uint8_t mode, void (*callback
uint32_t mask = 1 << pin;
uint32_t pupdr;
uint8_t irq;
-
+
ao_exti_callback[pin] = callback;
+
+ /* configure gpio to interrupt routing */
+ stm_exticr_set(gpio, pin);
+
/* configure pin as input, setting selected pull-up/down mode */
stm_moder_set(gpio, pin, STM_MODER_INPUT);
switch (mode & (AO_EXTI_MODE_PULL_UP|AO_EXTI_MODE_PULL_DOWN)) {