Sensirion / embedded-common

Generic Embedded i2c Driver HAL / Common Files
BSD 3-Clause "New" or "Revised" License
30 stars 16 forks source link

Code not architected for multiple modules usage. #75

Closed monkeytronics closed 3 years ago

monkeytronics commented 3 years ago

I'm not a c language expert, so apologies if this post has a simple resolution. When multiple modules are used (SCD30, SGP40 etc), they all reference the common files etc. This causes me a problem, since as it stands, the files here do not contain some of the expected functions used in the SGP40 module. Is there a standard approach to structuring the common files that works across all sensirion products?

'sensirion_i2c_read_words_as_bytes' [-Werror=implicit-function-declaration]

It would be great if we didn't have to put this together ourselves, as it makes it difficult to continue to sync up to the repo. Thanks.

monkey.

rnestler commented 3 years ago

Hi @monkeytronics

Yes, this is a known issue when our individual driver repositories reference different versions of the embedded-common parts. (embedded-scd uses embedded-common 285cb56 and embedded-sgp uses embedded-common ae8f449 at the moment)

In https://github.com/Sensirion/embedded-common/pull/59 we added versioning to this repository as well which should reduce the problem in the near future.

Our mid- to longterm solution is to generate all the drivers from an interface description which enables us to upgrade them all at one if we do some refactoring.

rnestler commented 3 years ago

Hi @monkeytronics

I'll update embedded-sgp and embedded-scd so both use embedded-common 0.1.0. Can you test if this works for you?

rnestler commented 3 years ago

@monkeytronics Did the latest release of embedded-sgp and embedded-scd fix the issue for you?

rnestler commented 3 years ago

I'll will close this for now. Feel free to reopen if you have any questions.