Can taskENTER_CRITICAL_FROM_ISR() be used outside ISR?

lantczak wrote on Tuesday, December 27, 2016:

Hi,

Can I use taskENTER_CRITICAL_FROM_ISR() in function that is NOT called from ISR?
Will critical section work properly (preemption protection) in this case?

Best Regards
Lukasz

rtel wrote on Tuesday, December 27, 2016:

Which port are you using?

lantczak wrote on Thursday, December 29, 2016:

FreeRTOSv9.0.0\FreeRTOS\Source\portable\GCC\ARM_CM4F

rtel wrote on Thursday, December 29, 2016:

For that port the answer is ‘yes’ you can use the macros outside an ISR. Note the macro returns the current interrupt status, and the value returned must then be passed into a matching call to taskEXIT_CRITICAL_FROM_ISR().