Skip to content

delayTimerless() implementation #11067

Open
@brycecherry75

Description

@brycecherry75

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);
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CoreRelated to the code for the standard Arduino APIfeature requestA request to make an enhancement (not a bug fix)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions