Commit 6beb5c28 authored by 陈家乐's avatar 陈家乐

🐞 fix:QAC问题:45353 Definite: Dereference of an invalid pointer value.

parent b12dc266
...@@ -190,7 +190,7 @@ void TIM_Cmd(TIMSelect_TypeDef TIMx,uint8_t Chx,TIM_FunState NewState) ...@@ -190,7 +190,7 @@ void TIM_Cmd(TIMSelect_TypeDef TIMx,uint8_t Chx,TIM_FunState NewState)
* @brief Set the specified TIMER channel's count num. * @brief Set the specified TIMER channel's count num.
* @param TIMx: where x can be 0, 1, select TIEMR peripheral. * @param TIMx: where x can be 0, 1, select TIEMR peripheral.
* @param Chx: where x can be 0, 1,2,3 select channel of specified TIMER peripheral. * @param Chx: where x can be 0, 1,2,3 select channel of specified TIMER peripheral.
* @arg TTM_Channel_0、TTM_Channel_1、TTM_Channel_2、TTM_Channel_3 * @arg TTM_Channel_0��TTM_Channel_1��TTM_Channel_2��TTM_Channel_3
* @param counter: the count num of the TIEMR channel. * @param counter: the count num of the TIEMR channel.
* @retval None * @retval None
*/ */
...@@ -294,11 +294,11 @@ int TIM_Init(TIM_InitTypeDef *TIM_InitStruct) ...@@ -294,11 +294,11 @@ int TIM_Init(TIM_InitTypeDef *TIM_InitStruct)
*TIM_reg.TDR[currentMChan[j]] = TIM_InitStruct->TIM_Period[currentMChan[j]] -1; *TIM_reg.TDR[currentMChan[j]] = TIM_InitStruct->TIM_Period[currentMChan[j]] -1;
*TIM_reg.TO &= ~(1 << masterPos); *TIM_reg.TO &= ~(1 << masterPos);
*TIM_reg.TOE &= ~(1 << masterPos); *TIM_reg.TOE &= ~(1 << masterPos);
MISC->NFEN1 |= (1<<currentMChan[j]); //后加 MISC->NFEN1 |= (1<<currentMChan[j]); //���
j++; j++;
} }
} }
for(chanPos = 0; chanPos < 8; chanPos++) //从属通道配置 for(chanPos = 0; chanPos < TIMER_CHAN_MAX_NUM; chanPos++) //����ͨ������
{ {
pos = ((uint8_t)0x01) << chanPos; pos = ((uint8_t)0x01) << chanPos;
chanNum = TIM_InitStruct->TIM_Channel & pos; chanNum = TIM_InitStruct->TIM_Channel & pos;
......
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