MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / enter

Function enter

TactilityCore/Source/kernel/critical/Critical.cpp:17–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15namespace tt::kernel::critical {
16
17CriticalInfo enter() {
18 CriticalInfo info = {
19 .isrm = 0,
20 .fromIsr = (xPortInIsrContext() == pdTRUE),
21 .kernelRunning = (xTaskGetSchedulerState() == taskSCHEDULER_RUNNING)
22 };
23
24 if (info.fromIsr) {
25 info.isrm = taskENTER_CRITICAL_FROM_ISR();
26 } else if (info.kernelRunning) {
27 TT_ENTER_CRITICAL();
28 } else {
29 portDISABLE_INTERRUPTS();
30 }
31
32 return info;
33}
34
35void exit(CriticalInfo info) {
36 if (info.fromIsr) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected