From: Jonathan McDowell Date: Thu, 10 May 2018 07:04:53 +0000 (+0100) Subject: Do USB disconnect/reconnect dance before initialising USB X-Git-Url: https://the.earth.li/gitweb/?p=temper-clone.git;a=commitdiff_plain;h=f259a83606c7e6692970cd0ec814a7414a481938 Do USB disconnect/reconnect dance before initialising USB According to http://vusb.wikidot.com/driver-api the initial usbDeviceDisconnect() / usbDeviceConnect() for enumeration should be called before doing the usbInit(). Haven't seen problems as a result, but do so. --- diff --git a/main.c b/main.c index a75a4fc..4e3d72c 100644 --- a/main.c +++ b/main.c @@ -375,17 +375,16 @@ int main(void) w1_setup(); set_serial(); - usbInit(); usbDeviceDisconnect(); - i = 0; while (--i) { wdt_reset(); _delay_ms(1); } - usbDeviceConnect(); + usbInit(); + /* PB1 as output for LED */ DDRB |= 1 << PB1;