summaryrefslogtreecommitdiffstats
path: root/ada_from_c_task/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'ada_from_c_task/app.c')
-rw-r--r--ada_from_c_task/app.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/ada_from_c_task/app.c b/ada_from_c_task/app.c
new file mode 100644
index 0000000..2ab91dc
--- /dev/null
+++ b/ada_from_c_task/app.c
@@ -0,0 +1,41 @@
+#include <rtems.h>
+
+#include <stdio.h>
+
+rtems_task c_task(
+ rtems_task_argument ignored
+)
+{
+ rtems_interval ticks_per_second;
+ int iterations;
+
+ ticks_per_second = rtems_clock_get_ticks_per_second();
+
+ for (iterations=0 ; ; iterations++ ) {
+ (void) rtems_task_wake_after( 1 * ticks_per_second );
+ printf( "C task loop iteration\n" );
+ example_ToBeCalled( iterations );
+ }
+}
+
+void initialize_application(void)
+{
+ rtems_status_code status;
+ rtems_id id;
+
+ status = rtems_task_create(
+ rtems_build_name( 'C', 'T', 'S', 'K' ),
+ 133,
+ RTEMS_MINIMUM_STACK_SIZE * 2,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &id
+ );
+ if ( status )
+ printf( "c_task create failed %d\n", status );
+
+ status = rtems_task_start( id, c_task, 0 );
+ if ( status )
+ printf( "c_task start failed %d\n", status );
+
+}