source: rtems/cpukit/sapi/src/delayticks.c @ 599d71f

Last change on this file since 599d71f was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 738 bytes
Line 
1/*
2 * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/counter.h>
20
21void rtems_counter_delay_ticks( rtems_counter_ticks ticks )
22{
23  rtems_counter_ticks a = rtems_counter_read();
24  rtems_counter_ticks delta = 0;
25
26  do {
27    rtems_counter_ticks b;
28
29    ticks -= delta;
30
31    b = rtems_counter_read();
32    delta = rtems_counter_difference( b, a );
33    a = b;
34  } while ( ticks > delta );
35}
Note: See TracBrowser for help on using the repository browser.