diff options
author | Marti Bolivar <mbolivar@mit.edu> | 2010-09-26 21:47:55 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@mit.edu> | 2010-09-26 21:47:55 -0400 |
commit | 849bc0f8f6abf42567a152cf6e01bf7349902aac (patch) | |
tree | 8d7dd363d7978e320fb71626e9ddc23285c26205 /wirish/time.c | |
parent | c13e850abe053edaa1aad6ef7b928c6bf9288cb3 (diff) | |
download | librambutan-849bc0f8f6abf42567a152cf6e01bf7349902aac.tar.gz librambutan-849bc0f8f6abf42567a152cf6e01bf7349902aac.zip |
wirish reformatted and code-styled
Diffstat (limited to 'wirish/time.c')
-rw-r--r-- | wirish/time.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/wirish/time.c b/wirish/time.c index eaa3c9e..3a48197 100644 --- a/wirish/time.c +++ b/wirish/time.c @@ -1,4 +1,4 @@ -/* ***************************************************************************** +/****************************************************************************** * The MIT License * * Copyright (c) 2010 Perry Hung. @@ -20,30 +20,30 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. - * ****************************************************************************/ + *****************************************************************************/ /** - * @brief + * @brief Delay implementation. */ #include "libmaple.h" #include "systick.h" #include "time.h" -void delay(unsigned long ms) -{ - uint32 i; - for (i = 0; i < ms; i++) { - delayMicroseconds(1000); - } +void delay(unsigned long ms) { + uint32 i; + for (i = 0; i < ms; i++) { + delayMicroseconds(1000); + } } void delayMicroseconds(uint32 us) { - // So (2^32)/12 micros max, or less than 6 minutes + /* So (2^32)/12 micros max, or less than 6 minutes */ us *= 12; /* fudge for function call overhead */ us--; + int x = 4; asm volatile(" mov r0, %[us] \n\t" "1: subs r0, #1 \n\t" " bhi 1b \n\t" |