]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Send usb wakeup through ChibiOS
authorFred Sundvik <fsundvik@gmail.com>
Sat, 3 Feb 2018 10:55:56 +0000 (12:55 +0200)
committerJack Humbert <jack.humb@gmail.com>
Wed, 7 Feb 2018 22:16:01 +0000 (17:16 -0500)
tmk_core/protocol/chibios/main.c
tmk_core/protocol/chibios/usb_main.c
tmk_core/protocol/chibios/usb_main.h

index 7138b5535c590591bae3479cbf043eb3eb33deeb..47a7eb09abc1a19ea49bc8db0744b7910f20fc8b 100644 (file)
@@ -165,8 +165,8 @@ int main(void) {
 #endif
         suspend_power_down(); // on AVR this deep sleeps for 15ms
         /* Remote wakeup */
-        if((USB_DRIVER.status & 2) && suspend_wakeup_condition()) {
-          send_remote_wakeup(&USB_DRIVER);
+        if(suspend_wakeup_condition()) {
+          usbWakeupHost(&USB_DRIVER);
         }
       }
       /* Woken up */
index 6173d3ad1c5993c39b9664238e6b873044a5d624..caa2770b5c53f5ecd08b6241ee3946aca2f9e587 100644 (file)
@@ -1036,27 +1036,6 @@ void init_usb_driver(USBDriver *usbp) {
 #endif
 }
 
-/*
- * Send remote wakeup packet
- * Note: should not be called from ISR
- */
-void send_remote_wakeup(USBDriver *usbp) {
-  (void)usbp;
-#if defined(K20x) || defined(KL2x)
-#if KINETIS_USB_USE_USB0
-  USB0->CTL |= USBx_CTL_RESUME;
-  wait_ms(15);
-  USB0->CTL &= ~USBx_CTL_RESUME;
-#endif /* KINETIS_USB_USE_USB0 */
-#elif defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) /* End K20x || KL2x */
-  STM32_USB->CNTR |= CNTR_RESUME;
-  wait_ms(15);
-  STM32_USB->CNTR &= ~CNTR_RESUME;
-#else /* End STM32F0XX || STM32F1XX || STM32F3XX */
-#warning Sending remote wakeup packet not implemented for your platform.
-#endif
-}
-
 /* ---------------------------------------------------------
  *                  Keyboard functions
  * ---------------------------------------------------------
index 30d8fcaef72a7786f0b23a0af6d0236759d130ba..b4f894f2f3dac66db9e8194142b84ac6d02e3c2b 100644 (file)
@@ -36,9 +36,6 @@
 /* Initialize the USB driver and bus */
 void init_usb_driver(USBDriver *usbp);
 
-/* Send remote wakeup packet */
-void send_remote_wakeup(USBDriver *usbp);
-
 /* ---------------
  * Keyboard header
  * ---------------