diff options
-rw-r--r-- | firmware/test/kernel/main.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/firmware/test/kernel/main.c b/firmware/test/kernel/main.c index 1280b8113b..fe7ddc8378 100644 --- a/firmware/test/kernel/main.c +++ b/firmware/test/kernel/main.c | |||
@@ -29,11 +29,14 @@ unsigned int s2[256]; | |||
29 | void t1(void); | 29 | void t1(void); |
30 | void t2(void); | 30 | void t2(void); |
31 | 31 | ||
32 | struct event_queue main_q; | ||
33 | |||
32 | int main(void) | 34 | int main(void) |
33 | { | 35 | { |
34 | char buf[40]; | 36 | char buf[40]; |
35 | char str[32]; | 37 | char str[32]; |
36 | int i=0; | 38 | int i=0; |
39 | struct event *ev; | ||
37 | 40 | ||
38 | /* Clear it all! */ | 41 | /* Clear it all! */ |
39 | SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER); | 42 | SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER); |
@@ -49,13 +52,15 @@ int main(void) | |||
49 | 52 | ||
50 | tick_start(10); | 53 | tick_start(10); |
51 | 54 | ||
55 | queue_init(&main_q); | ||
56 | |||
52 | create_thread(t1, s1, 1024); | 57 | create_thread(t1, s1, 1024); |
53 | create_thread(t2, s2, 1024); | 58 | create_thread(t2, s2, 1024); |
54 | 59 | ||
55 | while(1) | 60 | while(1) |
56 | { | 61 | { |
57 | sleep(100); | 62 | ev = queue_wait(&main_q); |
58 | debugf("Thread 0 awakened\n"); | 63 | debugf("Thread 0 got an event. ID: %d\n", ev->id); |
59 | } | 64 | } |
60 | } | 65 | } |
61 | 66 | ||
@@ -64,8 +69,10 @@ void t1(void) | |||
64 | debugf("Thread 1 started\n"); | 69 | debugf("Thread 1 started\n"); |
65 | while(1) | 70 | while(1) |
66 | { | 71 | { |
67 | sleep(200); | 72 | sleep(100); |
68 | debugf("Thread 1 awakened\n"); | 73 | debugf("Thread 1 posting an event\n"); |
74 | queue_post(&main_q, 1234, 0); | ||
75 | queue_post(&main_q, 5678, 0); | ||
69 | } | 76 | } |
70 | } | 77 | } |
71 | 78 | ||