diff options
author | Dave Hylands <dhylands@gmail.com> | 2014-02-19 22:28:36 -0800 |
---|---|---|
committer | Dave Hylands <dhylands@gmail.com> | 2014-02-23 11:26:22 -0800 |
commit | ee31f71d39207309b924ac99a7de2d847cb4bbfd (patch) | |
tree | a7d5022579bbe988c2dac79c7a99c56557ef8b52 /stm/stm32fxxx_it.c | |
parent | 790eed6f93dc12df40715ad1062b5ce01badcbd9 (diff) | |
download | micropython-ee31f71d39207309b924ac99a7de2d847cb4bbfd.tar.gz micropython-ee31f71d39207309b924ac99a7de2d847cb4bbfd.zip |
Add EXTI support
Revamp usrsw to use new exti code.
Add user switch callback function.
Diffstat (limited to 'stm/stm32fxxx_it.c')
-rw-r--r-- | stm/stm32fxxx_it.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/stm/stm32fxxx_it.c b/stm/stm32fxxx_it.c index 1a6862bbd1..1cef4514c1 100644 --- a/stm/stm32fxxx_it.c +++ b/stm/stm32fxxx_it.c @@ -284,66 +284,4 @@ void TIM6_DAC_IRQHandler(void) { } } -#include "std.h" -#include "misc.h" -#include "mpconfig.h" -#include "qstr.h" -#include "obj.h" -#include "led.h" - -void Default_Handler(void); // Found in startup_stm32f40xx.s - -// EXTI -// for USRSW on A13 for PYBOARD3, and B11 for NETDUINO_PLUS_2 -// for cc3000 on A14 -void EXTI15_10_IRQHandler(void) { - // work out if it's the user switch that had the interrupt - // Note that if the user switch is on a diffetent IRQ, then this code - // should be optimized out. - if (USRSW_EXTI_IRQN == EXTI15_10_IRQn) { - if (EXTI_GetITStatus(USRSW_EXTI_LINE) != RESET) { - // this is used just to wake the device - EXTI_ClearITPendingBit(USRSW_EXTI_LINE); - } - } - // work out if it's A14 that had the interrupt - if (EXTI_GetITStatus(EXTI_Line14) != RESET) { - led_toggle(PYB_LED_G2); - /* these are needed for CC3000 support - extern void SpiIntGPIOHandler(void); - extern uint32_t exti14_enabled; - extern uint32_t exti14_missed; - //printf("-> EXTI14 en=%lu miss=%lu\n", exti14_enabled, exti14_missed); - if (exti14_enabled) { - exti14_missed = 0; - SpiIntGPIOHandler(); // CC3000 interrupt - } else { - exti14_missed = 1; - } - */ - EXTI_ClearITPendingBit(EXTI_Line14); - //printf("<- EXTI14 done\n"); - } -} - -// STM32F4DISC is setup for A0 -void EXTI0_IRQHandler(void) { - if (USRSW_EXTI_IRQN == EXTI0_IRQn) { - // this is used just to wake the device - EXTI_ClearITPendingBit(USRSW_EXTI_LINE); - } else { - Default_Handler(); - } -} - -// PYBOARD4 has button on PB3 -void EXTI3_IRQHandler(void) { - if (USRSW_EXTI_IRQN == EXTI3_IRQn) { - // this is used just to wake the device - EXTI_ClearITPendingBit(USRSW_EXTI_LINE); - } else { - Default_Handler(); - } -} - /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |