diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2017-09-09 11:20:03 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2017-09-09 11:20:03 +0000 |
commit | 7da97fec6a03aaecd0238c5b7ac46651bbd080d5 (patch) | |
tree | da41c73bf474129c7832306f8898dd27d0a34307 /os/hal/src | |
parent | 66cf5195f983d64d24e708333907679529449b0b (diff) | |
download | ChibiOS-7da97fec6a03aaecd0238c5b7ac46651bbd080d5.tar.gz ChibiOS-7da97fec6a03aaecd0238c5b7ac46651bbd080d5.tar.bz2 ChibiOS-7da97fec6a03aaecd0238c5b7ac46651bbd080d5.zip |
Tentative implementation of USB host wake-up API.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10570 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r-- | os/hal/src/hal_usb.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/os/hal/src/hal_usb.c b/os/hal/src/hal_usb.c index b32bfc09f..61f03d832 100644 --- a/os/hal/src/hal_usb.c +++ b/os/hal/src/hal_usb.c @@ -632,6 +632,29 @@ bool usbStallTransmitI(USBDriver *usbp, usbep_t ep) { }
/**
+ * @brief Host wake-up procedure.
+ * @note It is silently ignored if the USB device is not in the
+ * @p USB_SUSPENDED state.
+ *
+ * @param[in] usbp pointer to the @p USBDriver object
+ *
+ * @api
+ */
+void usbWakeupHost(USBDriver *usbp) {
+
+ if (usbp->state == USB_SUSPENDED) {
+ /* Starting host wakeup procedure.*/
+ usb_lld_start_wakeup_host(usbp);
+
+ /* Holding it for the configured time, it must be 2..15 msecs.*/
+ osalThreadSleepMilliseconds(USB_HOST_WAKEUP_DURATION);
+
+ /* Stopping host wake up procedure.*/
+ usb_lld_stop_wakeup_host(usbp);
+ }
+}
+
+/**
* @brief USB reset routine.
* @details This function must be invoked when an USB bus reset condition is
* detected.
|