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


   > > > @xiaoxiang781216 could you take a look here please.
   > > 
   > > 
   > > Sorry, I thought this PR is for esp32 specific. So this patch want to 
sync the system time after wake up from RTC timer?
   > 
   > Hi @xiaoxiang781216 Yes, after entering auto-sleep(pm standby mode), the 
system clock interruption will stop, when exiting auto-sleep, the idletime tick 
obtained through watchdog monitoring (by calling wd_getidletime) will be 
inaccurate, so after exiting auto-sleep, the obtained system tick needs to be 
compensated (by calling wd_setsleepticks).
   
   But, the compensation isn't completed there are other places depend on the 
correct timing:
   1. systime need to update
   2. sched::timeslice need to update
   2. Many field in sporadic_s need to update
   
   To sync the timing information, the better method is:
   1. Call nxsched_process_timer with enough times after wakeup for fixed tick 
mode
   2. up_timer_gettime return the compensated time for tickless mode
   
   The above method can ensure all timing related component get updated 
correctly.
   One improvement, we can change nxsched_process_timer prototype to accept the 
elasped ticks:
   void nxsched_process_timer(uint32_t ticks);


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to