diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-05-05 16:45:40 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-05-05 16:45:40 +0000 |
commit | 7c1e69429a28adf03216c755bc1b4504c6e735b2 (patch) | |
tree | 891479b5bad29f5dc64d0a430f768d7514ecbec5 /testsuites/samples/ticker | |
parent | 2011-05-05 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-7c1e69429a28adf03216c755bc1b4504c6e735b2.tar.bz2 |
2011-05-05 Joel Sherrill <joel.sherrill@oarcorp.com>
* base_sp/apptask.c, base_sp/init.c, fileio/init.c, fileio/system.h,
nsecs/init.c, ticker/init.c, ticker/system.h, ticker/tasks.c: Remove
warnings.
Diffstat (limited to 'testsuites/samples/ticker')
-rw-r--r-- | testsuites/samples/ticker/init.c | 14 | ||||
-rw-r--r-- | testsuites/samples/ticker/system.h | 37 | ||||
-rw-r--r-- | testsuites/samples/ticker/tasks.c | 8 |
3 files changed, 20 insertions, 39 deletions
diff --git a/testsuites/samples/ticker/init.c b/testsuites/samples/ticker/init.c index 55f5e2ea13..05ab25802a 100644 --- a/testsuites/samples/ticker/init.c +++ b/testsuites/samples/ticker/init.c @@ -10,7 +10,7 @@ * * Output parameters: NONE * - * COPYRIGHT (c) 1989-1999. + * COPYRIGHT (c) 1989-2011. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -52,6 +52,7 @@ rtems_task Init( time.ticks = 0; status = rtems_clock_set( &time ); + directive_failed( status, "clock get" ); Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); @@ -61,18 +62,29 @@ rtems_task Init( Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ] ); + directive_failed( status, "create 1" ); + status = rtems_task_create( Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ] ); + directive_failed( status, "create 2" ); + status = rtems_task_create( Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ] ); + directive_failed( status, "create 3" ); status = rtems_task_start( Task_id[ 1 ], Test_task, 1 ); + directive_failed( status, "start 1" ); + status = rtems_task_start( Task_id[ 2 ], Test_task, 2 ); + directive_failed( status, "start 2" ); + status = rtems_task_start( Task_id[ 3 ], Test_task, 3 ); + directive_failed( status, "start 3" ); status = rtems_task_delete( RTEMS_SELF ); + directive_failed( status, "delete" ); } diff --git a/testsuites/samples/ticker/system.h b/testsuites/samples/ticker/system.h index ec17872b87..94b8d9f4ef 100644 --- a/testsuites/samples/ticker/system.h +++ b/testsuites/samples/ticker/system.h @@ -16,6 +16,7 @@ #include <rtems.h> #include <inttypes.h> #include "../../support/include/buffer_test_io.h" +#include "tmacros.h" /* functions */ @@ -53,42 +54,6 @@ extern rtems_name Task_name[ 4 ]; /* array of task names */ #include <rtems/confdefs.h> /* - * Handy macros and static inline functions - */ - -/* - * Macro to hide the ugliness of printing the time. - */ - -#define print_time(_s1, _tb, _s2) \ - do { \ - printf( "%s%02" PRId32 ":%02" PRId32 ":%02" PRId32 " %02" PRId32 "/%02" PRId32 "/%04" PRId32 "%s", \ - _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ - (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ - } while ( 0 ) - -/* - * Macro to print an task name that is composed of ASCII characters. - * - */ - -#define put_name( _name, _crlf ) \ - do { \ - uint32_t c0, c1, c2, c3; \ - \ - c0 = ((_name) >> 24) & 0xff; \ - c1 = ((_name) >> 16) & 0xff; \ - c2 = ((_name) >> 8) & 0xff; \ - c3 = (_name) & 0xff; \ - putchar( (char)c0 ); \ - if ( c1 ) putchar( (char)c1 ); \ - if ( c2 ) putchar( (char)c2 ); \ - if ( c3 ) putchar( (char)c3 ); \ - if ( (_crlf) ) \ - putchar( '\n' ); \ - } while (0) - -/* * This allows us to view the "Test_task" instantiations as a set * of numbered tasks by eliminating the number of application * tasks created. diff --git a/testsuites/samples/ticker/tasks.c b/testsuites/samples/ticker/tasks.c index a1f6d34584..3b16a8ed01 100644 --- a/testsuites/samples/ticker/tasks.c +++ b/testsuites/samples/ticker/tasks.c @@ -29,10 +29,12 @@ rtems_task Test_task( { rtems_id tid; rtems_time_of_day time; - uint32_t task_index; + uint32_t task_index; rtems_status_code status; status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); + directive_failed( status, "task ident" ); + task_index = task_number( tid ); for ( ; ; ) { status = rtems_clock_get_tod( &time ); @@ -43,6 +45,8 @@ rtems_task Test_task( put_name( Task_name[ task_index ], FALSE ); print_time( " - rtems_clock_get_tod - ", &time, "\n" ); status = rtems_task_wake_after( - task_index * 5 * rtems_clock_get_ticks_per_second() ); + task_index * 5 * rtems_clock_get_ticks_per_second() + ); + directive_failed( status, "wake after" ); } } |