mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 02:09:57 +00:00
User experience improvement - app battery icon (#3979)
* 'app_battery_icon' * Undo VS automatic modifications to this file * 'app_battery_icon_2'
This commit is contained in:
parent
77cf5c6200
commit
038413f46f
2
.vscode/extensions.json
vendored
2
.vscode/extensions.json
vendored
@ -6,4 +6,4 @@
|
||||
"platformio.platformio-ide",
|
||||
"trunk.io"
|
||||
],
|
||||
}
|
||||
}
|
||||
|
@ -59,9 +59,18 @@ class PowerStatus : public Status
|
||||
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; }
|
||||
#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
|
||||
{
|
||||
|
@ -40,6 +40,7 @@ Board Information: https://wiki.uniteng.com/en/meshtastic/station-g2
|
||||
#define SX126X_MAX_POWER 19
|
||||
#endif
|
||||
|
||||
/*
|
||||
#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_MULTIPLIER 4
|
||||
@ -50,3 +51,4 @@ Board Information: https://wiki.uniteng.com/en/meshtastic/station-g2
|
||||
#define BAT_NOBATVOLT 4460
|
||||
#define CELL_TYPE_LION // same curve for liion/lipo
|
||||
#define NUM_CELLS 2
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user