diff --git a/libraries/DataFlash/LogStructure.h b/libraries/DataFlash/LogStructure.h index 0a8031ea5f..0f185efc9a 100644 --- a/libraries/DataFlash/LogStructure.h +++ b/libraries/DataFlash/LogStructure.h @@ -1010,6 +1010,16 @@ struct PACKED log_Proximity { float closest_dist; }; +struct PACKED log_Performance { + LOG_PACKET_HEADER; + uint64_t time_us; + uint16_t num_long_running; + uint16_t num_loops; + uint32_t max_time; + uint16_t ins_error_count; + uint32_t mem_avail; +}; + struct PACKED log_SRTL { LOG_PACKET_HEADER; uint64_t time_us; @@ -1222,6 +1232,8 @@ Format characters in the format string for binary log messages "BCN", "QBBfffffff", "TimeUS,Health,Cnt,D0,D1,D2,D3,PosX,PosY,PosZ", "s--mmmmmmm", "F--BBBBBBB" }, \ { LOG_PROXIMITY_MSG, sizeof(log_Proximity), \ "PRX", "QBfffffffffff", "TimeUS,Health,D0,D45,D90,D135,D180,D225,D270,D315,DUp,CAn,CDis", "s-mmmmmmmmmhm", "F-BBBBBBBBB00" }, \ + { LOG_PERFORMANCE_MSG, sizeof(log_Performance), \ + "PM", "QHHIHI", "TimeUS,NLon,NLoop,MaxT,INSErr,Mem", "s----b", "F----0" }, \ { LOG_SRTL_MSG, sizeof(log_SRTL), \ "SRTL", "QBHHBfff", "TimeUS,Active,NumPts,MaxPts,Action,N,E,D", "s----mmm", "F----000" } @@ -1530,9 +1542,12 @@ enum LogMessages { LOG_ISBH_MSG, LOG_ISBD_MSG, LOG_ASP2_MSG, - + LOG_PERFORMANCE_MSG, + _LOG_LAST_MSG_ }; +static_assert(_LOG_LAST_MSG_ <= 255, "Too many message formats"); + enum LogOriginType { ekf_origin = 0, ahrs_home = 1