tianjialong 2 years ago
parent
commit
b381d054e2
  1. 19
      usersrc/usermain.c

19
usersrc/usermain.c

@ -100,13 +100,16 @@ void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim)
{
if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1)
if (htim == &htim4)
{
printf("channel 1\r\n");
}
else if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_2)
{
printf("channel 2\r\n");
if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1)
{
printf("tim4 channel 1\r\n");
}
else if (htim->Channel == HAL_TIM_ACTIVE_CHANNEL_2)
{
printf("tim4 channel 2\r\n");
}
}
}
@ -115,8 +118,8 @@ void user_main()
printf("==============ethernet_sound_acquisition_card=============\r\n");
printf("version %d.%d", VERSION_MAIN_ID, VERSION_SUB_ID);
HAL_TIM_IC_Start_IT(&htim4, TIM_CHANNEL_1); //
HAL_TIM_IC_Start_IT(&htim4, TIM_CHANNEL_2); //
HAL_TIM_IC_Start_IT(&htim4, TIM_CHANNEL_1); //
HAL_TIM_IC_Start_IT(&htim4, TIM_CHANNEL_2); //
// encoder_all_start();
// udp_client_init();

Loading…
Cancel
Save