示例#1
0
void _TOD_Tickle_ticks( void )
{
  TOD_Control       *tod = &_TOD;
  ISR_lock_Context   lock_context;
  Timestamp_Control  tick;
  uint32_t           nanoseconds_per_tick;

  nanoseconds_per_tick = rtems_configuration_get_nanoseconds_per_tick();

  /* Convert the tick quantum to a timestamp */
  _Timestamp_Set( &tick, 0, nanoseconds_per_tick );

  /* Update the counter of ticks since boot */
  _Watchdog_Ticks_since_boot += 1;

  _TOD_Acquire( tod, &lock_context );

  /* Update the uptime */
  _Timestamp_Add_to( &tod->uptime, &tick );

  /* Update the current TOD */
  _Timestamp_Add_to( &tod->now, &tick );

  _TOD_Release( tod, &lock_context );

  _TOD.seconds_trigger += nanoseconds_per_tick;
  if ( _TOD.seconds_trigger >= 1000000000UL ) {
    _TOD.seconds_trigger -= 1000000000UL;
    _Watchdog_Tickle_seconds();
  }
}
示例#2
0
void _TOD_Tickle_ticks( void )
{
  Timestamp_Control tick;
  uint32_t          seconds;

  /* Convert the tick quantum to a timestamp */
  _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() );

  /* Update the counter of ticks since boot */
  _Watchdog_Ticks_since_boot += 1;

  /* Update the timespec format uptime */
  _Timestamp_Add_to( &_TOD_Uptime, &tick );
  /* we do not care how much the uptime changed */

  /* Update the timespec format TOD */
  seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick );
  while ( seconds ) {
    _Watchdog_Tickle_seconds();
    seconds--;
  }
}
void _TOD_Tickle_ticks( void )
{
  struct timespec tick;
  uint32_t        seconds;

  /* Convert the tick quantum to a timespec */
  tick.tv_nsec = _TOD_Microseconds_per_tick * 1000;
  tick.tv_sec  = 0;

  /* Update the counter of ticks since boot */
  _Watchdog_Ticks_since_boot += 1;

  /* Update the timespec format uptime */
  (void) _Timespec_Add_to( &_TOD_Uptime, &tick );
  /* we do not care how much the uptime changed */

  /* Update the timespec format TOD */
  seconds = _Timespec_Add_to( &_TOD_Now, &tick );
  while ( seconds ) {
    _Watchdog_Tickle_seconds();
    seconds--;
  }
}