Using xTaskNotifyFromISR is kinda slow
This commit is contained in:
@@ -93,7 +93,7 @@ void HAL_TIM_IC_CaptureCallback(TIM_HandleTypeDef *htim) {
|
||||
if (htim->Instance == TIM2 && htim->Channel == HAL_TIM_ACTIVE_CHANNEL_1) {
|
||||
trig_value = HAL_TIM_ReadCapturedValue(htim, TIM_CHANNEL_1);
|
||||
trig_flag = 1;
|
||||
xTaskNotify(TimeCHHandle,trig_value,eSetValueWithOverwrite);
|
||||
xTaskNotifyFromISR(TimeCHHandle,trig_value,eSetValueWithOverwrite,NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,14 +392,12 @@ void StartDefaultTask(void *argument)
|
||||
{
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
uint32_t t = 0;
|
||||
for(;;)
|
||||
{
|
||||
if(trig_flag==1){
|
||||
|
||||
SEGGER_RTT_printf(0, "%lu\n\r",trig_value);
|
||||
trig_flag=0;
|
||||
}
|
||||
osDelay(1);
|
||||
SEGGER_RTT_printf(0, "%lu\n\r",__HAL_TIM_GET_COUNTER(&htim2)-t);
|
||||
t=__HAL_TIM_GET_COUNTER(&htim2);
|
||||
osDelay(1000);
|
||||
}
|
||||
/* USER CODE END 5 */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user