source: rtems/testsuites/samples/ticker/tasks.c @ 03f2154e

4.104.114.84.95
Last change on this file since 03f2154e was 03f2154e, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 22, 1997 at 5:20:27 PM

headers updated to reflect new style copyright notice as part
of switching to the modified GNU GPL.

  • Property mode set to 100644
File size: 1.1 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-1997.
11 *  On-Line Applications Research Corporation (OAR).
12 *  Copyright assigned to U.S. Government, 1994.
13 *
14 *  The license and distribution terms for this file may in
15 *  the file LICENSE in this distribution or at
16 *  http://www.OARcorp.com/rtems/license.html.
17 *
18 *  $Id$
19 */
20
21#include "system.h"
22
23rtems_task Test_task(
24  rtems_task_argument unused
25)
26{
27  rtems_id          tid;
28  rtems_time_of_day time;
29  rtems_unsigned32  task_index;
30  rtems_status_code status;
31
32  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
33  task_index = task_number( tid );
34  while( FOREVER ) {
35    status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
36    if ( time.second >= 35 ) {
37      puts( "*** END OF CLOCK TICK TEST ***" );
38      exit( 0 );
39    }
40    put_name( Task_name[ task_index ], FALSE );
41    print_time( " - rtems_clock_get - ", &time, "\n" );
42    status = rtems_task_wake_after( task_index * 5 * TICKS_PER_SECOND );
43  }
44}
Note: See TracBrowser for help on using the repository browser.