Add configurable battery and USB display behavior
Persist separate display modes and timeouts in seconds for battery and USB power, expose four controls in WebConfig and CLI, and apply one shared policy across display-equipped roles. Detect R8 external power from a USB host or calibrated battery voltage above 4.21 V, with cached sampling and hysteresis. Add policy, persistence, browser, and R8 power-detection regression coverage.
This commit is contained in:
1 parent
d83153e935
commit
a814a00ce7
39 files changed
+3187
-2488
No files matched your search
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "DisplayBuildFlags.h"
|
||||
#include "DisplayPowerPolicy.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@@ -15,6 +16,7 @@ public:
|
||||
|
||||
class DisplayDriver {
|
||||
int _w, _h;
|
||||
mesh::ui::DisplayPowerPolicy _power_policy;
|
||||
protected:
|
||||
DisplayDriver(int w, int h) { _w = w; _h = h; }
|
||||
void setDimensions(int w, int h) { _w = w; _h = h; }
|
||||
@@ -52,6 +54,10 @@ public:
|
||||
virtual void forceFullRefresh() {} // next refresh will be full for eink
|
||||
virtual void turnOn() = 0;
|
||||
virtual void turnOff() = 0;
|
||||
// Returns whether the panel state changed, allowing cached UIs to redraw.
|
||||
bool servicePower(bool usb_power, bool app_connected = false, bool pairing = false);
|
||||
bool wake(mesh::ui::DisplayWake reason);
|
||||
void dismiss();
|
||||
virtual void clear() = 0;
|
||||
virtual void startFrame(ColorVal bkg = UIColor::window_bkg) = 0;
|
||||
virtual void setTextSize(int sz) = 0;
|
||||
|
||||
Reference in new issue
Block a user