summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-08-06 16:40:20 +0100
committerDamien George <damien.p.george@gmail.com>2014-08-06 16:40:20 +0100
commit2fe2a05f9f9b49159b17c240d5c7d78fcae64de1 (patch)
tree2fbabc357b0fd46e86c3b23eaf09626f654dac61
parent95ea4f0c95a6d08215dbfd0705747c1f8480ef10 (diff)
downloadmicropython-2fe2a05f9f9b49159b17c240d5c7d78fcae64de1.tar.gz
micropython-2fe2a05f9f9b49159b17c240d5c7d78fcae64de1.zip
stmhal: Put #if guards around all GPIOx_CLK_ENABLE's.
Specifically, teensy port does not have these macros defined.
-rw-r--r--stmhal/pin.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/stmhal/pin.c b/stmhal/pin.c
index f71ca92d9c..0ef8b69508 100644
--- a/stmhal/pin.c
+++ b/stmhal/pin.c
@@ -287,10 +287,18 @@ STATIC mp_obj_t pin_obj_init(uint n_args, mp_obj_t *args) {
// enable the peripheral clock for the port of this pin
switch (self->port) {
+ #ifdef __GPIOA_CLK_ENABLE
case PORT_A: __GPIOA_CLK_ENABLE(); break;
+ #endif
+ #ifdef __GPIOB_CLK_ENABLE
case PORT_B: __GPIOB_CLK_ENABLE(); break;
+ #endif
+ #ifdef __GPIOC_CLK_ENABLE
case PORT_C: __GPIOC_CLK_ENABLE(); break;
+ #endif
+ #ifdef __GPIOD_CLK_ENABLE
case PORT_D: __GPIOD_CLK_ENABLE(); break;
+ #endif
#ifdef __GPIOE_CLK_ENABLE
case PORT_E: __GPIOE_CLK_ENABLE(); break;
#endif