Platform drivers for Mbed.
Dependents: EVAL-CN0535-FMCZ EVAL-CN0535-FMCZ EVAL-AD568x-AD569x EVAL-AD7606 ... more
Diff: delay.cpp
- Revision:
- 20:4951ea6abee5
- Parent:
- 17:af1f2416dd26
diff -r 3c61197500c4 -r 4951ea6abee5 delay.cpp --- a/delay.cpp Wed Sep 29 12:32:10 2021 +0100 +++ b/delay.cpp Mon Nov 29 12:39:54 2021 +0000 @@ -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); } }