Skip to content

drivers/sensors: Legacy sensor warning#18435

Merged
acassis merged 1 commit intoapache:masterfrom
linguini1:legacy-sensor-warning
Mar 1, 2026
Merged

drivers/sensors: Legacy sensor warning#18435
acassis merged 1 commit intoapache:masterfrom
linguini1:legacy-sensor-warning

Conversation

@linguini1
Copy link
Contributor

@linguini1 linguini1 commented Feb 24, 2026

Summary

This commit implements a compile-time warning and in-code comment warning for legacy sensor drivers. This is intended to:

  • Warn users that legacy drivers may eventually be removed
  • Warn developers that they should not use a legacy driver as a reference for their new driver contributions

Closes #18434

Impact

All legacy drivers have a compile-time warning.

Ideally, this makes it easier for contributors to be aware of what to use as a reference.

Testing

N/A: only a comment and #warning directive was added, so if the CI passes all is well.

@github-actions github-actions bot added Area: Sensors Sensors issues Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm labels Feb 24, 2026
@linguini1 linguini1 force-pushed the legacy-sensor-warning branch from 1649bff to 02a7c35 Compare February 24, 2026 16:11
@github-actions github-actions bot added Size: L The size of the change in this PR is large and removed Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm labels Feb 24, 2026
simbit18
simbit18 previously approved these changes Feb 24, 2026
@acassis
Copy link
Contributor

acassis commented Feb 25, 2026

@raiden00pl maybe qe, zerocross and other "sensors" that are not really a sensor and doesn't make sense to be in drivers/sensors/ should be moved to other place. See, qe in some way it similar to pulse capture that is in drivers/timers/ so maybe we could move it to there. The zerocross could be there too or in drivers/misc/

Or other alternative is creating a drivers/sensors/misc/ or other better name and move it to there. BTW we can do it during the 13.x release

acassis
acassis previously approved these changes Feb 25, 2026
@linguini1 linguini1 force-pushed the legacy-sensor-warning branch from c4323e3 to 5cb227b Compare February 25, 2026 18:16
simbit18
simbit18 previously approved these changes Feb 25, 2026
@acassis
Copy link
Contributor

acassis commented Feb 25, 2026

@linguini1 @raiden00pl I think the support to fixed math to sensors should come with 13.x, so in that in this new release "legacy" drivers will be removed (when its count-part uORB exists) or converted.

@jerpelea seems like we have a lot of work before 13.x be released :-/

acassis
acassis previously approved these changes Feb 25, 2026
@linguini1
Copy link
Contributor Author

@linguini1 @raiden00pl I think the support to fixed math to sensors should come with 13.x, so in that in this new release "legacy" drivers will be removed (when its count-part uORB exists) or converted.

I think getting the fixed math support for 13.0.0 is a good idea, but I don't know when we'll be able to retire the legacy drivers. I don't have any of those devices to test with/convert to uORB.

@jerpelea seems like we have a lot of work before 13.x be released :-/

Yeah....but we can do our best! Maybe some things will need to wait for a 14.0.0 :)

@raiden00pl
Copy link
Member

The initial fixed-math implementation is ready, and porting subsequent sensors can be done one by one. The only problem is that I haven't had a chance to finally verify it on HW yet so it's still marked as draft :)

@linguini1
Copy link
Contributor Author

linguini1 commented Feb 25, 2026

The initial fixed-math implementation is ready, and porting subsequent sensors can be done one by one. The only problem is that I haven't had a chance to finally verify it on HW yet so it's still marked as draft :)

I have a limited set of sensors available to me (IMU, mag, baro and GNSS) but I would be willing to help perform some testing for it! I have an RP2040-based flight computer from my L1 rocket flight, and I would be very curious to see the performance improvement on it without having to use floating point for uORB!

This commit implements a compile-time warning and in-code comment
warning for legacy sensor drivers. This is intended to:

- Warn users that legacy drivers may eventually be removed
- Warn developers that they should not use a legacy driver as a
  reference for their new driver contributions

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
@linguini1 linguini1 dismissed stale reviews from acassis and simbit18 via b815aaa February 26, 2026 01:36
@linguini1 linguini1 force-pushed the legacy-sensor-warning branch from 5cb227b to b815aaa Compare February 26, 2026 01:36
@linguini1 linguini1 requested review from raiden00pl and removed request for raiden00pl February 27, 2026 17:48
@acassis acassis merged commit 6cffe9b into apache:master Mar 1, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Sensors Sensors issues Size: L The size of the change in this PR is large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Mark legacy sensor drivers as "deprecated"

5 participants