From 28b23f09a4040b37356b486deca4ed7da6ff9fa6 Mon Sep 17 00:00:00 2001 From: mux Date: Wed, 22 Jan 2014 17:42:06 +0200 Subject: Add Generic Feature Macros to mpconfigport * Add some generic feature macros to mpconfigport * Move pin and port definitions from usrsw.c to mpconfigport --- stm/usrsw.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'stm/usrsw.c') 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; -- cgit v1.2.3