AP_TECS: convert to using Log_Write
preparation for a TEC2 message
This commit is contained in:
parent
9a6ac77c64
commit
bc911d15d1
@ -1042,10 +1042,22 @@ void AP_TECS::update_pitch_throttle(int32_t hgt_dem_cm,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// log the contents of the log_tuning structure to dataflash
|
// log the contents of the log_tuning structure to dataflash
|
||||||
void AP_TECS::log_data(DataFlash_Class &dataflash, uint8_t msgid)
|
void AP_TECS::log_data(DataFlash_Class &dataflash)
|
||||||
{
|
{
|
||||||
log_tuning.head1 = HEAD_BYTE1;
|
dataflash.Log_Write("TECS", "TimeUS,h,dh,hdem,dhdem,spdem,sp,dsp,ith,iph,th,ph,dspdem,w,f", "QfffffffffffffB",
|
||||||
log_tuning.head2 = HEAD_BYTE2;
|
AP_HAL::micros64(),
|
||||||
log_tuning.msgid = msgid;
|
log_tuning.hgt,
|
||||||
dataflash.WriteBlock(&log_tuning, sizeof(log_tuning));
|
log_tuning.dhgt,
|
||||||
|
log_tuning.hgt_dem,
|
||||||
|
log_tuning.dhgt_dem,
|
||||||
|
log_tuning.spd_dem,
|
||||||
|
log_tuning.spd,
|
||||||
|
log_tuning.dspd,
|
||||||
|
log_tuning.ithr,
|
||||||
|
log_tuning.iptch,
|
||||||
|
log_tuning.thr,
|
||||||
|
log_tuning.ptch,
|
||||||
|
log_tuning.dspd_dem,
|
||||||
|
log_tuning.speed_weight,
|
||||||
|
log_tuning.flags);
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// log data on internal state of the controller. Called at 10Hz
|
// log data on internal state of the controller. Called at 10Hz
|
||||||
void log_data(DataFlash_Class &dataflash, uint8_t msgid);
|
void log_data(DataFlash_Class &dataflash);
|
||||||
|
|
||||||
// return current target airspeed
|
// return current target airspeed
|
||||||
float get_target_airspeed(void) const {
|
float get_target_airspeed(void) const {
|
||||||
@ -357,5 +357,3 @@ private:
|
|||||||
float timeConstant(void) const;
|
float timeConstant(void) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TECS_LOG_FORMAT(msg) { msg, sizeof(AP_TECS::log_TECS_Tuning), \
|
|
||||||
"TECS", "QfffffffffffffB", "TimeUS,h,dh,hdem,dhdem,spdem,sp,dsp,ith,iph,th,ph,dspdem,w,f" }
|
|
||||||
|
Loading…
Reference in New Issue
Block a user