We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b31efe8 + 92cdd1a commit 6a9c795Copy full SHA for 6a9c795
STM32F1/cores/maple/wirish_time.cpp
@@ -34,13 +34,18 @@
34
#include <libmaple/delay.h>
35
#include "Arduino.h"
36
37
-void delay(unsigned long ms) {
38
- uint32 start = millis();
39
- do
40
- {
41
- yield();
42
- }
43
- while (millis() - start < ms);
+void delay(unsigned long ms)
+{
+ uint32 start = micros();
+ while (ms > 0)
+ {
+ yield();
+ while ( (ms > 0) && ((micros() - start) >= 1000) )
44
45
+ ms--;
46
+ start += 1000;
47
+ }
48
49
}
50
51
void delayMicroseconds(uint32 us) {
0 commit comments