source: rtems/c/src/tests/samples/ticker/tasks.c @ d25d17b

4.104.114.84.95
Last change on this file since d25d17b was d25d17b, checked in by Joel Sherrill <joel.sherrill@…>, on 04/17/02 at 14:01:40

2002-04-17 Ralf Corsepius <corsepiu@…>

  • base_sp/apptask.c: Include <stdlib.h>.
  • hello/init.c: Ditto.
  • paranoia/init.c: Ditto.
  • ticker/tasks.c: Ditto.
  • unlimited/init.c: Ditto.
  • unlimited/test1.c: Ditto.
  • unlimited/test2.c: Ditto.
  • unlimited/test3.c: Ditto.
  • 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-1999.
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.OARcorp.com/rtems/license.html.
16 *
17 *  $Id$
18 */
19
20#include "system.h"
21#include <stdio.h>
22#include <stdlib.h>
23
24rtems_task Test_task(
25  rtems_task_argument unused
26)
27{
28  rtems_id          tid;
29  rtems_time_of_day time;
30  rtems_unsigned32  task_index;
31  rtems_status_code status;
32
33  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
34  task_index = task_number( tid );
35  for ( ; ; ) {
36    status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
37    if ( time.second >= 35 ) {
38      puts( "*** END OF CLOCK TICK TEST ***" );
39      exit( 0 );
40    }
41    put_name( Task_name[ task_index ], FALSE );
42    print_time( " - rtems_clock_get - ", &time, "\n" );
43    status = rtems_task_wake_after( task_index * 5 * get_ticks_per_second() );
44  }
45}
Note: See TracBrowser for help on using the repository browser.