Remove on-the-fly LM75AD detection

Remove on-the-fly LM75AD detection (#6825)
This commit is contained in:
Theo Arends 2019-11-11 11:44:40 +01:00
parent b31f3d82e3
commit b436f47786
1 changed files with 5 additions and 5 deletions

View File

@ -45,7 +45,7 @@
#define LM75_THYST_REGISTER 0x02 #define LM75_THYST_REGISTER 0x02
#define LM75_TOS_REGISTER 0x03 #define LM75_TOS_REGISTER 0x03
uint8_t lm75ad_type = 0; bool lm75ad_type = false;
uint8_t lm75ad_address; uint8_t lm75ad_address;
uint8_t lm75ad_addresses[] = { LM75AD_ADDRESS1, LM75AD_ADDRESS2, LM75AD_ADDRESS3, LM75AD_ADDRESS4, LM75AD_ADDRESS5, LM75AD_ADDRESS6, LM75AD_ADDRESS7, LM75AD_ADDRESS8 }; uint8_t lm75ad_addresses[] = { LM75AD_ADDRESS1, LM75AD_ADDRESS2, LM75AD_ADDRESS3, LM75AD_ADDRESS4, LM75AD_ADDRESS5, LM75AD_ADDRESS6, LM75AD_ADDRESS7, LM75AD_ADDRESS8 };
@ -59,7 +59,7 @@ void LM75ADDetect(void)
uint16_t buffer; uint16_t buffer;
if (I2cValidRead16(&buffer, lm75ad_address, LM75_THYST_REGISTER)) { if (I2cValidRead16(&buffer, lm75ad_address, LM75_THYST_REGISTER)) {
if (buffer == 0x4B00) { if (buffer == 0x4B00) {
lm75ad_type = 1; lm75ad_type = true;
I2cSetActiveFound(lm75ad_address, "LM75AD"); I2cSetActiveFound(lm75ad_address, "LM75AD");
break; break;
} }
@ -110,9 +110,6 @@ bool Xsns26(uint8_t function)
bool result = false; bool result = false;
switch (function) { switch (function) {
case FUNC_EVERY_SECOND:
LM75ADDetect();
break;
case FUNC_JSON_APPEND: case FUNC_JSON_APPEND:
LM75ADShow(1); LM75ADShow(1);
break; break;
@ -121,6 +118,9 @@ bool Xsns26(uint8_t function)
LM75ADShow(0); LM75ADShow(0);
break; break;
#endif // USE_WEBSERVER #endif // USE_WEBSERVER
case FUNC_INIT:
LM75ADDetect();
break;
} }
return result; return result;
} }