mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-10 05:04:42 +00:00
putting crappy guards all over the place.. is there something better I can do here?
This commit is contained in:
parent
17265dfdc0
commit
de9da5a3eb
@ -59,7 +59,9 @@ MLX90632Sensor mlx90632Sensor;
|
||||
DFRobotLarkSensor dfRobotLarkSensor;
|
||||
NAU7802Sensor nau7802Sensor;
|
||||
BMP3XXSensor bmp3xxSensor;
|
||||
#ifdef CAN_HAVE_RAK12035VB_SENSOR
|
||||
RAK12035VBSensor rak12035vbSensor;
|
||||
#endif
|
||||
#ifdef T1000X_SENSOR_EN
|
||||
T1000xSensor t1000xSensor;
|
||||
#endif
|
||||
@ -153,8 +155,10 @@ int32_t EnvironmentTelemetryModule::runOnce()
|
||||
result = max17048Sensor.runOnce();
|
||||
if (cgRadSens.hasSensor())
|
||||
result = cgRadSens.runOnce();
|
||||
#ifdef CAN_HAVE_RAK12035VB_SENSOR
|
||||
if (rak12035vbSensor.hasSensor())
|
||||
result = rak12035vbSensor.runOnce();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
@ -411,10 +415,12 @@ bool EnvironmentTelemetryModule::getEnvironmentTelemetry(meshtastic_Telemetry *m
|
||||
valid = valid && cgRadSens.getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
#ifdef CAN_HAVE_RAK12035VB_SENSOR
|
||||
if (rak12035vbSensor.hasSensor()){
|
||||
valid = valid && rak12035vbSensor.getMetrics(m);
|
||||
hasSensor = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
return valid && hasSensor;
|
||||
@ -621,12 +627,14 @@ AdminMessageHandleResult EnvironmentTelemetryModule::handleAdminMessageForModule
|
||||
if (result != AdminMessageHandleResult::NOT_HANDLED)
|
||||
return result;
|
||||
}
|
||||
#ifdef CAN_HAVE_RAK12035VB_SENSOR
|
||||
if (rak12035vbSensor.hasSensor()){
|
||||
result = rak12035vbSensor.handleAdminMessage(mp, request, response);
|
||||
if (result != AdminMessageHandleResult::NOT_HANDLED)
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user