diff --git a/H750VBT6-flight-board-v0/System/States/state_coast_ascent.cpp b/H750VBT6-flight-board-v0/System/States/state_coast_ascent.cpp index d409df43..e207e8ce 100644 --- a/H750VBT6-flight-board-v0/System/States/state_coast_ascent.cpp +++ b/H750VBT6-flight-board-v0/System/States/state_coast_ascent.cpp @@ -8,21 +8,28 @@ void CoastAscentState::init() { // Empty + data_log_assign_flight(); // TEMP: will be replaced in pre-flight } EndCondition_t CoastAscentState::run() { - // Collect, filter, log, and transmit all data + // Collect, filter, log, and log all data HM_ReadSensorData(); SensorData_t* sensorData = HM_GetSensorData(); applyFilterData(sensorData); FilterData_t* filterData = getFilteredData(); data_log_write(sensorData, filterData, this->getID()); - transmitData(sensorData, filterData, this->getID()); + // Only transmit at 1/100th rate + if (this->getRunCounter() % 100 == 0) + transmitData(sensorData, filterData, this->getID()); + + this->incrementRunCounter(); + + // TEMP: Comment out apogee detection so this state runs the whole flight // Detect apogee if z velocity becomes negative - if (filterData->vel_z < 0) { - return EndCondition_t::Apogee; - } +// if (filterData->vel_z < 0) { +// return EndCondition_t::Apogee; +// } return EndCondition_t::NoChange; } diff --git a/H750VBT6-flight-board-v0/System/scheduler.cpp b/H750VBT6-flight-board-v0/System/scheduler.cpp index ae116301..af876f95 100644 --- a/H750VBT6-flight-board-v0/System/scheduler.cpp +++ b/H750VBT6-flight-board-v0/System/scheduler.cpp @@ -121,7 +121,7 @@ Scheduler::StateId Scheduler::getNextState(EndCondition_t endCondition) { case StateId::CliMain: switch(endCondition) { case EndCondition_t::UsbDisconnect: - return StateId::PreFlight; + return StateId::CoastAscent; // TEMP: Will be PreFlight once launch detect works default: break; }