diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index d8ad98d..251e4b9 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -58,6 +58,7 @@ public: void attach(); void detach(); // Serial port goes down too... void poll(); + bool wakeupHost(); // returns false, when wakeup cannot be processed }; extern USBDevice_ USBDevice; diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp index b0160e2..9095d79 100644 --- a/cores/arduino/USBCore.cpp +++ b/cores/arduino/USBCore.cpp @@ -78,6 +78,8 @@ const DeviceDescriptor USB_DeviceDescriptorB = //================================================================== volatile u8 _usbConfiguration = 0; +volatile u8 _usbCurrentStatus = 0; // meaning of bits see usb_20.pdf, Figure 9-4. Information Returned by a GetStatus() Request to a Device +volatile u8 _usbSuspendState = 0; // copy of UDINT to check SUSPI and WAKEUPI bits static inline void WaitIN(void) { @@ -329,7 +331,7 @@ static void InitEP(u8 index, u8 type, u8 size) { UENUM = index; - UECONX = 1; + UECONX = (1<