diff options
| author | mux <freelancer.c@gmail.com> | 2014-01-22 17:42:06 +0200 |
|---|---|---|
| committer | mux <freelancer.c@gmail.com> | 2014-01-22 17:42:06 +0200 |
| commit | 28b23f09a4040b37356b486deca4ed7da6ff9fa6 (patch) | |
| tree | 8ed2e5968467a52c1880ddefae00016cd1951211 /stm/usrsw.c | |
| parent | 5fa93b67557f21c22a41449c3266571c427f6798 (diff) | |
Add Generic Feature Macros to mpconfigport
* Add some generic feature macros to mpconfigport
* Move pin and port definitions from usrsw.c to mpconfigport
Diffstat (limited to 'stm/usrsw.c')
| -rw-r--r-- | stm/usrsw.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/stm/usrsw.c b/stm/usrsw.c index 6450b74a7..2aa21eef8 100644 --- a/stm/usrsw.c +++ b/stm/usrsw.c @@ -6,39 +6,11 @@ #include "misc.h" #include "mpconfig.h" +#include "mpconfigport.h" #include "qstr.h" #include "obj.h" #include "usrsw.h" -#if defined (PYBOARD) - #define USRSW_PORT (GPIOA) - #define USRSW_PIN (GPIO_Pin_13) - #define USRSW_PUPD (GPIO_PuPd_UP) - #define USRSW_EXTI_PIN (EXTI_PinSource13) - #define USRSW_EXTI_PORT (EXTI_PortSourceGPIOA) - #define USRSW_EXTI_LINE (EXTI_Line13) - #define USRSW_EXTI_IRQN (EXTI15_10_IRQn) - #define USRSW_EXTI_EDGE (EXTI_Trigger_Rising) -#elif defined (PYBOARD4) - #define USRSW_PORT (GPIOB) - #define USRSW_PIN (GPIO_Pin_3) - #define USRSW_PUPD (GPIO_PuPd_UP) - #define USRSW_EXTI_PIN (EXTI_PinSource3) - #define USRSW_EXTI_PORT (EXTI_PortSourceGPIOB) - #define USRSW_EXTI_LINE (EXTI_Line3) - #define USRSW_EXTI_IRQN (EXTI15_10_IRQn) - #define USRSW_EXTI_EDGE (EXTI_Trigger_Rising) -#elif defined (STM32F4DISC) - #define USRSW_PORT (GPIOA) - #define USRSW_PIN (GPIO_Pin_0) - #define USRSW_PUPD (GPIO_PuPd_NOPULL) - #define USRSW_EXTI_PIN (EXTI_PinSource0) - #define USRSW_EXTI_PORT (EXTI_PortSourceGPIOA) - #define USRSW_EXTI_LINE (EXTI_Line0) - #define USRSW_EXTI_IRQN (EXTI0_IRQn) - #define USRSW_EXTI_EDGE (EXTI_Trigger_Falling) -#endif - void switch_init(void) { // make it an input with pull-up GPIO_InitTypeDef GPIO_InitStructure; |
