diff options
author | Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> | 2015-11-19 16:30:01 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-11-30 12:20:34 +0300 |
commit | dc8984ae27ba81f76634cf1e58489664dc1569c4 (patch) | |
tree | 2d6aa6da3dc5aa3cc47e0f027ed5d4dce10d01ad | |
parent | 7294ab04a6b8dd06889e27165a5fdfc1edf436c3 (diff) |
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 <ola.liljedahl@linaro.org>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
-rw-r--r-- | example/timer/odp_timer_test.c | 3 |
1 files changed, 3 insertions, 0 deletions
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"); } |