Changeset c7ee085 in examples-v2


Ignore:
Timestamp:
Dec 17, 2009, 8:09:11 PM (10 years ago)
Author:
Glenn Humphrey <glenn.humphrey@…>
Branches:
4.11, examples-v2-4-10-branch, 286403d7a3d0e521179e677c0d2fd7549c9ceab4
Children:
a3bf3ec
Parents:
22c7774
Message:

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

  • delay/init.c, event_server/init.c, msg_server/init.c, posix_cond_server/test.c, posix_delay_nanosleep/test.c, posix_delay_sleep/test.c, posix_mutex_server/test.c, ratemon1/init.c, ratemon2/init.c, ratemon_cond_server/test.c, sem_server/init.c, timeout_event/init.c: Cleaned up the led examples to produce similiar output.
  • timer_server/.cvsignore: New file.
Location:
led
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • led/ChangeLog

    r22c7774 rc7ee085  
     12009-12-17      Glenn Humphrey <glenn.humphrey@OARcorp.com>
     2
     3        * delay/init.c, event_server/init.c, msg_server/init.c,
     4        posix_cond_server/test.c, posix_delay_nanosleep/test.c,
     5        posix_delay_sleep/test.c, posix_mutex_server/test.c, ratemon1/init.c,
     6        ratemon2/init.c, ratemon_cond_server/test.c, sem_server/init.c,
     7        timeout_event/init.c: Cleaned up the led examples to produce similiar
     8        output.
     9        * timer_server/.cvsignore: New file.
     10
    1112009-10-12      Glenn Humphrey <glenn.humphrey@OARcorp.com>
    212
  • led/delay/init.c

    r22c7774 rc7ee085  
    11/*
    2  *  COPYRIGHT (c) 1989-2007.
     2 *  COPYRIGHT (c) 1989-2009.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    2828
    2929    (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
     30    LED_OFF();
     31    (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
    3032    LED_ON();
    31     (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
    32     LED_OFF();
    3333
    3434  }
  • led/event_server/init.c

    r22c7774 rc7ee085  
    11/*
    2  *  COPYRIGHT (c) 1989-2007.
     2 *  COPYRIGHT (c) 1989-2009.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    3333
    3434    if ( events == RTEMS_EVENT_1 ) {
     35      LED_OFF();
     36    } else if ( events == RTEMS_EVENT_2 ) {
    3537      LED_ON();
    36     } else if ( events == RTEMS_EVENT_2 ) {
    37       LED_OFF();
    3838    } else {
    3939      fprintf( stderr, "Incorrect event set 0x%08" PRIx32 "\n", events );
     
    6666  status = rtems_task_start( task_id, Test_task, 1 );
    6767
    68   while (1) {
     68  for (count=0; ; count++) {
    6969
    70     events = ( (count++ % 2) == 0 ) ?  RTEMS_EVENT_1 : RTEMS_EVENT_2;
     70    events = ( (count % 2) == 0 ) ?  RTEMS_EVENT_1 : RTEMS_EVENT_2;
    7171    status = rtems_event_send( task_id, events );
    7272    if ( status != RTEMS_SUCCESSFUL )
  • led/msg_server/init.c

    r22c7774 rc7ee085  
    11/*
    2  *  COPYRIGHT (c) 1989-2007.
     2 *  COPYRIGHT (c) 1989-2009.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    3636
    3737    if ( (count % 2) == 0 ) {
     38      LED_OFF();
     39    } else {
    3840      LED_ON();
    39     } else {
    40       LED_OFF();
    4141    }
    4242  }
     
    7272    &Queue_id
    7373  );
    74   while (1) {
    7574
    76     count++;
     75  for (count=0; ; count++) {
     76
    7777    /* fprintf( stderr, "send 0x%d\n", count ); */
    7878    status = rtems_message_queue_send( Queue_id, &count, sizeof(uint32_t) );
  • led/posix_cond_server/test.c

    r22c7774 rc7ee085  
    2828    fprintf( stderr, "Server - lock did not work (%d)\n", status );
    2929
    30   for ( ; ; ) {
     30  for (count=0; ; count++) {
    3131
    3232    status = pthread_cond_wait( &Condition, &Mutex );
     
    3434      fprintf( stderr, "Server - condition wait did not work (%d)\n", status );
    3535
    36     if ((++count % 2) == 0)
     36    if ((count % 2) == 0)
    3737      LED_OFF();
    3838    else
     
    4747{
    4848  pthread_t thread_id;
    49   int status;
     49  int       status;
    5050
    5151  puts( "\n\n*** LED BLINKER -- sleep with pthread condition variables ***" );
  • led/posix_delay_nanosleep/test.c

    r22c7774 rc7ee085  
    2626
    2727    (void) nanosleep( &delay, NULL );
     28    LED_OFF();
     29    (void) nanosleep( &delay, NULL );
    2830    LED_ON();
    29     (void) nanosleep( &delay, NULL );
    30     LED_OFF();
    3131
    3232  }
  • led/posix_delay_sleep/test.c

    r22c7774 rc7ee085  
    2222
    2323    (void) sleep( 1 );
     24    LED_OFF();
     25    (void) sleep( 1 );
    2426    LED_ON();
    25     (void) sleep( 1 );
    26     LED_OFF();
    2727
    2828  }
  • led/posix_mutex_server/test.c

    r22c7774 rc7ee085  
    2222  LED_INIT();
    2323
    24   sleep( 1 );
     24  for ( ; ; ) {
    2525
    26   for ( ; ; ) {
    2726    status = pthread_mutex_lock( &Mutex );
    28     if ( status )
     27    if (status)
    2928      fprintf( stderr, "Server - lock did not work (%d)\n", status );
    3029
    31     LED_OFF();
     30    LED_ON();
    3231
    3332    status = sleep( 1 );
    3433
    3534    status = pthread_mutex_unlock( &Mutex );
    36     if ( status )
     35    if (status)
    3736      fprintf( stderr, "Server - unlock did not work (%d)\n", status );
    38 
    3937
    4038  }
     
    7573    fprintf( stderr, "Main -- first lock did not work (%d)\n", status );
    7674
    77   if ( status )
    78     fprintf( stderr, "Main - lock did not work (%d)\n", status );
     75  for ( ; ; ) {
    7976
    80   for ( ; ; ) {
    81     LED_ON();
     77    LED_OFF();
    8278
    8379    status = sleep( 1 );
    8480
    8581    status = pthread_mutex_unlock( &Mutex );
    86     if ( status )
     82    if (status)
    8783      fprintf( stderr, "Main - unlock did not work (%d)\n", status );
    8884
    8985    status = pthread_mutex_lock( &Mutex );
    90     if ( status )
     86    if (status)
    9187      fprintf( stderr, "Main - lock did not work (%d)\n", status );
    92 
    93 
    9488
    9589  }
  • led/ratemon1/init.c

    r22c7774 rc7ee085  
    11/*
    2  *  COPYRIGHT (c) 1989-2007.
     2 *  COPYRIGHT (c) 1989-2009.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    3333  );
    3434
    35   count = 0;
    3635  ticks = rtems_clock_get_ticks_per_second();
    3736
    38   while (1) {
     37  for (count=0; ; count++) {
    3938    status = rtems_rate_monotonic_period( period_id, ticks );
    40     if ( (++count % 2) == 0 )
     39    if ( (count % 2) == 0 )
     40      LED_OFF();
     41    else
    4142      LED_ON();
    42     else
    43       LED_OFF();
    4443  }
    4544
  • led/ratemon2/init.c

    r22c7774 rc7ee085  
    11/*
    2  *  COPYRIGHT (c) 1989-2007.
     2 *  COPYRIGHT (c) 1989-2009.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    4141
    4242  status = rtems_rate_monotonic_period( period_id1, 2 * ticks );
    43   LED_ON();
     43  LED_OFF();
    4444
    4545  (void) rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
    4646  status = rtems_rate_monotonic_period( period_id2, 2 * ticks );
    47   LED_OFF();
     47  LED_ON();
    4848
    4949  while (1) {
    5050    status = rtems_rate_monotonic_period( period_id1, 2 * ticks );
    51     LED_ON();
     51    LED_OFF();
    5252
    5353    status = rtems_rate_monotonic_period( period_id2, 2 * ticks );
    54     LED_OFF();
     54    LED_ON();
    5555  }
    5656
  • led/ratemon_cond_server/test.c

    r22c7774 rc7ee085  
    2929    fprintf( stderr, "Server - lock did not work (%d)\n", status );
    3030
    31   for ( ; ; ) {
     31  for (count=0; ; count++) {
    3232
    3333    status = pthread_cond_wait( &Condition, &Mutex );
     
    3535      fprintf( stderr, "Server - condition wait did not work (%d)\n", status );
    3636
    37     if ((++count % 2) == 0)
     37    if ((count % 2) == 0)
    3838      LED_OFF();
    3939    else
  • led/sem_server/init.c

    r22c7774 rc7ee085  
    11/*
    2  *  COPYRIGHT (c) 1989-2007.
     2 *  COPYRIGHT (c) 1989-2009.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    3535      fputs( "Task - obtain did not work\n", stderr );
    3636
    37     LED_OFF();
     37    LED_ON();
    3838
    3939    status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
     
    8181  while (1) {
    8282
    83     LED_ON();
     83    LED_OFF();
    8484    status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    8585    assert( status == RTEMS_SUCCESSFUL );
  • led/timeout_event/init.c

    r22c7774 rc7ee085  
    11/*
    2  *  COPYRIGHT (c) 1989-2007.
     2 *  COPYRIGHT (c) 1989-2009.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    2828  LED_INIT();
    2929
    30   while (1) {
     30  for (count=0; ; count++) {
    3131
    3232    status = rtems_event_receive( RTEMS_EVENT_1,
     
    3535      fputs( "receive did not timeout\n", stderr );
    3636
    37     if ( (count++ % 2) == 0 )
     37    if ( (count % 2) == 0 )
     38      LED_OFF();
     39    else
    3840      LED_ON();
    39     else
    40       LED_OFF();
    4141
    4242  }
Note: See TracChangeset for help on using the changeset viewer.