From df824414eface1c89175eb23e41ca06210bda334 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Mon, 28 Sep 2020 21:02:06 +0200 Subject: [PATCH] Fix probing in IR_SENSOR --- Firmware/pat9125.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/pat9125.c b/Firmware/pat9125.c index c6ffecf3..58308a9a 100644 --- a/Firmware/pat9125.c +++ b/Firmware/pat9125.c @@ -118,8 +118,8 @@ uint8_t pat9125_probe() twi_init(); #ifdef IR_SENSOR // NOTE: this is called from the MK3S variant, so it should be kept minimal - uint8_t addr = PAT9125_PID1; - return (twi_rw8(PAT9125_I2C_ADDR,TW_READ,&addr) == 0); + uint8_t data; + return (twi_r8(PAT9125_I2C_ADDR,PAT9125_PID1,&data) == 0); #else return (pat9125_rd_reg(PAT9125_PID1) != 0); #endif