why does chThdSleep() not allow a zero delay?

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

jafrey
Posts: 33
Joined: Tue Nov 05, 2013 12:15 am

Re: why does chThdSleep() not allow a zero delay?

Post by jafrey »

I seem to be running into this right now:

Code: Select all

chThdSleepSeconds(0.0);
chThdSleepUntil(chTimeNow() + S2ST(0));


Should be near identical however chThdSleepSeconds doesn't accept 0 or decimal while chThdSleepUntil doesn't seem to have a problem with it. Is there a technical reason for why one would work but the other wouldn't?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: why does chThdSleep() not allow a zero delay?

Post by Giovanni »

Hi,

Zero is a reserved constant for intervals, the minimum is one. chThdSleepUntil() does not handle intervals but absolute times so zero is valid.

Giovanni
Post Reply