mirror of
https://github.com/hathach/tinyusb.git
synced 2026-03-01 21:25:45 +00:00
Merge pull request #3126 from salkinium/fix/phyc_pll
[stm32] Wait until the PHYC PLL is stable
This commit is contained in:
@ -78,10 +78,16 @@
|
||||
#include "tusb_debug.h"
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Optional API implemented by application if needed
|
||||
// API implemented by application if needed
|
||||
// TODO move to a more obvious place/file
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Get current milliseconds, required by some port/configuration without RTOS
|
||||
extern uint32_t tusb_time_millis_api(void);
|
||||
|
||||
// Delay in milliseconds, use tusb_time_millis_api() by default. required by some port/configuration with no RTOS
|
||||
extern void tusb_time_delay_ms_api(uint32_t ms);
|
||||
|
||||
// flush data cache
|
||||
TU_ATTR_WEAK extern void tusb_app_dcache_flush(uintptr_t addr, uint32_t data_size);
|
||||
|
||||
|
||||
@ -233,6 +233,9 @@ static inline void dwc2_phy_init(dwc2_regs_t* dwc2, uint8_t hs_phy_type) {
|
||||
|
||||
// Enable PLL internal PHY
|
||||
USB_HS_PHYC->USB_HS_PHYC_PLL |= USB_HS_PHYC_PLL_PLLEN;
|
||||
|
||||
// Wait ~2ms until the PLL is ready (there's no RDY bit to query)
|
||||
tusb_time_delay_ms_api(2);
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
10
src/tusb.h
10
src/tusb.h
@ -170,16 +170,6 @@ bool tusb_deinit(uint8_t rhport);
|
||||
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// API Implemented by user
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
// Get current milliseconds, required by some port/configuration without RTOS
|
||||
uint32_t tusb_time_millis_api(void);
|
||||
|
||||
// Delay in milliseconds, use tusb_time_millis_api() by default. required by some port/configuration with no RTOS
|
||||
void tusb_time_delay_ms_api(uint32_t ms);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user