Integrated System wakeup into API

This commit is contained in:
Nico 2015-02-28 10:42:41 +01:00
parent 8fb1a2cb04
commit 2289569e7d
4 changed files with 9 additions and 7 deletions

View file

@ -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

View file

@ -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();

View file

@ -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);
}
}
}

View file

@ -1,4 +0,0 @@
Examples
========
Just try these examples once the HID Source is installed. Its pretty much self explaining.