diff options
author | bnewbold <bnewbold@robocracy.org> | 2010-08-31 17:39:46 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2010-08-31 17:39:46 -0400 |
commit | 02d7b08f0497096f21e41922e0efb54c4ef33bab (patch) | |
tree | a7e04293efcba70f37cffcd03c0fcc4c0be7858a /wirish/ext_interrupts.c | |
parent | b2dd49c3141d8a21a4e7c7ef51dee7329f847c30 (diff) | |
parent | e03d58f4dab4176514924baa3a1ff430bf5819b8 (diff) | |
download | librambutan-02d7b08f0497096f21e41922e0efb54c4ef33bab.tar.gz librambutan-02d7b08f0497096f21e41922e0efb54c4ef33bab.zip |
Merge maple-native changes into portable
This compiles for both maple and maple_native but is untested.
Diffstat (limited to 'wirish/ext_interrupts.c')
-rw-r--r-- | wirish/ext_interrupts.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/wirish/ext_interrupts.c b/wirish/ext_interrupts.c index 54b8be9..6ba1d05 100644 --- a/wirish/ext_interrupts.c +++ b/wirish/ext_interrupts.c @@ -32,29 +32,6 @@ #include "exti.h" #include "ext_interrupts.h" -typedef struct ExtiInfo { - uint8 channel; - uint8 port; -} ExtiInfo; - -static ExtiInfo PIN_TO_EXTI_CHANNEL[NR_MAPLE_PINS] = { - {EXTI3, EXTI_CONFIG_PORTA}, // D0/PA3 - {EXTI2, EXTI_CONFIG_PORTA}, // D1/PA2 - {EXTI0, EXTI_CONFIG_PORTA}, // D2/PA0 - {EXTI1, EXTI_CONFIG_PORTA}, // D3/PA1 - {EXTI5, EXTI_CONFIG_PORTB}, // D4/PB5 - {EXTI6, EXTI_CONFIG_PORTB}, // D5/PB6 - {EXTI8, EXTI_CONFIG_PORTA}, // D6/PA8 - {EXTI9, EXTI_CONFIG_PORTA}, // D7/PA9 - {EXTI10, EXTI_CONFIG_PORTA}, // D8/PA10 - {EXTI7, EXTI_CONFIG_PORTB}, // D9/PB7 - {EXTI4, EXTI_CONFIG_PORTA}, // D10/PA4 - {EXTI7, EXTI_CONFIG_PORTA}, // D11/PA7 - {EXTI6, EXTI_CONFIG_PORTA}, // D12/PA6 - {EXTI5, EXTI_CONFIG_PORTA}, // D13/PA5 -}; - - /** * @brief Attach an interrupt handler to be triggered on a given * transition on the pin. Runs in interrupt context @@ -65,10 +42,10 @@ static ExtiInfo PIN_TO_EXTI_CHANNEL[NR_MAPLE_PINS] = { * * @sideeffect Registers a handler */ -int attachInterrupt(uint8 pin, voidFuncPtr handler, ExtInterruptTriggerMode mode) { +int attachInterrupt(uint8 pin, voidFuncPtr handler, uint32 mode) { uint8 outMode; /* Parameter checking */ - if (pin >= NR_MAPLE_PINS) { + if (pin >= NR_GPIO_PINS) { return EXT_INTERRUPT_INVALID_PIN; } @@ -100,7 +77,7 @@ int attachInterrupt(uint8 pin, voidFuncPtr handler, ExtInterruptTriggerMode mode } int detachInterrupt(uint8 pin) { - if (!(pin < NR_MAPLE_PINS)) { + if (!(pin < NR_GPIO_PINS)) { return EXT_INTERRUPT_INVALID_PIN; } |