Merge pull request #141 from qmk/17.6.3_fixes
Add usb_lld_wakeup_host for Kinetis
This commit is contained in:
commit
14c851fdab
|
@ -76,6 +76,13 @@
|
|||
#define KINETIS_USB_ENDPOINTS USB_MAX_ENDPOINTS+1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Host wake-up procedure duration.
|
||||
*/
|
||||
#if !defined(USB_HOST_WAKEUP_DURATION) || defined(__DOXYGEN__)
|
||||
#define USB_HOST_WAKEUP_DURATION 2
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Derived constants and error checks. */
|
||||
/*===========================================================================*/
|
||||
|
@ -97,6 +104,10 @@
|
|||
#error "KINETIS_USB_IRQ_VECTOR not defined"
|
||||
#endif
|
||||
|
||||
#if (USB_HOST_WAKEUP_DURATION < 2) || (USB_HOST_WAKEUP_DURATION > 15)
|
||||
#error "invalid USB_HOST_WAKEUP_DURATION setting, it must be between 2 and 15"
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver data structures and types. */
|
||||
/*===========================================================================*/
|
||||
|
@ -394,6 +405,18 @@ struct USBDriver {
|
|||
#endif /* KINETIS_USB0_IS_USBOTG */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Start of host wake-up procedure.
|
||||
*
|
||||
* @notapi
|
||||
*/
|
||||
#define usb_lld_wakeup_host(usbp) \
|
||||
do{ \
|
||||
USB0->CTL |= USBx_CTL_RESUME; \
|
||||
osalThreadSleepMilliseconds(USB_HOST_WAKEUP_DURATION); \
|
||||
USB0->CTL &= ~USBx_CTL_RESUME; \
|
||||
} while (false)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* External declarations. */
|
||||
/*===========================================================================*/
|
||||
|
|
Loading…
Reference in New Issue