source: rtems/testsuites/sptests/sp19/task1.c @ 99de42c

5
Last change on this file since 99de42c was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2011.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include "system.h"
15#include "inttest.h"
16
17rtems_task Task_1(
18  rtems_task_argument argument
19)
20{
21  rtems_status_code status;
22  rtems_id          tid;
23  rtems_time_of_day time;
24  uint32_t          task_index;
25  INTEGER_DECLARE;
26
27  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
28  directive_failed( status, "rtems_task_ident" );
29
30  task_index = task_number( tid );
31
32  INTEGER_LOAD( INTEGER_factors[ task_index ] );
33
34  put_name( Task_name[ task_index ], FALSE );
35  printf(
36    " - integer base = (0x%" PRIx32 ")\n",
37    INTEGER_factors[ task_index ]
38  );
39
40  while( FOREVER ) {
41    status = rtems_clock_get_tod( &time );
42    directive_failed( status, "rtems_clock_get_tod" );
43
44    put_name( Task_name[ task_number( tid ) ], FALSE );
45    print_time( " - rtems_clock_get_tod - ", &time, "\n" );
46
47    INTEGER_CHECK( INTEGER_factors[ task_index ] );
48
49    status = rtems_task_wake_after(
50      ( task_number( tid ) ) * 5 * rtems_clock_get_ticks_per_second()
51    );
52    directive_failed( status, "rtems_task_wake_after" );
53  }
54}
Note: See TracBrowser for help on using the repository browser.