X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Output%2FpjrcUSB%2Favr%2Fusb_keyboard_serial.c;h=1403c9ae3ca06d83d7a5f72f26cbdcff11c83fca;hb=9e3d3aaca42c15edd3701334e6d6a3ffed41c463;hp=54586801eee45f1927355aac2d9a900b63747212;hpb=762e75d8759f80bc8433c21aa59a8276332793fc;p=kiibohd-controller.git diff --git a/Output/pjrcUSB/avr/usb_keyboard_serial.c b/Output/pjrcUSB/avr/usb_keyboard_serial.c index 5458680..1403c9a 100644 --- a/Output/pjrcUSB/avr/usb_keyboard_serial.c +++ b/Output/pjrcUSB/avr/usb_keyboard_serial.c @@ -590,8 +590,13 @@ void wdt_init() // initialize USB -void usb_init() +uint8_t usb_init() { + // Check to see if a usb cable has been plugged in + // XXX Not tested (also, not currently needed) -HaaTa + //if ( USB0_STAT & (1 << 1) + // return 0; + HW_CONFIG(); USB_FREEZE(); // enable USB PLL_CONFIG(); // config PLL @@ -604,6 +609,8 @@ void usb_init() // Disable watchdog timer after possible software reset //wdt_init(); // XXX Not working...seems to be ok without this, not sure though + + return 1; } // return 0 if the USB is not configured, or the configuration