From e55f28594cdb6094c2cc7bc21aaf263d970605d9 Mon Sep 17 00:00:00 2001 From: Stuart Ianna Date: Wed, 5 Jul 2023 11:49:21 +1000 Subject: [PATCH] examples/calib_udelay: Allow the number of delay loop iterations to be specified by kconfig. The calibration test can take a long time on platforms with less processing power. Allow the default value to be changed with kconfig. --- examples/calib_udelay/Kconfig | 6 ++++++ examples/calib_udelay/calib_udelay_main.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/calib_udelay/Kconfig b/examples/calib_udelay/Kconfig index a6a8e6932..97b059285 100644 --- a/examples/calib_udelay/Kconfig +++ b/examples/calib_udelay/Kconfig @@ -22,4 +22,10 @@ config EXAMPLES_CALIB_UDELAY_NUM_RESULTS int "Number of results to generate for calibration slope" default 20 +config EXAMPLES_CALIB_UDELAY_DELAY_TEST_ITERATIONS + int "Delay loop interrations per test." + default 100000 + ---help--- + Lower numbers decrease the time taken for the test to complete, + but may reduce the accuracy of the results. endif diff --git a/examples/calib_udelay/calib_udelay_main.c b/examples/calib_udelay/calib_udelay_main.c index 5f1abbf57..8f3638a13 100644 --- a/examples/calib_udelay/calib_udelay_main.c +++ b/examples/calib_udelay/calib_udelay_main.c @@ -43,7 +43,7 @@ # define CONFIG_EXAMPLES_CALIB_UDELAY_NUM_RESULTS 20 #endif -#define DELAY_TEST_ITERS 100000 +#define DELAY_TEST_ITERS CONFIG_EXAMPLES_CALIB_UDELAY_DELAY_TEST_ITERATIONS /**************************************************************************** * Private Types