Home > other >  For single chip microcomputer bosses give directions
For single chip microcomputer bosses give directions

Time:10-01

Comrades, recently wrote a single-chip microcomputer input capture program, debugging to the if (htim -> Channel==HAL_TIM_ACTIVE_CHANNEL_2) to directly jump out, this is how to return a responsibility

CodePudding user response:

One line of code to see what?

CodePudding user response:

Jump jump out is which go to? If just didn't perform this if, it can only prove that conditions are not satisfied

CodePudding user response:

refer to the second floor of whales, niko reply:
jump jump out is which go to? If just didn't perform this if, it can only prove that the condition does not meet

Has a point to give you some praise

CodePudding user response:

refer to the second floor of whales, niko reply:
jump jump out is which go to? If just didn't perform this if, it can only prove that the condition does not meet

Void HAL_TIM_IC_CaptureCallback (TIM_HandleTypeDef * htim) {if (htim - & gt; Channel==HAL_TIM_ACTIVE_CHANNEL_2)//if the first value is not HALst_Captured=1;//set the first captured as tufalling edge __HAL_TIM_SET_CATIM_CHANNEL_2, TIM_INPUTCHANNELPOLARITY_FALLING); } else if (Is_First_Captured==1)//if the first is alrea2=HAL_TIM_ReadCapturedValue (htim TIM_CHANNEL_2);//read the second value __HA L_TIM_SET_COUNTER directly (htim, 0); If (IC_Val2 & gt; IC_Val1) {Difference=IC_Val2 - IC_Val1; } Is_First_Captured=0;//set it back to false __HAL_TIM_SET_CAPTUREPOLARITY (htim TIM_CHANNEL_2, TIM_INPUTCHANNELPOLARITY_RISING); Does not perform, bosses don't know why meet the conditions? With after cubemx configuration program}}}

CodePudding user response:

The debug on the keil, look at the register, mostly you interrupt is not properly configured, and you want to see the keil, don't choose to the simulation, choose download debugging
  • Related