Skip to content

Commit a0eef14

Browse files
Hi-Im-DavidErdem Simsek
authored andcommitted
[nrf fromtree] tests: drivers: Update AUXPLL test to use frequency Macros
Eliminate the need for magic numbers when setting AUXPLL_FREQ_OUT Signed-off-by: David Jewsbury <[email protected]> (cherry picked from commit 9a3a954)
1 parent df58d67 commit a0eef14

File tree

1 file changed

+4
-11
lines changed
  • tests/drivers/clock_control/nrf_clock_control/src

1 file changed

+4
-11
lines changed

tests/drivers/clock_control/nrf_clock_control/src/main.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,17 +162,10 @@ static const struct test_clk_context lfclk_test_clk_contexts[] = {
162162
#define AUXPLL_NODE DT_INST(0, AUXPLL_COMPAT)
163163
#define AUXPLL_FREQ DT_PROP(AUXPLL_NODE, nordic_frequency)
164164

165-
/* Gets selected AUXPLL DIV and selects the expected frequency */
166-
#if AUXPLL_FREQ == NRF_AUXPLL_FREQUENCY_DIV_MIN
167-
#define AUXPLL_FREQ_OUT 80000000
168-
#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_44K1
169-
#define AUXPLL_FREQ_OUT 11289591
170-
#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_USB_24M
171-
#define AUXPLL_FREQ_OUT 24000000
172-
#elif AUXPLL_FREQ == NRF_AUXPLL_FREQ_DIV_AUDIO_48K
173-
#define AUXPLL_FREQ_OUT 12287963
174-
#else
175-
/*No use case for NRF_AUXPLL_FREQ_DIV_MAX or others yet*/
165+
166+
/* Gets expected AUXPLL frequency */
167+
#define AUXPLL_FREQ_OUT CLOCK_CONTROL_NRF_AUXPLL_GET_FREQ(AUXPLL_NODE)
168+
#if AUXPLL_FREQ_OUT == 0
176169
#error "Unsupported AUXPLL frequency selection"
177170
#endif
178171

0 commit comments

Comments
 (0)