aboutsummaryrefslogtreecommitdiff
path: root/src/tests/test.c
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-17 21:30:18 -0700
committerChristian Cunningham <cc@localhost>2022-03-17 21:30:18 -0700
commit249f526998a319a9282a16eb0d0b2907051c22da (patch)
treeb8d8e313846db6c2ef7269807520662c08479c07 /src/tests/test.c
parentade8ce64cf42471d2b85dc3ada77f91d41415798 (diff)
Added Semaphore Test
Diffstat (limited to 'src/tests/test.c')
-rw-r--r--src/tests/test.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/tests/test.c b/src/tests/test.c
index 91b400e..0c3ffb0 100644
--- a/src/tests/test.c
+++ b/src/tests/test.c
@@ -125,8 +125,29 @@ void ctest4(void)
//uart_string("4 Finished\n");
}
+static unsigned long test_semaphore = 0;
+
+void stest1(void)
+{
+ draw_cletter(x++, y+1, ' ', 0xFF0000);
+ draw_cletter(x++, y+1, 'S', 0xFF0000);
+ draw_cletter(x++, y+1, 'P', 0xFF0000);
+ sys1(SYS_SEMAPHORE_P, &test_semaphore);
+ draw_cletter(x++, y+1, 'F', 0xFF0000);
+}
+
+void stest2(void)
+{
+ draw_cletter(x++, y+2, 'S', 0xFF00);
+ draw_cletter(x++, y+2, 'V', 0xFF00);
+ sys1(SYS_SEMAPHORE_V, &test_semaphore);
+ draw_cletter(x++, y+2, 'F', 0xFF00);
+}
+
void btest(void)
{
x = 0;
add_thread(ctest1, 0, 3);
+ add_thread(stest1, 0, 6);
+ add_thread(stest2, 0, 7);
}