Skip to content

Commit

Permalink
ESP32 CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintYourDragon committed Oct 20, 2022
1 parent 84a19c3 commit 5007b44
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Adafruit_TCS34725.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ float powf(const float x, const float y) {
* @param value
*/
void Adafruit_TCS34725::write8(uint8_t reg, uint8_t value) {
uint8_t buffer[2] = {(uint8_t)TCS34725_COMMAND_BIT | reg, value};
uint8_t buffer[2] = {(uint8_t)(TCS34725_COMMAND_BIT | reg), value};
i2c_dev->write(buffer, 2);
}

Expand All @@ -59,7 +59,7 @@ void Adafruit_TCS34725::write8(uint8_t reg, uint8_t value) {
* @return value
*/
uint8_t Adafruit_TCS34725::read8(uint8_t reg) {
uint8_t buffer[1] = {TCS34725_COMMAND_BIT | reg};
uint8_t buffer[1] = {(uint8_t)(TCS34725_COMMAND_BIT | reg)};
i2c_dev->write_then_read(buffer, 1, buffer, 1);
return buffer[0];
}
Expand All @@ -70,7 +70,7 @@ uint8_t Adafruit_TCS34725::read8(uint8_t reg) {
* @return value
*/
uint16_t Adafruit_TCS34725::read16(uint8_t reg) {
uint8_t buffer[2] = {(uint8_t)TCS34725_COMMAND_BIT | reg, 0};
uint8_t buffer[2] = {(uint8_t)(TCS34725_COMMAND_BIT | reg), 0};
i2c_dev->write_then_read(buffer, 1, buffer, 2);
return (uint16_t(buffer[1]) << 8) | (uint16_t(buffer[0]) & 0xFF);
}
Expand Down

0 comments on commit 5007b44

Please sign in to comment.