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

Commit e2abcf7

Browse files
authored
v1.6.0 to fix multiple-definitions linker error
### Releases v1.6.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project. 3. Add support to many more boards, such as `SAMD21E1xA`, `SAMD21G1xA` and`SAMD21J1xA` 4. Optimize library code by using `reference-passing` instead of `value-passing` 5. Update all examples 6. Update `Packages_Patches`
1 parent c8ec002 commit e2abcf7

File tree

29 files changed

+1676
-1508
lines changed

29 files changed

+1676
-1508
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ If you don't find anything, please [open a new issue](https://github.com/khoih-p
1414

1515
Please ensure to specify the following:
1616

17-
* Arduino IDE version (e.g. 1.8.16) or Platform.io version
18-
* `SAMD` Core Version (e.g. Arduino SAMD core v1.8.11, Adafruit SAMD core v1.7.5, Seeed Studio SAMD v1.8.2, Sparkfun SAMD v1.8.1)
17+
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18+
* `SAMD` Core Version (e.g. Arduino SAMD core v1.8.12, Adafruit SAMD core v1.7.7, Seeed Studio SAMD v1.8.2, Sparkfun SAMD v1.8.1)
1919
* Contextual information (e.g. what you were trying to achieve)
2020
* Simplest possible steps to reproduce
2121
* Anything that might be relevant in your opinion, such as:
@@ -26,10 +26,10 @@ Please ensure to specify the following:
2626
### Example
2727

2828
```
29-
Arduino IDE version: 1.8.16
30-
Arduino SAMD Core Version 1.8.11
29+
Arduino IDE version: 1.8.19
30+
Arduino SAMD Core Version 1.8.12
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-86-generic #97-Ubuntu SMP Fri Sep 17 19:19:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
32+
Linux xy-Inspiron-3593 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 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

Lines changed: 284 additions & 236 deletions
Large diffs are not rendered by default.

changelog.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
## Table of Contents
1313

1414
* [Changelog](#changelog)
15+
* [Releases v1.6.0](#releases-v160)
1516
* [Releases v1.5.0](#releases-v150)
1617
* [Releases v1.4.0](#releases-v140)
1718
* [Releases v1.3.1](#releases-v131)
@@ -27,6 +28,15 @@
2728

2829
## Changelog
2930

31+
### Releases v1.6.0
32+
33+
1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories
34+
2. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project.
35+
3. Add support to many more boards, such as `SAMD21E1xA`, `SAMD21G1xA` and`SAMD21J1xA`
36+
4. Optimize library code by using `reference-passing` instead of `value-passing`
37+
5. Update all examples
38+
6. Update `Packages_Patches`
39+
3040
### Releases v1.5.0
3141

3242
1. Improve frequency precision by using float instead of ulong, Check PR [change variable period from unsigned long to float #7](https://github.com/khoih-prog/SAMD_TimerInterrupt/pull/7)

examples/Argument_None/Argument_None.ino

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@
1111
The accuracy is nearly perfect compared to software timers. The most important feature is they're ISR-based timers
1212
Therefore, their executions are not blocked by bad-behaving functions / tasks.
1313
This important feature is absolutely necessary for mission-critical tasks.
14-
15-
Based on SimpleTimer - A timer library for Arduino.
16-
17-
Copyright (c) 2010 OTTOTECNICA Italy
18-
19-
Based on BlynkTimer.h
20-
Author: Volodymyr Shymanskyy
21-
22-
Version: 1.5.0
23-
24-
Version Modified By Date Comments
25-
------- ----------- ---------- -----------
26-
1.0.0 K Hoang 30/10/2020 Initial coding
27-
1.0.1 K Hoang 06/11/2020 Add complicated example ISR_16_Timers_Array using all 16 independent ISR Timers.
28-
1.1.1 K.Hoang 06/12/2020 Add Change_Interval example. Bump up version to sync with other TimerInterrupt Libraries
29-
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
30-
1.3.0 K.Hoang 02/04/2021 Add support to Sparkfun SAMD21 and SAMD51 boards
31-
1.3.1 K.Hoang 09/05/2021 Fix compile error to some SAMD21-based boards
32-
1.4.0 K.Hoang 02/06/2021 Fix SAMD21 rare bug caused by not fully init Prescaler
33-
1.5.0 K.Hoang 08/10/2021 Improve frequency precision by using float instead of ulong
3414
*****************************************************************************************************************************/
3515

3616
/*
@@ -46,10 +26,13 @@
4626
*/
4727

4828
#if !( defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) \
49-
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
50-
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(__SAMD21G18A__) \
51-
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD21E18A__) || defined(__SAMD51__) || defined(__SAMD51J20A__) || defined(__SAMD51J19A__) \
52-
|| defined(__SAMD51G19A__) || defined(__SAMD51P19A__) || defined(__SAMD21G18A__) )
29+
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
30+
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) \
31+
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD51__) || defined(__SAMD51J20A__) \
32+
|| defined(__SAMD51J19A__) || defined(__SAMD51G19A__) || defined(__SAMD51P19A__) \
33+
|| defined(__SAMD21E15A__) || defined(__SAMD21E16A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) \
34+
|| defined(__SAMD21G15A__) || defined(__SAMD21G16A__) || defined(__SAMD21G17A__) || defined(__SAMD21G18A__) \
35+
|| defined(__SAMD21J15A__) || defined(__SAMD21J16A__) || defined(__SAMD21J17A__) || defined(__SAMD21J18A__) )
5336
#error This code is designed to run on SAMD21/SAMD51 platform! Please check your Tools->Board setting.
5437
#endif
5538

@@ -60,6 +43,7 @@
6043
#define TIMER_INTERRUPT_DEBUG 0
6144
#define _TIMERINTERRUPT_LOGLEVEL_ 0
6245

46+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
6347
#include "SAMDTimerInterrupt.h"
6448

6549
#ifndef LED_BUILTIN

examples/Argument_None_uS/Argument_None_uS.ino

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@
1111
The accuracy is nearly perfect compared to software timers. The most important feature is they're ISR-based timers
1212
Therefore, their executions are not blocked by bad-behaving functions / tasks.
1313
This important feature is absolutely necessary for mission-critical tasks.
14-
15-
Based on SimpleTimer - A timer library for Arduino.
16-
17-
Copyright (c) 2010 OTTOTECNICA Italy
18-
19-
Based on BlynkTimer.h
20-
Author: Volodymyr Shymanskyy
21-
22-
Version: 1.5.0
23-
24-
Version Modified By Date Comments
25-
------- ----------- ---------- -----------
26-
1.0.0 K Hoang 30/10/2020 Initial coding
27-
1.0.1 K Hoang 06/11/2020 Add complicated example ISR_16_Timers_Array using all 16 independent ISR Timers.
28-
1.1.1 K.Hoang 06/12/2020 Add Change_Interval example. Bump up version to sync with other TimerInterrupt Libraries
29-
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
30-
1.3.0 K.Hoang 02/04/2021 Add support to Sparkfun SAMD21 and SAMD51 boards
31-
1.3.1 K.Hoang 09/05/2021 Fix compile error to some SAMD21-based boards
32-
1.4.0 K.Hoang 02/06/2021 Fix SAMD21 rare bug caused by not fully init Prescaler
33-
1.5.0 K.Hoang 08/10/2021 Improve frequency precision by using float instead of ulong
3414
*****************************************************************************************************************************/
3515

3616
/*
@@ -46,10 +26,13 @@
4626
*/
4727

4828
#if !( defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) \
49-
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
50-
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(__SAMD21G18A__) \
51-
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD21E18A__) || defined(__SAMD51__) || defined(__SAMD51J20A__) || defined(__SAMD51J19A__) \
52-
|| defined(__SAMD51G19A__) || defined(__SAMD51P19A__) || defined(__SAMD21G18A__) )
29+
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
30+
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) \
31+
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD51__) || defined(__SAMD51J20A__) \
32+
|| defined(__SAMD51J19A__) || defined(__SAMD51G19A__) || defined(__SAMD51P19A__) \
33+
|| defined(__SAMD21E15A__) || defined(__SAMD21E16A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) \
34+
|| defined(__SAMD21G15A__) || defined(__SAMD21G16A__) || defined(__SAMD21G17A__) || defined(__SAMD21G18A__) \
35+
|| defined(__SAMD21J15A__) || defined(__SAMD21J16A__) || defined(__SAMD21J17A__) || defined(__SAMD21J18A__) )
5336
#error This code is designed to run on SAMD21/SAMD51 platform! Please check your Tools->Board setting.
5437
#endif
5538

@@ -60,6 +43,7 @@
6043
#define TIMER_INTERRUPT_DEBUG 0
6144
#define _TIMERINTERRUPT_LOGLEVEL_ 0
6245

46+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
6347
#include "SAMDTimerInterrupt.h"
6448

6549
//#ifndef LED_BUILTIN

examples/Change_Interval/Change_Interval.ino

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@
1111
The accuracy is nearly perfect compared to software timers. The most important feature is they're ISR-based timers
1212
Therefore, their executions are not blocked by bad-behaving functions / tasks.
1313
This important feature is absolutely necessary for mission-critical tasks.
14-
15-
Based on SimpleTimer - A timer library for Arduino.
16-
17-
Copyright (c) 2010 OTTOTECNICA Italy
18-
19-
Based on BlynkTimer.h
20-
Author: Volodymyr Shymanskyy
21-
22-
Version: 1.5.0
23-
24-
Version Modified By Date Comments
25-
------- ----------- ---------- -----------
26-
1.0.0 K Hoang 30/10/2020 Initial coding
27-
1.0.1 K Hoang 06/11/2020 Add complicated example ISR_16_Timers_Array using all 16 independent ISR Timers.
28-
1.1.1 K.Hoang 06/12/2020 Add Change_Interval example. Bump up version to sync with other TimerInterrupt Libraries
29-
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
30-
1.3.0 K.Hoang 02/04/2021 Add support to Sparkfun SAMD21 and SAMD51 boards
31-
1.3.1 K.Hoang 09/05/2021 Fix compile error to some SAMD21-based boards
32-
1.4.0 K.Hoang 02/06/2021 Fix SAMD21 rare bug caused by not fully init Prescaler
33-
1.5.0 K.Hoang 08/10/2021 Improve frequency precision by using float instead of ulong
3414
*****************************************************************************************************************************/
3515

3616
/*
@@ -46,10 +26,13 @@
4626
*/
4727

4828
#if !( defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) \
49-
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
50-
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(__SAMD21G18A__) \
51-
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD21E18A__) || defined(__SAMD51__) || defined(__SAMD51J20A__) || defined(__SAMD51J19A__) \
52-
|| defined(__SAMD51G19A__) || defined(__SAMD51P19A__) || defined(__SAMD21G18A__) )
29+
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
30+
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) \
31+
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD51__) || defined(__SAMD51J20A__) \
32+
|| defined(__SAMD51J19A__) || defined(__SAMD51G19A__) || defined(__SAMD51P19A__) \
33+
|| defined(__SAMD21E15A__) || defined(__SAMD21E16A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) \
34+
|| defined(__SAMD21G15A__) || defined(__SAMD21G16A__) || defined(__SAMD21G17A__) || defined(__SAMD21G18A__) \
35+
|| defined(__SAMD21J15A__) || defined(__SAMD21J16A__) || defined(__SAMD21J17A__) || defined(__SAMD21J18A__) )
5336
#error This code is designed to run on SAMD21/SAMD51 platform! Please check your Tools->Board setting.
5437
#endif
5538

@@ -60,6 +43,7 @@
6043
#define TIMER_INTERRUPT_DEBUG 0
6144
#define _TIMERINTERRUPT_LOGLEVEL_ 0
6245

46+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
6347
#include "SAMDTimerInterrupt.h"
6448

6549
//#ifndef LED_BUILTIN

examples/ISR_16_Timers_Array/ISR_16_Timers_Array.ino

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@
1111
The accuracy is nearly perfect compared to software timers. The most important feature is they're ISR-based timers
1212
Therefore, their executions are not blocked by bad-behaving functions / tasks.
1313
This important feature is absolutely necessary for mission-critical tasks.
14-
15-
Based on SimpleTimer - A timer library for Arduino.
16-
17-
Copyright (c) 2010 OTTOTECNICA Italy
18-
19-
Based on BlynkTimer.h
20-
Author: Volodymyr Shymanskyy
21-
22-
Version: 1.5.0
23-
24-
Version Modified By Date Comments
25-
------- ----------- ---------- -----------
26-
1.0.0 K Hoang 30/10/2020 Initial coding
27-
1.0.1 K Hoang 06/11/2020 Add complicated example ISR_16_Timers_Array using all 16 independent ISR Timers.
28-
1.1.1 K.Hoang 06/12/2020 Add Change_Interval example. Bump up version to sync with other TimerInterrupt Libraries
29-
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
30-
1.3.0 K.Hoang 02/04/2021 Add support to Sparkfun SAMD21 and SAMD51 boards
31-
1.3.1 K.Hoang 09/05/2021 Fix compile error to some SAMD21-based boards
32-
1.4.0 K.Hoang 02/06/2021 Fix SAMD21 rare bug caused by not fully init Prescaler
33-
1.5.0 K.Hoang 08/10/2021 Improve frequency precision by using float instead of ulong
3414
*****************************************************************************************************************************/
3515
/*
3616
Notes:
@@ -62,10 +42,13 @@
6242
*/
6343

6444
#if !( defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) \
65-
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
66-
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(__SAMD21G18A__) \
67-
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD21E18A__) || defined(__SAMD51__) || defined(__SAMD51J20A__) || defined(__SAMD51J19A__) \
68-
|| defined(__SAMD51G19A__) || defined(__SAMD51P19A__) || defined(__SAMD21G18A__) )
45+
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
46+
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) \
47+
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD51__) || defined(__SAMD51J20A__) \
48+
|| defined(__SAMD51J19A__) || defined(__SAMD51G19A__) || defined(__SAMD51P19A__) \
49+
|| defined(__SAMD21E15A__) || defined(__SAMD21E16A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) \
50+
|| defined(__SAMD21G15A__) || defined(__SAMD21G16A__) || defined(__SAMD21G17A__) || defined(__SAMD21G18A__) \
51+
|| defined(__SAMD21J15A__) || defined(__SAMD21J16A__) || defined(__SAMD21J17A__) || defined(__SAMD21J18A__) )
6952
#error This code is designed to run on SAMD21/SAMD51 platform! Please check your Tools->Board setting.
7053
#endif
7154

@@ -76,7 +59,10 @@
7659
#define TIMER_INTERRUPT_DEBUG 0
7760
#define _TIMERINTERRUPT_LOGLEVEL_ 0
7861

62+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
7963
#include "SAMDTimerInterrupt.h"
64+
65+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
8066
#include "SAMD_ISR_Timer.h"
8167

8268
#include <SimpleTimer.h> // https://github.com/jfturcot/SimpleTimer

examples/ISR_16_Timers_Array_Complex/ISR_16_Timers_Array_Complex.ino

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,6 @@
1111
The accuracy is nearly perfect compared to software timers. The most important feature is they're ISR-based timers
1212
Therefore, their executions are not blocked by bad-behaving functions / tasks.
1313
This important feature is absolutely necessary for mission-critical tasks.
14-
15-
Based on SimpleTimer - A timer library for Arduino.
16-
17-
Copyright (c) 2010 OTTOTECNICA Italy
18-
19-
Based on BlynkTimer.h
20-
Author: Volodymyr Shymanskyy
21-
22-
Version: 1.5.0
23-
24-
Version Modified By Date Comments
25-
------- ----------- ---------- -----------
26-
1.0.0 K Hoang 30/10/2020 Initial coding
27-
1.0.1 K Hoang 06/11/2020 Add complicated example ISR_16_Timers_Array using all 16 independent ISR Timers.
28-
1.1.1 K.Hoang 06/12/2020 Add Change_Interval example. Bump up version to sync with other TimerInterrupt Libraries
29-
1.2.0 K.Hoang 08/01/2021 Add better debug feature. Optimize code and examples to reduce RAM usage
30-
1.3.0 K.Hoang 02/04/2021 Add support to Sparkfun SAMD21 and SAMD51 boards
31-
1.3.1 K.Hoang 09/05/2021 Fix compile error to some SAMD21-based boards
32-
1.4.0 K.Hoang 02/06/2021 Fix SAMD21 rare bug caused by not fully init Prescaler
33-
1.5.0 K.Hoang 08/10/2021 Improve frequency precision by using float instead of ulong
3414
*****************************************************************************************************************************/
3515
/*
3616
Notes:
@@ -53,11 +33,14 @@
5333
*/
5434

5535
#if !( defined(ARDUINO_SAMD_ZERO) || defined(ARDUINO_SAMD_MKR1000) || defined(ARDUINO_SAMD_MKRWIFI1010) \
56-
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
57-
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) || defined(__SAMD21G18A__) \
58-
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD21E18A__) || defined(__SAMD51__) || defined(__SAMD51J20A__) || defined(__SAMD51J19A__) \
59-
|| defined(__SAMD51G19A__) || defined(__SAMD51P19A__) || defined(__SAMD21G18A__) )
60-
#error This code is designed to run on SAMD21/SAMD51 platform! Please check your Tools->Board setting.
36+
|| defined(ARDUINO_SAMD_NANO_33_IOT) || defined(ARDUINO_SAMD_MKRFox1200) || defined(ARDUINO_SAMD_MKRWAN1300) || defined(ARDUINO_SAMD_MKRWAN1310) \
37+
|| defined(ARDUINO_SAMD_MKRGSM1400) || defined(ARDUINO_SAMD_MKRNB1500) || defined(ARDUINO_SAMD_MKRVIDOR4000) \
38+
|| defined(ARDUINO_SAMD_CIRCUITPLAYGROUND_EXPRESS) || defined(__SAMD51__) || defined(__SAMD51J20A__) \
39+
|| defined(__SAMD51J19A__) || defined(__SAMD51G19A__) || defined(__SAMD51P19A__) \
40+
|| defined(__SAMD21E15A__) || defined(__SAMD21E16A__) || defined(__SAMD21E17A__) || defined(__SAMD21E18A__) \
41+
|| defined(__SAMD21G15A__) || defined(__SAMD21G16A__) || defined(__SAMD21G17A__) || defined(__SAMD21G18A__) \
42+
|| defined(__SAMD21J15A__) || defined(__SAMD21J16A__) || defined(__SAMD21J17A__) || defined(__SAMD21J18A__) )
43+
#error This code is designed to run on SAMD21/SAMD51 platform! Please check your Tools->Board setting.
6144
#endif
6245

6346
// These define's must be placed at the beginning before #include "SAMDTimerInterrupt.h"
@@ -67,7 +50,10 @@
6750
#define TIMER_INTERRUPT_DEBUG 0
6851
#define _TIMERINTERRUPT_LOGLEVEL_ 0
6952

53+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
7054
#include "SAMDTimerInterrupt.h"
55+
56+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
7157
#include "SAMD_ISR_Timer.h"
7258

7359
#include <SimpleTimer.h> // https://github.com/jfturcot/SimpleTimer

0 commit comments

Comments
 (0)