mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
Fix QMC5883 and HLC5883 drivers breaking sensor command (#20585)
* fix breaking sensor command * fix hmc5883
This commit is contained in:
parent
559789b4ec
commit
ab49593f9f
@ -261,6 +261,7 @@ bool Ina3221CmndSensor(void)
|
||||
{
|
||||
int argc = ArgC();
|
||||
if(argc != 1 && argc != 4) {
|
||||
AddLog(LOG_LEVEL_DEBUG, PSTR(D_INA3221 ": Not enough arguments (1 or 4)"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -224,6 +224,8 @@ bool HMC5883L_Command() {
|
||||
bool Xsns101(uint32_t function) {
|
||||
if (!I2cEnabled(XI2C_73)) { return false; }
|
||||
|
||||
bool result = false;
|
||||
|
||||
if (FUNC_INIT == function) {
|
||||
HMC5883L_Init();
|
||||
}
|
||||
@ -231,7 +233,7 @@ bool Xsns101(uint32_t function) {
|
||||
switch (function) {
|
||||
case FUNC_COMMAND_SENSOR:
|
||||
if (XSNS_101 == XdrvMailbox.index) {
|
||||
return HMC5883L_Command(); // Return true on success
|
||||
result = HMC5883L_Command(); // Return true on success
|
||||
}
|
||||
break;
|
||||
case FUNC_JSON_APPEND:
|
||||
@ -247,7 +249,7 @@ bool Xsns101(uint32_t function) {
|
||||
#endif // USE_WEBSERVER
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
#endif // USE_HMC5883L
|
||||
#endif // USE_I2C
|
||||
|
@ -286,11 +286,18 @@ void QMC5883L_Show(uint8_t json) {
|
||||
bool Xsns33(uint32_t function) {
|
||||
if (!I2cEnabled(XI2C_71)) { return false; }
|
||||
|
||||
bool result = false;
|
||||
|
||||
if (FUNC_INIT == function) {
|
||||
QMC5883L_Init();
|
||||
}
|
||||
else if (QMC5883L != nullptr) {
|
||||
switch (function) {
|
||||
// case FUNC_COMMAND_SENSOR:
|
||||
// if (XSNS_33 == XdrvMailbox.index) {
|
||||
// result = QMC5883L_CmndSensor();
|
||||
// }
|
||||
// break;
|
||||
case FUNC_JSON_APPEND:
|
||||
QMC5883L_Show(1);
|
||||
break;
|
||||
@ -304,7 +311,7 @@ bool Xsns33(uint32_t function) {
|
||||
#endif // USE_WEBSERVER
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
#endif // USE_QMC5883L
|
||||
#endif // USE_I2C
|
Loading…
x
Reference in New Issue
Block a user