* @brief Enters a critical section to prevent context switching or interrupts. * * @note Critical sections are typically used to protect shared resources or perform * non-interruptible operations. Ensure to exit the critical section as soon as * possible by calling `sys_exit_critical` to avoid system performance degradation * or deadlocks. * * @warning Failure to exit a cr
| 4343 | * `sys_exit_critical` call) may lead to system instability or a complete halt. |
| 4344 | */ |
| 4345 | void sys_enter_critical(void) |
| 4346 | { |
| 4347 | rt_sem_take(&critical_lock, RT_WAITING_FOREVER); |
| 4348 | } |
| 4349 | |
| 4350 | /** |
| 4351 | * @brief Exits a critical section and restores the system's previous state. |
nothing calls this directly
no test coverage detected