Forked repo of Platform Drivers- Analog Devices
Diff: delay.cpp
- Revision:
- 20:26b1a4570f4b
- Parent:
- 17:af1f2416dd26
diff -r 3c61197500c4 -r 26b1a4570f4b delay.cpp --- a/delay.cpp Wed Sep 29 12:32:10 2021 +0100 +++ b/delay.cpp Mon Nov 22 22:26:51 2021 +0530 @@ -39,7 +39,10 @@ */ void udelay(uint32_t usecs) { - wait_us(usecs); + /* wait_ns is more time efficient function compared to wait_us + * Note: For higher values of delay (more than few msec), it is better to use + * mdelay() function as no error/limit checking is done in this function */ + wait_ns(usecs * 1000); } /** @@ -50,7 +53,7 @@ void mdelay(uint32_t msecs) { if (msecs) { - HAL_Delay(msecs); + thread_sleep_for(msecs); } }