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