Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce number of log IDs allocated to vehicles, rearrange #19562

Merged
merged 8 commits into from
Dec 20, 2021
8 changes: 5 additions & 3 deletions AntennaTracker/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ enum class PWMDisarmed {
#define MASK_LOG_CURRENT (1<<6)
#define MASK_LOG_ANY 0xFFFF

// Logging messages
#define LOG_V_BAR_MSG 0x04
#define LOG_V_POS_MSG 0x05
// Logging messages - only 32 messages are available to the vehicle here.
enum log_messages {
LOG_V_BAR_MSG,
LOG_V_POS_MSG,
};
2 changes: 1 addition & 1 deletion ArduCopter/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ enum DevOptions {
DevOptionVFR_HUDRelativeAlt = 2,
};

// Logging parameters
// Logging parameters - only 32 messages are available to the vehicle here.
enum LoggingParameters {
LOG_CONTROL_TUNING_MSG,
LOG_DATA_INT16_MSG,
Expand Down
2 changes: 1 addition & 1 deletion ArduPlane/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ enum tuning_pid_bits {

static_assert(TUNING_BITS_END <= (1 << 24) + 1, "Tuning bit mask is too large to be set by MAVLink");

// Logging message types
// Logging message types - only 32 messages are available to the vehicle here.
enum log_messages {
LOG_CTUN_MSG,
LOG_NTUN_MSG,
Expand Down
2 changes: 1 addition & 1 deletion ArduSub/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum RTLState {
RTL_Land
};

// Logging parameters
// Logging parameters - only 32 messages are available to the vehicle here.
enum LoggingParameters {
LOG_CONTROL_TUNING_MSG,
LOG_DATA_INT16_MSG,
Expand Down
2 changes: 1 addition & 1 deletion Blimp/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ enum DevOptions {
DevOptionSetAttitudeTarget_ThrustAsThrust = 4,
};

// Logging parameters
// Logging parameters - only 32 messages are available to the vehicle here.
enum LoggingParameters {
LOG_CONTROL_TUNING_MSG,
LOG_DATA_INT16_MSG,
Expand Down
14 changes: 8 additions & 6 deletions Rover/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
#define FAILSAFE_EVENT_THROTTLE (1<<0)
#define FAILSAFE_EVENT_GCS (1<<1)

// Logging parameters
#define LOG_THR_MSG 0x01
#define LOG_NTUN_MSG 0x02
#define LOG_STARTUP_MSG 0x06
#define LOG_STEERING_MSG 0x0D
#define LOG_GUIDEDTARGET_MSG 0x0E
// Logging parameters - only 32 messages are available to the vehicle here.
enum LoggingParameters {
LOG_THR_MSG,
LOG_NTUN_MSG,
LOG_STARTUP_MSG,
LOG_STEERING_MSG,
LOG_GUIDEDTARGET_MSG,
};

#define TYPE_GROUNDSTART_MSG 0x01

Expand Down
25 changes: 13 additions & 12 deletions libraries/AP_Logger/LogStructure.h
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,7 @@ LOG_STRUCTURE_FROM_AIS, \

// message types for common messages
enum LogMessages : uint8_t {
LOG_PARAMETER_MSG = 64,
LOG_PARAMETER_MSG = 32,
LOG_IDS_FROM_NAVEKF2,
LOG_IDS_FROM_NAVEKF3,
LOG_MESSAGE_MSG,
Expand All @@ -1377,14 +1377,6 @@ enum LogMessages : uint8_t {

LOG_IDS_FROM_GPS,

// LOG_MODE_MSG is used as a check for duplicates. Do not add between this and LOG_FORMAT_MSG
LOG_MODE_MSG,

LOG_FORMAT_MSG = 128, // this must remain #128

LOG_IDS_FROM_DAL,
LOG_IDS_FROM_INERTIALSENSOR,

LOG_PIDR_MSG,
LOG_PIDP_MSG,
LOG_PIDY_MSG,
Expand All @@ -1401,9 +1393,18 @@ enum LogMessages : uint8_t {
LOG_FORMAT_UNITS_MSG,
LOG_UNIT_MSG,
LOG_MULT_MSG,

LOG_RALLY_MSG,

// LOG_MODE_MSG is used as a check for duplicates. Do not add between this and LOG_FORMAT_MSG
LOG_MODE_MSG,

LOG_FORMAT_MSG = 128, // this must remain #128

LOG_IDS_FROM_DAL,
LOG_IDS_FROM_INERTIALSENSOR,

LOG_IDS_FROM_VISUALODOM,
LOG_IDS_FROM_AVOIDANCE,
LOG_BEACON_MSG,
LOG_PROXIMITY_MSG,
LOG_DF_FILE_STATS,
Expand All @@ -1416,7 +1417,6 @@ enum LogMessages : uint8_t {
LOG_ERROR_MSG,
LOG_ADSB_MSG,
LOG_ARM_DISARM_MSG,
LOG_IDS_FROM_AVOIDANCE,
LOG_WINCH_MSG,
LOG_PSCN_MSG,
LOG_PSCE_MSG,
Expand All @@ -1431,5 +1431,6 @@ enum LogMessages : uint8_t {
_LOG_LAST_MSG_
};

static_assert(_LOG_LAST_MSG_ <= 255, "Too many message formats");
// we reserve ID #255 for future expansion
static_assert(_LOG_LAST_MSG_ < 255, "Too many message formats");
static_assert(LOG_MODE_MSG < 128, "Duplicate message format IDs");