I would say there are two ways to do this:

1) As Marko mentions os_cputime is good for these types of delays. If you are 
using the bluetooth stack it forces os cputime to count at a frequency of 32768 
Hz (~30.51 usecs). If you are not using the bluetooth stack you can modify 
os_cputime to count at a higher frequency.

2) Set up a hal_timer at a high frequency. This will give you whatever 
resolution you set the hal timer to. You can then use hal_timer_delay() for a 
blocking delay.

Will

> On Sep 19, 2018, at 6:48 AM, Rohit Gujarathi <[email protected]> wrote:
> 
> Hello all,
> 
> I am new to mynewt OS and was wondering whats the most optimised way to get
> accurate msec and nsec delay.
> 
> I want to be able to call this delay in libraries as well.
> 
> Thank you

Reply via email to