source: rtems/cpukit/score/src/coretodusectoticks.c @ e6f7f81

4.115
Last change on this file since e6f7f81 was 1b475860, checked in by Christopher Kerl <zargyyoyo@…>, on 11/29/12 at 19:39:17

score misc: Score misc: Clean up Doxygen #6 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

http://www.google-melange.com/gci/task/view/google/gci2012/7976215

  • Property mode set to 100644
File size: 998 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Converts Microseconds to Ticks
5 *
6 * @ingroup ScoreTOD
7 */
8
9/*  COPYRIGHT (c) 1989-2011.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.com/license/LICENSE.
15 */
16
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/system.h>
23#include <rtems/config.h>
24#include <rtems/score/tod.h>
25
26uint32_t TOD_MICROSECONDS_TO_TICKS(
27  uint32_t microseconds
28)
29{
30  uint32_t ticks;
31  uint32_t microseconds_per_tick;
32
33  /**
34   *  We should ensure the ticks not be truncated by integer division.  We
35   *  need to have it be greater than or equal to the requested time.  It
36   *  should not be shorter.
37   */
38  microseconds_per_tick = rtems_configuration_get_microseconds_per_tick();
39  ticks                 = microseconds / microseconds_per_tick;
40  if ( (microseconds % microseconds_per_tick) != 0 )
41    ticks += 1;
42
43  return ticks;
44}
Note: See TracBrowser for help on using the repository browser.