Invoking vTaskNotifyGiveFromISR not from ISR context

kkoovalsky wrote on Thursday, April 12, 2018:

Hi. I have a simple handler which invokes vTaskNotifyGiveFromISR at the end of it and switches context if needed:

void handle_some_isr()
{
    do_job();

    freertos_base higher_prior_task_woken;
	vTaskNotifyGiveFromISR(handle, &higher_prior_task_woken);
	portEND_SWITCHING_ISR(higher_prior_task_woken);
}

I want to test this handler by invoking it explicitly within test case which runs inside a task.

My question is is it legal to invoke such a handler not from interrupt context?

rtel wrote on Thursday, April 12, 2018:

void handle_some_isr()
{
do_job();

 freertos_base higher_prior_task_woken;
 give_notification_from_isr(handle, &higher_prior_task_woken);
 portEND_SWITCHING_ISR(higher_prior_task_woken);

}

Not your question - but higher_prior_task_woken should be initialised to
pdFALSE before it is passed into whatever give_notification_from_isr()
is calling.

I want to test this handler by invoking it explicitly within test case
which runs inside a task.

My question is is it legal to invoke such a handler not from interrupt
context?

The answer probably depends on the port being used, but in general, yes
this should be fine to call from a task - the scheduler does need to be
running though.