Skip to content

Commit df78777

Browse files
Add yield() call in delay() to support the Arduino Scheduler library. Ref issue #299
1 parent 920b57a commit df78777

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

STM32F1/cores/maple/wirish_time.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,15 @@
3232

3333
#include <libmaple/libmaple_types.h>
3434
#include <libmaple/delay.h>
35+
#include "Arduino.h"
3536

3637
void delay(unsigned long ms) {
3738
uint32 start = millis();
38-
while (millis() - start < ms)
39-
;
39+
do
40+
{
41+
yield();
42+
}
43+
while (millis() - start < ms);
4044
}
4145

4246
void delayMicroseconds(uint32 us) {

0 commit comments

Comments
 (0)