You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 29, 2023. It is now read-only.
*[Important Notes about ISR](#important-notes-about-isr)
18
18
*[Changelog](#changelog)
19
+
*[Releases v1.3.0](#releases-v130)
19
20
*[Releases v1.2.0](#releases-v120)
20
21
*[Releases v1.1.2](#releases-v112)
21
22
*[Releases v1.1.1](#releases-v111)
@@ -124,18 +125,24 @@ The catch is your function is now part of an ISR (Interrupt Service Routine), an
124
125
125
126
### Currently supported Boards
126
127
127
-
- Arduino Uno / Mega / Leonardo / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano etc.
128
+
- Arduino Uno / Mega / Duemilanove / Diecimila / LilyPad / Mini / Fio / Nano, etc.
128
129
- Sanguino
129
130
- ATmega8, 48, 88, 168, 328
130
131
- ATmega8535, 16, 32, 164, 324, 644, 1284,
131
132
- ATmega64, 128
132
133
- ATtiny 84 / 85
134
+
-**ATMega 16U4, 32U4** such as AVR Leonardo, Leonardo ETH, YUN, Esplora, LILYPAD_USB, AVR_ROBOT_CONTROL, AVR_ROBOT_MOTOR, AVR_INDUSTRIAL101, etc.
133
135
134
136
---
135
137
---
136
138
137
139
## Changelog
138
140
141
+
### Releases v1.3.0
142
+
143
+
1. Add support to **AVR ATMEGA_16U4, ATMEGA_32U4** such as **Leonardo, YUN, ESPLORA, etc.**
144
+
2. Update examples
145
+
139
146
### Releases v1.2.0
140
147
141
148
1. Add better debug feature.
@@ -169,7 +176,7 @@ The catch is your function is now part of an ISR (Interrupt Service Routine), an
169
176
## Prerequisites
170
177
171
178
1.[`Arduino IDE 1.8.13+` for Arduino](https://www.arduino.cc/en/Main/Software)
172
-
2.[`Arduino AVR core 1.8.3+`](https://github.com/arduino/ArduinoCore-avr) for Arduino AVR boards. Use Arduino Board Manager to install.
179
+
2.[`Arduino AVR core 1.8.3+`](https://github.com/arduino/ArduinoCore-avr) for Arduino AVR boards. Use Arduino Board Manager to install.[](https://github.com/arduino/ArduinoCore-avr/releases/latest/)
173
180
174
181
---
175
182
---
@@ -236,7 +243,7 @@ In the Arduino world timer0 is been used for the timer functions, like delay(),
236
243
237
244
### 2. Timer1:
238
245
239
-
Timer1 is a 16-bit timer.
246
+
Timer1 is a 16-bit timer. This is available Timer to use for **ATMEGA_16U4, ATMEGA_32U4 boards**, such as Leonardo, YUN, ESPLORA, etc.
240
247
In the Arduino world the Servo library uses timer1 on Arduino Uno (Timer5 on Arduino Mega).
241
248
242
249
### 3. Timer2:
@@ -252,7 +259,9 @@ Timer 3,4,5 are only available on Arduino Mega boards. These timers are all 16-b
252
259
253
260
Before using any Timer, you have to make sure the **Timer has not been used by any other purpose.**
254
261
255
-
Only Timer1 and Timer2 are supported for Nano, UNO, etc. boards possessing 3 timers.
262
+
Only Timer1 is supported for Nano, UNO, etc. boards possessing 3 timers.
263
+
264
+
Only Timer1 and Timer2 are supported for ATMEGA_16U4, ATMEGA_32U4 boards, such as Leonardo, YUN, ESPLORA, etc.
256
265
257
266
Timer3, Timer4 and Timer5 are only available for Arduino Mega boards.
258
267
@@ -269,11 +278,15 @@ Before using any Timer, you have to make sure the Timer has not been used by any
269
278
270
279
```
271
280
// Select the timers you're using, here ITimer1
272
-
#define USE_TIMER_1 true
273
-
#define USE_TIMER_2 false
274
-
#define USE_TIMER_3 false
275
-
#define USE_TIMER_4 false
276
-
#define USE_TIMER_5 false
281
+
#if ( TIMER_INTERRUPT_USING_ATMEGA_32U4 )
282
+
#define USE_TIMER_1 true
283
+
#else
284
+
#define USE_TIMER_1 true
285
+
#define USE_TIMER_2 false
286
+
#define USE_TIMER_3 false
287
+
#define USE_TIMER_4 false
288
+
#define USE_TIMER_5 false
289
+
#endif
277
290
278
291
// Init timer ITimer1
279
292
ITimer1.init();
@@ -369,12 +382,15 @@ The 16 ISR_based Timers, designed for long timer intervals, only support using *
369
382
### 2.2 Init Hardware Timer and ISR-based Timer
370
383
371
384
```
372
-
// Select the timers you're using, here ITimer2
373
-
#define USE_TIMER_1 false
374
-
#define USE_TIMER_2 true
375
-
#define USE_TIMER_3 false
376
-
#define USE_TIMER_4 false
377
-
#define USE_TIMER_5 false
385
+
#if ( TIMER_INTERRUPT_USING_ATMEGA_32U4 )
386
+
#define USE_TIMER_1 true
387
+
#else
388
+
#define USE_TIMER_1 true
389
+
#define USE_TIMER_2 false
390
+
#define USE_TIMER_3 false
391
+
#define USE_TIMER_4 false
392
+
#define USE_TIMER_5 false
393
+
#endif
378
394
379
395
// Init ISR_Timer
380
396
// Each ISR_Timer can service 16 different ISR-based timers
@@ -468,12 +484,22 @@ void setup()
468
484
### Example [ISR_16_Timers_Array_Complex](examples/ISR_16_Timers_Array_Complex)
@@ -809,7 +839,7 @@ While software timer, **programmed for 2s, is activated after more than 10.000s
809
839
810
840
```
811
841
Starting ISR_16_Timers_Array_Complex on AVR
812
-
TimerInterrupt v1.1.2
842
+
TimerInterrupt v1.3.0
813
843
CPU Frequency = 16 MHz
814
844
Starting ITimer2 OK, millis() = 1
815
845
SimpleTimer : 2, ms : 10007, Dms : 10007
@@ -959,7 +989,7 @@ The following is the sample terminal output when running example [Change_Interva
959
989
960
990
```
961
991
Starting Change_Interval on AVR
962
-
TimerInterrupt v1.1.2
992
+
TimerInterrupt v1.3.0
963
993
CPU Frequency = 16 MHz
964
994
Starting ITimer1 OK, millis() = 1
965
995
Starting ITimer2 OK, millis() = 4
@@ -1007,6 +1037,11 @@ Sometimes, the library will only work if you update the board core to the latest
1007
1037
1008
1038
## Releases
1009
1039
1040
+
### Releases v1.3.0
1041
+
1042
+
1. Add support to **AVR ATMEGA_16U4, ATMEGA_32U4** such as **Leonardo, YUN, ESPLORA, etc.**
1043
+
2. Update examples
1044
+
1010
1045
### Releases v1.2.0
1011
1046
1012
1047
1. Add better debug feature.
@@ -1077,6 +1112,7 @@ Submit issues to: [TimerInterrupt issues](https://github.com/khoih-prog/TimerInt
1077
1112
4. Fix some bugs in v1.0.0
1078
1113
5. Add more examples.
1079
1114
6. Similar library for ESP32, ESP8266, SAMD21/SAMD51, nRF52, Mbed-OS Nano-33-BLE, STM32
1115
+
7. Add support to **ATMega-16U4, ATMega-32U4**-based boards
1080
1116
1081
1117
1082
1118
---
@@ -1087,10 +1123,13 @@ Submit issues to: [TimerInterrupt issues](https://github.com/khoih-prog/TimerInt
1087
1123
Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library. Especially to these people who have directly or indirectly contributed to this [TimerInterrupt library](https://github.com/khoih-prog/TimerInterrupt)
1088
1124
1089
1125
1. Thanks to [Django0](https://github.com/Django0) to provide the following PR [Fixed warnings from cppcheck (platformio) and -Wall arduino-cli. PR#10](https://github.com/khoih-prog/TimerInterrupt/pull/10).
1126
+
2. Thanks to [eslavko](https://github.com/eslavko) to report the issue [Error compiling for arduino leonardo #13](https://github.com/khoih-prog/TimerInterrupt/issues/13) leading to new release v1.3.0 to provide support to **ATMega-16U4, ATMega-32U4**-based boards, such as AVR Leonardo, Leonardo ETH, YUN, Esplora, LILYPAD_USB, AVR_ROBOT_CONTROL, AVR_ROBOT_MOTOR, AVR_INDUSTRIAL101, etc..
0 commit comments