Skip to content

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).

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