RobTillaart / AM2315

Arduino library for the I2C AM2315 temperature and humidity sensor.
MIT License
3 stars 1 forks source link

compiler warning for call to requestFrom #11

Closed Sisyphos0 closed 2 years ago

Sisyphos0 commented 2 years ago

Hi Rob,

Compiling in Arduino IDE 1.8.13 for ESP32 target. Using version 0.1.4 of AM2315

I'm getting following compiler warnings: " In file included from /Volumes/develop/Arduino 1.x/libraries/AM2315/AM2315.h:23, from /Volumes/develop/Arduino 1.x/libraries/AM2315/AM2315.cpp:16: /Users/xyz/Library/Arduino15/packages/esp32/hardware/esp32/2.0.4/libraries/Wire/src/Wire.h: In member function 'int AM2315::_readSensor()': /Users/xyz/Library/Arduino15/packages/esp32/hardware/esp32/2.0.4/libraries/Wire/src/Wire.h:104:13: note: candidate 1: 'uint8_t TwoWire::requestFrom(int, int)' uint8_t requestFrom(int address, int size); ^~~ /Users/xyz/Library/Arduino15/packages/esp32/hardware/esp32/2.0.4/libraries/Wire/src/Wire.h:102:13: note: candidate 2: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)' uint8_t requestFrom(uint8_t address, uint8_t size); ^~~ "

changing type to uint8_t on lines 198 & 199 (var length & bytes) should avoid the warning...

Thanks for the Lib!

RobTillaart commented 2 years ago

Thanks for the issue, I will look into it asap.

RobTillaart commented 2 years ago

Release 0.1.5 fixes the issue, if there are still problems reopen this issue or open a new if needed.

Sisyphos0 commented 2 years ago

I'm confirming, bug fixed with 0.1.5 Big Thanks!