Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-src by
Revision 636:be1e636d5109, committed 2016-06-02
- Comitter:
- destinyXfate
- Date:
- Thu Jun 02 04:52:00 2016 +0000
- Parent:
- 562:9f26fcd0c9ce
- Commit message:
- ;
Changed in this revision
api/wait_api.h | Show annotated file Show diff for this revision Revisions of this file |
common/wait_api.c | Show annotated file Show diff for this revision Revisions of this file |
--- a/api/wait_api.h Tue Jun 09 15:30:08 2015 +0100 +++ b/api/wait_api.h Thu Jun 02 04:52:00 2016 +0000 @@ -59,6 +59,12 @@ */ void wait_us(int us); +/** Waits a number of nanoseconds. + * + * @param ns the whole number of nanoseconds to wait + */ +void wait_ns(int ns); + #ifdef __cplusplus } #endif
--- a/common/wait_api.c Tue Jun 09 15:30:08 2015 +0100 +++ b/common/wait_api.c Thu Jun 02 04:52:00 2016 +0000 @@ -24,6 +24,10 @@ wait_us(ms * 1000); } +void wait_ns(int ns) { + wait_us(ns / 1000); +} + void wait_us(int us) { uint32_t start = us_ticker_read(); while ((us_ticker_read() - start) < (uint32_t)us);