Changeset 61d2a1f in examples-v2


Ignore:
Timestamp:
Aug 29, 2014, 6:17:40 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 286403d7a3d0e521179e677c0d2fd7549c9ceab4
Children:
944b4f1
Parents:
c247956
Message:

Miscellaneous clean up and warning removal

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • cxx/cxx_throw/init.cc

    rc247956 r61d2a1f  
    165165
    166166#define CONFIGURE_MAXIMUM_TASKS 1
     167/*
     168 * GCC C++ support requires Classic Semaphores but this could change to
     169 * POSIX mutexes at some point in the future. When that happens, this will
     170 * need to change.
     171 */
     172#define CONFIGURE_MAXIMUM_SEMAPHORES 1
    167173
    168174#define CONFIGURE_INIT
  • hello/hello_world_c/test.c

    rc247956 r61d2a1f  
    11/*
    2  *  Simple test program -- simplified version of sample test hello.
     2 *  Classic API Hello World
    33 */
    44
    5 #include <bsp.h>
     5#include <rtems.h>
    66#include <stdlib.h>
    77#include <stdio.h>
     
    1919/* configuration information */
    2020
     21#include <bsp.h>
     22
    2123/* NOTICE: the clock driver is explicitly disabled */
    2224#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
    2325#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
     26#define CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM
    2427
    2528#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
  • hello/wscript

    rc247956 r61d2a1f  
    88def build(bld):
    99    bld.recurse('hello_world_c')
     10    bld.recurse('main')
    1011    if rtems.check_posix(bld):
    1112        bld.recurse('posix_hello_world')
  • led/event_server/init.c

    rc247956 r61d2a1f  
    1818)
    1919{
    20   rtems_event_set   events;
    21   rtems_status_code status;
     20  rtems_event_set events;
    2221
    2322  for ( ; ; ) {
    2423    events = 0;
    25     status = rtems_event_receive(
     24    (void) rtems_event_receive(
    2625      (RTEMS_EVENT_1 | RTEMS_EVENT_2),
    2726      RTEMS_EVENT_ANY,
     
    5655  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
    5756
    58   status = rtems_task_create(
     57  (void) rtems_task_create(
    5958    task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    6059    RTEMS_DEFAULT_ATTRIBUTES, &task_id
    6160  );
    6261
    63   status = rtems_task_start( task_id, Test_task, 1 );
     62  (void) rtems_task_start( task_id, Test_task, 1 );
    6463
    6564  for (count=0; ; count++) {
     
    7069      fputs( "send did not work\n", stderr );
    7170
    72     status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
     71    (void) rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    7372  }
    7473
    75   status = rtems_task_delete( RTEMS_SELF );
     74  (void) rtems_task_delete( RTEMS_SELF );
    7675}
    7776
  • led/msg_server/init.c

    rc247956 r61d2a1f  
    2121  uint32_t           count;
    2222  size_t             received;
    23   rtems_status_code  status;
    2423
    2524  for ( ; ; ) {
    2625    count = 0xFFFFFFFF;
    27     status = rtems_message_queue_receive(
     26    (void) rtems_message_queue_receive(
    2827      Queue_id,
    2928      (void *) &count,
     
    4544)
    4645{
    47   uint32_t          count = 0;
     46  uint32_t          count;
     47  rtems_id          task_id;
    4848  rtems_status_code status;
    49   rtems_id          task_id;
    50   rtems_name        task_name;
    5149
    5250  puts( "\n\n*** LED BLINKER -- message receive server ***" );
     
    5452  LED_INIT();
    5553
    56   status = rtems_message_queue_create(
     54  (void) rtems_message_queue_create(
    5755    rtems_build_name( 'Q', '1', ' ', ' ' ),
    5856    1,
     
    6260  );
    6361
    64   task_name = rtems_build_name( 'T', 'A', '1', ' ' );
    65 
    66   status = rtems_task_create(
    67     task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    68     RTEMS_DEFAULT_ATTRIBUTES, &task_id
     62  (void) rtems_task_create(
     63    rtems_build_name( 'T', 'A', '1', ' ' ),
     64    1,
     65    RTEMS_MINIMUM_STACK_SIZE,
     66    RTEMS_DEFAULT_MODES,
     67    RTEMS_DEFAULT_ATTRIBUTES,
     68    &task_id
    6969  );
    7070
    71   status = rtems_task_start( task_id, Test_task, 1 );
     71  (void) rtems_task_start( task_id, Test_task, 1 );
    7272
    7373  for (count=0; ; count++) {
     
    7878      fputs( "send did not work\n", stderr );
    7979
    80     status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
     80    (void) rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    8181  }
    8282
    83   status = rtems_task_delete( RTEMS_SELF );
     83  (void) rtems_task_delete( RTEMS_SELF );
    8484}
    8585
    8686/**************** START OF CONFIGURATION INFORMATION ****************/
    87 
    88 #define CONFIGURE_INIT
    8987
    9088#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
     
    9694#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    9795
    98 #define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
    99 
     96#define CONFIGURE_INIT
    10097#include <rtems/confdefs.h>
    10198
  • led/ratemon1/init.c

    rc247956 r61d2a1f  
    1717)
    1818{
    19   rtems_status_code status;
    2019  rtems_id          period_id;
    2120  rtems_interval    ticks;
     
    2625  LED_INIT();
    2726
    28   status = rtems_rate_monotonic_create(
     27  (void) rtems_rate_monotonic_create(
    2928    rtems_build_name( 'P', 'E', 'R', '1' ),
    3029    &period_id
     
    3433
    3534  for (count=0; ; count++) {
    36     status = rtems_rate_monotonic_period( period_id, ticks );
     35    (void) rtems_rate_monotonic_period( period_id, ticks );
    3736    if ( (count % 2) == 0 )
    3837      LED_OFF();
     
    4140  }
    4241
    43   status = rtems_task_delete( RTEMS_SELF );
     42  (void) rtems_task_delete( RTEMS_SELF );
    4443}
    4544
  • led/ratemon2/init.c

    rc247956 r61d2a1f  
    1717)
    1818{
    19   rtems_status_code status;
    2019  rtems_id          period_id1;
    2120  rtems_id          period_id2;
     
    2625  LED_INIT();
    2726
    28   status = rtems_rate_monotonic_create(
     27  (void) rtems_rate_monotonic_create(
    2928    rtems_build_name( 'P', 'E', 'R', '1' ),
    3029    &period_id1
    3130  );
    3231
    33   status = rtems_rate_monotonic_create(
     32  (void) rtems_rate_monotonic_create(
    3433    rtems_build_name( 'P', 'E', 'R', '2' ),
    3534    &period_id2
     
    3837  ticks = rtems_clock_get_ticks_per_second();
    3938
    40   status = rtems_rate_monotonic_period( period_id1, 2 * ticks );
     39  (void) rtems_rate_monotonic_period( period_id1, 2 * ticks );
    4140  LED_OFF();
    4241
    4342  (void) rtems_task_wake_after( ticks );
    44   status = rtems_rate_monotonic_period( period_id2, 2 * ticks );
     43  (void) rtems_rate_monotonic_period( period_id2, 2 * ticks );
    4544  LED_ON();
    4645
    4746  while (1) {
    48     status = rtems_rate_monotonic_period( period_id1, 2 * ticks );
     47    (void) rtems_rate_monotonic_period( period_id1, 2 * ticks );
    4948    LED_OFF();
    5049
    51     status = rtems_rate_monotonic_period( period_id2, 2 * ticks );
     50    (void) rtems_rate_monotonic_period( period_id2, 2 * ticks );
    5251    LED_ON();
    5352  }
    5453
    55   status = rtems_task_delete( RTEMS_SELF );
     54  (void) rtems_task_delete( RTEMS_SELF );
    5655}
    5756
    5857/**************** START OF CONFIGURATION INFORMATION ****************/
    5958
    60 #define CONFIGURE_INIT
    6159#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    6260#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
     
    6765#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    6866
    69 #define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
    70 
     67#define CONFIGURE_INIT
    7168#include <rtems/confdefs.h>
    7269
  • led/timeout_event/init.c

    rc247956 r61d2a1f  
    2828  for (count=0; ; count++) {
    2929
    30     status = rtems_event_receive( RTEMS_EVENT_1,
    31       RTEMS_DEFAULT_OPTIONS, rtems_clock_get_ticks_per_second(), &events );
     30    status = rtems_event_receive(
     31      RTEMS_EVENT_1,
     32      RTEMS_DEFAULT_OPTIONS,
     33      rtems_clock_get_ticks_per_second(),
     34      &events
     35    );
    3236    if ( status != RTEMS_TIMEOUT )
    3337      fputs( "receive did not timeout\n", stderr );
     
    4044  }
    4145
    42   status = rtems_task_delete( RTEMS_SELF );
     46  (void) rtems_task_delete( RTEMS_SELF );
    4347}
    4448
    4549/**************** START OF CONFIGURATION INFORMATION ****************/
    4650
    47 #define CONFIGURE_INIT
    4851#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    4952#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
     
    5356#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    5457
    55 #define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
    56 
     58#define CONFIGURE_INIT
    5759#include <rtems/confdefs.h>
    5860
  • led/timer/init.c

    rc247956 r61d2a1f  
    3838rtems_timer_service_routine Timer_Routine( rtems_id id, void *ignored )
    3939{
    40   rtems_status_code status;
    41 
    4240  if ( id == Timer1 )
    4341    led_value = 1;
     
    4644  led_do_print = 1;
    4745
    48   status = rtems_timer_fire_after(
     46  (void) rtems_timer_fire_after(
    4947    id,
    5048    2 * rtems_clock_get_ticks_per_second(),
     
    5856)
    5957{
    60   rtems_status_code status;
    61 
    6258  puts( "\n\n*** LED BLINKER -- timer ***" );
    6359
    6460  LED_INIT();
    6561
    66   status = rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '1' ), &Timer1);
    67   if ( status != RTEMS_SUCCESSFUL )
    68     fputs( "Timer1 create failed\n", stderr );
     62  (void) rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '1' ), &Timer1);
    6963
    70   status = rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '2' ), &Timer2);
    71   if ( status != RTEMS_SUCCESSFUL )
    72     fputs( "Timer2 create failed\n", stderr );
     64  (void) rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '2' ), &Timer2);
    7365
    7466  Timer_Routine(Timer1, NULL);
    7567  LED_Change_Routine();
    7668
    77   status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
     69  (void) rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    7870
    7971  Timer_Routine(Timer2, NULL);
     
    8173
    8274  while (1) {
    83     status = rtems_task_wake_after( 10 );
     75    (void) rtems_task_wake_after( 10 );
    8476    LED_Change_Routine();
    8577  }
    8678
    87   status = rtems_task_delete( RTEMS_SELF );
     79  (void) rtems_task_delete( RTEMS_SELF );
    8880}
    8981
     
    9991#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    10092
    101 #define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
    102 
    10393#define CONFIGURE_INIT
    10494#include <rtems/confdefs.h>
  • led/timer_server/init.c

    rc247956 r61d2a1f  
    1818rtems_timer_service_routine Timer_Routine( rtems_id id, void *ignored )
    1919{
    20   rtems_status_code status;
    21 
    2220  if ( id == Timer1 )
    2321    LED_OFF();
     
    2523    LED_ON();
    2624
    27   status = rtems_timer_server_fire_after(
     25  (void) rtems_timer_server_fire_after(
    2826    id,
    2927    2 * rtems_clock_get_ticks_per_second(),
     
    3735)
    3836{
    39   rtems_status_code status;
    40 
    4137  puts( "\n\n*** LED BLINKER -- timer_server ***" );
    4238
    4339  LED_INIT();
    4440
    45   status = rtems_timer_initiate_server(
     41  (void) rtems_timer_initiate_server(
    4642    1,
    4743    RTEMS_MINIMUM_STACK_SIZE * 2,
     
    4945  );
    5046
    51   if ( status != RTEMS_SUCCESSFUL )
    52     fputs( "timer create server failed\n", stderr );
     47  (void) rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '1' ), &Timer1);
    5348
    54   status = rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '1' ), &Timer1);
    55   if ( status != RTEMS_SUCCESSFUL )
    56     fputs( "Timer1 create failed\n", stderr );
    57 
    58   status = rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '2' ), &Timer2);
    59   if ( status != RTEMS_SUCCESSFUL )
    60     fputs( "Timer2 create failed\n", stderr );
     49  (void) rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '2' ), &Timer2);
    6150
    6251  Timer_Routine(Timer1, NULL);
    6352
    64   status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
     53  (void) rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    6554
    6655  Timer_Routine(Timer2, NULL);
    6756
    68   status = rtems_task_delete( RTEMS_SELF );
     57  (void) rtems_task_delete( RTEMS_SELF );
    6958}
    7059
     
    8069#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
    8170
    82 #define CONFIGURE_EXTRA_TASK_STACKS         (3 * RTEMS_MINIMUM_STACK_SIZE)
     71#define CONFIGURE_EXTRA_TASK_STACKS         (RTEMS_MINIMUM_STACK_SIZE)
    8372
    8473#define CONFIGURE_INIT
  • ticker/ticker/init.c

    rc247956 r61d2a1f  
    1919
    2020rtems_task Test_task(
    21   rtems_task_argument unused
     21  rtems_task_argument task_index
    2222)
    2323{
    24   rtems_id          tid;
    2524  rtems_time_of_day time;
    26   uint32_t          task_index;
    27   rtems_status_code status;
     25  rtems_interval    ticks;
    2826
    29   status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
    30   task_index = task_number( tid );
     27  ticks = task_index * 5 * rtems_clock_get_ticks_per_second();
     28
    3129  for ( ; ; ) {
    32     status = rtems_clock_get_tod( &time );
     30    (void) rtems_clock_get_tod( &time );
    3331    if ( time.second >= 35 ) {
    3432      puts( "*** END OF CLOCK TICK TEST ***" );
     
    3735    put_name( Task_name[ task_index ], FALSE );
    3836    print_time( " - rtems_clock_get_tod - ", &time, "\n" );
    39     status = rtems_task_wake_after(
    40       task_index * 5 * rtems_clock_get_ticks_per_second()
    41     );
     37    (void) rtems_task_wake_after( ticks );
    4238  }
    4339}
     
    4743)
    4844{
    49   rtems_status_code status;
    5045  rtems_time_of_day time;
    5146
     
    6055  time.ticks  = 0;
    6156
    62   status = rtems_clock_set( &time );
     57  (void) rtems_clock_set( &time );
    6358
    6459  Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
     
    6661  Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
    6762
    68   status = rtems_task_create(
     63  (void) rtems_task_create(
    6964    Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    7065    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
    7166  );
    72   status = rtems_task_create(
     67  (void) rtems_task_create(
    7368    Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    7469    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ]
    7570  );
    76   status = rtems_task_create(
     71  (void) rtems_task_create(
    7772    Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    7873    RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ]
    7974  );
    8075
    81   status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
    82   status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );
    83   status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );
     76  (void) rtems_task_start( Task_id[ 1 ], Test_task, 1 );
     77  (void) rtems_task_start( Task_id[ 2 ], Test_task, 2 );
     78  (void) rtems_task_start( Task_id[ 3 ], Test_task, 3 );
    8479
    85   status = rtems_task_delete( RTEMS_SELF );
     80  (void) rtems_task_delete( RTEMS_SELF );
    8681}
    8782
    8883/**************** START OF CONFIGURATION INFORMATION ****************/
    89 
    90 #define CONFIGURE_INIT
    9184
    9285#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
     
    10093#define CONFIGURE_EXTRA_TASK_STACKS       (4 * RTEMS_MINIMUM_STACK_SIZE)
    10194
     95#define CONFIGURE_INIT
    10296#include <rtems/confdefs.h>
    10397
Note: See TracChangeset for help on using the changeset viewer.