source:
rtems/testsuites/samples/ticker/tasks.c
@
9391f6d
Last change on this file since 9391f6d was 9391f6d, checked in by Sebastian Huber <sebastian.huber@…>, on 03/10/14 at 15:31:43 | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[ac7d5ef0] | 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 | * | |
[99f09711] | 10 | * COPYRIGHT (c) 1989-2009. |
[ac7d5ef0] | 11 | * On-Line Applications Research Corporation (OAR). |
12 | * | |
[98e4ebf5] | 13 | * The license and distribution terms for this file may be |
14 | * found in the file LICENSE in this distribution or at | |
[3e26377b] | 15 | * http://www.rtems.com/license/LICENSE. |
[ac7d5ef0] | 16 | */ |
17 | ||
[e313551] | 18 | #ifdef HAVE_CONFIG_H |
19 | #include "config.h" | |
20 | #endif | |
21 | ||
[ac7d5ef0] | 22 | #include "system.h" |
23 | ||
24 | rtems_task Test_task( | |
25 | rtems_task_argument unused | |
26 | ) | |
27 | { | |
28 | rtems_id tid; | |
29 | rtems_time_of_day time; | |
[7c1e6942] | 30 | uint32_t task_index; |
[ac7d5ef0] | 31 | rtems_status_code status; |
32 | ||
33 | status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); | |
[7c1e6942] | 34 | directive_failed( status, "task ident" ); |
35 | ||
[ac7d5ef0] | 36 | task_index = task_number( tid ); |
[df49c60] | 37 | for ( ; ; ) { |
[fa342bc7] | 38 | status = rtems_clock_get_tod( &time ); |
[ac7d5ef0] | 39 | if ( time.second >= 35 ) { |
[9391f6d] | 40 | TEST_END(); |
[dfc6f3dc] | 41 | rtems_test_exit( 0 ); |
[ac7d5ef0] | 42 | } |
43 | put_name( Task_name[ task_index ], FALSE ); | |
[fa342bc7] | 44 | print_time( " - rtems_clock_get_tod - ", &time, "\n" ); |
[99f09711] | 45 | status = rtems_task_wake_after( |
[7c1e6942] | 46 | task_index * 5 * rtems_clock_get_ticks_per_second() |
47 | ); | |
48 | directive_failed( status, "wake after" ); | |
[ac7d5ef0] | 49 | } |
50 | } |
Note: See TracBrowser
for help on using the repository browser.