From ebab492700784b956c3e198f112c7f3662c7f710 Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Thu, 17 Jun 2021 11:34:07 -0700 Subject: [PATCH] AP_RangeFinder: Rearrange parameters to reduce memory usage Saves 4 bytes per instance, and with 10 instances this gives us an extra 40 bytes of RAM --- libraries/AP_RangeFinder/AP_RangeFinder_Params.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libraries/AP_RangeFinder/AP_RangeFinder_Params.h b/libraries/AP_RangeFinder/AP_RangeFinder_Params.h index d2c6532121..3704d88d88 100644 --- a/libraries/AP_RangeFinder/AP_RangeFinder_Params.h +++ b/libraries/AP_RangeFinder/AP_RangeFinder_Params.h @@ -13,18 +13,18 @@ public: AP_RangeFinder_Params(const AP_RangeFinder_Params &other) = delete; AP_RangeFinder_Params &operator=(const AP_RangeFinder_Params&) = delete; + AP_Vector3f pos_offset; // position offset in body frame + AP_Float scaling; + AP_Float offset; + AP_Int16 powersave_range; + AP_Int16 min_distance_cm; + AP_Int16 max_distance_cm; AP_Int8 type; AP_Int8 pin; AP_Int8 ratiometric; - AP_Int16 powersave_range; AP_Int8 stop_pin; - AP_Float scaling; - AP_Float offset; AP_Int8 function; - AP_Int16 min_distance_cm; - AP_Int16 max_distance_cm; AP_Int8 ground_clearance_cm; AP_Int8 address; - AP_Vector3f pos_offset; // position offset in body frame AP_Int8 orientation; };