From cbd68666694e916d27881796fd504312437567ab Mon Sep 17 00:00:00 2001 From: Oscar Beaumont Date: Mon, 19 Aug 2019 20:34:10 +0800 Subject: [PATCH] added ev3_wait function to the EV3 api I couldn't find one already in the API and it makes sense to have an easy way to add blocking delays for x milliseconds. --- common/ev3api/src/ev3api.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/ev3api/src/ev3api.c b/common/ev3api/src/ev3api.c index 9da34ae..8853a11 100644 --- a/common/ev3api/src/ev3api.c +++ b/common/ev3api/src/ev3api.c @@ -57,3 +57,8 @@ void *__dso_handle __attribute__((weak))=0; * See 'http://wiki.osdev.org/Calling_Global_Constructors' for details of '.fini_array' and '_fini' in ARM. */ void __attribute__((weak)) _fini() {} + +void ev3_wait(unsigned int milliSec) { + ER ercd = dly_tsk(milliSec * 1000U); + assert(ercd == E_OK); +}