|
|
@@ -28,10 +28,12 @@ void cht8305_reset(void) {
|
|
|
state_debug("cht8305 not ready reinit\n");
|
|
|
cht8305_init();
|
|
|
}
|
|
|
- u16 data = 0x8000; //reset
|
|
|
- i2c_write(Config_Reg, data);
|
|
|
- i2c_read(Config_Reg, &data);
|
|
|
- state_debug("data = 0x%x\n", data);
|
|
|
+ if (_ready) {
|
|
|
+ u16 data = 0x8000; //reset
|
|
|
+ i2c_write(Config_Reg, data);
|
|
|
+ i2c_read(Config_Reg, &data);
|
|
|
+ state_debug("data = 0x%x\n", data);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
u8 cht8305_get_humidity(void){
|