Skip to content
This repository was archived by the owner on Jan 29, 2023. It is now read-only.

Commit fad02fa

Browse files
authored
v1.5.0 to add support to megaAVR
### Releases v1.5.0 1. Add support to **ATmega4809-based boards** such as **Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.**
1 parent b287fa6 commit fad02fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3037
-121
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Please ensure to specify the following:
2929
Arduino IDE version: 1.8.13
3030
Arduino SAMDUE Core Version 1.6.12
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-70-generic #78-Ubuntu SMP Fri Mar 19 13:29:52 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux xy-Inspiron-3593 5.4.0-71-generic #79-Ubuntu SMP Wed Mar 24 10:56:57 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
3333
3434
Context:
3535
I encountered a crash while trying to use the Timer Interrupt.

README.md

+504-63
Large diffs are not rendered by default.

library.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "TimerInterrupt_Generic",
3-
"version": "1.4.0",
4-
"keywords": "timing,device,control,timer,interrupt,hardware,avr,mega, nano, uno, leonardo, yun, yun-mini, esplora, gemma, atmega, feather, adafruit, 16u4, 32u4, atmega328p, atmega128, atmega168, atmega2560, atmega1280, atmega16u4, atmega32u4, atmegang, atmega8,esp8266,esp32,due,sam-due,samd,samd21,samd51,nrf52,teensy,stm32,mission-critical,accuracy,precise,non-blocking,isr,isr-based,hardware-timer,mbed,nano-33-ble,adafruit,sparkfun,arduino,generic",
5-
"description": "This library enables you to use Interrupt from Hardware Timers on supported boards such as AVR, ESP8266, ESP32, SAMD, SAM DUE, nRF52, STM32F/L/H/G/WB/MP1, Teensy, Nano-33-BLE, etc. These hardware timers, using interrupt, still work even if other functions are blocking. It now supports 16 ISR-based timers, while consuming only 1 Hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's necessary if you need to measure some data requiring better accuracy.",
3+
"version": "1.5.0",
4+
"keywords": "timing, device, control, timer, interrupt, hardware, avr, mega, nano, uno, leonardo, yun, yun-mini, esplora, gemma, atmega, feather, adafruit, 16u4, 32u4, atmega328p, atmega128, atmega168, atmega2560, atmega1280, atmega16u4, atmega32u4, atmega4809, nano-every, uno-wifi-rev2, esp8266, esp32, due, sam-due, samd, samd21, samd51, nrf52, teensy, stm32, mission-critical, accuracy, precise, non-blocking, isr, isr-based, hardware-timer, mbed, nano-33-ble, adafruit, sparkfun, arduino, generic",
5+
"description": "This library enables you to use Interrupt from Hardware Timers on supported boards such as AVR, Mega-AVR, ESP8266, ESP32, SAMD, SAM DUE, nRF52, STM32F/L/H/G/WB/MP1, Teensy, Nano-33-BLE, etc. These hardware timers, using interrupt, still work even if other functions are blocking. It now supports 16 ISR-based timers, while consuming only 1 Hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's necessary if you need to measure some data requiring better accuracy.",
66
"authors":
77
{
88
"name": "Khoi Hoang",

library.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
name=TimerInterrupt_Generic
2-
version=1.4.0
2+
version=1.5.0
33
author=Khoi Hoang <[email protected]>
44
maintainer=Khoi Hoang <[email protected]>
5-
sentence=This library enables you to use Interrupt from Hardware Timers on supported Arduino boards such as AVR, ESP8266, ESP32, SAMD, SAM DUE, nRF52, STM32F/L/H/G/WB/MP1, Teensy, Nano-33-BLE, etc.
5+
sentence=This library enables you to use Interrupt from Hardware Timers on supported Arduino boards such as AVR, Mega-AVR, ESP8266, ESP32, SAMD, SAM DUE, nRF52, STM32F/L/H/G/WB/MP1, Teensy, Nano-33-BLE, etc.
66
paragraph=These Hardware Timers, using Interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's mandatory if you need to measure some data requiring better accuracy. It now supports 16 ISR-based Timers, while consuming only 1 Hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based Timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks.
7-
category=Timing,Control,Device,Time,Timer,AVR,SAM-DUE,ESP32,ESP8266,SAMD,NRF52,STM32,Teensy,MBED,Nano-33-BLE,interrupt
7+
category=Timing, Control, Device, Time, Timer, AVR, Mega-AVR, SAM-DUE, ESP32, ESP8266, SAMD, NRF52, STM32, Teensy, MBED, Nano-33-BLE, interrupt
88
url=https://github.com/khoih-prog/TimerInterrupt_Generic
99
architectures=*
1010
repository=https://github.com/khoih-prog/TimerInterrupt_Generic

src/AVRTimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2727
Licensed under MIT license
2828
29-
Version: 1.4.0
29+
Version: 1.5.0
3030
3131
Version Modified By Date Comments
3232
------- ----------- ---------- -----------
@@ -36,6 +36,7 @@
3636
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3737
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3838
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
39+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3940
*****************************************************************************************************************************/
4041

4142

src/ESP32TimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2626
Licensed under MIT license
2727
28-
Version: 1.4.0
28+
Version: 1.5.0
2929
3030
Version Modified By Date Comments
3131
------- ----------- ---------- -----------
@@ -35,6 +35,7 @@
3535
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3636
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3737
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
38+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3839
*****************************************************************************************************************************/
3940

4041
#pragma once

src/ESP8266TimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2525
Licensed under MIT license
2626
27-
Version: 1.4.0
27+
Version: 1.5.0
2828
2929
Version Modified By Date Comments
3030
------- ----------- ---------- -----------
@@ -34,6 +34,7 @@
3434
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3535
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3636
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
37+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3738
*****************************************************************************************************************************/
3839

3940
#pragma once

src/ISR_Timer-Impl_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334

3435
#pragma once

src/ISR_Timer_Generic.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334

3435
#pragma once
@@ -37,7 +38,7 @@
3738
#define ISR_TIMER_GENERIC_H
3839

3940
#if !defined(TIMER_INTERRUPT_GENERIC_VERSION)
40-
#define TIMER_INTERRUPT_GENERIC_VERSION "TimerInterrupt_Generic v1.4.0"
41+
#define TIMER_INTERRUPT_GENERIC_VERSION "TimerInterrupt_Generic v1.5.0"
4142
#endif
4243

4344
#include <stddef.h>

src/NRF52TimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334
/*
3435
nRF52 has 5 Hardware TIMERs: NRF_TIMER0-NRF_TIMER4

src/NRF52_MBED_TimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Based on BlynkTimer.h
2020
Author: Volodymyr Shymanskyy
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334
/*
3435
nRF52 has 5 Hardware TIMERs: NRF_TIMER0-NRF_TIMER4

src/SAMDTimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334
/*
3435
SAMD21

src/SAMDUETimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334

3435
#pragma once

src/STM32TimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334

3435
#pragma once

src/TeensyTimerInterrupt_Generic.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334

3435
#pragma once

src/TimerInterrupt_Generic.h

+11-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
********************************************************************************************************************************/
3334

3435
#pragma once
@@ -37,7 +38,7 @@
3738
#define TIMERINTERRUPT_GENERIC_H
3839

3940
#if !defined(TIMER_INTERRUPT_GENERIC_VERSION)
40-
#define TIMER_INTERRUPT_GENERIC_VERSION "TimerInterrupt_Generic v1.4.0"
41+
#define TIMER_INTERRUPT_GENERIC_VERSION "TimerInterrupt_Generic v1.5.0"
4142
#endif
4243

4344
#include "TimerInterrupt_Generic_Debug.h"
@@ -159,7 +160,11 @@
159160
defined(STM32WB) || defined(STM32MP1) )
160161

161162
#define TIMER_INTERRUPT_USING_STM32 true
162-
163+
164+
#elif ( defined(__AVR_ATmega4809__) || defined(ARDUINO_AVR_UNO_WIFI_REV2) || defined(ARDUINO_AVR_NANO_EVERY) )
165+
166+
#define TIMER_INTERRUPT_USING_MEGA_AVR true
167+
163168
#else
164169

165170
#error Unsupported Board! Please check your Tools->Board setting.
@@ -185,7 +190,9 @@
185190
#elif TIMER_INTERRUPT_USING_TEENSY
186191
#include "TeensyTimerInterrupt_Generic.h"
187192
#elif TIMER_INTERRUPT_USING_STM32
188-
#include "STM32TimerInterrupt_Generic.h"
193+
#include "STM32TimerInterrupt_Generic.h"
194+
#elif TIMER_INTERRUPT_USING_MEGA_AVR
195+
#include "megaAVR_TimerInterrupt_Generic.h"
189196
#endif
190197

191198
////////////////////////////////////////////////////

src/TimerInterrupt_Generic_Debug.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Built by Khoi Hoang https://github.com/khoih-prog/TimerInterrupt_Generic
2020
Licensed under MIT license
2121
22-
Version: 1.4.0
22+
Version: 1.5.0
2323
2424
Version Modified By Date Comments
2525
------- ----------- ---------- -----------
@@ -29,6 +29,7 @@
2929
1.3.1 K.Hoang 09/12/2020 Add complex examples and board Version String. Fix SAMD bug.
3030
1.3.2 K.Hoang 06/01/2021 Fix warnings. Optimize examples to reduce memory usage
3131
1.4.0 K.Hoang 02/04/2021 Add support to Arduino, Adafruit, Sparkfun AVR 32u4, 328P, 128128RFA1 and Sparkfun SAMD
32+
1.5.0 K.Hoang 17/04/2021 Add support to Arduino megaAVR ATmega4809-based boards (Nano Every, UNO WiFi Rev2, etc.)
3233
*****************************************************************************************************************************/
3334

3435
#pragma once

0 commit comments

Comments
 (0)