Go Down

Topic: leonardo as keyboard does not wake windows 7 from sleep (Read 8117 times) previous topic - next topic

bam80

Mike, thank you for the explanation.
As I understand, Keyboard.systemControl() is not for S3 suspend, but rather for S1. Am I right?
If your code incorporated to Arduino, should we update Documentation as well?

Mike T

I'm not that confident with the power levels S1 to S5. Microsoft describes their interpretation here:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa373229%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/hardware/ff564575%28v=vs.85%29.aspx

I haven't found reasonable information which of these system power modes maps to which device mode D0 to D4 for the USB ports. This might even change between operating systems versions or different operating systems.

Actually it doesn't matter, the only relevant points which matter are:
  • is the USB bus suspended
  • has the operating system enabled the USB wakep feature before suspending the USB bus

Both is handled in wakeupHost():
 && (_usbSuspendState & (1<<SUSPI))
 && (_usbCurrentStatus & FEATURE_REMOTE_WAKEUP_ENABLED))

From a usability perspective, it would be good to provide an extra function on top of the systemControl() and wakeupHost() function or replace the wakeUp function:

Code: [Select]
bool Wakeup() {
  if(USBDevice.wakeupHost()) {
    return true;
  } else {
    return (Keyboard.systemControl(SYSTEM_CONTROL_WAKEUP) == 1);
  }
}


In my tests I've never used SYSTEM_CONTROL_WAKEUP.

  Michael

bam80

Thank you Michael.
Hope this stuff will find it's land in Arduino)

Exxo

Hi, could anybody update sleep/wakeup patch to current arduino-1.6.7 version?

I can`t use older version, because i installed windows 10 and HID devices don`t work there after reboot - https://forum.arduino.cc/index.php?topic=339139.0


Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy