Add other error flag. Include platform specific header.
[bertos.git] / bertos / cpu / power.h
index 93c40c0394936d09552074b905eb423e9b4113aa..4e88def111bf414471cdd43adb66aefb76b5d958 100644 (file)
@@ -40,6 +40,8 @@
 #include "cfg/cfg_proc.h"
 #include "cfg/cfg_wdt.h"
 
+#include <cfg/compiler.h>
+
 #if CONFIG_KERN
        #include <kern/proc.h>
 #endif
@@ -67,7 +69,8 @@
 INLINE void cpu_relax(void)
 {
 #if CONFIG_KERN
-       proc_yield();
+       if (proc_preemptAllowed())
+               proc_yield();
 #endif
 
 #if CONFIG_WATCHDOG