Skip to content

Commit

Permalink
sched/clock: cleanup g_system_ticks reference if arch timer is enabled
Browse files Browse the repository at this point in the history
continue work of: #15139

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao authored and jerpelea committed Dec 12, 2024
1 parent 4a51c21 commit cafdcb1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion sched/clock/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ extern struct timespec g_basetime;
int clock_basetime(FAR struct timespec *tp);

void clock_initialize(void);
#ifndef CONFIG_SCHED_TICKLESS
#if !defined(CONFIG_SCHED_TICKLESS) && \
!defined(CONFIG_ALARM_ARCH) && !defined(CONFIG_TIMER_ARCH)
void clock_timer(void);
#else
# define clock_timer()
Expand Down
16 changes: 8 additions & 8 deletions sched/clock/clock_initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,9 @@
* Public Data
****************************************************************************/

#ifndef CONFIG_SCHED_TICKLESS
#ifdef CONFIG_SYSTEM_TIME64
volatile uint64_t g_system_ticks = INITIAL_SYSTEM_TIMER_TICKS;
#else
volatile uint32_t g_system_ticks = INITIAL_SYSTEM_TIMER_TICKS;
#endif
#if !defined(CONFIG_SCHED_TICKLESS) && \
!defined(CONFIG_ALARM_ARCH) && !defined(CONFIG_TIMER_ARCH)
volatile clock_t g_system_ticks = INITIAL_SYSTEM_TIMER_TICKS;
#endif

#ifndef CONFIG_CLOCK_TIMEKEEPING
Expand Down Expand Up @@ -305,7 +302,9 @@ void clock_synchronize(FAR const struct timespec *tp)
*
****************************************************************************/

#if defined(CONFIG_RTC) && !defined(CONFIG_SCHED_TICKLESS) && !defined(CONFIG_CLOCK_TIMEKEEPING)
#if defined(CONFIG_RTC) && !defined(CONFIG_SCHED_TICKLESS) && \
!defined(CONFIG_CLOCK_TIMEKEEPING) && !defined(CONFIG_ALARM_ARCH) && \
!defined(CONFIG_TIMER_ARCH)
void clock_resynchronize(FAR struct timespec *rtc_diff)
{
struct timespec rtc_time;
Expand Down Expand Up @@ -393,7 +392,8 @@ void clock_resynchronize(FAR struct timespec *rtc_diff)
*
****************************************************************************/

#ifndef CONFIG_SCHED_TICKLESS
#if !defined(CONFIG_SCHED_TICKLESS) && \
!defined(CONFIG_ALARM_ARCH) && !defined(CONFIG_TIMER_ARCH)
void clock_timer(void)
{
/* Increment the per-tick system counter */
Expand Down

0 comments on commit cafdcb1

Please sign in to comment.