diff options
author | Glenn Humphrey <glenn.humphrey@oarcorp.com> | 2009-10-12 21:02:40 +0000 |
---|---|---|
committer | Glenn Humphrey <glenn.humphrey@oarcorp.com> | 2009-10-12 21:02:40 +0000 |
commit | b1d5a734778cef6046560a9cdee8ef8b789e6633 (patch) | |
tree | 76b0f605dfbbe9e474d15738d759ccce7fb4552c /led/msg_server | |
parent | 2009-10-12 Glenn Humphrey <glenn.humphrey@OARcorp.com> (diff) | |
download | rtems-examples-b1d5a734778cef6046560a9cdee8ef8b789e6633.tar.bz2 |
2009-10-12 Glenn Humphrey <glenn.humphrey@OARcorp.com>
* delay/init.c, event_server/init.c, msg_server/init.c,
ratemon1/init.c, ratemon2/init.c, sem_server/init.c,
timeout_event/init.c: Cleaned up unused variables and standardized
for inclusion into RTEMS class materials.
Diffstat (limited to 'led/msg_server')
-rw-r--r-- | led/msg_server/init.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/led/msg_server/init.c b/led/msg_server/init.c index 721aa08..83654cf 100644 --- a/led/msg_server/init.c +++ b/led/msg_server/init.c @@ -12,18 +12,10 @@ #include <stdio.h> #include <bsp.h> -#include "../../testmacros.h" #include "../led.h" -/* - * Keep the names and IDs in global variables so another task can use them. - */ - -rtems_id Task_id[ 4 ]; /* array of task ids */ -rtems_name Task_name[ 4 ]; /* array of task names */ rtems_id Queue_id; - rtems_task Test_task( rtems_task_argument unused ) @@ -32,8 +24,6 @@ rtems_task Test_task( size_t received; rtems_status_code status; - LED_INIT(); - for ( ; ; ) { count = 0xFFFFFFFF; status = rtems_message_queue_receive( @@ -56,19 +46,23 @@ rtems_task Init( rtems_task_argument argument ) { - rtems_status_code status; uint32_t count = 0; + rtems_status_code status; + rtems_id task_id; + rtems_name task_name; puts( "\n\n*** LED BLINKER -- message receive server ***" ); - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); + LED_INIT(); + + task_name = rtems_build_name( 'T', 'A', '1', ' ' ); status = rtems_task_create( - Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ] + task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, &task_id ); - status = rtems_task_start( Task_id[ 1 ], Test_task, 1 ); + status = rtems_task_start( task_id, Test_task, 1 ); status = rtems_message_queue_create( rtems_build_name( 'Q', '1', ' ', ' ' ), @@ -85,7 +79,7 @@ rtems_task Init( if ( status != RTEMS_SUCCESSFUL ) fputs( "send did not work\n", stderr ); - status = rtems_task_wake_after( get_ticks_per_second() ); + status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); } status = rtems_task_delete( RTEMS_SELF ); @@ -98,7 +92,7 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 4 +#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |