diff --git a/src/boards/Groundstation/Automated/SMController/SMController.cpp b/src/boards/Groundstation/Automated/SMController/SMController.cpp index fd14eb265a84cc43db96a73069653ba61f5bbf6a..b4c07f141b9d0db2d3fcdaa995fea74c908328dc 100644 --- a/src/boards/Groundstation/Automated/SMController/SMController.cpp +++ b/src/boards/Groundstation/Automated/SMController/SMController.cpp @@ -55,16 +55,10 @@ SMController::SMController(TaskScheduler* sched) bool SMController::start() { - size_t result; - bool ok = true; - - // add the update task - result = scheduler->addTask(bind(&SMController::update, this), - SMControllerConfig::UPDATE_PERIOD, - TaskScheduler::Policy::RECOVER); - ok &= result != 0; - - return ActiveObject::start() && ok; + size_t result = scheduler->addTask(bind(&SMController::update, this), + SMControllerConfig::UPDATE_PERIOD, + TaskScheduler::Policy::RECOVER); + return HSM::start() && result != 0; } void SMController::setAntennaCoordinates( diff --git a/src/boards/Groundstation/Automated/SMController/SMControllerData.h b/src/boards/Groundstation/Automated/SMController/SMControllerData.h index 98b3fa259acdf35868893b9d6d784dca04d32a3c..f13fd8047d25b0e5404dec1f1b1d0d539c1c64e1 100644 --- a/src/boards/Groundstation/Automated/SMController/SMControllerData.h +++ b/src/boards/Groundstation/Automated/SMController/SMControllerData.h @@ -60,13 +60,14 @@ enum class SMControllerState : uint8_t * @brief macro state for no feedback (armed_nf, test_nf, * fix_rocket_nf, active_nf) */ - NO_FEEDBACK + NO_FEEDBACK, + INVALID, }; struct SMControllerStatus { - uint64_t timestamp; - SMControllerState state; + uint64_t timestamp = 0; + SMControllerState state = SMControllerState::INVALID; static std::string header() { return "timestamp,state\n"; }