]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/lufa/LUFA-120730/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c
Merge commit 'a074364c3731d66b56d988c8a6c960a83ea0e0a1' as 'tmk_core'
[qmk_firmware.git] / tmk_core / protocol / lufa / LUFA-120730 / LUFA / Drivers / USB / Core / AVR8 / Device_AVR8.c
1 /*\r
2              LUFA Library\r
3      Copyright (C) Dean Camera, 2012.\r
4 \r
5   dean [at] fourwalledcubicle [dot] com\r
6            www.lufa-lib.org\r
7 */\r
8 \r
9 /*\r
10   Copyright 2012  Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
11 \r
12   Permission to use, copy, modify, distribute, and sell this\r
13   software and its documentation for any purpose is hereby granted\r
14   without fee, provided that the above copyright notice appear in\r
15   all copies and that both that the copyright notice and this\r
16   permission notice and warranty disclaimer appear in supporting\r
17   documentation, and that the name of the author not be used in\r
18   advertising or publicity pertaining to distribution of the\r
19   software without specific, written prior permission.\r
20 \r
21   The author disclaim all warranties with regard to this\r
22   software, including all implied warranties of merchantability\r
23   and fitness.  In no event shall the author be liable for any\r
24   special, indirect or consequential damages or any damages\r
25   whatsoever resulting from loss of use, data or profits, whether\r
26   in an action of contract, negligence or other tortious action,\r
27   arising out of or in connection with the use or performance of\r
28   this software.\r
29 */\r
30 \r
31 #include "../../../../Common/Common.h"\r
32 #if (ARCH == ARCH_AVR8)\r
33 \r
34 #define  __INCLUDE_FROM_USB_DRIVER\r
35 #include "../USBMode.h"\r
36 \r
37 #if defined(USB_CAN_BE_DEVICE)\r
38 \r
39 #include "../Device.h"\r
40 \r
41 void USB_Device_SendRemoteWakeup(void)\r
42 {\r
43         if (!(USB_Options & USB_OPT_MANUAL_PLL))\r
44         {\r
45                 USB_PLL_On();\r
46                 while (!(USB_PLL_IsReady()));\r
47         }\r
48 \r
49         USB_CLK_Unfreeze();\r
50 \r
51         UDCON |= (1 << RMWKUP);\r
52         while (UDCON & (1 << RMWKUP));\r
53 }\r
54 \r
55 #endif\r
56 \r
57 #endif\r