9 static void SetupHardware(void)
11 /* Disable watchdog if enabled by bootloader/fuses */
12 MCUSR &= ~(1 << WDRF);
15 /* Disable clock division */
16 clock_prescale_set(clock_div_1);
18 // Leonardo needs. Without this USB device is not recognized.
24 USB_Device_EnableSOFEvents();
25 print_set_sendchar(sendchar);
28 int main(void) __attribute__ ((weak));
34 /* wait for USB startup & debug output */
35 while (USB_DeviceState != DEVICE_STATE_Configured) {
36 #if defined(INTERRUPT_CONTROL_ENDPOINT)
42 print("USB configured.\n");
46 host_set_driver(&lufa_driver);
47 #ifdef SLEEP_LED_ENABLE
51 print("Keyboard start.\n");
53 while (USB_DeviceState == DEVICE_STATE_Suspended) {
55 if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) {
56 USB_Device_SendRemoteWakeup();
62 #if !defined(INTERRUPT_CONTROL_ENDPOINT)