DataFlash: use const ins reference

save some pointer dereferences
This commit is contained in:
Andrew Tridgell 2013-11-04 14:36:14 +11:00 committed by Randy Mackay
parent b258a63b8c
commit 14d2453216
2 changed files with 4 additions and 4 deletions

View File

@ -46,7 +46,7 @@ public:
void Log_Write_Format(const struct LogStructure *structure);
void Log_Write_Parameter(const char *name, float value);
void Log_Write_GPS(const GPS *gps, int32_t relative_alt);
void Log_Write_IMU(const AP_InertialSensor *ins);
void Log_Write_IMU(const AP_InertialSensor &ins);
void Log_Write_Message(const char *message);
void Log_Write_Message_P(const prog_char_t *message);

View File

@ -622,10 +622,10 @@ void DataFlash_Class::Log_Write_GPS(const GPS *gps, int32_t relative_alt)
// Write an raw accel/gyro data packet
void DataFlash_Class::Log_Write_IMU(const AP_InertialSensor *ins)
void DataFlash_Class::Log_Write_IMU(const AP_InertialSensor &ins)
{
Vector3f gyro = ins->get_gyro();
Vector3f accel = ins->get_accel();
Vector3f gyro = ins.get_gyro();
Vector3f accel = ins.get_accel();
struct log_IMU pkt = {
LOG_PACKET_HEADER_INIT(LOG_IMU_MSG),
gyro_x : gyro.x,