Exclude timers from H7 builds

This commit is contained in:
Lucian Copeland 2020-07-16 17:11:24 -04:00
parent 6a49766df0
commit dc6902a33e

View File

@ -34,6 +34,8 @@
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/microcontroller/Pin.h"
#if !(CPY_STM32H7)
#define ALL_CLOCKS 0xFFFF
#define NULL_IRQ 0xFF
@ -193,7 +195,9 @@ TIM_TypeDef * stm_peripherals_find_timer(void) {
// If no results are found, no unclaimed pins with this timer are in this package,
// and it is safe to pick
if (timer_in_package == false && mcu_tim_banks[i] != NULL) {
// DEBUG: print the timer
return mcu_tim_banks[i];
mp_printf(&mp_plat_print, "Timer: %d\n",i);
}
}
//TODO: secondary search for timers outside the pins in the board profile
@ -201,6 +205,8 @@ TIM_TypeDef * stm_peripherals_find_timer(void) {
// Work backwards - higher index timers have fewer pin allocations
for (size_t i = (MP_ARRAY_SIZE(mcu_tim_banks) - 1); i >= 0; i--) {
if ((!stm_timer_reserved[i]) && (mcu_tim_banks[i] != NULL)) {
// DEBUG: print the timer
mp_printf(&mp_plat_print, "Timer: %d\n",i);
return mcu_tim_banks[i];
}
}
@ -449,3 +455,5 @@ void TIM17_IRQHandler(void) {
callback_router(17);
}
#endif
#endif