Commit d19ce431 authored by 张金硕's avatar 张金硕

🐞 fix:修改RTE_TIM40.c的QAC问题

parent d6b4d355
...@@ -222,6 +222,18 @@ void RTE_Calc_Freq(uint8_t u8ch) ...@@ -222,6 +222,18 @@ void RTE_Calc_Freq(uint8_t u8ch)
uint16_t u16TSR; uint16_t u16TSR;
uint8_t u8RollingCh = 0; uint8_t u8RollingCh = 0;
if((u8ch < 0) || (u8ch >= RTE_TIM40_CH_SUM))
{
;
}
else
{
if((g_stTIM40CapObj[u8ch].u8PeriodBufCnt < 0) || (g_stTIM40CapObj[u8ch].u8PeriodBufCnt >= RTE_TIM40_PERIOD_FILTER_SUM ))
{
;
}
else
{
switch (u8ch) switch (u8ch)
{ {
case RTE_TIM40_CH0: case RTE_TIM40_CH0:
...@@ -273,6 +285,9 @@ void RTE_Calc_Freq(uint8_t u8ch) ...@@ -273,6 +285,9 @@ void RTE_Calc_Freq(uint8_t u8ch)
u32Temp = u32Temp / g_stTIM40CapObj[u8ch].u8PeriodCnt; u32Temp = u32Temp / g_stTIM40CapObj[u8ch].u8PeriodCnt;
g_stTIM40CapObj[u8ch].u32Freq = (g_stTIM40CapObj[u8ch].u32CHClock * 10U) / u32Temp; g_stTIM40CapObj[u8ch].u32Freq = (g_stTIM40CapObj[u8ch].u32CHClock * 10U) / u32Temp;
}
}
} }
/*********************************************************************************************************************** /***********************************************************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment