mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-02 20:05:52 +00:00
Trunk formating
This commit is contained in:
parent
fc8594a8d3
commit
aca5249fd1
@ -76,7 +76,6 @@ static const uint8_t ext_chrg_detect_value = EXT_CHRG_DETECT_VALUE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
#include "main.h";
|
||||
uint8_t INA_ADDR_LOCAL;
|
||||
@ -507,7 +506,6 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_STM32WL)
|
||||
/*
|
||||
Read Voltage from INA using autodetect of addr first else use addr in config.power.device_battery_ina_address
|
||||
@ -517,18 +515,18 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
||||
if (!config.power.device_battery_ina_address) {
|
||||
if (ina_found.type != ScanI2C::DeviceType::NONE) {
|
||||
switch (ina_found.type) {
|
||||
case ScanI2C::DeviceType::INA219:
|
||||
return ina219Sensor.getBusVoltageMv();
|
||||
break;
|
||||
case ScanI2C::DeviceType::INA226:
|
||||
return ina226Sensor.getBusVoltageMv();
|
||||
break;
|
||||
case ScanI2C::DeviceType::INA260:
|
||||
return ina260Sensor.getBusVoltageMv();
|
||||
break;
|
||||
case ScanI2C::DeviceType::INA3221:
|
||||
return ina3221Sensor.getBusVoltageMv();
|
||||
break;
|
||||
case ScanI2C::DeviceType::INA219:
|
||||
return ina219Sensor.getBusVoltageMv();
|
||||
break;
|
||||
case ScanI2C::DeviceType::INA226:
|
||||
return ina226Sensor.getBusVoltageMv();
|
||||
break;
|
||||
case ScanI2C::DeviceType::INA260:
|
||||
return ina260Sensor.getBusVoltageMv();
|
||||
break;
|
||||
case ScanI2C::DeviceType::INA3221:
|
||||
return ina3221Sensor.getBusVoltageMv();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (config.power.device_battery_ina_address) {
|
||||
@ -556,14 +554,14 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
||||
if (!config.power.device_battery_ina_address) {
|
||||
if (ina_found.type != ScanI2C::DeviceType::NONE) {
|
||||
switch (ina_found.type) {
|
||||
case ScanI2C::DeviceType::INA219:
|
||||
return ina219Sensor.getCurrentMa();
|
||||
case ScanI2C::DeviceType::INA219:
|
||||
return ina219Sensor.getCurrentMa();
|
||||
|
||||
case ScanI2C::DeviceType::INA226:
|
||||
return ina226Sensor.getCurrentMa();
|
||||
case ScanI2C::DeviceType::INA226:
|
||||
return ina226Sensor.getCurrentMa();
|
||||
|
||||
case ScanI2C::DeviceType::INA3221:
|
||||
return ina3221Sensor.getCurrentMa();
|
||||
case ScanI2C::DeviceType::INA3221:
|
||||
return ina3221Sensor.getCurrentMa();
|
||||
}
|
||||
}
|
||||
} else if (config.power.device_battery_ina_address) {
|
||||
@ -590,25 +588,25 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
||||
if (ina_found.type != ScanI2C::DeviceType::NONE) {
|
||||
INA_ADDR_LOCAL = ina_found.address.address;
|
||||
switch (ina_found.type) {
|
||||
case ScanI2C::DeviceType::INA219:
|
||||
if (!ina219Sensor.isInitialized())
|
||||
return ina219Sensor.runOnce() > 0;
|
||||
return ina219Sensor.isRunning();
|
||||
case ScanI2C::DeviceType::INA219:
|
||||
if (!ina219Sensor.isInitialized())
|
||||
return ina219Sensor.runOnce() > 0;
|
||||
return ina219Sensor.isRunning();
|
||||
|
||||
case ScanI2C::DeviceType::INA226:
|
||||
if (!ina226Sensor.isInitialized())
|
||||
return ina226Sensor.runOnce() > 0;
|
||||
return ina226Sensor.isRunning();
|
||||
case ScanI2C::DeviceType::INA226:
|
||||
if (!ina226Sensor.isInitialized())
|
||||
return ina226Sensor.runOnce() > 0;
|
||||
return ina226Sensor.isRunning();
|
||||
|
||||
case ScanI2C::DeviceType::INA260:
|
||||
if (!ina260Sensor.isInitialized())
|
||||
return ina260Sensor.runOnce() > 0;
|
||||
return ina260Sensor.isRunning();
|
||||
case ScanI2C::DeviceType::INA260:
|
||||
if (!ina260Sensor.isInitialized())
|
||||
return ina260Sensor.runOnce() > 0;
|
||||
return ina260Sensor.isRunning();
|
||||
|
||||
case ScanI2C::DeviceType::INA3221:
|
||||
if (!ina3221Sensor.isInitialized())
|
||||
return ina3221Sensor.runOnce() > 0;
|
||||
return ina3221Sensor.isRunning();
|
||||
case ScanI2C::DeviceType::INA3221:
|
||||
if (!ina3221Sensor.isInitialized())
|
||||
return ina3221Sensor.runOnce() > 0;
|
||||
return ina3221Sensor.isRunning();
|
||||
}
|
||||
}
|
||||
} else if (config.power.device_battery_ina_address) {
|
||||
|
@ -41,7 +41,6 @@ ScanI2C::FoundDevice ScanI2C::firstAccelerometer() const
|
||||
return firstOfOrNONE(8, types);
|
||||
}
|
||||
|
||||
|
||||
ScanI2C::FoundDevice ScanI2C::firstINA() const
|
||||
{
|
||||
ScanI2C::DeviceType types[] = {INA219, INA226, INA260, INA3221};
|
||||
|
@ -122,7 +122,7 @@ class ScanI2C
|
||||
FoundDevice firstKeyboard() const;
|
||||
|
||||
FoundDevice firstAccelerometer() const;
|
||||
|
||||
|
||||
FoundDevice firstINA() const;
|
||||
|
||||
FoundDevice firstRGBLED() const;
|
||||
|
@ -180,7 +180,6 @@ ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE,
|
||||
ScanI2C::FoundDevice ina_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE, ScanI2C::ADDRESS_NONE);
|
||||
ScanI2C::DeviceAddress ina_Address = ScanI2C::ADDRESS_NONE;
|
||||
|
||||
|
||||
#ifdef T_WATCH_S3
|
||||
Adafruit_DRV2605 drv;
|
||||
#endif
|
||||
@ -704,7 +703,7 @@ void setup()
|
||||
|
||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO)
|
||||
auto ina_Info = i2cScanner->firstINA();
|
||||
// ina_Address = ina_Info.type != ScanI2C::DeviceType::NONE ? ina_Info.address : ina_Address;
|
||||
// ina_Address = ina_Info.type != ScanI2C::DeviceType::NONE ? ina_Info.address : ina_Address;
|
||||
LOG_DEBUG("ina_info = %i", ina_Info.type);
|
||||
#endif
|
||||
|
||||
|
@ -34,7 +34,7 @@ extern uint8_t kb_model;
|
||||
extern ScanI2C::DeviceAddress rtc_found;
|
||||
extern ScanI2C::DeviceAddress accelerometer_found;
|
||||
extern ScanI2C::FoundDevice rgb_found;
|
||||
//extern ScanI2C::DeviceAddress ina_Address;
|
||||
// extern ScanI2C::DeviceAddress ina_Address;
|
||||
extern ScanI2C::FoundDevice ina_found;
|
||||
|
||||
extern bool eink_found;
|
||||
|
Loading…
Reference in New Issue
Block a user