FlightTasks: construct all tasks in constructor

This commit is contained in:
Dennis Mannhart
2018-05-31 15:27:13 +02:00
committed by Lorenz Meier
parent b1530d1a81
commit 29fb5089bd
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -3,6 +3,18 @@
#include <uORB/topics/vehicle_command.h>
#include <uORB/topics/vehicle_command_ack.h>
FlightTasks::FlightTasks()
{
// initialize all flight-tasks
// currently this is required to get all parameters read
for (int i = 0; i < static_cast<int>(FlightTaskIndex::Count); i++) {
_initTask(static_cast<FlightTaskIndex>(i));
}
// disable all tasks
_initTask(FlightTaskIndex::None);
}
bool FlightTasks::update()
{
_updateCommand();
+1 -1
View File
@@ -76,7 +76,7 @@ enum class FlightTaskIndex : int {
class FlightTasks
{
public:
FlightTasks() = default;
FlightTasks();
~FlightTasks()
{