Skip to content

Commit 6c720b2

Browse files
committed
fix race condition
1 parent 1161f34 commit 6c720b2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ void AntennaDeployer ::SET_DEPLOYMENT_STATE_cmdHandler(FwOpcodeType opCode, U32
104104
if (deployed) {
105105
this->writeDeploymentState();
106106
} else {
107+
// Stop any ongoing deployment and reset all internal state
108+
this->ensureBurnwireStopped();
109+
this->resetDeploymentState();
110+
111+
// Remove the deployment state file
107112
Fw::ParamValid is_valid;
108113
auto file_path = this->paramGet_DEPLOYED_STATE_FILE(is_valid);
109114
FW_ASSERT(is_valid == Fw::ParamValid::VALID || is_valid == Fw::ParamValid::DEFAULT);
@@ -258,6 +263,7 @@ void AntennaDeployer ::finishDeployment(Components::DeployResult result) {
258263
void AntennaDeployer ::resetDeploymentState() {
259264
this->m_state = DeploymentState::IDLE;
260265
this->m_currentAttempt = 0;
266+
this->m_totalAttempts = 0;
261267
this->m_ticksInState = 0;
262268
this->m_stopRequested = false;
263269
this->m_successDetected = false;

0 commit comments

Comments
 (0)