Arduino IDE version (found in Arduino -> About Arduino menu): 1.8.12
List the steps to reproduce the problem below (if possible attach a sketch or
copy the sketch code in too): build my sample ino
I got the following warnings.
/Users/takashi/Documents/Arduino/libraries/Adafruit_APDS9960-1.1.3/Adafruit_APDS9960.cpp: In member function 'uint8_t Adafruit_APDS9960::readGesture()':
/Users/takashi/Documents/Arduino/libraries/Adafruit_APDS9960-1.1.3/Adafruit_APDS9960.cpp:394:19: warning: variable 'bytesRead' set but not used [-Wunused-but-set-variable]
uint8_t toRead, bytesRead;
^~~~~~~~~
/Users/takashi/Documents/Arduino/libraries/Adafruit_APDS9960-1.1.3/Adafruit_APDS9960.cpp: In member function 'uint32_t Adafruit_APDS9960::read32(uint8_t)':
/Users/takashi/Documents/Arduino/libraries/Adafruit_APDS9960-1.1.3/Adafruit_APDS9960.cpp:643:21: warning: left shift count >= width of type [-Wshift-count-overflow]
return (ret[0] << 24) | (ret[1] << 16) | (ret[2] << 8) | ret[3];
^~
/Users/takashi/Documents/Arduino/libraries/Adafruit_APDS9960-1.1.3/Adafruit_APDS9960.cpp:643:38: warning: left shift count >= width of type [-Wshift-count-overflow]
return (ret[0] << 24) | (ret[1] << 16) | (ret[2] << 8) | ret[3];
^~
There is comment of bytesRead is unused but produces sideffects needed for readGesture to work but it seems OK with only reading APDS9960_GFIFO_U register and bytesRead variable itself can be removed.
I got the following warnings.
There is comment of
bytesRead is unused but produces sideffects needed for readGesture to work
but it seems OK with only readingAPDS9960_GFIFO_U
register andbytesRead
variable itself can be removed.And I cast
uint32_t
before bit shifting.