Skip to content
Snippets Groups Projects
Commit 5ba02ca9 authored by Andrew Plaza's avatar Andrew Plaza
Browse files

Reset PIT_TICKS to 0 on context::switch, change condition for context::switch [irq]

Set the counter to 0 when context is to be switched in the PIT interrupt,
and change the condition for context switching from % 10 to >= 10.
parent 7127e14b
No related branches found
No related tags found
1 merge request!12Fix PIT Interrupt Not Context Switching [irq]
......@@ -51,7 +51,9 @@ interrupt!(pit, {
pic::MASTER.ack();
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) % 10 == 0 {
if PIT_TICKS.fetch_add(1, Ordering::SeqCst) >= 10 {
PIT_TICKS.store(0, Ordering::SeqCst);
assert_eq!(PIT_TICKS.load(Ordering::SeqCst), 0);
context::switch();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment