Is it safe to call the user event logging from an ISR? Something like this for example where I have an encoder interrupt, I want to log the encoder value immediately and then notify the task to execute afterwards.
void encoder_isr(void *handle)
{
//read the encoder count and log it to trace
u32 enc_count = read_encoder();
xTracePrintF(isr_channel, "EncoderCount = %d", enc_count);
TaskHandle_t *task_handle= (TaskHandle_t *)handle;
if (task_handle != NULL && *task_handle != NULL) {
//notify the task to execute
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
vTaskNotifyGiveFromISR(*task_handle, &xHigherPriorityTaskWoken);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
I looked through the percepio documentation but couldn’t find a specific answer.