Copter: rename MOT df msg to MOTB

This will slightly reduce confusion with the MOT message from AC3.1.5
that eventually became RCOUT
This commit is contained in:
Randy Mackay 2015-03-18 21:08:30 +09:00
parent b679fd0be0
commit 522ef8f91f
4 changed files with 20 additions and 20 deletions

View File

@ -1040,8 +1040,8 @@ static void ten_hz_logging_loop()
Log_Write_Attitude(); Log_Write_Attitude();
Log_Write_Rate(); Log_Write_Rate();
} }
if (should_log(MASK_LOG_MOT)) { if (should_log(MASK_LOG_MOTBATT)) {
Log_Write_Mot(); Log_Write_MotBatt();
} }
if (should_log(MASK_LOG_RCIN)) { if (should_log(MASK_LOG_RCIN)) {
DataFlash.Log_Write_RCIN(); DataFlash.Log_Write_RCIN();

View File

@ -364,15 +364,6 @@ static void Log_Write_Cmd(const AP_Mission::Mission_Command &cmd)
DataFlash.Log_Write_MavCmd(mission.num_commands(),mav_cmd); DataFlash.Log_Write_MavCmd(mission.num_commands(),mav_cmd);
} }
struct PACKED log_Mot {
LOG_PACKET_HEADER;
uint32_t time_ms;
float lift_max;
float bat_volt;
float bat_res;
float th_limit;
};
// Write an attitude packet // Write an attitude packet
static void Log_Write_Attitude() static void Log_Write_Attitude()
{ {
@ -426,11 +417,20 @@ static void Log_Write_Rate()
DataFlash.WriteBlock(&pkt_rate, sizeof(pkt_rate)); DataFlash.WriteBlock(&pkt_rate, sizeof(pkt_rate));
} }
struct PACKED log_MotBatt {
LOG_PACKET_HEADER;
uint32_t time_ms;
float lift_max;
float bat_volt;
float bat_res;
float th_limit;
};
// Write an rate packet // Write an rate packet
static void Log_Write_Mot() static void Log_Write_MotBatt()
{ {
struct log_Mot pkt_mot = { struct log_MotBatt pkt_mot = {
LOG_PACKET_HEADER_INIT(LOG_MOT_MSG), LOG_PACKET_HEADER_INIT(LOG_MOTBATT_MSG),
time_ms : hal.scheduler->millis(), time_ms : hal.scheduler->millis(),
lift_max : (float)(motors.get_lift_max()), lift_max : (float)(motors.get_lift_max()),
bat_volt : (float)(motors.get_batt_voltage_filt()), bat_volt : (float)(motors.get_batt_voltage_filt()),
@ -608,8 +608,8 @@ static const struct LogStructure log_structure[] PROGMEM = {
"PM", "HHIhBH", "NLon,NLoop,MaxT,PMT,I2CErr,INSErr" }, "PM", "HHIhBH", "NLon,NLoop,MaxT,PMT,I2CErr,INSErr" },
{ LOG_RATE_MSG, sizeof(log_Rate), { LOG_RATE_MSG, sizeof(log_Rate),
"RATE", "Ifffffffff", "TimeMS,RllDes,Rll,RllOut,PitDes,Pit,PitOut,YawDes,Yaw,YawOut" }, "RATE", "Ifffffffff", "TimeMS,RllDes,Rll,RllOut,PitDes,Pit,PitOut,YawDes,Yaw,YawOut" },
{ LOG_MOT_MSG, sizeof(log_Mot), { LOG_MOTBATT_MSG, sizeof(log_MotBatt),
"MOT", "Iffff", "TimeMS,LiftMax,BatVolt,BatRes,ThLimit" }, "MOTB", "Iffff", "TimeMS,LiftMax,BatVolt,BatRes,ThLimit" },
{ LOG_STARTUP_MSG, sizeof(log_Startup), { LOG_STARTUP_MSG, sizeof(log_Startup),
"STRT", "", "" }, "STRT", "", "" },
{ LOG_EVENT_MSG, sizeof(log_Event), { LOG_EVENT_MSG, sizeof(log_Event),
@ -685,7 +685,7 @@ static void Log_Write_AutoTuneDetails(float angle_cd, float rate_cds) {}
static void Log_Write_Current() {} static void Log_Write_Current() {}
static void Log_Write_Attitude() {} static void Log_Write_Attitude() {}
static void Log_Write_Rate() {} static void Log_Write_Rate() {}
static void Log_Write_Mot() {} static void Log_Write_MotBatt() {}
static void Log_Write_Data(uint8_t id, int16_t value){} static void Log_Write_Data(uint8_t id, int16_t value){}
static void Log_Write_Data(uint8_t id, uint16_t value){} static void Log_Write_Data(uint8_t id, uint16_t value){}
static void Log_Write_Data(uint8_t id, int32_t value){} static void Log_Write_Data(uint8_t id, int32_t value){}

View File

@ -686,7 +686,7 @@
MASK_LOG_OPTFLOW | \ MASK_LOG_OPTFLOW | \
MASK_LOG_COMPASS | \ MASK_LOG_COMPASS | \
MASK_LOG_CAMERA | \ MASK_LOG_CAMERA | \
MASK_LOG_MOT MASK_LOG_MOTBATT
#endif #endif
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////

View File

@ -240,7 +240,7 @@ enum FlipState {
#define LOG_AUTOTUNE_MSG 0x19 #define LOG_AUTOTUNE_MSG 0x19
#define LOG_AUTOTUNEDETAILS_MSG 0x1A #define LOG_AUTOTUNEDETAILS_MSG 0x1A
#define LOG_RATE_MSG 0x1D #define LOG_RATE_MSG 0x1D
#define LOG_MOT_MSG 0x1E #define LOG_MOTBATT_MSG 0x1E
#define MASK_LOG_ATTITUDE_FAST (1<<0) #define MASK_LOG_ATTITUDE_FAST (1<<0)
#define MASK_LOG_ATTITUDE_MED (1<<1) #define MASK_LOG_ATTITUDE_MED (1<<1)
@ -259,7 +259,7 @@ enum FlipState {
#define MASK_LOG_INAV (1<<14) // deprecated #define MASK_LOG_INAV (1<<14) // deprecated
#define MASK_LOG_CAMERA (1<<15) #define MASK_LOG_CAMERA (1<<15)
#define MASK_LOG_WHEN_DISARMED (1UL<<16) #define MASK_LOG_WHEN_DISARMED (1UL<<16)
#define MASK_LOG_MOT (1UL<<17) #define MASK_LOG_MOTBATT (1UL<<17)
#define MASK_LOG_ANY 0xFFFF #define MASK_LOG_ANY 0xFFFF
// DATA - event logging // DATA - event logging