I am writing a program for STM32 using FreeRTOS. I have a shared resource between a task and an interrupt. When I access this shared resource, can I disable this interrupt manually by changing the STM32 registers?
In “Mastering the FreeRTOS™ Real Time Kernel” section 7.2 it is said:
“Calling taskENTER_CRITICAL() and taskEXIT_CRITICAL() is the only legitimate way for a task to alter the interrupt enable state of the processor on which FreeRTOS is running. Altering the interrupt enable state by any other means will invalidate the macro’s nesting count.”
What does that mean exactly? As I understand, taskENTER_CRITICAL() disables all interrupts that use FreeRTOS API. But I need to disable only one interrupt. Do I have to use this function?