Skip to content

AP_Baro: avoid use of ownptr in AP_Baro #29859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

peterbarker
Copy link
Contributor

I've flashed this onto CubeOrangePlus and ZeroOneX6 and both still see their baros.

Everything that built still builds.

Things still seem to have all of the baro features they used to have.

Board                    AP_Periph  blimp  bootloader  copter  heli  iofirmware  plane  rover  sub
CubeOrange-periph-heavy  -896              *                                                   
CubeRedPrimary                      -800   *           -800    -800              -800   -800   -912
Durandal                            -904   *           -904    -904              -896   -896   -1112
Hitec-Airspeed           *                 *                                                   
KakuteH7-bdshot                     -944   *           -952    -944              -952   -952   -1184
MatekF405                           -112   *           -112    -112              -112   -104   -104
Pixhawk1-1M-bdshot                  -128               -128    -120              -128   -120   -344
f103-QiotekPeriph        *                 *                                                   
f303-Universal           -896              *                                                   
iomcu                                                                *                         
revo-mini                           -160   *           -160    -160              -160   -160   -392
skyviper-journey                                       -952                                    
skyviper-v2450                                         -48                                     

Looking more closely at the Durandal changes:
image

And each of the probe functions gets smaller:
image
image

... and the compiler is optimising better in there, too.

There's a couple of obvious follow-up cleanups which will save more bytes.

  • holding reference-to-device rather than pointer-to-device
  • possible creation of AP_Baro_I2C or similar as common base class for I2C barometers (init and constructors can be shared)

@peterbarker peterbarker force-pushed the pr/baro-ownptr branch 4 times, most recently from 5de8bc5 to c990e43 Compare April 22, 2025 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant