Skip to content

Commit 25fd5b2

Browse files
committed
review tweaks
1 parent 459a83b commit 25fd5b2

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

src/rp2040/hardware_regs/include/hardware/platform_defs.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,18 @@
6161
#endif
6262
#endif
6363

64+
// PICO_CONFIG: PICO_USE_FASTEST_SUPPORTED_CLOCK, Use the fastest officially supported clock by default, type=bool, default=0, group=hardware_base
65+
#ifndef PICO_USE_FASTEST_SUPPORTED_CLOCK
66+
#define PICO_USE_FASTEST_SUPPORTED_CLOCK 0
67+
#endif
68+
6469
// PICO_CONFIG: SYS_CLK_HZ, System operating frequency in Hz, type=int, default=125000000, advanced=true, group=hardware_base
6570
#ifndef SYS_CLK_HZ
6671
#ifdef SYS_CLK_KHZ
6772
#define SYS_CLK_HZ ((SYS_CLK_KHZ) * _u(1000))
6873
#elif defined(SYS_CLK_MHZ)
6974
#define SYS_CLK_HZ ((SYS_CLK_MHZ) * _u(1000000))
7075
#else
71-
// PICO_CONFIG: PICO_USE_FASTEST_SUPPORTED_CLOCK, Use the fastest officially supported clock by default, type=bool, default=0, group=hardware_base
72-
#ifndef PICO_USE_FASTEST_SUPPORTED_CLOCK
73-
#define PICO_USE_FASTEST_SUPPORTED_CLOCK 0
74-
#endif
7576
#if PICO_USE_FASTEST_SUPPORTED_CLOCK
7677
#define SYS_CLK_HZ _u(200000000)
7778
#else

src/rp2350/hardware_regs/include/hardware/platform_defs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@
8989
#endif
9090
#endif
9191

92+
// PICO_CONFIG: PICO_USE_FASTEST_SUPPORTED_CLOCK, Use the fastest officially supported clock by default, type=bool, default=0, group=hardware_base
93+
#ifndef PICO_USE_FASTEST_SUPPORTED_CLOCK
94+
#define PICO_USE_FASTEST_SUPPORTED_CLOCK 0
95+
#endif
96+
9297
// PICO_CONFIG: SYS_CLK_HZ, System operating frequency in Hz, type=int, default=150000000, advanced=true, group=hardware_base
9398
#ifndef SYS_CLK_HZ
9499
#ifdef SYS_CLK_KHZ

src/rp2_common/hardware_clocks/include/hardware/clocks.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,11 @@ extern "C" {
231231
#endif
232232
#endif // PICO_RP2040 && SYS_CLK_KHZ == 200000 && XOSC_KHZ == 12000 && PLL_COMMON_REFDIV == 1
233233

234+
// PICO_CONFIG: SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST_DELAY_MS, Number of milliseconds to wait after updating regular voltage due to SYS_CLK_VREG_VOLTAGE_MIN to allow voltage to settle, type=bool, default=1, advanced=true, group=hardware_clocks
235+
#ifndef SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST_DELAY_MS
236+
#define SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST_DELAY_MS 1
237+
#endif
238+
234239
#if !defined(PLL_SYS_VCO_FREQ_HZ) || !defined(PLL_SYS_POSTDIV1) || !defined(PLL_SYS_POSTDIV2)
235240
#error PLL_SYS_VCO_FREQ_HZ, PLL_SYS_POSTDIV1 and PLL_SYS_POSTDIV2 must all be specified when using custom clock setup
236241
#endif

src/rp2_common/pico_runtime_init/runtime_init_clocks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void __weak runtime_init_clocks(void) {
7373
if (vreg_get_voltage() < SYS_CLK_VREG_VOLTAGE_MIN) {
7474
vreg_set_voltage(SYS_CLK_VREG_VOLTAGE_MIN);
7575
// wait for voltage to settle
76-
busy_wait_ms(1);
76+
busy_wait_ms(SYS_CLK_VREG_VOLTAGE_AUTO_ADJUST_DELAY_MS);
7777
}
7878
#endif
7979
// Configure clocks

0 commit comments

Comments
 (0)