From dc8984ae27ba81f76634cf1e58489664dc1569c4 Mon Sep 17 00:00:00 2001 From: Ivan Khoronzhuk Date: Thu, 19 Nov 2015 16:30:01 +0200 Subject: example: timer: warn if timeout less than resolution The period shouldn't be less than timer resolution. If it's less there is no guarantee about timeout accuracy, it can be executed right after setting it or after up to timer resolution timeout or even be set late, in which case application will be stopped with error. So it's better to warn user that timeout is less then resolution instead of silence. Reviewed-by: Ola Liljedahl Signed-off-by: Ivan Khoronzhuk Signed-off-by: Maxim Uvarov --- example/timer/odp_timer_test.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'example/timer/odp_timer_test.c') diff --git a/example/timer/odp_timer_test.c b/example/timer/odp_timer_test.c index 94619e481..aee01c838 100644 --- a/example/timer/odp_timer_test.c +++ b/example/timer/odp_timer_test.c @@ -311,6 +311,9 @@ static void parse_args(int argc, char *argv[], test_args_t *args) break; } } + + if (args->period_us < args->resolution_us) + printf("\n\tWarn: timeout is set less then resolution\n"); } -- cgit v1.2.3