main.c
1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#include <os.h>
#include <rmon.h>
#include "ostime.h"
char bootStack[STACKSIZE];
static void idle(void *);
static void main(void *);
static OSThread idleThread;
static char idleThreadStack[STACKSIZE];
static OSThread mainThread;
static char mainThreadStack[STACKSIZE];
static OSThread rmonThread;
static char rmonThreadStack[RMON_STACKSIZE];
int pif(void);
boot(void)
{
int *pr;
osInitialize();
osCreateThread(&mainThread, 1, main, (void *)0, mainThreadStack+STACKSIZE,
10);
osStartThread(&mainThread);
}
static void
main(void *arg)
{
int totalFailures = 0;
int i;
/*
* Create idle thread
*/
osCreateThread(&idleThread, 3, idle, (void *)0, idleThreadStack+STACKSIZE,
0);
osStartThread(&idleThread);
/* Start VI manager */
osCreateViManager((OSPri)OS_PRIORITY_VIMGR);
/*
* Create rmon thread
*/
osCreateThread(&rmonThread, 0, rmonMain, (void *)0,
rmonThreadStack+RMON_STACKSIZE, OS_PRIORITY_RMON);
osStartThread(&rmonThread);
/*
* Tests are ordered so that succeeding tests
* use functionality verified by preceding tests.
*/
rmonPrintf("pif\n");
totalFailures += pif(); /* interval controller tests */
rmonPrintf("timer1\n");
totalFailures += timer1(); /* interval timer tests */
rmonPrintf("timer2\n");
totalFailures += timer2(); /* interval timer tests */
rmonPrintf("timer3\n");
totalFailures += timer3(); /* interval timer tests */
rmonPrintf("controller: total number of failures: %d\n", totalFailures);
}
static void
idle(void *arg)
{
for(;;);
}