Integrated System wakeup into API
This commit is contained in:
parent
8fb1a2cb04
commit
2289569e7d
4 changed files with 9 additions and 7 deletions
|
|
@ -72,6 +72,7 @@ Version History
|
|||
* Arduino as ISP fix for 328
|
||||
* Upload verification on USB hubs fix for HL2.0.4
|
||||
* No USB workaround for Leonardo integrated into variants
|
||||
* Changed USB Wakeup in System API
|
||||
|
||||
2.1 Release (28.01.2015)
|
||||
* Reworked the whole USB-Core from scratch
|
||||
|
|
|
|||
|
|
@ -59,7 +59,12 @@ public:
|
|||
release();
|
||||
}
|
||||
inline void press(uint8_t s){
|
||||
HID_SendReport(HID_REPORTID_SYSTEMCONTROL, &s, sizeof(s));
|
||||
#ifdef USBCON
|
||||
if (s == SYSTEM_WAKE_UP)
|
||||
USBDevice.wakeupHost();
|
||||
else
|
||||
#endif
|
||||
HID_SendReport(HID_REPORTID_SYSTEMCONTROL, &s, sizeof(s));
|
||||
}
|
||||
inline void release(void){
|
||||
begin();
|
||||
|
|
|
|||
|
|
@ -39,10 +39,10 @@ void loop() {
|
|||
|
||||
// tries to wake up the PC
|
||||
// this might fail on some PCs where USB wakeup isnt supported
|
||||
USBDevice.wakeupHost();
|
||||
System.write(SYSTEM_WAKE_UP);
|
||||
|
||||
// simple debounce
|
||||
delay(300);
|
||||
digitalWrite(pinLed, LOW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
Examples
|
||||
========
|
||||
|
||||
Just try these examples once the HID Source is installed. Its pretty much self explaining.
|
||||
Loading…
Reference in a new issue