D21G Timers
Trying to follow
https://industruino.com/blog/our-news-1/post/d21g-timer-library-33#blog_content
but it seems to be a little outdated on the changing of the Adafruit_ZeroTimer.cpp
line numbers don't seem to match up.
So wondering what is the current status?
Hi, indeed i see Adafruit has upgraded the library to include other SAMD boards now; the version i used for that blog post is still available at https://github.com/adafruit/Adafruit_ZeroTimer/releases/tag/1.0.0
For reference i paste the updated section below. With this info i think it will not be difficult to update the latest version of the .cpp if you prefer to use that.
extract of Adafruit_ZeroTimer.cpp (version 1.0.0 modified for Industruino D21G)::
if (_timernum == 3) {
if (channum == 0) {
if (pin == 10) {
pinout = PIN_PA18E_TC3_WO0; pinmux = MUX_PA18E_TC3_WO0;
}
if (pin == 2) {
pinout = PIN_PA14E_TC3_WO0; pinmux = MUX_PA14E_TC3_WO0;
}
}
if (channum == 1) {
if (pin == 0) { // TT was 12 *******************************************
pinout = PIN_PA19E_TC3_WO1; pinmux = MUX_PA19E_TC3_WO1;
}
if (pin == 5) {
pinout = PIN_PA15E_TC3_WO1; pinmux = MUX_PA15E_TC3_WO1;
}
}
}
if (_timernum == 4) {
if (channum == 0) {
if (pin == 20) { // a.k.a SDA
pinout = PIN_PA22E_TC4_WO0; pinmux = MUX_PA22E_TC4_WO0;
}
//#if defined(__SAMD21G18A__) // ***********
// if (pin == A1) {
// pinout = PIN_PB08E_TC4_WO0; pinmux = MUX_PB08E_TC4_WO0;
// }
//#endif // ***********
}
if (channum == 1) {
if (pin == 21) { // a.k.a SCL
pinout = PIN_PA23E_TC4_WO1; pinmux = MUX_PA23E_TC4_WO1;
}
#if defined(__SAMD21G18A__)
if (pin == 6) { // TT was A2 **************************************************
pinout = PIN_PB09E_TC4_WO1; pinmux = MUX_PB09E_TC4_WO1;
}
#endif
}
}
Ciao, sono fuori ufficio per motivi di salute, vi risponderò al mio rientro: 21/1. Per urgenze contattatemi al cellulare.
In urgent cases, please call me on my mobile.
Best regards
Your answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
Stats
Asked: 1/18/19, 1:23 AM |
Seen: 1878 times |
Last updated: 1/18/19, 6:23 AM |
Thanks, Will give it a try this weekend