Hello:
I am trying to port existing code that have macro called "ENTER_CRITICAL_SECTION()" and "EXIT_CRITICAL_SECTION()". I look into the MQX document that doesn't have critical section API.
Does anyone know how to create a MQX called that service "ENTER_CRITICAL_SECTION()" and "EXIT_CRITICAL_SECTION()"?
Thank You
Mike
Solved! Go to Solution.
In MQX3.8:
For short code block protection:
_int_disable()
_int_enable()
For other protection lightweigth semaphore:
_lwsem_create()
_lwsem_wait()
_lwsem_post()
Disabling task context switch but allows interrupts to run
_task_stop_preemption()
_task_start_preemption()
~Mark
Hi mikedwn,
can you write us an important detail what did your code protect with critical section ?
Regards,
MartinK
i know this critical section from FreeRTOS ..
.. lock the os and just execute code like without os .. no task switching, and so on ..
In MQX3.8:
For short code block protection:
_int_disable()
_int_enable()
For other protection lightweigth semaphore:
_lwsem_create()
_lwsem_wait()
_lwsem_post()
Disabling task context switch but allows interrupts to run
_task_stop_preemption()
_task_start_preemption()
~Mark