OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [samples/] [ticker/] [tasks.c] - Blame information for rev 484

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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: tasks.c,v 1.2 2001-09-27 12:02:29 chris Exp $
18
 */
19
 
20
#include "system.h"
21
#include <stdio.h>
22
 
23
rtems_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
  for ( ; ; ) {
35
    status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
36
    if ( time.second >= 3 ) {
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 * get_ticks_per_second() );
43
  }
44
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.