Add immediate response for usb cable plug in / removal
This commit is contained in:
+8
-1
@@ -7,7 +7,14 @@ void HalGPIO::begin() {
|
||||
pinMode(UART0_RXD, INPUT);
|
||||
}
|
||||
|
||||
void HalGPIO::update() { inputMgr.update(); }
|
||||
void HalGPIO::update() {
|
||||
inputMgr.update();
|
||||
const bool connected = isUsbConnected();
|
||||
usbStateChanged = (connected != lastUsbConnected);
|
||||
lastUsbConnected = connected;
|
||||
}
|
||||
|
||||
bool HalGPIO::wasUsbStateChanged() const { return usbStateChanged; }
|
||||
|
||||
bool HalGPIO::isPressed(uint8_t buttonIndex) const { return inputMgr.isPressed(buttonIndex); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user