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.
1 parent 202e0e6 commit 9be7c15Copy full SHA for 9be7c15
cores/arduino/wiring.c
@@ -25,7 +25,7 @@ extern "C" {
25
uint32_t millis( void )
26
{
27
// todo: ensure no interrupts
28
- return GetTickCount() ;
+ return GetTickCount() ;
29
}
30
31
// Interrupt-compatible version of micros
@@ -74,9 +74,12 @@ uint32_t micros( void )
74
75
void delay( uint32_t ms )
76
77
- uint32_t end = GetTickCount() + ms;
78
- while (GetTickCount() < end)
79
- yield();
+ if (ms == 0)
+ return;
+ uint32_t start = GetTickCount();
80
+ do {
81
+ yield();
82
+ } while (GetTickCount() - start < ms);
83
84
85
#if defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */
0 commit comments