fix #49: make debug screen show real data

* Break out debug screen to a separate class and make it thread-safe.
* Break out power state to a separate class.
* Show battery voltage, charging & USB status on debug screen.
* Show GPS lock / no lock
* Fix an off-by-one that I introduced earlier in `drawRows`.
This commit is contained in:
Girts Folkmanis
2020-03-26 09:24:53 -07:00
parent 4c35d1f207
commit 54cd082bfe
6 changed files with 196 additions and 52 deletions

18
src/power.h Normal file
View File

@@ -0,0 +1,18 @@
#pragma once
namespace meshtastic
{
/// Describes the state of the power system.
struct PowerStatus {
/// Whether we have a battery connected
bool haveBattery;
/// Battery voltage in mV, valid if haveBattery is true
int batteryVoltageMv;
/// Whether USB is connected
bool usb;
/// Whether we are charging the battery
bool charging;
};
} // namespace meshtastic