diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-12-21 10:27:37 -0500 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-12-21 10:27:37 -0500 |
commit | c45bccad44187da27505cf5808424e709e3f54a1 (patch) | |
tree | 18a459a50f8d0551ba046e30462c93999d982725 /wirish/time.h | |
parent | 84fd2532a7f23d20354ff590790b3f892cb7e7d7 (diff) | |
parent | d5ad2a27f4e69e6cc9324331945937c983c30366 (diff) | |
download | librambutan-c45bccad44187da27505cf5808424e709e3f54a1.tar.gz librambutan-c45bccad44187da27505cf5808424e709e3f54a1.zip |
Merge branch 'master' into debug-serialusb.
Chose debug-serialusb version in cases of conflict.
Conflicts:
libmaple/usb/usb_callbacks.c
Diffstat (limited to 'wirish/time.h')
-rw-r--r-- | wirish/time.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/wirish/time.h b/wirish/time.h index c3dfe2d..c925f74 100644 --- a/wirish/time.h +++ b/wirish/time.h @@ -23,7 +23,8 @@ *****************************************************************************/ /** - * @brief Timing and delay functions. + * @file time.h + * @brief Timing and delay functions. */ #ifndef _TIME_H @@ -41,12 +42,20 @@ extern "C"{ extern volatile uint32 systick_timer_millis; -/* time in milliseconds since boot */ +/** + * Returns time (in milliseconds) since the beginning of program + * execution. On overflow, restarts at 0. + * @see micros() + */ static inline uint32 millis(void) { return systick_timer_millis; } -/* Time in microseconds since boot */ +/** + * Returns time (in microseconds) since the beginning of program + * execution. On overflow, restarts at 0. + * @see millis() + */ static inline uint32 micros(void) { uint32 ms; uint32 cycle_cnt; @@ -67,7 +76,28 @@ static inline uint32 micros(void) { return res; } +/** + * Delay for at least the given number of milliseconds. + * + * Interrupts, etc. may cause the actual number of milliseconds to + * exceed ms. However, this function will return no less than ms + * milliseconds from the time it is called. + * + * @param ms the number of milliseconds to delay. + * @see delayMicroseconds() + */ void delay(unsigned long ms); + +/** + * Delay for at least the given number of microseconds. + * + * Interrupts, etc. may cause the actual number of microseconds to + * exceed us. However, this function will return no less than us + * microseconds from the time it is called. + * + * @param us the number of microseconds to delay. + * @see delay() + */ void delayMicroseconds(uint32 us); #ifdef __cplusplus |