Skip to content

Commit

Permalink
[NUCLEO_F030R8] Set NVIC Timer priorities
Browse files Browse the repository at this point in the history
This fix is a solution for issue #816 when having two separate IRQ handlers
in Timers (UPDATE Irq and OutputCompare Irq). The update priority needs to
be higher to avoid undefined behaviours.

Change-Id: Ic143ed0f3e4e42ad5f7b95337d8c005b7ec61274
  • Loading branch information
Maciej Bojczuk authored and BartSX committed Jun 13, 2016
1 parent 899cd44 commit bb65961
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) {
// Output compare channel 2 interrupt for HAL tick
NVIC_SetVector(TIM_MST_UP_IRQ, (uint32_t)timer_update_irq_handler);
NVIC_EnableIRQ(TIM_MST_UP_IRQ);
NVIC_SetPriority(TIM_MST_UP_IRQ, 0);
NVIC_SetVector(TIM_MST_OC_IRQ, (uint32_t)timer_oc_irq_handler);
NVIC_EnableIRQ(TIM_MST_OC_IRQ);
NVIC_SetPriority(TIM_MST_OC_IRQ, 1);

// Enable interrupts
__HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_UPDATE); // For 32-bit counter
Expand Down

0 comments on commit bb65961

Please sign in to comment.