mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 07:46:16 +08:00
arm/rp2040,rp2350: Use BOARD_XOSC_FREQ for calculating startup delay
Previously this used a hard-coded value of 12 MHz, but this presumably should use `BOARD_XOSC_FREQ`. Similarly to how it is done in pico-sdk. It looks like all boards are currently defined to use 12 MHz XOSC clocks, so this won't change behavior with any of them. Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
This commit is contained in:
committed by
archer
parent
9f5a45340f
commit
4401036406
@@ -80,7 +80,7 @@ void rp2040_xosc_init(void)
|
||||
|
||||
/* Set xosc startup delay */
|
||||
|
||||
uint32_t startup_delay = (((12 * MHZ) / 1000) + 128) / 256;
|
||||
uint32_t startup_delay = ((BOARD_XOSC_FREQ / 1000) + 128) / 256;
|
||||
putreg32(startup_delay, RP2040_XOSC_STARTUP);
|
||||
|
||||
/* Set the enable bit now that we have set freq range and startup delay */
|
||||
|
||||
@@ -78,7 +78,7 @@ void rp23xx_xosc_init(void)
|
||||
|
||||
/* Set xosc startup delay */
|
||||
|
||||
uint32_t startup_delay = (((12 * MHZ) / 1000) + 128) / 256;
|
||||
uint32_t startup_delay = ((BOARD_XOSC_FREQ / 1000) + 128) / 256;
|
||||
putreg32(startup_delay, RP23XX_XOSC_STARTUP);
|
||||
|
||||
/* Set the enable bit now that we have set freq range and startup delay */
|
||||
|
||||
Reference in New Issue
Block a user