-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Rework SPL06 to do background updates compliant with the spec #28983
Conversation
67b9686
to
855f8ad
Compare
@radiolinkW this PR will directly affect your board RadiolinkPIX6 Wu was the committer on the commit which added to the SPL06 driver to add SPA06 support, and to add the ability to do "background" reading on this sensor. @andyp1per has tested this on a board he is currently working on, and the background reading does improve the driver's performance significantly. Would it be possible for you to test this PR on your RadiolinkPIX6 board and verify that the Baro still works as expected? |
No response from radiolink |
Regarding TMP_EXT(external temperature sensor), it is in the TMP_CFG register of SPL06, but in the MEAS_CFG register of SPA06. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this would have us write incorrect configuration into the SPA06.
Thanks for checking, we'll make sure we don't break that bit. Can you confirm https://vi.aliexpress.com/item/1005007607117391.html?gatewayAdapt=glo2vnm always contain the SPA06, please? It'll be worth getting one of those into an ArduPilot DevTeam member's hands so we can check we're not breaking this sensor without bugging you :-) |
855f8ad
to
7b3d707
Compare
Pull in some bug fixes from betaflight
Fixed |
@andyp1per I think you should buy one of these boards so we can test the driver changes, can you apply for funding for that? |
BETAFPV-F405 doesn't list the SPL06 baro in hwdef? is this a variant? |
Yes, the RadiolinkPIX6 we ship includes the SPA06 baro, and we are waiting for you to release the 4.6 firmware because only the 4.6 firmware supports the SPA06 driver. |
We can provide a free RadiolinkPIX6 for you to test the SPA06 driver. |
E-mail sent |
|
@tridge TBH the other option is to delete the driver and fold the SPA06 fixes into the DPS310 driver - BF only has one driver |
So both SPL06 and SPA06 would move to the DPS310? Interesting... |
We're just about to release -beta3 for 4.6 Can't be that much longer! |
@radiolinkW are you able to test this change on your board? I sent you e-mail, but response so far. |
I haved replied to your email. We are on Spring Festival holiday and probably cannot test it. |
Tested on SpeedyBeeF405AIO which has an SPA6 - checked out. I added the correct devid so that we can identify the different parts. |
The temperature register that @radiolinkW were interested in is functional? |
Right, that fix is part of this PR |
770a6b6
to
6c076b3
Compare
Fixes applied |
#define READ_LENGTH 9 | ||
|
||
for (uint8_t i = 0; i < ARRAY_SIZE(buf); ) { | ||
ssize_t chunk = MIN(READ_LENGTH, SPL06_CALIB_COEFFS_LEN - i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ssize_t chunk = MIN(READ_LENGTH, SPL06_CALIB_COEFFS_LEN - i); | |
const ssize_t chunk = MIN(READ_LENGTH, ARRAY_SIZE(buf) - i); |
@@ -200,7 +238,12 @@ bool AP_Baro_SPL06::_init() | |||
|
|||
_instance = _frontend.register_sensor(); | |||
|
|||
_dev->set_device_type(DEVTYPE_BARO_SPL06); | |||
if(type == Type::SPA06) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(type == Type::SPA06) { | |
switch (type) { |
Pulls in some bug fixes from betaflight to make the code more understandable.
Enabled background updates by default (which is what the DPS310 driver does)
Uses external temperature sensor as required by the spec.
This results in much more accurate baro updates from this sensor.
Tested on BetaFPV F405