source: rtems/testsuites/sptests/spcbssched01/task1.c @ 88c74ab

4.115
Last change on this file since 88c74ab was 88c74ab, checked in by Sebastian Huber <sebastian.huber@…>, on 07/25/13 at 13:10:11

score: Merge tod implementation into one file

Delete TOD_MICROSECONDS_PER_SECOND, TOD_MICROSECONDS_TO_TICKS() and
TOD_MILLISECONDS_TO_TICKS().

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