Skip to content

Commit 71c1d36

Browse files
committed
fix side effect
1 parent 3b3dbc9 commit 71c1d36

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

FprimeZephyrReference/Components/AntennaDeployer/AntennaDeployer.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ void AntennaDeployer ::SET_DEPLOYMENT_STATE_cmdHandler(FwOpcodeType opCode, U32
106106
} else {
107107
// Reset all internal state counters to ensure clean test isolation
108108
this->resetDeploymentState();
109+
// Also reset total attempts counter which persists across deployments
110+
this->m_totalAttempts = 0;
109111

110112
// Remove the deployment state file
111113
Fw::ParamValid is_valid;
@@ -262,12 +264,13 @@ void AntennaDeployer ::finishDeployment(Components::DeployResult result) {
262264
void AntennaDeployer ::resetDeploymentState() {
263265
this->m_state = DeploymentState::IDLE;
264266
this->m_currentAttempt = 0;
265-
this->m_totalAttempts = 0;
266267
this->m_ticksInState = 0;
267268
this->m_stopRequested = false;
268269
this->m_successDetected = false;
269270
this->m_lastDistanceValid = false;
270271
this->m_burnTicksThisAttempt = 0;
272+
// Note: m_totalAttempts is NOT reset here as it's a persistent counter
273+
// across deployments. It's only reset in SET_DEPLOYMENT_STATE for test isolation.
271274
}
272275

273276
bool AntennaDeployer ::isDistanceWithinValidRange(F32 distance) {

0 commit comments

Comments
 (0)