mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-21 17:20:01 +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
|
#ifdef EXT_CHRG_DETECT
|
||||||
return digitalRead(EXT_CHRG_DETECT) == ext_chrg_detect_value;
|
return digitalRead(EXT_CHRG_DETECT) == ext_chrg_detect_value;
|
||||||
#else
|
#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()) {
|
if (hasINA()) {
|
||||||
// get current flow from INA sensor - negative value means power flowing into the battery
|
// get current flow from INA sensor - negative value means power flowing into the battery
|
||||||
// default assuming BATTERY+ <--> INA_VIN+ <--> SHUNT RESISTOR <--> INA_VIN- <--> LOAD
|
// default assuming BATTERY+ <--> INA_VIN+ <--> SHUNT RESISTOR <--> INA_VIN- <--> LOAD
|
||||||
@ -472,7 +473,8 @@ class AnalogBatteryLevel : public HasBatteryLevel
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t getINACurrent() {
|
int16_t getINACurrent()
|
||||||
|
{
|
||||||
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) {
|
if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA219].first == config.power.device_battery_ina_address) {
|
||||||
return ina219Sensor.getCurrentMa();
|
return ina219Sensor.getCurrentMa();
|
||||||
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA3221].first ==
|
} else if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_INA3221].first ==
|
||||||
|
@ -10,5 +10,4 @@ class CurrentSensor
|
|||||||
virtual int16_t getCurrentMa() = 0;
|
virtual int16_t getCurrentMa() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -3,9 +3,9 @@
|
|||||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||||
|
|
||||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||||
|
#include "CurrentSensor.h"
|
||||||
#include "TelemetrySensor.h"
|
#include "TelemetrySensor.h"
|
||||||
#include "VoltageSensor.h"
|
#include "VoltageSensor.h"
|
||||||
#include "CurrentSensor.h"
|
|
||||||
#include <Adafruit_INA219.h>
|
#include <Adafruit_INA219.h>
|
||||||
|
|
||||||
class INA219Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor
|
class INA219Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
#if HAS_TELEMETRY && !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||||
|
|
||||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||||
|
#include "CurrentSensor.h"
|
||||||
#include "TelemetrySensor.h"
|
#include "TelemetrySensor.h"
|
||||||
#include "VoltageSensor.h"
|
#include "VoltageSensor.h"
|
||||||
#include "CurrentSensor.h"
|
|
||||||
#include <INA3221.h>
|
#include <INA3221.h>
|
||||||
|
|
||||||
class INA3221Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor
|
class INA3221Sensor : public TelemetrySensor, VoltageSensor, CurrentSensor
|
||||||
|
Loading…
Reference in New Issue
Block a user