Skip to content

Commit dc6902a

Browse files
committed
Exclude timers from H7 builds
1 parent 6a49766 commit dc6902a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ports/stm/peripherals/timers.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "shared-bindings/microcontroller/__init__.h"
3535
#include "shared-bindings/microcontroller/Pin.h"
3636

37+
#if !(CPY_STM32H7)
38+
3739
#define ALL_CLOCKS 0xFFFF
3840
#define NULL_IRQ 0xFF
3941

@@ -193,14 +195,18 @@ TIM_TypeDef * stm_peripherals_find_timer(void) {
193195
// If no results are found, no unclaimed pins with this timer are in this package,
194196
// and it is safe to pick
195197
if (timer_in_package == false && mcu_tim_banks[i] != NULL) {
198+
// DEBUG: print the timer
196199
return mcu_tim_banks[i];
200+
mp_printf(&mp_plat_print, "Timer: %d\n",i);
197201
}
198202
}
199203
//TODO: secondary search for timers outside the pins in the board profile
200204

201205
// Work backwards - higher index timers have fewer pin allocations
202206
for (size_t i = (MP_ARRAY_SIZE(mcu_tim_banks) - 1); i >= 0; i--) {
203207
if ((!stm_timer_reserved[i]) && (mcu_tim_banks[i] != NULL)) {
208+
// DEBUG: print the timer
209+
mp_printf(&mp_plat_print, "Timer: %d\n",i);
204210
return mcu_tim_banks[i];
205211
}
206212
}
@@ -449,3 +455,5 @@ void TIM17_IRQHandler(void) {
449455
callback_router(17);
450456
}
451457
#endif
458+
459+
#endif

0 commit comments

Comments
 (0)