Changeset b1d5a73 in examples-v2


Ignore:
Timestamp:
Oct 12, 2009, 9:02:40 PM (10 years ago)
Author:
Glenn Humphrey <glenn.humphrey@…>
Branches:
4.11, examples-v2-4-10-branch, 286403d7a3d0e521179e677c0d2fd7549c9ceab4
Children:
f15ae40
Parents:
778e80d
Message:

2009-10-12 Glenn Humphrey <glenn.humphrey@…>

  • 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.
Location:
led
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • led/ChangeLog

    r778e80d rb1d5a73  
     12009-10-12      Glenn Humphrey <glenn.humphrey@OARcorp.com>
     2
     3        * delay/init.c, event_server/init.c, msg_server/init.c,
     4        ratemon1/init.c, ratemon2/init.c, sem_server/init.c,
     5        timeout_event/init.c: Cleaned up unused variables and standardized
     6        for inclusion into RTEMS class materials.
     7
    182009-10-12      Glenn Humphrey <glenn.humphrey@OARcorp.com>
    29
  • led/delay/init.c

    r778e80d rb1d5a73  
    1313#include <bsp.h>
    1414
    15 #include "../../testmacros.h"
    1615#include "../led.h"
    1716
     
    2827  while (1) {
    2928
    30     (void) rtems_task_wake_after( 1 * get_ticks_per_second() );
     29    (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
    3130    LED_ON();
    32     (void) rtems_task_wake_after( 1 * get_ticks_per_second() );
     31    (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
    3332    LED_OFF();
    3433
  • led/event_server/init.c

    r778e80d rb1d5a73  
    1414#include <stdio.h>
    1515
    16 #include "../../testmacros.h"
    1716#include "../led.h"
    1817
     
    2322  rtems_event_set   events;
    2423  rtems_status_code status;
    25 
    26   LED_INIT();
    2724
    2825  for ( ; ; ) {
     
    4542}
    4643
    47 /*
    48  *  Keep the names and IDs in global variables so another task can use them.
    49  */
    50 
    51 rtems_id   Task_id[ 4 ];         /* array of task ids */
    52 rtems_name Task_name[ 4 ];       /* array of task names */
    5344
    5445rtems_task Init(
     
    5647)
    5748{
    58   rtems_status_code status;
    5949  uint32_t          count = 0;
    6050  rtems_event_set   events;
     51  rtems_status_code status;
     52  rtems_id          task_id;
     53  rtems_name        task_name;
    6154
    6255  puts( "\n\n*** LED BLINKER -- event receive server ***" );
    6356
    64   Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
     57  LED_INIT();
     58
     59  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
    6560
    6661  status = rtems_task_create(
    67     Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    68     RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
     62    task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
     63    RTEMS_DEFAULT_ATTRIBUTES, &task_id
    6964  );
    7065
    71   status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
     66  status = rtems_task_start( task_id, Test_task, 1 );
    7267
    7368  while (1) {
    7469
    7570    events = ( (count++ % 2) == 0 ) ?  RTEMS_EVENT_1 : RTEMS_EVENT_2;
    76     status = rtems_event_send( Task_id[ 1 ], events );
     71    status = rtems_event_send( task_id, events );
    7772    if ( status != RTEMS_SUCCESSFUL )
    7873      fputs( "send did not work\n", stderr );
    7974
    80     status = rtems_task_wake_after( get_ticks_per_second() );
     75    status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    8176  }
    8277
  • led/msg_server/init.c

    r778e80d rb1d5a73  
    1313#include <bsp.h>
    1414
    15 #include "../../testmacros.h"
    1615#include "../led.h"
    1716
    18 /*
    19  *  Keep the names and IDs in global variables so another task can use them.
    20  */
    21 
    22 rtems_id   Task_id[ 4 ];         /* array of task ids */
    23 rtems_name Task_name[ 4 ];       /* array of task names */
    2417rtems_id   Queue_id;
    25 
    2618
    2719rtems_task Test_task(
     
    3224  size_t             received;
    3325  rtems_status_code  status;
    34 
    35   LED_INIT();
    3626
    3727  for ( ; ; ) {
     
    5747)
    5848{
     49  uint32_t          count = 0;
    5950  rtems_status_code status;
    60   uint32_t          count = 0;
     51  rtems_id          task_id;
     52  rtems_name        task_name;
    6153
    6254  puts( "\n\n*** LED BLINKER -- message receive server ***" );
    6355
    64   Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
     56  LED_INIT();
     57
     58  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
    6559
    6660  status = rtems_task_create(
    67     Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    68     RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
     61    task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
     62    RTEMS_DEFAULT_ATTRIBUTES, &task_id
    6963  );
    7064
    71   status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
     65  status = rtems_task_start( task_id, Test_task, 1 );
    7266
    7367  status = rtems_message_queue_create(
     
    8680      fputs( "send did not work\n", stderr );
    8781
    88     status = rtems_task_wake_after( get_ticks_per_second() );
     82    status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    8983  }
    9084
     
    9993#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    10094
    101 #define CONFIGURE_MAXIMUM_TASKS             4
     95#define CONFIGURE_MAXIMUM_TASKS             2
    10296#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES    1
    10397
  • led/ratemon1/init.c

    r778e80d rb1d5a73  
    1313#include <bsp.h>
    1414
    15 #include "../../testmacros.h"
    1615#include "../led.h"
    1716
     
    3534
    3635  count = 0;
    37   ticks = get_ticks_per_second();
     36  ticks = rtems_clock_get_ticks_per_second();
    3837
    3938  while (1) {
  • led/ratemon2/init.c

    r778e80d rb1d5a73  
    1313#include <bsp.h>
    1414
    15 #include "../../testmacros.h"
    1615#include "../led.h"
    1716
     
    3938  );
    4039
    41   ticks = get_ticks_per_second();
     40  ticks = rtems_clock_get_ticks_per_second();
    4241
    4342  status = rtems_rate_monotonic_period( period_id1, 2 * ticks );
    4443  LED_ON();
    4544
    46   (void) rtems_task_wake_after( 1 * get_ticks_per_second() );
     45  (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
    4746  status = rtems_rate_monotonic_period( period_id2, 2 * ticks );
    4847  LED_OFF();
     
    6564#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    6665
    67 #define CONFIGURE_MAXIMUM_TASKS             4
     66#define CONFIGURE_MAXIMUM_TASKS             1
    6867#define CONFIGURE_MAXIMUM_PERIODS           2
    6968
  • led/sem_server/init.c

    r778e80d rb1d5a73  
    1414#include <assert.h>
    1515
    16 #include "../../testmacros.h"
    1716#include "../led.h"
    1817
    19 /*
    20  *  Keep the names and IDs in global variables so another task can use them.
    21  */
    22 
    23 rtems_id   Task_id[ 4 ];         /* array of task ids */
    24 rtems_name Task_name[ 4 ];       /* array of task names */
    2518rtems_id   Sem_id;
    2619
     
    3124  rtems_status_code status;
    3225
    33   LED_INIT();
     26  for ( ; ; ) {
    3427
    35   for ( ; ; ) {
     28    /* Semaphore not available, ensured to block */
    3629    status = rtems_semaphore_obtain(
    3730      Sem_id,
     
    4437    LED_OFF();
    4538
    46     status = rtems_task_wake_after( get_ticks_per_second() );
     39    status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    4740    assert( status == RTEMS_SUCCESSFUL );
    4841
     42    /* Transfers semaphore to Init task */
    4943    status = rtems_semaphore_release( Sem_id );
    5044    if ( status != RTEMS_SUCCESSFUL )
     
    5852{
    5953  rtems_status_code status;
     54  rtems_id          task_id;
     55  rtems_name        task_name;
    6056
    6157  puts( "\n\n*** LED BLINKER -- semaphore ping/pong ***" );
    6258
    63   Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
     59  LED_INIT();
     60
     61  task_name = rtems_build_name( 'T', 'A', '1', ' ' );
    6462
    6563  status = rtems_semaphore_create(
    6664    rtems_build_name( 'S', 'E', 'M', ' ' ),
    67     0,
     65    0,  /* created locked */
    6866    RTEMS_DEFAULT_ATTRIBUTES,
    6967    0,
     
    7371
    7472  status = rtems_task_create(
    75     Task_name[ 1 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
    76     RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ]
     73    task_name, 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES,
     74    RTEMS_DEFAULT_ATTRIBUTES, &task_id
    7775  );
    7876  assert( status == RTEMS_SUCCESSFUL );
    7977
    80   status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
     78  status = rtems_task_start( task_id, Test_task, 1 );
    8179  assert( status == RTEMS_SUCCESSFUL );
    8280
     
    8482
    8583    LED_ON();
    86     status = rtems_task_wake_after( get_ticks_per_second() );
     84    status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    8785    assert( status == RTEMS_SUCCESSFUL );
    8886
     87    /* Transfers semaphore to TA1 */
    8988    status = rtems_semaphore_release( Sem_id );
    9089    if ( status != RTEMS_SUCCESSFUL )
    9190      fputs( "init - release did not work\n", stderr );
    9291
     92    /* Semaphore not available, ensured to block */
    9393    status = rtems_semaphore_obtain(
    9494      Sem_id,
     
    111111#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    112112
    113 #define CONFIGURE_MAXIMUM_TASKS         4
     113#define CONFIGURE_MAXIMUM_TASKS         2
    114114#define CONFIGURE_MAXIMUM_SEMAPHORES    1
    115115
  • led/timeout_event/init.c

    r778e80d rb1d5a73  
    1414#include <stdio.h>
    1515
    16 #include "../../testmacros.h"
    1716#include "../led.h"
    18 
    19 /*
    20  *  Keep the names and IDs in global variables so another task can use them.
    21  */
    22 
    23 rtems_id   Task_id[ 4 ];         /* array of task ids */
    24 rtems_name Task_name[ 4 ];       /* array of task names */
    2517
    2618rtems_task Init(
     
    3931
    4032    status = rtems_event_receive( RTEMS_EVENT_1,
    41       RTEMS_DEFAULT_OPTIONS, get_ticks_per_second(), &events );
     33      RTEMS_DEFAULT_OPTIONS, rtems_clock_get_ticks_per_second(), &events );
    4234    if ( status != RTEMS_TIMEOUT )
    4335      fputs( "receive did not timeout\n", stderr );
     
    5951#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    6052
    61 #define CONFIGURE_MAXIMUM_TASKS             4
     53#define CONFIGURE_MAXIMUM_TASKS             1
    6254
    6355#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
Note: See TracChangeset for help on using the changeset viewer.