Skip to content

Commit 7fa8bf1

Browse files
lstnlkartben
authored andcommitted
modules: hal_nordic: dvfs: refactor
This is follow up to commit: modules: hal_nordic: dvfs: added callback when scaling done Used get and set timer user data functions. Added missing help text in KConfig. Signed-off-by: Lukasz Stepnicki <[email protected]>
1 parent 4ad05aa commit 7fa8bf1

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

modules/hal_nordic/nrfs/dvfs/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ config NRFS_LOCAL_DOMAIN_DOWNSCALE_FINISH_DELAY_TIMEOUT_US
3030
int "Additional delay to let secdom finish dowscale procedure in us"
3131
range 1 10000000
3232
default 1000
33+
help
34+
This value depends on the secdom core performance and shouldn't be touched by the user.
3335

3436
config NRFS_LOCAL_DOMAIN_DVFS_HANDLER_TASK_STACK_SIZE
3537
int "Stack size used for DVFS handling task"

modules/hal_nordic/nrfs/dvfs/ld_dvfs_handler.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,9 @@ static void dvfs_service_handler_set_initial_hsfll_config(void)
178178

179179
static void dvfs_service_handler_scaling_finish_delay_timeout(struct k_timer *timer)
180180
{
181-
if (timer) {
182-
dvfs_service_handler_scaling_finish(
183-
*(enum dvfs_frequency_setting *)timer->user_data);
184-
}
181+
182+
dvfs_service_handler_scaling_finish(
183+
*(enum dvfs_frequency_setting *)k_timer_user_data_get(timer));
185184
}
186185

187186
K_TIMER_DEFINE(dvfs_service_scaling_finish_delay_timer,
@@ -237,7 +236,8 @@ static void nrfs_dvfs_evt_handler(nrfs_dvfs_evt_t const *p_evt, void *context)
237236
static enum dvfs_frequency_setting freq;
238237

239238
freq = p_evt->freq;
240-
dvfs_service_scaling_finish_delay_timer.user_data = (void *)&freq;
239+
k_timer_user_data_set(&dvfs_service_scaling_finish_delay_timer,
240+
(void *)&freq);
241241
k_timer_start(&dvfs_service_scaling_finish_delay_timer,
242242
SCALING_FINISH_DELAY_TIMEOUT_US, K_NO_WAIT);
243243
} else {

0 commit comments

Comments
 (0)