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:
Stephan Walter 2020-10-08 09:16:17 +02:00 committed by Carles Cufí
commit 5836e30fc1

View file

@ -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;
} }