mirror of
https://github.com/esphome/esphome.git
synced 2024-12-19 16:07:47 +01:00
Fix two i2c error code return errors (#2375)
This commit is contained in:
parent
edb557f79e
commit
b398d826c1
@ -12,7 +12,9 @@ namespace pn532_i2c {
|
||||
|
||||
static const char *const TAG = "pn532_i2c";
|
||||
|
||||
bool PN532I2C::write_data(const std::vector<uint8_t> &data) { return this->write(data.data(), data.size()); }
|
||||
bool PN532I2C::write_data(const std::vector<uint8_t> &data) {
|
||||
return this->write(data.data(), data.size()) == i2c::ERROR_OK;
|
||||
}
|
||||
|
||||
bool PN532I2C::read_data(std::vector<uint8_t> &data, uint8_t len) {
|
||||
delay(1);
|
||||
|
@ -198,7 +198,7 @@ bool SCD30Component::write_command_(uint16_t command, uint16_t data) {
|
||||
raw[2] = data >> 8;
|
||||
raw[3] = data & 0xFF;
|
||||
raw[4] = sht_crc_(raw[2], raw[3]);
|
||||
return this->write(raw, 5);
|
||||
return this->write(raw, 5) == i2c::ERROR_OK;
|
||||
}
|
||||
|
||||
uint8_t SCD30Component::sht_crc_(uint8_t data1, uint8_t data2) {
|
||||
|
Loading…
Reference in New Issue
Block a user