Skip to content

Commit 2fe2a05

Browse files
committed
stmhal: Put #if guards around all GPIOx_CLK_ENABLE's.
Specifically, teensy port does not have these macros defined.
1 parent 95ea4f0 commit 2fe2a05

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

stmhal/pin.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,18 @@ STATIC mp_obj_t pin_obj_init(uint n_args, mp_obj_t *args) {
287287

288288
// enable the peripheral clock for the port of this pin
289289
switch (self->port) {
290+
#ifdef __GPIOA_CLK_ENABLE
290291
case PORT_A: __GPIOA_CLK_ENABLE(); break;
292+
#endif
293+
#ifdef __GPIOB_CLK_ENABLE
291294
case PORT_B: __GPIOB_CLK_ENABLE(); break;
295+
#endif
296+
#ifdef __GPIOC_CLK_ENABLE
292297
case PORT_C: __GPIOC_CLK_ENABLE(); break;
298+
#endif
299+
#ifdef __GPIOD_CLK_ENABLE
293300
case PORT_D: __GPIOD_CLK_ENABLE(); break;
301+
#endif
294302
#ifdef __GPIOE_CLK_ENABLE
295303
case PORT_E: __GPIOE_CLK_ENABLE(); break;
296304
#endif

0 commit comments

Comments
 (0)