Fix probing in IR_SENSOR

This commit is contained in:
Yuri D'Elia 2020-09-28 21:02:06 +02:00
parent c2e8d229a7
commit df824414ef

View File

@ -118,8 +118,8 @@ uint8_t pat9125_probe()
twi_init(); twi_init();
#ifdef IR_SENSOR #ifdef IR_SENSOR
// NOTE: this is called from the MK3S variant, so it should be kept minimal // NOTE: this is called from the MK3S variant, so it should be kept minimal
uint8_t addr = PAT9125_PID1; uint8_t data;
return (twi_rw8(PAT9125_I2C_ADDR,TW_READ,&addr) == 0); return (twi_r8(PAT9125_I2C_ADDR,PAT9125_PID1,&data) == 0);
#else #else
return (pat9125_rd_reg(PAT9125_PID1) != 0); return (pat9125_rd_reg(PAT9125_PID1) != 0);
#endif #endif