Beispiel #1
0
/*********************************************************************
 * @fn      osalClockUpdate
 *
 * @brief   Updates the OSAL Clock time with elapsed milliseconds.
 *
 * @param   elapsedMSec - elapsed milliseconds
 *
 * @return  none
 */
static void osalClockUpdate( uint32 elapsedMSec )
{
  uint32 tmp;
  halIntState_t intState;
  
  HAL_ENTER_CRITICAL_SECTION(intState);
  // Add elapsed milliseconds to the saved millisecond portion of time
  timeMSec += elapsedMSec;

  // Roll up milliseconds to the number of seconds
  if ( timeMSec >= 1000 )
  {
    tmp = timeMSec;
    CONVERT_MS_TO_S_ELAPSED_REMAINDER(tmp, OSAL_timeSeconds, timeMSec);
  }
  HAL_EXIT_CRITICAL_SECTION(intState);
}
Beispiel #2
0
// update the EvtX clock time wiht elasped ms
static void evtx_clock_update(uint32_t elapsed_ms)
{
  uint32_t tmp;
  hal_int_state_t int_state;
  
  HAL_CRITICAL_ENTER(int_state);
  // Add elapsed milliseconds to the saved millisecond portion of time
  time_ms += elapsed_ms;

  // Roll up milliseconds to the number of seconds
  if ( time_ms >= 1000 )
  {
    tmp = time_ms;
    CONVERT_MS_TO_S_ELAPSED_REMAINDER(tmp, evtx_time_secs, time_ms);
  }
  HAL_CRITICAL_EXIT(int_state);
}