tests: kernel: tickless: tickless_concept: Support more frequencies
Test was assuming that CONFIG_SYS_CLOCK_TICKS_PER_SEC=100 but such frequency is not well supported on SoC which are based on 32768 Hz RTC clock. Align test to be able to work with different sys_clock frequency by converting previously 20 ticks to milliseconds. Set CONFIG_SYS_CLOCK_TICKS_PER_SEC=32768 when system clock is using Nordic RTC timer driver. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
589333e4d9
commit
5cbae7f2b6
3 changed files with 9 additions and 2 deletions
8
tests/kernel/tickless/tickless_concept/Kconfig
Normal file
8
tests/kernel/tickless/tickless_concept/Kconfig
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2025 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config SYS_CLOCK_TICKS_PER_SEC
|
||||
default 32768 if NRF_RTC_TIMER
|
||||
default 100
|
||||
|
||||
source "Kconfig.zephyr"
|
|
@ -1,3 +1,2 @@
|
|||
CONFIG_ZTEST=y
|
||||
CONFIG_SYS_CLOCK_TICKS_PER_SEC=100
|
||||
CONFIG_MP_MAX_NUM_CPUS=1
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
static K_THREAD_STACK_ARRAY_DEFINE(tstack, NUM_THREAD, STACK_SIZE);
|
||||
static struct k_thread tdata[NUM_THREAD];
|
||||
|
||||
#define IDLE_THRESH 20
|
||||
#define IDLE_THRESH k_ms_to_ticks_floor64(200)
|
||||
|
||||
/*sleep duration tickless*/
|
||||
#define SLEEP_TICKLESS k_ticks_to_ms_floor64(IDLE_THRESH)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue