Add immediate response for usb cable plug in / removal
This commit is contained in:
@@ -23,6 +23,9 @@ class HalGPIO {
|
||||
InputManager inputMgr;
|
||||
#endif
|
||||
|
||||
bool lastUsbConnected = false;
|
||||
bool usbStateChanged = false;
|
||||
|
||||
public:
|
||||
HalGPIO() = default;
|
||||
|
||||
@@ -41,6 +44,9 @@ class HalGPIO {
|
||||
// Check if USB is connected
|
||||
bool isUsbConnected() const;
|
||||
|
||||
// Returns true once per edge (plug or unplug) since the last update()
|
||||
bool wasUsbStateChanged() const;
|
||||
|
||||
enum class WakeupReason { PowerButton, AfterFlash, AfterUSBPower, Other };
|
||||
|
||||
WakeupReason getWakeupReason() const;
|
||||
|
||||
Reference in New Issue
Block a user