ldc1612: shutdown on i2c errors

Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
Timofey Titovets
2024-09-28 19:51:59 +02:00
committed by KevinOConnor
parent 1563a68144
commit 1c3b30b815
2 changed files with 3 additions and 1 deletions

View File

@@ -146,7 +146,8 @@ check_home(struct ldc1612 *ld, uint32_t data)
static void
read_reg(struct ldc1612 *ld, uint8_t reg, uint8_t *res)
{
i2c_dev_read(ld->i2c, sizeof(reg), &reg, 2, res);
int ret = i2c_dev_read(ld->i2c, sizeof(reg), &reg, 2, res);
i2c_shutdown_on_err(ret);
}
// Read the status register on the ldc1612