Reverse byte-order of 16 bit register read
This commit is contained in:
@ -102,7 +102,7 @@ int mgos_i2c_read_reg_w(struct mgos_i2c *i2c, uint16_t addr, uint8_t reg) {
|
||||
|
||||
if (!mgos_i2c_read_reg_n(i2c, addr, reg, 2, data))
|
||||
return -1;
|
||||
value=(data[1]<<8)+data[0];
|
||||
value=(data[0]<<8)+data[1];
|
||||
return value;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user