USB manual PLL control

pull/354/head
Alex Voinea 2024-05-04 20:19:59 +02:00 committed by DRracer
parent f240bb24d1
commit 454619bfd4
2 changed files with 9 additions and 1 deletions

View File

@ -7,7 +7,7 @@
#define FIXED_NUM_CONFIGURATIONS 1
#define INTERRUPT_CONTROL_ENDPOINT
#define USE_FLASH_DESCRIPTORS
#define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)
#define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_MANUAL_PLL)
#define NO_INTERNAL_SERIAL
#define NO_DEVICE_SELF_POWER
#define NO_DEVICE_REMOTE_WAKEUP

View File

@ -90,6 +90,14 @@ namespace usb {
CDC cdc;
void CDC::Init() {
#if defined(USE_STATIC_OPTIONS) && (USE_STATIC_OPTIONS & USB_OPT_MANUAL_PLL)
#if defined(USB_SERIES_4_AVR)
PLLFRQ = ((1 << PLLUSB) | (1 << PDIV3) | (1 << PDIV1));
#endif
USB_PLL_On();
while (!(USB_PLL_IsReady()));
#endif
USB_Init();
/* Create a regular character stream for the interface so that it can be used with the stdio.h functions */