Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys/ztimer: rename required_pm_mode to block_pm_mode #16160

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sys/include/ztimer.h
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ struct ztimer_clock {
ztimer_now_t checkpoint; /**< cumulated time at last now() call */
#endif
#if MODULE_PM_LAYERED || DOXYGEN
uint8_t required_pm_mode; /**< min. pm mode required for the clock to run */
uint8_t block_pm_mode; /**< min. pm mode to block for the clock to run */
#endif
};

Expand Down
12 changes: 6 additions & 6 deletions sys/ztimer/auto_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,29 +224,29 @@ void ztimer_init(void)
ztimer_periph_timer_init(&ZTIMER_TIMER, CONFIG_ZTIMER_USEC_DEV,
ZTIMER_TIMER_FREQ, WIDTH_TO_MAXVAL(CONFIG_ZTIMER_USEC_WIDTH));
# ifdef MODULE_PM_LAYERED
LOG_DEBUG("ztimer_init(): ZTIMER_TIMER setting required_pm_mode to %i\n",
LOG_DEBUG("ztimer_init(): ZTIMER_TIMER setting block_pm_mode to %i\n",
CONFIG_ZTIMER_TIMER_BLOCK_PM_MODE);
ZTIMER_TIMER_CLK.required_pm_mode = CONFIG_ZTIMER_TIMER_BLOCK_PM_MODE;
ZTIMER_TIMER_CLK.block_pm_mode = CONFIG_ZTIMER_TIMER_BLOCK_PM_MODE;
# endif
#endif

#if INIT_ZTIMER_RTT
LOG_DEBUG("ztimer_init(): initializing rtt\n");
ztimer_periph_rtt_init(&ZTIMER_RTT);
# ifdef MODULE_PM_LAYERED
LOG_DEBUG("ztimer_init(): ZTIMER_RTT setting required_pm_mode to %i\n",
LOG_DEBUG("ztimer_init(): ZTIMER_RTT setting block_pm_mode to %i\n",
CONFIG_ZTIMER_RTT_BLOCK_PM_MODE);
ZTIMER_RTT_CLK.required_pm_mode = CONFIG_ZTIMER_RTT_BLOCK_PM_MODE;
ZTIMER_RTT_CLK.block_pm_mode = CONFIG_ZTIMER_RTT_BLOCK_PM_MODE;
# endif
#endif

#if INIT_ZTIMER_RTC
LOG_DEBUG("ztimer_init(): initializing rtc\n");
ztimer_periph_rtc_init(&ZTIMER_RTC);
# ifdef MODULE_PM_LAYERED
LOG_DEBUG("ztimer_init(): ZTIMER_RTC setting required_pm_mode to %i\n",
LOG_DEBUG("ztimer_init(): ZTIMER_RTC setting block_pm_mode to %i\n",
CONFIG_ZTIMER_RTC_BLOCK_PM_MODE);
ZTIMER_RTC_CLK.required_pm_mode = CONFIG_ZTIMER_RTC_BLOCK_PM_MODE;
ZTIMER_RTC_CLK.block_pm_mode = CONFIG_ZTIMER_RTC_BLOCK_PM_MODE;
# endif
#endif

Expand Down
12 changes: 6 additions & 6 deletions sys/ztimer/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ static void _add_entry_to_list(ztimer_clock_t *clock, ztimer_base_t *entry)
#ifdef MODULE_PM_LAYERED
/* First timer on the clock's linked list */
if (list->next == NULL &&
clock->required_pm_mode != ZTIMER_CLOCK_NO_REQUIRED_PM_MODE) {
pm_block(clock->required_pm_mode);
clock->block_pm_mode != ZTIMER_CLOCK_NO_REQUIRED_PM_MODE) {
pm_block(clock->block_pm_mode);
}
#endif

Expand Down Expand Up @@ -260,8 +260,8 @@ static void _del_entry_from_list(ztimer_clock_t *clock, ztimer_base_t *entry)
#ifdef MODULE_PM_LAYERED
/* The last timer just got removed from the clock's linked list */
if (clock->list.next == NULL &&
clock->required_pm_mode != ZTIMER_CLOCK_NO_REQUIRED_PM_MODE) {
pm_unblock(clock->required_pm_mode);
clock->block_pm_mode != ZTIMER_CLOCK_NO_REQUIRED_PM_MODE) {
pm_unblock(clock->block_pm_mode);
}
#endif
}
Expand All @@ -276,8 +276,8 @@ static ztimer_t *_now_next(ztimer_clock_t *clock)
/* The last timer just got removed from the clock's linked list */
clock->last = NULL;
#ifdef MODULE_PM_LAYERED
if (clock->required_pm_mode != ZTIMER_CLOCK_NO_REQUIRED_PM_MODE) {
pm_unblock(clock->required_pm_mode);
if (clock->block_pm_mode != ZTIMER_CLOCK_NO_REQUIRED_PM_MODE) {
pm_unblock(clock->block_pm_mode);
}
#endif
}
Expand Down