commander: remove low priority thread, run tasks in a worker thread on demand

- removes race conditions
- removes dependencies on static data & methods
- reduces RAM usage by ~3.8KB
This commit is contained in:
Beat Küng
2020-11-30 11:53:22 -05:00
committed by Daniel Agar
parent 419b336a15
commit 05a3492174
7 changed files with 499 additions and 359 deletions
+3
View File
@@ -36,6 +36,7 @@
#include "Arming/PreFlightCheck/PreFlightCheck.hpp"
#include "failure_detector/FailureDetector.hpp"
#include "state_machine_helper.h"
#include "worker_thread.hpp"
#include <lib/controllib/blocks.hpp>
#include <lib/hysteresis/hysteresis.h>
@@ -382,6 +383,8 @@ private:
safety_s _safety{};
vtol_vehicle_status_s _vtol_status{};
WorkerThread _worker_thread;
// Subscriptions
uORB::Subscription _actuator_controls_sub{ORB_ID_VEHICLE_ATTITUDE_CONTROLS};
uORB::Subscription _cmd_sub {ORB_ID(vehicle_command)};