You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/01/26 04:45:41 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #2740: sched/timer: get the previous reload value correctly

xiaoxiang781216 commented on pull request #2740:
URL: https://github.com/apache/incubator-nuttx/pull/2740#issuecomment-767286486


   BTW, timer_gettime use pt_delay(https://github.com/apache/incubator-nuttx/blob/master/sched/timer/timer_gettime.c#L71-L91):
   ```
   int timer_gettime(timer_t timerid, FAR struct itimerspec *value)
   {
     FAR struct posix_timer_s *timer = (FAR struct posix_timer_s *)timerid;
     sclock_t ticks;
   
     if (!timer || !value)
       {
         set_errno(EINVAL);
         return ERROR;
       }
   
     /* Get the number of ticks before the underlying watchdog expires */
   
     ticks = wd_gettime(&timer->pt_wdog);
   
     /* Convert that to a struct timespec and return it */
   
     clock_ticks2time(ticks, &value->it_value);
     clock_ticks2time(timer->pt_delay, &value->it_interval);
     return OK;
   }
   ```
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org