-
Notifications
You must be signed in to change notification settings - Fork 7k
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
drivers/sensor/lsm6dsl: Use DT defines to select I2C/SPI bus #12105
Conversation
compiled/tested on both ArgonKey (LSM6DSL_SPI) and disco_l475_iot1 (LSM6DSL_I2C) boards |
Codecov Report
@@ Coverage Diff @@
## master #12105 +/- ##
=======================================
Coverage 48.06% 48.06%
=======================================
Files 284 284
Lines 43383 43383
Branches 10397 10397
=======================================
Hits 20853 20853
Misses 18389 18389
Partials 4141 4141 Continue to review full report at Codecov.
|
So I think we need avoid using DT_ symbols in CMakeLists.txt I wondering about introducing a:
|
We also probably need to add:
|
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.
Made a few comments on how to get sanity builds to pass.
This should be fine, as I was able to compile it for ArgonKey and discovery iot boards.
It might be. I can try. |
2b866d8
to
af2962b
Compare
The reason I say that is because of how build the tests that are failing. Use DT_ in CMakefile.txt like this is probably best to be avoided. |
I understand why (lack of dependencies control and so on), but I feel this render the DT_X_BUS not easy to use. I know this seems like a proposal going in the opposite direction of all the efforts made recently, but: |
To be honest I'm not sure I understand why we cannot do it, but I feel
Why not doing the following instead: CMakeLists.txt:: lsm6dsl_spi.c:: lsm6dsl_i2c.c:: Similar to @galak proposal, but without introducing a new file. EDIT:: |
Remove configuration parameter CONFIG_BUS_TYPE. Now we may make use of DT_ST_LSM6DSL_BUS_I2C and DT_ST_LSM6DSL_BUS_SPI definition to select the bus. Signed-off-by: Armando Visconti <armando.visconti@st.com>
af2962b
to
743035e
Compare
@galak |
@galak |
Remove configuration parameter CONFIG_BUS_TYPE. Now we may
make use of DT_ST_LSM6DSL_BUS_I2C and DT_ST_LSM6DSL_BUS_SPI
definition to select the bus.
Signed-off-by: Armando Visconti armando.visconti@st.com