source: rtems/testsuites/mptests/mp14/evtmtask.c @ 7753aa9f

4.104.114.95
Last change on this file since 7753aa9f was 7753aa9f, checked in by Joel Sherrill <joel.sherrill@…>, on 09/05/08 at 21:30:17

2008-09-05 Joel Sherrill <joel.sherrill@…>

  • mp14/delay.c, mp14/evtmtask.c: Pass task Id to TSR.
  • mp14/system.h: Semaphore_task_id and Semaphore_task_name arrays were one entry too short.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*  Delayed_events_task
2 *
3 *  This task continuously sends itself events at one tick
4 *  intervals.
5 *
6 *  Input parameters:
7 *    argument - task argument
8 *
9 *  Output parameters:  NONE
10 *
11 *  COPYRIGHT (c) 1989-1999.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.com/license/LICENSE.
17 *
18 *  $Id$
19 */
20
21#include "system.h"
22
23rtems_task Delayed_events_task(
24  rtems_task_argument argument
25)
26{
27  uint32_t          count;
28  uint32_t          previous_mode;
29  rtems_status_code status;
30  rtems_event_set   events;
31  rtems_id          self;
32
33  status = rtems_task_mode(
34    RTEMS_PREEMPT | RTEMS_TIMESLICE,
35    RTEMS_PREEMPT_MASK | RTEMS_TIMESLICE_MASK,
36    &previous_mode
37  );
38  directive_failed( status, "rtems_task_mode" );
39
40  status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
41  directive_failed( status, "rtems_timer_create" );
42
43  self = rtems_task_self();
44
45  while ( Stop_Test == false ) {
46    for ( count=DELAYED_EVENT_DOT_COUNT; Stop_Test == false && count; count-- ){
47      status = rtems_timer_fire_after(
48        Timer_id[ 1 ],
49        1,
50        Delayed_send_event,
51        &self
52      );
53      directive_failed( status, "rtems_timer_reset" );
54
55      status = rtems_event_receive(
56        RTEMS_EVENT_16,
57        RTEMS_DEFAULT_OPTIONS,
58        RTEMS_NO_TIMEOUT,
59        &events
60      );
61      directive_failed( status, "rtems_event_receive" );
62    }
63    put_dot('.');
64  }
65
66  Exit_test();
67}
Note: See TracBrowser for help on using the repository browser.