mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 05:06:32 +00:00
parent
0f531e24e5
commit
2376a14ec1
@ -814,10 +814,10 @@ bool I2cWrite(uint8_t addr, uint8_t reg, uint32_t val, uint8_t size)
|
|||||||
do {
|
do {
|
||||||
Wire.beginTransmission((uint8_t)addr); // start transmission to device
|
Wire.beginTransmission((uint8_t)addr); // start transmission to device
|
||||||
Wire.write(reg); // sends register address to write to
|
Wire.write(reg); // sends register address to write to
|
||||||
uint8_t loops = size -1;
|
uint8_t bytes = size;
|
||||||
do {
|
while (bytes--) {
|
||||||
Wire.write((val >> (8 * loops)) & 0xFF); // write data
|
Wire.write((val >> (8 * bytes)) & 0xFF); // write data
|
||||||
} while(--loops);
|
}
|
||||||
x--;
|
x--;
|
||||||
} while (Wire.endTransmission(true) != 0 && x != 0); // end transmission
|
} while (Wire.endTransmission(true) != 0 && x != 0); // end transmission
|
||||||
return (x);
|
return (x);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user