File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -205,11 +205,20 @@ DECLARE_THREAD(kalman, RocketSystems* arg) {
205205}
206206
207207DECLARE_THREAD (telemetry, RocketSystems* arg) {
208+ double launch_time = 0 ;
209+
208210 while (true ) {
209211 arg->tlm .transmit (arg->rocket_data , arg->led );
210212
211213 FSMState current_state = arg->rocket_data .fsm_state .getRecentUnsync ();
212- if (current_state == FSMState (STATE_IDLE) || current_state == FSMState (STATE_SAFE) || current_state == FSMState (STATE_PYRO_TEST)) {
214+
215+ double current_time = pdTICKS_TO_MS (xTaskGetTickCount ());
216+
217+ if (current_state == FSMState::STATE_IDLE) {
218+ launch_time = current_time;
219+ }
220+
221+ if (current_state == FSMState (STATE_IDLE) || current_state == FSMState (STATE_SAFE) || current_state == FSMState (STATE_PYRO_TEST) || (current_time - launch_time) > 1800000 ) {
213222 TelemetryCommand command;
214223 if (arg->tlm .receive (&command, 500 )) {
215224 if (command.valid ()) {
You can’t perform that action at this time.
0 commit comments