Fix IRQ enum protections

This commit is contained in:
Lucian Copeland 2020-07-14 16:33:36 -04:00
parent b8910676db
commit 818b96ae61
2 changed files with 6 additions and 2 deletions

View File

@ -133,7 +133,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu
self->last_count = 0;
self->last_overflow = 0;
if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) {
if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) { //TODO: there's no state yet
// Find a suitable timer
TIM_TypeDef * tim_instance = stm_peripherals_find_timer();
stm_peripherals_timer_reserve(tim_instance);

View File

@ -67,7 +67,11 @@ static size_t irq_map[] = {
NULL_IRQ,
#endif
#ifdef TIM6
TIM6_DAC_IRQn,
#if !defined(DAC_BASE) || !defined(DAC1_BASE)
TIM6_IRQn,
#else
TIM6_DAC_IRQn,
#endif
#else
NULL_IRQ,
#endif