Skip to content

Commit

Permalink
Remove unused state field mask for handling state
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanademovic committed Jan 25, 2017
1 parent d3b930c commit 386aeb7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions serial_substates.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ enum SerialComm::States : uint8_t {
AUX_CHAN_MASK,
COMMANDS,
F_AND_T,
UNUSED,
PID_FZ_MASTER,
PID_TX_MASTER,
PID_TY_MASTER,
Expand All @@ -35,6 +34,8 @@ enum SerialComm::States : uint8_t {
END_OF_STATES,
};

static_assert(SerialComm::States::END_OF_STATES == 27, "Added/removed states not acknowledged");

// Reads part of the state into a COBS payload, named "payload"
#define READ_SUBSTATE(name) \
template <> \
Expand Down Expand Up @@ -71,9 +72,6 @@ READ_SUBSTATE_PAYLOAD(AUX_CHAN_MASK, state->command_AUX_mask)
READ_SUBSTATE_PAYLOAD(COMMANDS, state->command_throttle, state->command_pitch, state->command_roll, state->command_yaw)
READ_SUBSTATE_PAYLOAD(F_AND_T, state->Fz, state->Tx, state->Ty, state->Tz)

READ_SUBSTATE(UNUSED) {
}

READ_SUBSTATE(PID_FZ_MASTER) {
WritePIDData(payload, control->thrust_pid.master());
}
Expand Down

0 comments on commit 386aeb7

Please sign in to comment.