source: rtems/cpukit/score/src/coretodmsecstoticks.c @ a936aa49

4.115
Last change on this file since a936aa49 was d4d7899, checked in by Christopher Kerl <zargyyoyo@…>, on 11/28/12 at 19:31:53

score misc: Clean up Doxygen #2 (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/7986213

  • Property mode set to 100644
File size: 1006 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Convert Microseconds to Ticks
5 *
6 * @ingroup ScoreTODConstants
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_MILLISECONDS_TO_TICKS(
27  uint32_t milliseconds
28)
29{
30  uint32_t ticks;
31  uint32_t milliseconds_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  milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick();
39  ticks                 = milliseconds / milliseconds_per_tick;
40  if ( (milliseconds % milliseconds_per_tick) != 0 )
41    ticks += 1;
42
43  return ticks;
44}
Note: See TracBrowser for help on using the repository browser.