mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 17:42:48 +00:00
trunk fmt
This commit is contained in:
parent
78a1b6a9a8
commit
64dc6cc215
@ -544,7 +544,6 @@ void setup()
|
||||
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::VEML7700, meshtastic_TelemetrySensorType_VEML7700)
|
||||
SCANNER_TO_SENSORS_MAP(ScanI2C::DeviceType::SHT4X, meshtastic_TelemetrySensorType_SHT4X)
|
||||
|
||||
|
||||
i2cScanner.reset();
|
||||
|
||||
#ifdef HAS_SDCARD
|
||||
|
@ -293,7 +293,6 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||
}
|
||||
valid = valid && hasSensor;
|
||||
|
||||
|
||||
if (valid) {
|
||||
LOG_INFO("(Sending): barometric_pressure=%f, current=%f, gas_resistance=%f, relative_humidity=%f, temperature=%f, "
|
||||
"lux=%f\n",
|
||||
|
@ -30,11 +30,11 @@ void VEML7700Sensor::setup() {}
|
||||
* @param corrected if true, apply non-linear correction
|
||||
* @return lux value
|
||||
*/
|
||||
float VEML7700Sensor::computeLux(uint16_t rawALS, bool corrected) {
|
||||
float VEML7700Sensor::computeLux(uint16_t rawALS, bool corrected)
|
||||
{
|
||||
float lux = getResolution() * rawALS;
|
||||
if (corrected)
|
||||
lux = (((6.0135e-13 * lux - 9.3924e-9) * lux + 8.1488e-5) * lux + 1.0023) *
|
||||
lux;
|
||||
lux = (((6.0135e-13 * lux - 9.3924e-9) * lux + 8.1488e-5) * lux + 1.0023) * lux;
|
||||
return lux;
|
||||
}
|
||||
|
||||
@ -42,9 +42,9 @@ float VEML7700Sensor::computeLux(uint16_t rawALS, bool corrected) {
|
||||
* @brief Determines resolution for current gain and integration time
|
||||
* settings.
|
||||
*/
|
||||
float VEML7700Sensor::getResolution(void) {
|
||||
return MAX_RES * (IT_MAX / veml7700.getIntegrationTimeValue()) *
|
||||
(GAIN_MAX / veml7700.getGainValue());
|
||||
float VEML7700Sensor::getResolution(void)
|
||||
{
|
||||
return MAX_RES * (IT_MAX / veml7700.getIntegrationTimeValue()) * (GAIN_MAX / veml7700.getGainValue());
|
||||
}
|
||||
|
||||
bool VEML7700Sensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
@ -53,10 +53,8 @@ bool VEML7700Sensor::getMetrics(meshtastic_Telemetry *measurement)
|
||||
measurement->variant.environment_metrics.lux = veml7700.readLux(VEML_LUX_AUTO);
|
||||
white = veml7700.readWhite(true);
|
||||
measurement->variant.environment_metrics.white_lux = computeLux(white, white > 100);
|
||||
LOG_INFO("white lux %f, als lux %f\n",
|
||||
measurement->variant.environment_metrics.white_lux,
|
||||
LOG_INFO("white lux %f, als lux %f\n", measurement->variant.environment_metrics.white_lux,
|
||||
measurement->variant.environment_metrics.lux);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
Loading…
Reference in New Issue
Block a user