/* Task_1
|
/* Task_1
|
*
|
*
|
* This routine serves as a test task. It verifies the basic task
|
* This routine serves as a test task. It verifies the basic task
|
* switching capabilities of the executive.
|
* switching capabilities of the executive.
|
*
|
*
|
* Input parameters:
|
* Input parameters:
|
* argument - task argument
|
* argument - task argument
|
*
|
*
|
* Output parameters: NONE
|
* Output parameters: NONE
|
*
|
*
|
* COPYRIGHT (c) 1989-1999.
|
* COPYRIGHT (c) 1989-1999.
|
* On-Line Applications Research Corporation (OAR).
|
* On-Line Applications Research Corporation (OAR).
|
*
|
*
|
* The license and distribution terms for this file may be
|
* The license and distribution terms for this file may be
|
* found in the file LICENSE in this distribution or at
|
* found in the file LICENSE in this distribution or at
|
* http://www.OARcorp.com/rtems/license.html.
|
* http://www.OARcorp.com/rtems/license.html.
|
*
|
*
|
* $Id: task1.c,v 1.2 2001-09-27 12:02:34 chris Exp $
|
* $Id: task1.c,v 1.2 2001-09-27 12:02:34 chris Exp $
|
*/
|
*/
|
|
|
#include "system.h"
|
#include "system.h"
|
#include "inttest.h"
|
#include "inttest.h"
|
|
|
rtems_task Task_1(
|
rtems_task Task_1(
|
rtems_task_argument argument
|
rtems_task_argument argument
|
)
|
)
|
{
|
{
|
rtems_status_code status;
|
rtems_status_code status;
|
rtems_id tid;
|
rtems_id tid;
|
rtems_time_of_day time;
|
rtems_time_of_day time;
|
rtems_unsigned32 task_index;
|
rtems_unsigned32 task_index;
|
INTEGER_DECLARE;
|
INTEGER_DECLARE;
|
|
|
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
directive_failed( status, "rtems_task_ident" );
|
directive_failed( status, "rtems_task_ident" );
|
|
|
task_index = task_number( tid );
|
task_index = task_number( tid );
|
|
|
INTEGER_LOAD( INTEGER_factors[ task_index ] );
|
INTEGER_LOAD( INTEGER_factors[ task_index ] );
|
|
|
put_name( Task_name[ task_index ], FALSE );
|
put_name( Task_name[ task_index ], FALSE );
|
printf( " - integer base = (0x%x)\n", INTEGER_factors[ task_index ] );
|
printf( " - integer base = (0x%x)\n", INTEGER_factors[ task_index ] );
|
|
|
while( FOREVER ) {
|
while( FOREVER ) {
|
status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
|
status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
|
directive_failed( status, "rtems_clock_get" );
|
directive_failed( status, "rtems_clock_get" );
|
|
|
put_name( Task_name[ task_number( tid ) ], FALSE );
|
put_name( Task_name[ task_number( tid ) ], FALSE );
|
print_time( " - rtems_clock_get - ", &time, "\n" );
|
print_time( " - rtems_clock_get - ", &time, "\n" );
|
|
|
INTEGER_CHECK( INTEGER_factors[ task_index ] );
|
INTEGER_CHECK( INTEGER_factors[ task_index ] );
|
|
|
status = rtems_task_wake_after(
|
status = rtems_task_wake_after(
|
( task_number( tid ) ) * 5 * TICKS_PER_SECOND
|
( task_number( tid ) ) * 5 * TICKS_PER_SECOND
|
);
|
);
|
directive_failed( status, "rtems_task_wake_after" );
|
directive_failed( status, "rtems_task_wake_after" );
|
}
|
}
|
}
|
}
|
|
|