doc: End time comparison is wrong in my_wait_for_event sample code
We need to loop while `end` is still in the future and thus larger than the current uptime, not smaller. Also fix indentation. Signed-off-by: Stephan Walter <stephan.walter@swissphone.com>
This commit is contained in:
parent
77e1d4d710
commit
5836e30fc1
1 changed files with 6 additions and 6 deletions
|
@ -352,7 +352,7 @@ expire. So such a loop might look like:
|
||||||
/* Compute the end time from the timeout */
|
/* Compute the end time from the timeout */
|
||||||
uint64_t end = z_timeout_end_calc(timeout_in_ms);
|
uint64_t end = z_timeout_end_calc(timeout_in_ms);
|
||||||
|
|
||||||
while (end < k_uptime_ticks()) {
|
while (end > k_uptime_ticks()) {
|
||||||
if (is_event_complete(obj)) {
|
if (is_event_complete(obj)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue