projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/ao_button.c: Support up to 16 buttons
[fw/altos]
/
src
/
lpc
/
ao_exti_lpc.c
diff --git
a/src/lpc/ao_exti_lpc.c
b/src/lpc/ao_exti_lpc.c
index ce98b4ad3e0dae3c771083dd2fc214009b183112..193f45470b4ca6dee4774c2587f413af1d5c747d 100644
(file)
--- a/
src/lpc/ao_exti_lpc.c
+++ b/
src/lpc/ao_exti_lpc.c
@@
-3,7
+3,8
@@
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-69,7
+70,7
@@
_ao_exti_set_enable(uint8_t pint)
lpc_gpio_pin.sienr = mask;
else
lpc_gpio_pin.cienr = mask;
lpc_gpio_pin.sienr = mask;
else
lpc_gpio_pin.cienr = mask;
-
+
if (mode & AO_EXTI_MODE_FALLING)
lpc_gpio_pin.sienf = mask;
else
if (mode & AO_EXTI_MODE_FALLING)
lpc_gpio_pin.sienf = mask;
else
@@
-91,11
+92,14
@@
ao_exti_setup (uint8_t port, uint8_t pin, uint8_t mode, void (*callback)(void))
if (pint == LPC_NUM_PINT)
ao_panic(AO_PANIC_EXTI);
if (pint == LPC_NUM_PINT)
ao_panic(AO_PANIC_EXTI);
+ if (!(mode & AO_EXTI_PIN_NOCONFIGURE))
+ ao_enable_input(port, pin, mode);
+
ao_arch_block_interrupts();
mask = (1 << pint);
ao_pint_inuse |= mask;
ao_pint_enabled &= ~mask;
ao_arch_block_interrupts();
mask = (1 << pint);
ao_pint_inuse |= mask;
ao_pint_enabled &= ~mask;
-
+
ao_pint_map[id] = pint;
ao_exti_callback[pint] = callback;
ao_pint_map[id] = pint;
ao_exti_callback[pint] = callback;