diff --git a/libraries/AP_HAL_QURT/Scheduler.cpp b/libraries/AP_HAL_QURT/Scheduler.cpp index 18870873e5..3465f49e72 100644 --- a/libraries/AP_HAL_QURT/Scheduler.cpp +++ b/libraries/AP_HAL_QURT/Scheduler.cpp @@ -266,6 +266,11 @@ bool Scheduler::in_timerprocess() return getpid() != _main_task_pid; } +bool Scheduler::in_main_thread() const +{ + return getpid() == _main_task_pid; +} + void Scheduler::system_initialized() { if (_initialized) { AP_HAL::panic("PANIC: scheduler::system_initialized called" diff --git a/libraries/AP_HAL_QURT/Scheduler.h b/libraries/AP_HAL_QURT/Scheduler.h index bbe5fbd8ee..4ed7230d7b 100644 --- a/libraries/AP_HAL_QURT/Scheduler.h +++ b/libraries/AP_HAL_QURT/Scheduler.h @@ -32,6 +32,7 @@ public: void reboot(bool hold_in_bootloader); bool in_timerprocess(); + bool in_main_thread() const override; void system_initialized(); void hal_initialized();