修改后的代码如下:FlagStatus HRTIM_GetFlagStatus(HRTIM_TypeDef * HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_FLAG)
{
FlagStatus bitstatus = RESET;
assert_param(IS_HRTIM_TIMERINDEX(TimerIdx));
switch(TimerIdx)
{
case HRTIM_TIMERINDEX_MASTER:
{
if ((HRTIMx->HRTIM_MASTER.MISR & HRTIM_FLAG) != RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
}
break;
case HRTIM_TIMERINDEX_TIMER_A:
case HRTIM_TIMERINDEX_TIMER_B:
case HRTIM_TIMERINDEX_TIMER_C:
case HRTIM_TIMERINDEX_TIMER_D:
case HRTIM_TIMERINDEX_TIMER_E:
{
if ((HRTIMx->HRTIM_TIMERx[TimerIdx].TIMxISR & HRTIM_FLAG) != RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
}
break;
default:
break;
}
return bitstatus;
}
|