summaryrefslogtreecommitdiff
path: root/interrupt
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2013-07-20 08:41:41 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2013-07-20 08:43:10 +0200
commite14b2f0d2406311a6fcdaea313584995ec8adefd (patch)
treef2cffca4fe334aeb873cce8a77bd5b6f98cc0096 /interrupt
parent657d427aa41e6e05c8c4d4b1179b42d3363e8018 (diff)
Add support for sleeping threads.scheduler_improvements
Diffstat (limited to 'interrupt')
-rw-r--r--interrupt/fault.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/interrupt/fault.cpp b/interrupt/fault.cpp
index 9af0eb8..8a577bf 100644
--- a/interrupt/fault.cpp
+++ b/interrupt/fault.cpp
@@ -13,9 +13,11 @@ inline void __attribute__((naked)) switch_context() {
// Update running thread.
if(!Thread::reschedule()) {
- // TODO: Set SLEEPONEXIT
+ // No threads are ready - set SLEEPONEXIT.
+ SCB.SCR = 1 << 1;
} else {
- // TODO: Clear SLEEPONEXIT
+ // Clear SLEEPONEXIT.
+ SCB.SCR = 0 << 1;
}
// Fetch stack pointer for new thread.