CM3: kernel preemption.
[bertos.git] / bertos / kern / proc.c
index acaf4220a1bdd3527f274762096b648f65ecac20..a18fc40498d52e85e198ee54e5e13a1e90e2c49e 100644 (file)
@@ -453,7 +453,8 @@ void proc_schedule(void)
                MEMORY_BARRIER;
                IRQ_DISABLE;
        }
-       proc_switchTo(current_process, old_process);
+       if (CONTEXT_SWITCH_FROM_ISR())
+               proc_switchTo(current_process, old_process);
        /* This RET resumes the execution on the new process */
        LOG_INFO("resuming %p:%s\n", current_process, proc_currentName());
 }