Skip to content

Commit 818b96a

Browse files
committed
Fix IRQ enum protections
1 parent b891067 commit 818b96a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ports/stm/common-hal/pulseio/PulseIn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu
133133
self->last_count = 0;
134134
self->last_overflow = 0;
135135

136-
if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) {
136+
if (HAL_TIM_Base_GetState(&tim_handle) == HAL_TIM_STATE_RESET) { //TODO: there's no state yet
137137
// Find a suitable timer
138138
TIM_TypeDef * tim_instance = stm_peripherals_find_timer();
139139
stm_peripherals_timer_reserve(tim_instance);

ports/stm/peripherals/timers.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ static size_t irq_map[] = {
6767
NULL_IRQ,
6868
#endif
6969
#ifdef TIM6
70-
TIM6_DAC_IRQn,
70+
#if !defined(DAC_BASE) || !defined(DAC1_BASE)
71+
TIM6_IRQn,
72+
#else
73+
TIM6_DAC_IRQn,
74+
#endif
7175
#else
7276
NULL_IRQ,
7377
#endif

0 commit comments

Comments
 (0)