arduino / arduino/ArduinoCore-avr
tone() doesn't work on the Gemma
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
While looking at some unexpected size differences when testing LTO, I noticed something weird about examples using tone() and the gemma. Closer investigation shows that on the gemma, timer2 is used, but the gemma doesn't actually have a timer2. Hence I'm pretty sure that tone() doesn't work on the Gemma (though I didn't test it for lack of time and a Gemma).
To fix this, another timer should be selected. Ideally, I think the timer to use should be selected based on the availability of timers, not on the CPU used (See also arduino/Arduino#1258). Note that `TIMSKx` is not the most reliable macro to check (see [this avr-libc bug](https://savannah.nongnu.org/bugs/?45539)).
If someone is going to pick this up, also have a look at arduino/Arduino#1220 (especially my comment) for somewhat related optimizations.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.