source: ada-examples/ada_from_c_task/app.c @ d4c4aba

ada-examples-4-10-branch
Last change on this file since d4c4aba was d4c4aba, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 17, 2009 at 6:13:31 PM

2009-09-17 Joel Sherrill <joel.sherrill@…>

  • Makefile, ada_from_c.adb, app.c: Make follow standard RTEMS test output format. Add output screens where appropriate.
  • ada_from_c_task.scn: New file.
  • Property mode set to 100644
File size: 875 bytes
Line 
1/*
2 *  $Id$
3 */
4
5#include <rtems.h>
6
7#include <stdio.h>
8
9rtems_task c_task(
10  rtems_task_argument ignored
11)
12{
13  rtems_interval ticks_per_second;
14  int            iterations;
15
16  ticks_per_second = rtems_clock_get_ticks_per_second();
17
18  for (iterations=0 ; ; iterations++ ) {
19    (void) rtems_task_wake_after( 1 * ticks_per_second );
20    printf( "C task loop iteration\n" );
21    example_ToBeCalled( iterations );
22  }
23}
24
25void initialize_application(void)
26{
27  rtems_status_code status;
28  rtems_id          id;
29
30  status = rtems_task_create(
31    rtems_build_name( 'C', 'T', 'S', 'K' ),
32    133,
33    RTEMS_MINIMUM_STACK_SIZE * 2,
34    RTEMS_DEFAULT_MODES,
35    RTEMS_DEFAULT_ATTRIBUTES,
36    &id
37  );
38  if ( status )
39    printf( "c_task create failed %d\n", status );
40
41  status = rtems_task_start( id, c_task, 0 );
42  if ( status )
43    printf( "c_task start failed %d\n", status );
44
45}
Note: See TracBrowser for help on using the repository browser.