@@ -40,16 +40,16 @@ static void send_and_receive(void)
cmd[2] = 0x34;
i2c_send(i2c, addr, cmd, 3);
i2c_recv(i2c, addr, resp, 2);
- g_assert_cmphex(resp[0], ==, cmd[1]);
- g_assert_cmphex(resp[1], ==, cmd[2]);
+ g_assert_cmphex(((uint16_t)resp[0] << 8) | resp[1], ==,
+ ((uint16_t)cmd[1] << 8) | cmd[2]);
cmd[0] = TMP105_REG_T_HIGH;
cmd[1] = 0x42;
cmd[2] = 0x31;
i2c_send(i2c, addr, cmd, 3);
i2c_recv(i2c, addr, resp, 2);
- g_assert_cmphex(resp[0], ==, cmd[1]);
- g_assert_cmphex(resp[1], ==, cmd[2]);
+ g_assert_cmphex(((uint16_t)resp[0] << 8) | resp[1], ==,
+ ((uint16_t)cmd[1] << 8) | cmd[2]);
}
int main(int argc, char **argv)