2016-09-10 05:48 PM
2016-09-11 12:23 AM
> I use TIM4 to generate period and TIM4 to generate one pulse every period.
? > The problem is that when I enable TIM4_IRQ (commented line), The TIM1 does not receive trigger. So, if you don't enable TIM4_IRQ, with this very same code, you see a train of pulses coming out of TIM1? What is that ''OnePulse'' stuff around TIM1 setup? I don't speak the ''library'' gobbledygook.void
TIM4_IRQHandler(
void
)
{
if
(__HAL_TIM_GET_FLAG(&htim4, TIM_FLAG_UPDATE) != RESET)
//In case other interrupts are also running
{
if
(__HAL_TIM_GET_ITSTATUS(&htim4, TIM_IT_UPDATE) != RESET)
{
__HAL_TIM_CLEAR_FLAG(&htim4, TIM_FLAG_UPDATE);
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_5);
// TIM4->ARR = 10;/* recalculation */
}
}
How comes this compiles at all? IMO a closing bracket is missing.
JW