Skip to content

Commit dcd99f6

Browse files
committed
Correct errors in microsecond delay() function
1 parent 98b32d2 commit dcd99f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/arduino-timer-cpp17.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ struct Clock {
114114
void
115115
delay(Timepoint until) {
116116
unsigned int micros = until % 1000;
117+
until -= micros;
118+
until /= 1000;
117119

118120
::delayMicroseconds(micros);
119-
::delay(until - micros);
121+
::delay(until);
120122
}
121123
};
122124

0 commit comments

Comments
 (0)