From 2a210549f94e6dbed9cb8e4c5f11913996206613 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 9 Nov 2020 19:49:27 +1100 Subject: [PATCH] AP_DAL: minor review cleanups --- libraries/AP_DAL/AP_DAL_Baro.cpp | 3 +-- libraries/AP_DAL/AP_DAL_InertialSensor.h | 3 --- libraries/AP_DAL/AP_DAL_RangeFinder.cpp | 6 +++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/libraries/AP_DAL/AP_DAL_Baro.cpp b/libraries/AP_DAL/AP_DAL_Baro.cpp index ad4d3ad0a5..9e3c717a4c 100644 --- a/libraries/AP_DAL/AP_DAL_Baro.cpp +++ b/libraries/AP_DAL/AP_DAL_Baro.cpp @@ -22,8 +22,7 @@ void AP_DAL_Baro::start_frame() for (uint8_t i=0; i<_RBRH.num_instances; i++) { log_RBRI &RBRI = _RBRI[i]; log_RBRI old = RBRI; - const uint32_t last_update_ms = baro.get_last_update(i); - RBRI.last_update_ms = last_update_ms; + RBRI.last_update_ms = baro.get_last_update(i); RBRI.healthy = baro.healthy(i); RBRI.altitude = baro.get_altitude(i); WRITE_REPLAY_BLOCK_IFCHANGED(RBRI, _RBRI[i], old); diff --git a/libraries/AP_DAL/AP_DAL_InertialSensor.h b/libraries/AP_DAL/AP_DAL_InertialSensor.h index a90bcd641e..cc2ed13d74 100644 --- a/libraries/AP_DAL/AP_DAL_InertialSensor.h +++ b/libraries/AP_DAL/AP_DAL_InertialSensor.h @@ -75,8 +75,5 @@ private: uint8_t _primary_gyro; - void log_header(uint64_t time_us); - void log_instance(uint64_t time_us, uint8_t i); - void update_filtered(uint8_t i); }; diff --git a/libraries/AP_DAL/AP_DAL_RangeFinder.cpp b/libraries/AP_DAL/AP_DAL_RangeFinder.cpp index d9939a9ff6..664b579473 100644 --- a/libraries/AP_DAL/AP_DAL_RangeFinder.cpp +++ b/libraries/AP_DAL/AP_DAL_RangeFinder.cpp @@ -35,9 +35,8 @@ int16_t AP_DAL_RangeFinder::ground_clearance_cm_orient(enum Rotation orientation int16_t AP_DAL_RangeFinder::max_distance_cm_orient(enum Rotation orientation) const { #if !APM_BUILD_TYPE(APM_BUILD_AP_DAL_Standalone) - const auto *rangefinder = AP::rangefinder(); - if (orientation != ROTATION_PITCH_270) { + const auto *rangefinder = AP::rangefinder(); // the EKF only asks for this from a specific orientation. Thankfully. INTERNAL_ERROR(AP_InternalError::error_t::flow_of_control); return rangefinder->ground_clearance_cm_orient(orientation); @@ -54,8 +53,9 @@ void AP_DAL_RangeFinder::start_frame() return; } - // EKF only asks for this *down*. const log_RRNH old = _RRNH; + + // EKF only asks for this *down*. _RRNH.ground_clearance_cm = rangefinder->ground_clearance_cm_orient(ROTATION_PITCH_270); _RRNH.max_distance_cm = rangefinder->max_distance_cm_orient(ROTATION_PITCH_270); _RRNH.backend_mask = 0;