From 367e20fa0c6f15e60d943cf222d41414fffd2318 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Fri, 21 Jan 2022 13:01:58 -0700 Subject: Added scheduling logic --- src/sys/schedule.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/sys') diff --git a/src/sys/schedule.c b/src/sys/schedule.c index 0dc89e9..3aca0ff 100644 --- a/src/sys/schedule.c +++ b/src/sys/schedule.c @@ -1,5 +1,22 @@ +#include +#include + void init_scheduler(void) { // Set rthread to usrloopthread - an infinitely running thread so that the pointer will never be null + usrloopthread.pc = (void*)loop; + usrloopthread.sp = 0x0FCC; + usrloopthread.sp_base = 0x1000; + usrloopthread.mptr = 0; + usrloopthread.pid = -1; + usrloopthread.priority = -1; + usrloopthread.status = THREAD_READY; + scheduler.rthread = &usrloopthread; // Initialize Rotating Buffers } + +void loop(void) +{ + while(1) + asm volatile ("wfe"); +} -- cgit v1.2.1