Skip to content
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

rangefinder gy-us42 added #5698

Closed
wants to merge 2 commits into from

Conversation

emtrax-ltd
Copy link
Contributor

Add the ultrasonic sensor GY-US42 as a new rangefinder to inav.

Because of the sensor's i2c trigger write command (only point to the register and restart), there was the need to patch the Method "drivers/bus_ic2_hal.c-> i2cWriteBuffer(...)" for passing through null values to HAL_I2C_Master_Transmit (raw access).

@@ -187,7 +187,7 @@ bool i2cWriteBuffer(I2CDevice device, uint8_t addr_, uint8_t reg_, uint8_t len_,

HAL_StatusTypeDef status;

if (reg_ == 0xFF && allowRawAccess) {
if ((reg_ == 0xFF || len_ == 0) && allowRawAccess) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STDPeriph I2C driver probably needs patching to allow null writes as well. Can you please check?

Copy link
Contributor Author

@emtrax-ltd emtrax-ltd May 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to patch "driver/bus_busdev_i2c.c" and "driver/bus_i2c_soft.c" because they are using for-loops based on paramater "len" [... for (i = 0; i < len; i++) { ...]. so it should work... but how can i test it? any other i2c-drivers out there?

@digitalentity digitalentity added this to the 2.6 milestone May 9, 2020
@digitalentity digitalentity changed the base branch from development to master June 8, 2020 10:16
@digitalentity digitalentity modified the milestones: 2.6, 2.7 Nov 14, 2020
@DzikuVx
Copy link
Member

DzikuVx commented Apr 5, 2021

@emtrax-ltd could you please rebase on top of current master ?

@emtrax-ltd
Copy link
Contributor Author

@DzikuVx ... i rebased this pull request onto master (3.0.0) in #6792 - you can close this old one if it's ok!

@DzikuVx
Copy link
Member

DzikuVx commented Apr 6, 2021

closing as #6792 is in place

@DzikuVx DzikuVx closed this Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants