arduino / arduino/Arduino

delayTimerless() implementation

Open
#11,067 1 comment 0 reactions 0 assignees View on GitHub
Component: Core feature request
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

I noted that the standard delay() function is dependent on a timer and its corresponding interrupt on most Arduino microcontrollers and therefore, any interrupt which occurs during execution of delay() will be serviced only when delay() has finished executing, so can I recommend implementing delayTimerless() which is not dependent on a timer and its corresponding interrupt noting a few cautions regarding inaccuracy?

void delayTimerless(word value) {
for (word i = 0; i < value; i++) {
delayMicroseconds(1000);
}
}

Contributor guide

Open the contributing guide

Research direction

The issue names delay() and delayMicroseconds() but no file or test. Start by locating their Arduino core implementations and checking how timer interrupts affect them. Done means determining whether a timer-independent delay API is appropriate, including its accuracy cautions, and adding the relevant validation or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.