Update preset.
[bertos.git] / bertos / cpu / power.h
index 035495d47811aa1016bf2f41d56dd36046b04813..f161c698f40ebf14f261d4b77323138e45f98cfb 100644 (file)
 #ifndef CPU_POWER_H
 #define CPU_POWER_H
 
-#include <cfg/cfg_kern.h>
-#include <cfg/cfg_wdt.h>
+#include "cfg/cfg_proc.h"
+#include "cfg/cfg_wdt.h"
 
-#if CONFIG_KERNEL
+#include <cfg/compiler.h>
+
+#if CONFIG_KERN
        #include <kern/proc.h>
 #endif
 
  */
 INLINE void cpu_relax(void)
 {
-#if CONFIG_KERNEL
-       proc_yield();
+       MEMORY_BARRIER;
+#if CONFIG_KERN
+       if (proc_preemptAllowed())
+               proc_yield();
 #endif
 
 #if CONFIG_WATCHDOG