mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 10:51:57 +00:00
feat(ui-new): a bolt beside the battery while USB power is connected
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
643dc09615
commit
6e13ad59ae
@@ -16,9 +16,14 @@ class SimMainBoard : public mesh::MainBoard {
|
||||
// plumbed through, same reasoning as SimLocationProvider.h's singleton.
|
||||
static uint16_t& battMilliVoltsRef() { static uint16_t mv = 4000; return mv; }
|
||||
|
||||
static bool& externalPowerRef() { static bool on = false; return on; }
|
||||
|
||||
public:
|
||||
void begin() { }
|
||||
|
||||
bool isExternalPowered() override { return externalPowerRef(); }
|
||||
static void setExternalPower(bool on) { externalPowerRef() = on; }
|
||||
|
||||
uint16_t getBattMilliVolts() override { return battMilliVoltsRef(); }
|
||||
static void setBattMilliVolts(uint16_t mv) { battMilliVoltsRef() = mv; }
|
||||
const char* getManufacturerName() const override { return "MeshCore Sim (native)"; }
|
||||
@@ -43,4 +48,7 @@ public:
|
||||
extern "C" inline EMSCRIPTEN_KEEPALIVE void sim_battery_set_mv(int mv) {
|
||||
SimMainBoard::setBattMilliVolts((uint16_t)mv);
|
||||
}
|
||||
extern "C" inline EMSCRIPTEN_KEEPALIVE void sim_external_power_set(int on) {
|
||||
SimMainBoard::setExternalPower(on != 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user