Skip to content

Commit

Permalink
arm/rp2040,rp2350: Use BOARD_XOSC_FREQ for calculating startup delay
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ids1024 authored and anchao committed Jan 18, 2025
1 parent 9f5a453 commit 4401036
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/arm/src/rp2040/rp2040_xosc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/rp23xx/rp23xx_xosc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 4401036

Please sign in to comment.