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

Commit e8b8e89

Browse files
authored
v1.3.0 to fix multiple-definitions linker error
### Releases v1.3.0 1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories 2. Fix reattachInterrupt() bug. Check [bugfix: reattachInterrupt() pass wrong frequency value to setFrequency() #19](khoih-prog/ESP8266TimerInterrupt#19) 3. Update `Packages_Patches`
1 parent fa540a0 commit e8b8e89

22 files changed

+377
-506
lines changed

CONTRIBUTING.md

+5-5
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.15) or Platform.io version
18-
* `STM32` Core Version (e.g. STM32 core v2.0.0)
17+
* Arduino IDE version (e.g. 1.8.19) or Platform.io version
18+
* `STM32` Core Version (e.g. STM32 core v2.2.0)
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.15
30-
STM32 Core Version 2.0.0
29+
Arduino IDE version: 1.8.19
30+
STM32 Core Version 2.2.0
3131
OS: Ubuntu 20.04 LTS
32-
Linux xy-Inspiron-3593 5.4.0-81-generic #91-Ubuntu SMP Thu Jul 15 19:09:17 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

+54-146
Large diffs are not rendered by default.

changelog.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# STM32_TimerInterrupt Library
2+
3+
[![arduino-library-badge](https://www.ardu-badge.com/badge/STM32_TimerInterrupt.svg?)](https://www.ardu-badge.com/STM32_TimerInterrupt)
4+
[![GitHub release](https://img.shields.io/github/release/khoih-prog/STM32_TimerInterrupt.svg)](https://github.com/khoih-prog/STM32_TimerInterrupt/releases)
5+
[![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/khoih-prog/STM32_TimerInterrupt/blob/master/LICENSE)
6+
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
7+
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/STM32_TimerInterrupt.svg)](http://github.com/khoih-prog/STM32_TimerInterrupt/issues)
8+
9+
---
10+
---
11+
12+
13+
* [Changelog](#changelog)
14+
* [Releases v1.3.0](#releases-v130)
15+
* [Releases v1.2.1](#releases-v121)
16+
* [Releases v1.2.0](#releases-v120)
17+
* [Releases v1.1.1](#releases-v111)
18+
* [Releases v1.0.1](#releases-v101)
19+
* [Releases v1.0.0](#releases-v100)
20+
21+
---
22+
---
23+
24+
25+
## Changelog
26+
27+
### Releases v1.3.0
28+
29+
1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories
30+
2. Fix reattachInterrupt() bug. Check [bugfix: reattachInterrupt() pass wrong frequency value to setFrequency() #19](https://github.com/khoih-prog/ESP8266TimerInterrupt/pull/19)
31+
3. Update `Packages_Patches`
32+
33+
### Releases v1.2.1
34+
35+
1. Add support to **STM32L5 (NUCLEO_L552ZE_Q)**
36+
2. Verify OK with **STM32H7 (NUCLEO_H743ZI2)**
37+
38+
### Releases v1.2.0
39+
40+
1. Add better debug feature.
41+
2. Optimize code and examples to reduce RAM usage
42+
3. Add Table of Contents
43+
44+
### Releases v1.1.1
45+
46+
1. Add example [**Change_Interval**](examples/Change_Interval) and [**ISR_16_Timers_Array_Complex**](examples/ISR_16_Timers_Array_Complex)
47+
2. Bump up version to sync with other TimerInterrupt Libraries. Modify Version String.
48+
49+
50+
### Releases v1.0.1
51+
52+
1. Add complicated example [ISR_16_Timers_Array](examples/ISR_16_Timers_Array) utilizing and demonstrating the full usage of 16 independent ISR Timers.
53+
54+
### Releases v1.0.0
55+
56+
1. Permit up to 16 super-long-time, super-accurate ISR-based timers to avoid being blocked
57+
2. Using cpp code besides Impl.h code to use if Multiple-Definition linker error.
58+

examples/Argument_None/Argument_None.ino

+1-18
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215

3316
/*
@@ -53,7 +36,7 @@
5336
// Don't define _TIMERINTERRUPT_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
5437
// Don't define TIMER_INTERRUPT_DEBUG > 2. Only for special ISR debugging only. Can hang the system.
5538
#define TIMER_INTERRUPT_DEBUG 0
56-
#define _TIMERINTERRUPT_LOGLEVEL_ 0
39+
#define _TIMERINTERRUPT_LOGLEVEL_ 3
5740

5841
#include "STM32TimerInterrupt.h"
5942

examples/Change_Interval/Change_Interval.ino

+1-18
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215

3316
/*
@@ -53,7 +36,7 @@
5336
// Don't define _TIMERINTERRUPT_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
5437
// Don't define TIMER_INTERRUPT_DEBUG > 2. Only for special ISR debugging only. Can hang the system.
5538
#define TIMER_INTERRUPT_DEBUG 0
56-
#define _TIMERINTERRUPT_LOGLEVEL_ 0
39+
#define _TIMERINTERRUPT_LOGLEVEL_ 3
5740

5841
#include "STM32TimerInterrupt.h"
5942

examples/ISR_16_Timers_Array/ISR_16_Timers_Array.ino

+3-18
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215
/*
3316
Notes:
@@ -72,9 +55,11 @@
7255
#define _TIMERINTERRUPT_LOGLEVEL_ 0
7356

7457
#include "STM32TimerInterrupt.h"
58+
59+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
7560
#include "STM32_ISR_Timer.h"
7661

77-
#include <SimpleTimer.h> // https://github.com/schinken/SimpleTimer
62+
#include <SimpleTimer.h> // https://github.com/jfturcot/SimpleTimer
7863

7964
#ifndef LED_BUILTIN
8065
#define LED_BUILTIN 13

examples/ISR_16_Timers_Array_Complex/ISR_16_Timers_Array_Complex.ino

+4-19
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215
/*
3316
Notes:
@@ -60,12 +43,14 @@
6043
// Don't define _TIMERINTERRUPT_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
6144
// Don't define TIMER_INTERRUPT_DEBUG > 2. Only for special ISR debugging only. Can hang the system.
6245
#define TIMER_INTERRUPT_DEBUG 0
63-
#define _TIMERINTERRUPT_LOGLEVEL_ 0
46+
#define _TIMERINTERRUPT_LOGLEVEL_ 3
6447

6548
#include "STM32TimerInterrupt.h"
49+
50+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
6651
#include "STM32_ISR_Timer.h"
6752

68-
#include <SimpleTimer.h> // https://github.com/schinken/SimpleTimer
53+
#include <SimpleTimer.h> // https://github.com/jfturcot/SimpleTimer
6954

7055
#ifndef LED_BUILTIN
7156
#define LED_BUILTIN 13

examples/ISR_RPM_Measure/ISR_RPM_Measure.ino

-17
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215
/*
3316
Notes:

examples/ISR_Timer_Complex/ISR_Timer_Complex.ino

+3-18
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215
/*
3316
Notes:
@@ -120,9 +103,11 @@
120103
// Don't define _TIMERINTERRUPT_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
121104
// Don't define TIMER_INTERRUPT_DEBUG > 2. Only for special ISR debugging only. Can hang the system.
122105
#define TIMER_INTERRUPT_DEBUG 0
123-
#define _TIMERINTERRUPT_LOGLEVEL_ 0
106+
#define _TIMERINTERRUPT_LOGLEVEL_ 3
124107

125108
#include "STM32TimerInterrupt.h"
109+
110+
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
126111
#include "STM32_ISR_Timer.h"
127112

128113
#define HW_TIMER_INTERVAL_US 100L

examples/RPM_Measure/RPM_Measure.ino

-17
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215
/*
3316
Notes:

examples/SwitchDebounce/SwitchDebounce.ino

-17
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215
/*
3316
Notes:

examples/TimerInterruptLEDDemo/TimerInterruptLEDDemo.ino

-17
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215

3316
/*

examples/TimerInterruptTest/TimerInterruptTest.ino

+1-18
Original file line numberDiff line numberDiff line change
@@ -11,23 +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.2.1
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 complex examples. 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.2.1 K.Hoang 20/08/2021 Add support to STM32L5 (NUCLEO_L552ZE_Q). Verify OK with STM32H7 (NUCLEO_H743ZI2)
3114
*****************************************************************************************************************************/
3215
/*
3316
Notes:
@@ -52,7 +35,7 @@
5235
// Don't define _TIMERINTERRUPT_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
5336
// Don't define TIMER_INTERRUPT_DEBUG > 2. Only for special ISR debugging only. Can hang the system.
5437
#define TIMER_INTERRUPT_DEBUG 0
55-
#define _TIMERINTERRUPT_LOGLEVEL_ 0
38+
#define _TIMERINTERRUPT_LOGLEVEL_ 3
5639

5740
#include "STM32TimerInterrupt.h"
5841

0 commit comments

Comments
 (0)