arduino / arduino/ArduinoCore-avr

wiring.c select which timer to use for millis() and other functions

Open
#132 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
1.5k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

Would be great to be able to define which timer to use for millis/micros/delay and may be others, where timer0 currently used. For example timer2 (where available) can be used instead.
This will be useful in case both timers 0 and 1 have to be clocked from external source to count pulses from two independent sources. Something like #define CORE_USE_TIMER2

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in wiring.c and trace how timer0 currently supports millis(), micros(), and delay(). Determine the changes needed to select timer2 where available while preserving the existing behavior. Done means the core can configure an alternate timer for these functions without preventing timers 0 and 1 from counting external pulses.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.