Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cores/arduino/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

// this file implements the following public funcions: delay, delayMicroseconds, yield, millis, micros

__attribute__((weak)) void delay(uint32_t ms) {
R_BSP_SoftwareDelay(ms, BSP_DELAY_UNITS_MILLISECONDS);
__attribute__((weak)) void delay(uint32_t ms)
{
auto const start = millis();
auto const stop = start + ms;
while(millis() < stop) yield();
}

void delayMicroseconds(unsigned int us) {
Expand Down