Skip to content

Commit

Permalink
Fixes to tickless operation code. From Brandon Warhurst
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-nutt committed Oct 23, 2014
1 parent c8b4ab7 commit a7a5c8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/nuttx/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ void sched_timer_expiration(void);
****************************************************************************/

#if defined(CONFIG_SCHED_TICKLESS) && defined(CONFIG_SCHED_TICKLESS_ALARM)
void sched_alarm_expiration(FAR const struct *ts);
void sched_alarm_expiration(FAR const struct timespec *ts);
#endif

/************************************************************************
Expand Down
10 changes: 5 additions & 5 deletions sched/sched/sched_timerexpiration.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ static struct timespec g_stop_time;
#ifdef CONFIG_SCHED_TICKLESS_ALARM
static void sched_timespec_add(FAR const struct timespec *ts1,
FAR const struct timespec *ts2,
FAR struct timespec ts3)
FAR struct timespec *ts3)
{
time_t sec = ts1->tv_sec + ts2->tv_sec;
long nsec = ts1->tv_nsec + ts2->tv_nsec;

if (nsec >= NSEC_PER_SEC)
{
nsec -= NSEC_PER_SEC
nsec -= NSEC_PER_SEC;
sec++;
}

Expand Down Expand Up @@ -166,7 +166,7 @@ static void sched_timespec_add(FAR const struct timespec *ts1,
#ifdef CONFIG_SCHED_TICKLESS_ALARM
static void sched_timespec_subtract(FAR const struct timespec *ts1,
FAR const struct timespec *ts2,
FAR struct timespec ts3)
FAR struct timespec *ts3)
{
time_t sec;
long nsec;
Expand Down Expand Up @@ -196,7 +196,7 @@ static void sched_timespec_subtract(FAR const struct timespec *ts1,
}

ts3->tv_sec = sec;
ts3->tv_nsec = sec;
ts3->tv_nsec = nsec;
}
#endif

Expand Down Expand Up @@ -497,7 +497,7 @@ static void sched_timer_start(unsigned int ticks)
****************************************************************************/

#ifdef CONFIG_SCHED_TICKLESS_ALARM
void sched_alarm_expiration(FAR const struct *ts);
void sched_alarm_expiration(FAR const struct timespec *ts)
{
unsigned int elapsed;
unsigned int nexttime;
Expand Down

0 comments on commit a7a5c8c

Please sign in to comment.