Changeset 778e80d in examples-v2


Ignore:
Timestamp:
Oct 12, 2009, 8:59:26 PM (10 years ago)
Author:
Glenn Humphrey <glenn.humphrey@…>
Branches:
4.11, examples-v2-4-10-branch, 286403d7a3d0e521179e677c0d2fd7549c9ceab4
Children:
b1d5a73
Parents:
956c2e4
Message:

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

  • Makefile, timer/init.c: Split the timer example into two examples and cleaned up resource usage.
  • timer_server/Makefile, timer_server/init.c: New files.
Location:
led
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • led/ChangeLog

    r956c2e4 r778e80d  
     12009-10-12      Glenn Humphrey <glenn.humphrey@OARcorp.com>
     2
     3        * Makefile, timer/init.c: Split the timer example into two examples
     4        and cleaned up resource usage.
     5        * timer_server/Makefile, timer_server/init.c: New files.
     6
    172009-09-24      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • led/Makefile

    r956c2e4 r778e80d  
    88
    99SUBDIRS=delay event_server msg_server sem_server ratemon1 ratemon2 \
    10   timeout_event timer
     10  timeout_event timer timer_server
    1111
    1212# If the POSIX API isn't enabled, we can't build these
  • led/timer/init.c

    r956c2e4 r778e80d  
    1313#include <bsp.h>
    1414
    15 #include "../../testmacros.h"
    1615#include "../led.h"
    1716
     
    1918rtems_id          Timer2;
    2019
    21 #define USE_TIMER_SERVER
    2220#if defined(__LED_PRINTING)
    2321volatile int led_do_print;
     
    4240#endif
    4341
    44 #if defined(USE_TIMER_SERVER)
    45   status = rtems_timer_server_fire_after(
    46 #else
    4742  status = rtems_timer_fire_after(
    48 #endif
    4943    id,
    50     2 * get_ticks_per_second(),
     44    2 * rtems_clock_get_ticks_per_second(),
    5145    Timer_Routine,
    5246    NULL
     
    6458  LED_INIT();
    6559
    66 #if defined(USE_TIMER_SERVER)
    67   status = rtems_timer_initiate_server(
    68     1,
    69     RTEMS_MINIMUM_STACK_SIZE * 2,
    70     RTEMS_DEFAULT_ATTRIBUTES
    71   );
    72 
    73   if ( status != RTEMS_SUCCESSFUL )
    74     fputs( "timer create server failed\n", stderr );
    75 #endif
    76 
    7760  status = rtems_timer_create(rtems_build_name( 'T', 'M', 'R', '1' ), &Timer1);
    7861  if ( status != RTEMS_SUCCESSFUL )
     
    8568  Timer_Routine(Timer1, NULL);
    8669
    87   status = rtems_task_wake_after( get_ticks_per_second() );
     70  status = rtems_task_wake_after( rtems_clock_get_ticks_per_second() );
    8871
    8972  Timer_Routine(Timer2, NULL);
    9073
    91 
    9274#if defined(__LED_PRINTING)
    93  
    9475  while (1) {
    9576    int _led_do_print;
     
    11394  }
    11495#endif
     96
    11597  status = rtems_task_delete( RTEMS_SELF );
    11698}
     
    123105#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    124106
    125 #define CONFIGURE_MAXIMUM_TASKS         4
     107#define CONFIGURE_MAXIMUM_TASKS         1
    126108#define CONFIGURE_MAXIMUM_TIMERS        2
    127 #define CONFIGURE_MAXIMUM_SEMAPHORES    20
    128109
    129110#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
Note: See TracChangeset for help on using the changeset viewer.