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

Commit 73f17d1

Browse files
authored
v1.8.0 to fix bug
### Releases v1.8.0 1. Fix bug introduced in v1.7.0 to SAMD21 TC3. Check [Do I have a brick? I'm unable to upload sketches after using this library! #21](#21)
1 parent 3f496d6 commit 73f17d1

11 files changed

+442
-548
lines changed

README.md

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
147147

148148
2. Typically global variables are used to pass data between an ISR and the main program. To make sure variables shared between an ISR and the main program are updated correctly, declare them as volatile.
149149

150+
3. The maximum time you can use directly on SAMD TC3/TCC Timer is **~1398.11ms = 1.39811s**. If you use time larger than 1398.11ms, the wrap-around will happen and you'll get much smaller time.
151+
150152
---
151153
---
152154

@@ -160,7 +162,7 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
160162
5. [`Sparkfun SAMD core 1.8.1+`](https://github.com/sparkfun/Arduino_Boards) for SAMD21/SAMD51 boards (SparkFun_RedBoard_Turbo, SparkFun_SAMD51_Thing_Plus, etc.).
161163
6. [`Blynk library 1.0.1`](https://github.com/blynkkk/blynk-library/releases). [![Latest release](https://img.shields.io/github/release/blynkkk/blynk-library.svg)](https://github.com/blynkkk/blynk-library/releases/latest/) to use with some examples. Don't use Blynk beta versions.
162164
7. To use with some examples, depending on which Ethernet card you're using:
163-
- [`Ethernet_Generic library v2.1.0+`](https://github.com/khoih-prog/Ethernet_Generic) for W5100, W5200 and W5500/WIZ550io/WIZ850io/USR-ES1 with Wiznet W5500 chip. [![GitHub release](https://img.shields.io/github/release/khoih-prog/Ethernet_Generic.svg)](https://github.com/khoih-prog/Ethernet_Generic/releases/latest)
165+
- [`Ethernet_Generic library v2.3.0+`](https://github.com/khoih-prog/Ethernet_Generic) for W5100, W5200 and W5500/WIZ550io/WIZ850io/USR-ES1 with Wiznet W5500 chip. [![GitHub release](https://img.shields.io/github/release/khoih-prog/Ethernet_Generic.svg)](https://github.com/khoih-prog/Ethernet_Generic/releases/latest)
164166
- [`EthernetENC library v2.0.2+`](https://github.com/jandrassy/EthernetENC) for ENC28J60. [![GitHub release](https://img.shields.io/github/release/jandrassy/EthernetENC.svg)](https://github.com/jandrassy/EthernetENC/releases/latest). **New and Better**
165167
- [`UIPEthernet library v2.0.11+`](https://github.com/UIPEthernet/UIPEthernet) for ENC28J60. [![GitHub release](https://img.shields.io/github/release/UIPEthernet/UIPEthernet.svg)](https://github.com/UIPEthernet/UIPEthernet/releases/latest)
166168
7. To use with some examples
@@ -537,7 +539,7 @@ While software timer, **programmed for 2s, is activated after 7.937s !!!**. Then
537539

538540
```
539541
Starting ISR_Timer_Complex_WiFiNINA on SAMD_NANO_33_IOT
540-
SAMDTimerInterrupt v1.7.0
542+
SAMDTimerInterrupt v1.8.0
541543
CPU Frequency = 48 MHz
542544
[TISR] SAMDTimerInterrupt: F_CPU (MHz) = 48 , TIMER_HZ = 48
543545
[TISR] TC_Timer::startTimer _Timer = 0x 42002c00 , TC3 = 0x 42002c00
@@ -602,7 +604,7 @@ The following is the sample terminal output when running example [**TimerInterru
602604

603605
```
604606
Starting TimerInterruptTest on ITSYBITSY_M4
605-
SAMDTimerInterrupt v1.7.0
607+
SAMDTimerInterrupt v1.8.0
606608
CPU Frequency = 48 MHz
607609
[TISR] SAMDTimerInterrupt: F_CPU (MHz) = 120 , TIMER_HZ = 48
608610
[TISR] TC_Timer::startTimer _Timer = 0x 0x4101c000 , TC3 = 0x 0x4101c000
@@ -680,7 +682,7 @@ The following is the sample terminal output when running example [**Argument_Non
680682

681683
```
682684
Starting Argument_None on SAMD_NANO_33_IOT
683-
SAMDTimerInterrupt v1.7.0
685+
SAMDTimerInterrupt v1.8.0
684686
CPU Frequency = 48 MHz
685687
[TISR] SAMDTimerInterrupt: F_CPU (MHz) = 48 , TIMER_HZ = 48
686688
[TISR] TC_Timer::startTimer _Timer = 0x 42002c00 , TC3 = 0x 42002c00
@@ -730,7 +732,7 @@ In this example, 16 independent ISR Timers are used, yet utilized just one Hardw
730732

731733
```
732734
Starting ISR_16_Timers_Array on SAMD_NANO_33_IOT
733-
SAMDTimerInterrupt v1.7.0
735+
SAMDTimerInterrupt v1.8.0
734736
CPU Frequency = 48 MHz
735737
[TISR] SAMDTimerInterrupt: F_CPU (MHz) = 48 , TIMER_HZ = 48
736738
[TISR] TC_Timer::startTimer _Timer = 0x 42002c00 , TC3 = 0x 42002c00
@@ -854,7 +856,7 @@ The following is the sample terminal output when running example [Change_Interva
854856

855857
```
856858
Starting Change_Interval on SAMD_NANO_33_IOT
857-
SAMDTimerInterrupt v1.7.0
859+
SAMDTimerInterrupt v1.8.0
858860
CPU Frequency = 48 MHz
859861
[TISR] SAMDTimerInterrupt: F_CPU (MHz) = 48 , TIMER_HZ = 48
860862
[TISR] TC_Timer::startTimer _Timer = 0x 42002c00 , TC3 = 0x 42002c00
@@ -918,7 +920,7 @@ The following is the sample terminal output when running example [RepeatedAttach
918920

919921
```
920922
Starting RepeatedAttachInterrupt_uS on SEEED_XIAO_M0
921-
SAMDTimerInterrupt v1.7.0
923+
SAMDTimerInterrupt v1.8.0
922924
CPU Frequency = 48 MHz
923925
[TISR] _period = 19995 , frequency = 50.01
924926
[TISR] SAMDTimerInterrupt: F_CPU (MHz) = 48 , TIMER_HZ = 48
@@ -1018,15 +1020,16 @@ Submit issues to: [SAMD_TimerInterrupt issues](https://github.com/khoih-prog/SAM
10181020
## DONE
10191021

10201022

1021-
1. Basic hardware timers for SAMD21 and SAMD51.
1022-
2. More hardware-initiated software-enabled timers
1023-
3. Longer time interval
1024-
4. Similar features for remaining Arduino boards such as ESP32, ESP8266, STM32, nRF52, mbed-nRF52, Teensy, etc.
1025-
5. Add Table of Contents
1026-
6. Fix `multiple-definitions` linker error
1027-
7. Add support to many more boards, such as `SAMD21E1xA`, `SAMD21G1xA` and`SAMD21J1xA`
1028-
8. Optimize library code by using `reference-passing` instead of `value-passing`
1029-
9. Optimize code for setInterval() of SAMD21 TC3
1023+
1. Basic hardware timers for SAMD21 and SAMD51.
1024+
2. More hardware-initiated software-enabled timers
1025+
3. Longer time interval
1026+
4. Similar features for remaining Arduino boards such as ESP32, ESP8266, STM32, nRF52, mbed-nRF52, Teensy, etc.
1027+
5. Add Table of Contents
1028+
6. Fix `multiple-definitions` linker error
1029+
7. Add support to many more boards, such as `SAMD21E1xA`, `SAMD21G1xA` and`SAMD21J1xA`
1030+
8. Optimize library code by using `reference-passing` instead of `value-passing`
1031+
9. Optimize code for `setInterval()` of SAMD21 TC3
1032+
10. Reverse the change in `setInterval()` of SAMD21 TC3 to fix bug when using SAMD21 TC3.
10301033

10311034
---
10321035
---
@@ -1042,7 +1045,8 @@ Many thanks for everyone for bug reporting, new feature suggesting, testing and
10421045
5. Thanks to [generationmake](https://github.com/generationmake) to make a PR in [change variable period from unsigned long to float #7](https://github.com/khoih-prog/SAMD_TimerInterrupt/pull/7) leading to new release v1.5.0.
10431046
6. Thanks to [Alexander Golovanov](https://github.com/homeodor) to propose a PR in [Add more SAMD21 #10](https://github.com/khoih-prog/SAMD_TimerInterrupt/pull/10) leading to the support of many new boards in new release v1.6.0
10441047
7. Thanks to [Will Powell](https://github.com/WillPowellUk) to report the bug in [Multiple Definition Error Not fixed by swapping src_cpp or src_h with src #9](https://github.com/khoih-prog/SAMD_TimerInterrupt/issues/9) leading to new release v1.6.0.
1045-
8. Thanks to [Dave Hooper](https://github.com/stripwax) to report the bug and propose the fix in [setInterval on a running timer results in a period significantly longer than the specified period #17](https://github.com/khoih-prog/SAMD_TimerInterrupt/issues/17) leading to new release v1.7.0.
1048+
8. Thanks to [Dave Hooper](https://github.com/stripwax) to report the bug and propose the fix in [setInterval on a running timer results in a period significantly longer than the specified period #17](https://github.com/khoih-prog/SAMD_TimerInterrupt/issues/17) leading to new release v1.7.0
1049+
9. Thanks to [Rui Marinheiro](https://github.com/sailorsail) to start the discussion in [Do I have a brick? I'm unable to upload sketches after using this library! #21](https://github.com/khoih-prog/SAMD_TimerInterrupt/discussions/21) leading to new release v1.8.0 to fix the bug
10461050

10471051

10481052
<table>
@@ -1057,6 +1061,7 @@ Many thanks for everyone for bug reporting, new feature suggesting, testing and
10571061
<tr>
10581062
<td align="center"><a href="https://github.com/WillPowellUk"><img src="https://github.com/WillPowellUk.png" width="100px;" alt="WillPowellUk"/><br /><sub><b>Will Powell</b></sub></a><br /></td>
10591063
<td align="center"><a href="https://github.com/stripwax"><img src="https://github.com/stripwax.png" width="100px;" alt="stripwax"/><br /><sub><b>Dave Hooper</b></sub></a><br /></td>
1064+
<td align="center"><a href="https://github.com/sailorsail"><img src="https://github.com/sailorsail.png" width="100px;" alt="sailorsail"/><br /><sub><b>Rui Marinheiro</b></sub></a><br /></td>
10601065
</tr>
10611066
</table>
10621067

changelog.md

Lines changed: 5 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.8.0](#releases-v180)
1516
* [Releases v1.7.0](#releases-v170)
1617
* [Releases v1.6.0](#releases-v160)
1718
* [Releases v1.5.0](#releases-v150)
@@ -29,6 +30,10 @@
2930

3031
## Changelog
3132

33+
### Releases v1.8.0
34+
35+
1. Fix bug introduced in v1.7.0 to SAMD21 TC3. Check [Do I have a brick? I'm unable to upload sketches after using this library! #21](https://github.com/khoih-prog/SAMD_TimerInterrupt/discussions/21)
36+
3237
### Releases v1.7.0
3338

3439
1. Optimize code for setInterval() of SAMD21 TC3. Check [setInterval on a running timer results in a period significantly longer than the specified period #17](https://github.com/khoih-prog/SAMD_TimerInterrupt/issues/17)

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SAMD_TimerInterrupt",
3-
"version": "1.7.0",
3+
"version": "1.8.0",
44
"keywords": "timing, device, control, timer, interrupt, hardware, isr, isr-based, hardware-timer, isr-timer, isr-based-timer, mission-critical, accuracy, precise, non-blocking, samd, samd21, samd51, nano-33-iot",
55
"description": "This library enables you to use Interrupt from Hardware Timers on SAMD-based boards. 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. 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 necessary if you need to measure some data requiring better accuracy.",
66
"authors":

library.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SAMD_TimerInterrupt
2-
version=1.7.0
2+
version=1.8.0
33
author=Khoi Hoang <khoih.prog@gmail.com>
44
maintainer=Khoi Hoang <khoih.prog@gmail.com>
55
sentence=This library enables you to use Interrupt from Hardware Timers on SAMD-based boards such as SAMD21 Nano-33-IoT, Adafruit SAMD51 Itsy-Bitsy M4, SeeedStudio XIAO, Sparkfun SAMD51_MICROMOD, etc.
@@ -9,4 +9,4 @@ url=https://github.com/khoih-prog/SAMD_TimerInterrupt
99
architectures=samd
1010
repository=https://github.com/khoih-prog/SAMD_TimerInterrupt
1111
license=MIT
12-
includes=SAMDTimerInterrupt.h,SAMDTimerInterrupt.hpp,SAMD_ISR_Timer.h,SAMD_ISR_Timer.hpp
12+
includes=SAMDTimerInterrupt.h, SAMDTimerInterrupt.hpp, SAMD_ISR_Timer.h, SAMD_ISR_Timer.hpp

src/SAMDTimerInterrupt.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Based on BlynkTimer.h
1717
Author: Volodymyr Shymanskyy
1818
19-
Version: 1.7.0
19+
Version: 1.8.0
2020
2121
Version Modified By Date Comments
2222
------- ----------- ---------- -----------
@@ -30,6 +30,7 @@
3030
1.5.0 K.Hoang 08/10/2021 Improve frequency precision by using float instead of ulong
3131
1.6.0 K.Hoang 20/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards
3232
1.7.0 K.Hoang 25/04/2022 Optimize code for setInterval() of SAMD21 TC3
33+
1.8.0 K.Hoang 07/05/2022 Scrap the buggy code in v1.7.0 for TC3
3334
*****************************************************************************************************************************/
3435
/*
3536
SAMD21

0 commit comments

Comments
 (0)