[En-Nut-Discussion] NutSleep(0) doesn't yield
Harald Kipp
harald.kipp at egnite.de
Fri Sep 8 13:58:41 CEST 2006
That's how it's designed. As NutSleep(0) waits for nothing, the
thread continues to run, if it got the highest priority. But note,
that some background system threads like the Ethernet receiver
(if registered) run at very high priorities.
I assume, that the granularity of 1ms is too high for your
application. Then you should consider implementing hardware
timer interrupts.
Harald
At 13:31 08.09.2006 +0200, you wrote:
>Harald,
>
>I had NutThreadSetPriority(128) in the thread and NutSleep(0) in the main
>programm. That way, the thread was never called. Only with NutSleep(1) in
>the main programm the thread was called.
>
>Removing the line "NutThreadSetPriority(128)" made the programm working as
>expected, even with NutSleep(0) in the main program.
More information about the En-Nut-Discussion
mailing list