summaryrefslogtreecommitdiff
path: root/stm/usrsw.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-22 22:56:17 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-22 22:56:17 +0000
commit8bcc52e8341368c73edf094e288a4f514b84028a (patch)
tree6344c33d8e82602818bb5f785c3eb740a23bab65 /stm/usrsw.c
parentb5d13c309f00b0c959c0806c1ab11ba7a07c2cee (diff)
parent66db7bf69fdd94f8ff20b30698cffd111058b2bb (diff)
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'stm/usrsw.c')
-rw-r--r--stm/usrsw.c30
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;