]> rtime.felk.cvut.cz Git - rtems-devel.git/blob - rtems-omk-template/appsmptest/task_1.c
appsmptest: include simple application to test RTEMS SMP capabilities.
[rtems-devel.git] / rtems-omk-template / appsmptest / task_1.c
1 #include <system_def.h>
2 #include "system.h"
3 #include "app_def.h"
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <rtems/untar.h>
7 #include <rtems/error.h>
8 #include <rtems/mw_uid.h>
9 #include <errno.h>
10
11
12 rtems_task Task_1(
13   rtems_task_argument argument
14 )
15 {
16   int loops = 10;
17   int id = (int)argument;
18   rtems_status_code status;
19   printf("*** Starting up Task_%d ***\n", id);
20
21   while(loops--){
22     printf("Task_%d woken\n", id);
23     status = rtems_task_wake_after(rtems_clock_get_ticks_per_second());
24     check_rtems_status( status, 0, "rtems_task_wake_after" );
25   }
26   printf("*** Suspend Task_%d ***\n", id);
27   rtems_task_suspend( RTEMS_SELF );
28 }
29