mirror of
https://github.com/esphome/esphome.git
synced 2024-11-28 12:46:22 +01:00
I2c fix (#2460)
This commit is contained in:
parent
1c58b17235
commit
5461f87ff0
@ -12,7 +12,7 @@ bool I2CDevice::write_bytes_16(uint8_t a_register, const uint16_t *data, uint8_t
|
||||
std::unique_ptr<uint16_t[]> temp{new uint16_t[len]};
|
||||
for (size_t i = 0; i < len; i++)
|
||||
temp[i] = htoi2cs(data[i]);
|
||||
return write_register(a_register, reinterpret_cast<const uint8_t *>(data), len * 2) == ERROR_OK;
|
||||
return write_register(a_register, reinterpret_cast<const uint8_t *>(temp.get()), len * 2) == ERROR_OK;
|
||||
}
|
||||
|
||||
I2CRegister &I2CRegister::operator=(uint8_t value) {
|
||||
|
Loading…
Reference in New Issue
Block a user