main.c
972 Bytes
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
#include <os.h>
#include <rmon.h>
#include "perf.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];
boot(void)
{
osInitialize();
osCreateThread(&mainThread, 1, main, (void *)0, mainThreadStack+STACKSIZE,
(OSPri)10);
osStartThread(&mainThread);
}
static void
main(void *arg)
{
/*
* Create idle thread
*/
osCreateThread(&idleThread, 2, idle, (void *)0, idleThreadStack+STACKSIZE,
(OSPri)0);
osStartThread(&idleThread);
/*
* Create rmon thread
*/
osCreateThread(&rmonThread, 0, rmonMain, (void *)0,
rmonThreadStack+RMON_STACKSIZE, (OSPri)OS_PRIORITY_RMON);
osStartThread(&rmonThread);
int0();
osExit();
}
static void
idle(void *arg)
{
for (;;);
}