mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-20 16:56:17 +00:00
Trunk Fixes
This commit is contained in:
parent
233b6089f6
commit
0058187bed
@ -413,7 +413,8 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
||||
#ifdef EXT_CHRG_DETECT
|
||||
return digitalRead(EXT_CHRG_DETECT) == ext_chrg_detect_value;
|
||||
#else
|
||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !defined(DISABLE_INA_CHARGING_DETECTION)
|
||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR && !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && \
|
||||
!defined(DISABLE_INA_CHARGING_DETECTION)
|
||||
if (hasINA()) {
|
||||
// get current flow from INA sensor - negative value means power flowing into the battery
|
||||
// default assuming BATTERY+ <--> INA_VIN+ <--> SHUNT RESISTOR <--> INA_VIN- <--> LOAD
|
||||
@ -472,7 +473,8 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
||||
return 0;
|
||||
}
|
||||
|
||||
int16_t getINACurrent() {
|
||||
int16_t getINACurrent()
|
||||
{
|
||||
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) {
|
||||
return ina219Sensor.getCurrentMa();
|
||||
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA3221].first ==
|
||||
@ -1176,4 +1178,4 @@ bool Power::lipoInit()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
@ -10,5 +10,4 @@ class CurrentSensor
|
||||
virtual int16_t getCurrentMa() = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
@ -3,9 +3,9 @@
|
||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "CurrentSensor.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "VoltageSensor.h"
|
||||
#include "CurrentSensor.h"
|
||||
#include <Adafruit_INA219.h>
|
||||
|
||||
class INA219Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor
|
||||
@ -24,4 +24,4 @@ class INA219Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor
|
||||
virtual int16_t getCurrentMa() override;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
@ -3,9 +3,9 @@
|
||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "CurrentSensor.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "VoltageSensor.h"
|
||||
#include "CurrentSensor.h"
|
||||
#include <INA3221.h>
|
||||
|
||||
class INA3221Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor
|
||||
|
Loading…
Reference in New Issue
Block a user