summaryrefslogtreecommitdiff
path: root/interrupt/fault.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'interrupt/fault.cpp')
-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.