Fix functionality when coming from boot loader
This commit is contained in:
parent
0627841025
commit
49a33c5b06
12
usb.c
12
usb.c
|
@ -707,6 +707,18 @@ static void pll_init(void)
|
||||||
|
|
||||||
void usb_init(const struct usb_parameters *params)
|
void usb_init(const struct usb_parameters *params)
|
||||||
{
|
{
|
||||||
|
// Initialize the registers to the default values
|
||||||
|
// from the datasheet. The bootloader that sometimes
|
||||||
|
// runs before we get here (when doing updates) leaves
|
||||||
|
// different values...
|
||||||
|
#ifdef UHWCON
|
||||||
|
UHWCON = 0x80;
|
||||||
|
#endif
|
||||||
|
USBCON = 0x20;
|
||||||
|
UDCON = 0x01;
|
||||||
|
UDIEN = 0x00;
|
||||||
|
UDADDR = 0x00;
|
||||||
|
|
||||||
g_params = params;
|
g_params = params;
|
||||||
|
|
||||||
// Set some initial values
|
// Set some initial values
|
||||||
|
|
Loading…
Reference in New Issue