source: rtems/testsuites/samples/ticker/tasks.c @ e313551

4.11
Last change on this file since e313551 was e313551, checked in by Ralf Corsepius <ralf.corsepius@…>, on Feb 22, 2011 at 10:58:44 AM

Add HAVE_CONFIG_H.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*  Test_task
2 *
3 *  This routine serves as a test task.  It verifies the basic task
4 *  switching capabilities of the executive.
5 *
6 *  Input parameters:  NONE
7 *
8 *  Output parameters:  NONE
9 *
10 *  COPYRIGHT (c) 1989-2009.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19
20#ifdef HAVE_CONFIG_H
21#include "config.h"
22#endif
23
24#include "system.h"
25
26rtems_task Test_task(
27  rtems_task_argument unused
28)
29{
30  rtems_id          tid;
31  rtems_time_of_day time;
32  uint32_t    task_index;
33  rtems_status_code status;
34
35  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
36  task_index = task_number( tid );
37  for ( ; ; ) {
38    status = rtems_clock_get_tod( &time );
39    if ( time.second >= 35 ) {
40      puts( "*** END OF CLOCK TICK TEST ***" );
41      rtems_test_exit( 0 );
42    }
43    put_name( Task_name[ task_index ], FALSE );
44    print_time( " - rtems_clock_get_tod - ", &time, "\n" );
45    status = rtems_task_wake_after(
46      task_index * 5 * rtems_clock_get_ticks_per_second() );
47  }
48}
Note: See TracBrowser for help on using the repository browser.