From f259a83606c7e6692970cd0ec814a7414a481938 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Thu, 10 May 2018 08:04:53 +0100 Subject: [PATCH] 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. --- main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.39.2