File indexing completed on 2025-05-11 08:24:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 #ifdef HAVE_CONFIG_H
0042 #include "config.h"
0043 #endif
0044
0045 #define CONFIGURE_INIT
0046 #include "system.h"
0047
0048 const char rtems_test_name[] = "SP 31";
0049
0050 rtems_task Init(
0051 rtems_task_argument argument
0052 )
0053 {
0054 rtems_time_of_day time;
0055 rtems_status_code status;
0056
0057 TEST_BEGIN();
0058
0059 build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
0060
0061 status = rtems_clock_set( &time );
0062 directive_failed( status, "rtems_clock_set" );
0063
0064 status = rtems_timer_initiate_server(
0065 RTEMS_TIMER_SERVER_DEFAULT_PRIORITY,
0066 RTEMS_MINIMUM_STACK_SIZE,
0067 RTEMS_DEFAULT_ATTRIBUTES
0068 );
0069 directive_failed( status, "rtems_timer_initiate_server" );
0070
0071 Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
0072 Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
0073 Timer_name[ 2 ] = rtems_build_name( 'T', 'M', '2', ' ' );
0074
0075 status = rtems_task_create(
0076 Task_name[ 1 ],
0077 1,
0078 RTEMS_MINIMUM_STACK_SIZE * 2,
0079 RTEMS_DEFAULT_MODES,
0080 RTEMS_DEFAULT_ATTRIBUTES,
0081 &Task_id[ 1 ]
0082 );
0083 directive_failed( status, "rtems_task_create of TA1" );
0084
0085 status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
0086 directive_failed( status, "rtems_task_start of TA1" );
0087
0088 puts( "INIT - rtems_timer_create - creating timer 1" );
0089 status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
0090 directive_failed( status, "rtems_timer_create" );
0091 printf( "INIT - timer 1 has id (0x%" PRIxrtems_id ")\n", Timer_id[ 1 ] );
0092
0093 puts( "INIT - rtems_timer_create - creating timer 2" );
0094 status = rtems_timer_create( Timer_name[ 2 ], &Timer_id[ 2 ] );
0095 directive_failed( status, "rtems_timer_create" );
0096 printf( "INIT - timer 2 has id (0x%" PRIxrtems_id ")\n", Timer_id[ 2 ] );
0097
0098 rtems_task_exit();
0099 }