5 Replies Latest reply on Sep 21, 2020 9:36 PM by YashwantK_46

    Make computer wake up from sleep with HID?

    DiDi_4439146

      Hi,

       

      I am using the hid_examples/cyfx3_hid example. With my current mouse if the computer is in sleep mode and I press any button on the mouse - the computer will wake up. How do I implement this in the hid example?

        • 1. Re: Make computer wake up from sleep with HID?
          YashwantK_46

          Hello,

           

          The default hid_examples/cyfx3_hid example can be used without any changes to wake up the PC when the screen turns off automatically by pressing the switch 'SW2'.

           

          I have tried this as follows (on a Windows 10 host PC):

          1.) Change the Power and Sleep setting in the Settings application to go to sleep in '1 minute'.
          2.) The FX3 superspeed explorer kit is programmed with the MouseDemo.img and allowed the PC to go into sleep.3.) Press the switch SW2, wakes up the PC to the log-in screen of windows (as expected, like with a real mouse).

           

          Please try as mentioned above and let me know if you face any issues.


          Regards,Yashwant

          • 2. Re: Make computer wake up from sleep with HID?
            DiDi_4439146

            Hi Yashwant,

             

            Sorry I don't think I was clear in my first post. I don't mean when the screen turns off I mean when the PC goes into this sleep mode (screenshot added)

             

             

             

            I think this is also called "hibernation" mode. With other mice, all I need to do is pretty the mouse button and the computer wakes up from this state.

            • 3. Re: Make computer wake up from sleep with HID?
              YashwantK_46

              Hello DiDi_4439146,

               

              Please refer to the attached firmware with the remote wake up from sleep enabled.
              Please test and let me know if you face any issues.


              Apologies for the delay.


              Regards,

              Yashwant

              1 of 1 people found this helpful
              • 4. Re: Make computer wake up from sleep with HID?
                DiDi_4439146

                Hi Yashwant,

                 

                This worked for me - can you please explain the purpose of this code though?

                 

                if ((bTarget == CY_U3P_USB_TARGET_DEVICE) && (bRequest == CY_U3P_USB_SC_SET_FEATURE)){

                        //    switch (wValue)

                    {

                        case CY_U3P_USB2_FS_REMOTE_WAKE:

                            CyU3PDeviceReset(CyFalse);

                            break;

                    }

                 

                }

                • 5. Re: Make computer wake up from sleep with HID?
                  YashwantK_46

                  Hello,

                   

                  Apologies about that.
                  That piece of code was added for debug purposes and i forgot to remove it before sharing it with you.

                   

                  Please comment out or remove the code from the firmware:

                   

                  if ((bTarget == CY_U3P_USB_TARGET_DEVICE) && (bRequest == CY_U3P_USB_SC_SET_FEATURE)){

                          //    switch (wValue)

                      {

                          case CY_U3P_USB2_FS_REMOTE_WAKE:

                              CyU3PDeviceReset(CyFalse);

                              break;

                      }

                   

                  Regards,

                  Yashwant