arduino-sps
arduino-sps copied to clipboard
sensirion_i2c_read: change count to uint8_t to avoid compiler warnings
On some arduino architectures the current implementation causes compiler warnings as there is no implementation for uint8_t requestFrom(uint8_t address, uint16_t size) in the wire library. Example is the esp32 architecture. I think it is save to change it to uint8_t to avoid these warnings.
Signed-off-by: Volker [email protected]
Hi @moeskerv, I just realized that we're on arduino-sps, not the embedded driver - as such your fix does not jeopardize "all implementations" (since there is only arduino). However, we'd like to fix the issue for all embedded and *-arduino drivers at once.
Could you thus resubmit the PR against https://github.com/Sensirion/embedded-common/ - more precisely against https://github.com/Sensirion/embedded-common/blob/32bea2d6f7fa2b7d349f95d7f554bc6ef8a179a8/hw_i2c/sample-implementations/arduino/sensirion_hw_i2c_implementation.cpp#L70
and ideally also
https://github.com/Sensirion/embedded-common/blob/32bea2d6f7fa2b7d349f95d7f554bc6ef8a179a8/hw_i2c/sample-implementations/arduino-mkrzero-multiple-i2c-buses/sensirion_hw_i2c_implementation.cpp#L109
and
https://github.com/Sensirion/embedded-common/blob/32bea2d6f7fa2b7d349f95d7f554bc6ef8a179a8/hw_i2c/sample-implementations/arduino-alt-i2c/sensirion_hw_i2c_implementation.cpp#L59 which takes two uint8_t's or two ints
..also while we're at it, the write counterpart also seems to be cast implicitly
Kind regards Andreas
Issue is resolved, thanks for your contribution