mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-15 09:32:08 +00:00
Merge branch 'master' into tft-gui-work
This commit is contained in:
commit
1dec9ea7e5
2
.vscode/extensions.json
vendored
2
.vscode/extensions.json
vendored
@ -6,4 +6,4 @@
|
|||||||
"platformio.platformio-ide",
|
"platformio.platformio-ide",
|
||||||
"trunk.io"
|
"trunk.io"
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -59,9 +59,18 @@ class PowerStatus : public Status
|
|||||||
int getBatteryVoltageMv() const { return batteryVoltageMv; }
|
int getBatteryVoltageMv() const { return batteryVoltageMv; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note: 0% battery means 'unknown/this board doesn't have a battery installed'
|
* Note: for boards with battery pin or PMU, 0% battery means 'unknown/this board doesn't have a battery installed'
|
||||||
*/
|
*/
|
||||||
|
#if defined(HAS_PMU) || defined(BATTERY_PIN)
|
||||||
uint8_t getBatteryChargePercent() const { return getHasBattery() ? batteryChargePercent : 0; }
|
uint8_t getBatteryChargePercent() const { return getHasBattery() ? batteryChargePercent : 0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Note: for boards without battery pin and PMU, 101% battery means 'the board is using external power'
|
||||||
|
*/
|
||||||
|
#if !defined(HAS_PMU) && !defined(BATTERY_PIN)
|
||||||
|
uint8_t getBatteryChargePercent() const { return getHasBattery() ? batteryChargePercent : 101; }
|
||||||
|
#endif
|
||||||
|
|
||||||
bool matches(const PowerStatus *newStatus) const
|
bool matches(const PowerStatus *newStatus) const
|
||||||
{
|
{
|
||||||
|
@ -40,6 +40,7 @@ Board Information: https://wiki.uniteng.com/en/meshtastic/station-g2
|
|||||||
#define SX126X_MAX_POWER 19
|
#define SX126X_MAX_POWER 19
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
#define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
#define BATTERY_PIN 4 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage
|
||||||
#define ADC_CHANNEL ADC1_GPIO4_CHANNEL
|
#define ADC_CHANNEL ADC1_GPIO4_CHANNEL
|
||||||
#define ADC_MULTIPLIER 4
|
#define ADC_MULTIPLIER 4
|
||||||
@ -50,3 +51,4 @@ Board Information: https://wiki.uniteng.com/en/meshtastic/station-g2
|
|||||||
#define BAT_NOBATVOLT 4460
|
#define BAT_NOBATVOLT 4460
|
||||||
#define CELL_TYPE_LION // same curve for liion/lipo
|
#define CELL_TYPE_LION // same curve for liion/lipo
|
||||||
#define NUM_CELLS 2
|
#define NUM_CELLS 2
|
||||||
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user