mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 01:18:29 -04:00
Plane: use dataflash Log_Write_Airspeed()
This commit is contained in:
parent
5d83124675
commit
5a01933b7b
@ -542,33 +542,10 @@ static void Log_Write_Baro(void)
|
||||
DataFlash.Log_Write_Baro(barometer);
|
||||
}
|
||||
|
||||
struct PACKED log_AIRSPEED {
|
||||
LOG_PACKET_HEADER;
|
||||
uint32_t timestamp;
|
||||
float airspeed;
|
||||
float diffpressure;
|
||||
int16_t temperature;
|
||||
float rawpressure;
|
||||
float offset;
|
||||
};
|
||||
|
||||
// Write a AIRSPEED packet
|
||||
static void Log_Write_Airspeed(void)
|
||||
{
|
||||
float temperature;
|
||||
if (!airspeed.get_temperature(temperature)) {
|
||||
temperature = 0;
|
||||
}
|
||||
struct log_AIRSPEED pkt = {
|
||||
LOG_PACKET_HEADER_INIT(LOG_AIRSPEED_MSG),
|
||||
timestamp : hal.scheduler->millis(),
|
||||
airspeed : airspeed.get_raw_airspeed(),
|
||||
diffpressure : airspeed.get_differential_pressure(),
|
||||
temperature : (int16_t)(temperature * 100.0f),
|
||||
rawpressure : airspeed.get_raw_pressure(),
|
||||
offset : airspeed.get_offset()
|
||||
};
|
||||
DataFlash.WriteBlock(&pkt, sizeof(pkt));
|
||||
DataFlash.Log_Write_Airspeed(airspeed);
|
||||
}
|
||||
|
||||
static const struct LogStructure log_structure[] PROGMEM = {
|
||||
@ -595,8 +572,6 @@ static const struct LogStructure log_structure[] PROGMEM = {
|
||||
"MAG2", "Ihhhhhh", "TimeMS,MagX,MagY,MagZ,OfsX,OfsY,OfsZ" },
|
||||
{ LOG_ARM_DISARM_MSG, sizeof(log_Arm_Disarm),
|
||||
"ARM", "IHB", "TimeMS,ArmState,ArmChecks" },
|
||||
{ LOG_AIRSPEED_MSG, sizeof(log_AIRSPEED),
|
||||
"ARSP", "Iffcff", "TimeMS,Airspeed,DiffPress,Temp,RawPress,Offset" },
|
||||
{ LOG_ATRP_MSG, sizeof(AP_AutoTune::log_ATRP),
|
||||
"ATRP", "IBBcfff", "TimeMS,Type,State,Servo,Demanded,Achieved,P" },
|
||||
#if OPTFLOW == ENABLED
|
||||
|
@ -126,7 +126,7 @@ enum log_messages {
|
||||
LOG_SONAR_MSG,
|
||||
LOG_COMPASS2_MSG,
|
||||
LOG_ARM_DISARM_MSG,
|
||||
LOG_AIRSPEED_MSG,
|
||||
LOG_AIRSPEED_MSG_DEPRECATED, // deprecated
|
||||
LOG_COMPASS3_MSG
|
||||
#if OPTFLOW == ENABLED
|
||||
,LOG_OPTFLOW_MSG
|
||||
|
Loading…
Reference in New Issue
Block a user