Changeset 7c1e6942 in rtems


Ignore:
Timestamp:
May 5, 2011, 4:45:40 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
6f27ba8
Parents:
355d79fa
Message:

2011-05-05 Joel Sherrill <joel.sherrill@…>

  • 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.
Location:
testsuites/samples
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • testsuites/samples/ChangeLog

    r355d79fa r7c1e6942  
     12011-05-05      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * base_sp/apptask.c, base_sp/init.c, fileio/init.c, fileio/system.h,
     4        nsecs/init.c, ticker/init.c, ticker/system.h, ticker/tasks.c: Remove
     5        warnings.
     6
    172011-02-22      Ralf Corsépius <ralf.corsepius@rtems.org>
    28
  • testsuites/samples/base_sp/apptask.c

    r355d79fa r7c1e6942  
    99 *  Output parameters:  NONE
    1010 *
    11  *  COPYRIGHT (c) 1989-1999.
     11 *  COPYRIGHT (c) 1989-2011.
    1212 *  On-Line Applications Research Corporation (OAR).
    1313 *
     
    3737
    3838  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
     39  directive_failed( status, "ident" );
    3940
    40   printf( "Application task was invoked with argument (%" PRIdrtems_task_argument ") "
    41           "and has id of 0x%" PRIxrtems_id "\n", argument, tid );
     41  printf(
     42    "Application task was invoked with argument (%" PRIdrtems_task_argument ") "
     43    "and has id of 0x%" PRIxrtems_id "\n", argument, tid
     44  );
    4245
    4346  printf( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***\n" );
  • testsuites/samples/base_sp/init.c

    r355d79fa r7c1e6942  
    1111 *  Output parameters:  NONE
    1212 *
    13  *  COPYRIGHT (c) 1989-1999.
     13 *  COPYRIGHT (c) 1989-2011.
    1414 *  On-Line Applications Research Corporation (OAR).
    1515 *
     
    2727#define CONFIGURE_INIT
    2828#include "system.h"
     29#include "tmacros.h"
    2930#include <stdio.h>
    3031
     
    4647  status = rtems_task_create( task_name, 1, RTEMS_MINIMUM_STACK_SIZE,
    4748             RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid );
     49  directive_failed( status, "create" );
    4850
    4951  status = rtems_task_start( tid, Application_task, ARGUMENT );
     52  directive_failed( status, "start" );
    5053
    5154  status = rtems_task_delete( RTEMS_SELF );
     55  directive_failed( status, "delete" );
    5256}
  • testsuites/samples/fileio/init.c

    r355d79fa r7c1e6942  
    1111 *  Output parameters:  NONE
    1212 *
    13  *  COPYRIGHT (c) 1989-2009.
     13 *  COPYRIGHT (c) 1989-2011.
    1414 *  On-Line Applications Research Corporation (OAR).
    1515 *
     
    708708    RTEMS_FLOATING_POINT | RTEMS_DEFAULT_ATTRIBUTES, &Task_id
    709709  );
     710  directive_failed( status, "create" );
    710711
    711712  status = rtems_task_start( Task_id, fileio_task, 1 );
     713  directive_failed( status, "start" );
    712714
    713715  status = rtems_task_delete( RTEMS_SELF );
     716  directive_failed( status, "delete" );
    714717}
    715718
  • testsuites/samples/fileio/system.h

    r355d79fa r7c1e6942  
    1515
    1616#include <rtems.h>
     17#include "tmacros.h"
    1718
    1819/* functions */
     
    6465#include <rtems/confdefs.h>
    6566
    66 /*
    67  *  Handy macros and static inline functions
    68  */
    69 
    70 /*
    71  *  Macro to hide the ugliness of printing the time.
    72  */
    73 
    74 #define print_time(_s1, _tb, _s2) \
    75   do { \
    76     printf( "%s%02d:%02d:%02d   %02d/%02d/%04d%s", \
    77        _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
    78        (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
    79     fflush(stdout); \
    80   } while ( 0 )
    81 
    82 /*
    83  *  Macro to print an task name that is composed of ASCII characters.
    84  *
    85  */
    86 
    87 #define put_name( _name, _crlf ) \
    88   do { \
    89     uint32_t   c0, c1, c2, c3; \
    90     \
    91     c0 = ((_name) >> 24) & 0xff; \
    92     c1 = ((_name) >> 16) & 0xff; \
    93     c2 = ((_name) >> 8) & 0xff; \
    94     c3 = (_name) & 0xff; \
    95     putchar( (char)c0 ); \
    96     if ( c1 ) putchar( (char)c1 ); \
    97     if ( c2 ) putchar( (char)c2 ); \
    98     if ( c3 ) putchar( (char)c3 ); \
    99     if ( (_crlf) ) \
    100       putchar( '\n' ); \
    101   } while (0)
    102 
    103 /*
    104  *  This allows us to view the "Test_task" instantiations as a set
    105  *  of numbered tasks by eliminating the number of application
    106  *  tasks created.
    107  *
    108  *  In reality, this is too complex for the purposes of this
    109  *  example.  It would have been easier to pass a task argument. :)
    110  *  But it shows how rtems_id's can sometimes be used.
    111  */
    112 
    113 #define task_number( tid ) \
    114   ( rtems_object_id_get_index( tid ) - \
    115       rtems_configuration_get_rtems_api_configuration()-> \
    116         number_of_initialization_tasks )
    117 
    11867/* end of include file */
  • testsuites/samples/nsecs/init.c

    r355d79fa r7c1e6942  
    33 */
    44
    5 /*  COPYRIGHT (c) 1989-2007.
     5/*  COPYRIGHT (c) 1989-2011.
    66 *  On-Line Applications Research Corporation (OAR).
    77 *
     
    7070
    7171  status = rtems_clock_set( &time );
     72  directive_failed( status, "clock set" );
    7273
    7374  /*
     
    9293    );
    9394
    94    printf( " --> %" PRItime_t ":%ld\n", diff.tv_sec, diff.tv_nsec );
     95    printf( " --> %" PRItime_t ":%ld\n", diff.tv_sec, diff.tv_nsec );
    9596  }
    9697
  • testsuites/samples/ticker/init.c

    r355d79fa r7c1e6942  
    1111 *  Output parameters:  NONE
    1212 *
    13  *  COPYRIGHT (c) 1989-1999.
     13 *  COPYRIGHT (c) 1989-2011.
    1414 *  On-Line Applications Research Corporation (OAR).
    1515 *
     
    5353
    5454  status = rtems_clock_set( &time );
     55  directive_failed( status, "clock get" );
    5556
    5657  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
     
    6263    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
    6364  );
     65  directive_failed( status, "create 1" );
     66
    6467  status = rtems_task_create(
    6568    Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    6669    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
    6770  );
     71  directive_failed( status, "create 2" );
     72
    6873  status = rtems_task_create(
    6974    Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    7075    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ]
    7176  );
     77  directive_failed( status, "create 3" );
    7278
    7379  status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
     80  directive_failed( status, "start 1" );
     81
    7482  status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );
     83  directive_failed( status, "start 2" );
     84
    7585  status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );
     86  directive_failed( status, "start 3" );
    7687
    7788  status = rtems_task_delete( RTEMS_SELF );
     89  directive_failed( status, "delete" );
    7890}
  • testsuites/samples/ticker/system.h

    r355d79fa r7c1e6942  
    1717#include <inttypes.h>
    1818#include "../../support/include/buffer_test_io.h"
     19#include "tmacros.h"
    1920
    2021/* functions */
     
    5455
    5556/*
    56  *  Handy macros and static inline functions
    57  */
    58 
    59 /*
    60  *  Macro to hide the ugliness of printing the time.
    61  */
    62 
    63 #define print_time(_s1, _tb, _s2) \
    64   do { \
    65     printf( "%s%02" PRId32 ":%02" PRId32 ":%02" PRId32 "   %02" PRId32 "/%02" PRId32 "/%04" PRId32 "%s", \
    66        _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \
    67        (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \
    68   } while ( 0 )
    69 
    70 /*
    71  *  Macro to print an task name that is composed of ASCII characters.
    72  *
    73  */
    74 
    75 #define put_name( _name, _crlf ) \
    76   do { \
    77     uint32_t   c0, c1, c2, c3; \
    78     \
    79     c0 = ((_name) >> 24) & 0xff; \
    80     c1 = ((_name) >> 16) & 0xff; \
    81     c2 = ((_name) >> 8) & 0xff; \
    82     c3 = (_name) & 0xff; \
    83     putchar( (char)c0 ); \
    84     if ( c1 ) putchar( (char)c1 ); \
    85     if ( c2 ) putchar( (char)c2 ); \
    86     if ( c3 ) putchar( (char)c3 ); \
    87     if ( (_crlf) ) \
    88       putchar( '\n' ); \
    89   } while (0)
    90 
    91 /*
    9257 *  This allows us to view the "Test_task" instantiations as a set
    9358 *  of numbered tasks by eliminating the number of application
  • testsuites/samples/ticker/tasks.c

    r355d79fa r7c1e6942  
    3030  rtems_id          tid;
    3131  rtems_time_of_day time;
    32   uint32_t    task_index;
     32  uint32_t          task_index;
    3333  rtems_status_code status;
    3434
    3535  status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
     36  directive_failed( status, "task ident" );
     37
    3638  task_index = task_number( tid );
    3739  for ( ; ; ) {
     
    4446    print_time( " - rtems_clock_get_tod - ", &time, "\n" );
    4547    status = rtems_task_wake_after(
    46       task_index * 5 * rtems_clock_get_ticks_per_second() );
     48      task_index * 5 * rtems_clock_get_ticks_per_second()
     49    );
     50    directive_failed( status, "wake after" );
    4751  }
    4852}
Note: See TracChangeset for help on using the changeset viewer.