X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fpower.h;h=f161c698f40ebf14f261d4b77323138e45f98cfb;hb=f1fab319eb3fe91c157b3a9564841aef62a03554;hp=035495d47811aa1016bf2f41d56dd36046b04813;hpb=b812fafcc11015af6fe0ef2b1b0bd81e19cf6eff;p=bertos.git diff --git a/bertos/cpu/power.h b/bertos/cpu/power.h index 035495d4..f161c698 100644 --- a/bertos/cpu/power.h +++ b/bertos/cpu/power.h @@ -37,10 +37,12 @@ #ifndef CPU_POWER_H #define CPU_POWER_H -#include -#include +#include "cfg/cfg_proc.h" +#include "cfg/cfg_wdt.h" -#if CONFIG_KERNEL +#include + +#if CONFIG_KERN #include #endif @@ -66,8 +68,10 @@ */ INLINE void cpu_relax(void) { -#if CONFIG_KERNEL - proc_yield(); + MEMORY_BARRIER; +#if CONFIG_KERN + if (proc_preemptAllowed()) + proc_yield(); #endif #if CONFIG_WATCHDOG