aboutsummaryrefslogtreecommitdiffstats
path: root/wirish
diff options
context:
space:
mode:
Diffstat (limited to 'wirish')
-rw-r--r--wirish/time.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/wirish/time.c b/wirish/time.c
index c0a0649..b5663b0 100644
--- a/wirish/time.c
+++ b/wirish/time.c
@@ -29,6 +29,7 @@
#include "libmaple.h"
#include "systick.h"
#include "time.h"
+#include "delay.h"
void delay(unsigned long ms) {
uint32 i;
@@ -38,15 +39,5 @@ void delay(unsigned long ms) {
}
void delayMicroseconds(uint32 us) {
- /* So (2^32)/12 micros max, or less than 6 minutes */
- us *= 12;
-
- /* fudge for function call overhead */
- us--;
- asm volatile(" mov r0, %[us] \n\t"
- "1: subs r0, #1 \n\t"
- " bhi 1b \n\t"
- :
- : [us] "r" (us)
- : "r0");
+ delay_us(us);
}