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

Commit

Permalink
v1.8.0 to fix bug
Browse files Browse the repository at this point in the history
### 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)
  • Loading branch information
khoih-prog authored May 7, 2022
1 parent 3f496d6 commit 73f17d1
Show file tree
Hide file tree
Showing 11 changed files with 442 additions and 548 deletions.
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),

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.

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.

---
---

Expand All @@ -160,7 +162,7 @@ The catch is **your function is now part of an ISR (Interrupt Service Routine),
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.).
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.
7. To use with some examples, depending on which Ethernet card you're using:
- [`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)
- [`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)
- [`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**
- [`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)
7. To use with some examples
Expand Down Expand Up @@ -537,7 +539,7 @@ While software timer, **programmed for 2s, is activated after 7.937s !!!**. Then

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

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

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

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

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

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


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

---
---
Expand All @@ -1042,7 +1045,8 @@ Many thanks for everyone for bug reporting, new feature suggesting, testing and
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.
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
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.
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.
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
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


<table>
Expand All @@ -1057,6 +1061,7 @@ Many thanks for everyone for bug reporting, new feature suggesting, testing and
<tr>
<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>
<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>
<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>
</tr>
</table>

Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
## Table of Contents

* [Changelog](#changelog)
* [Releases v1.8.0](#releases-v180)
* [Releases v1.7.0](#releases-v170)
* [Releases v1.6.0](#releases-v160)
* [Releases v1.5.0](#releases-v150)
Expand All @@ -29,6 +30,10 @@

## Changelog

### 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](https://github.com/khoih-prog/SAMD_TimerInterrupt/discussions/21)

### Releases v1.7.0

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)
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SAMD_TimerInterrupt",
"version": "1.7.0",
"version": "1.8.0",
"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",
"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.",
"authors":
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SAMD_TimerInterrupt
version=1.7.0
version=1.8.0
author=Khoi Hoang <[email protected]>
maintainer=Khoi Hoang <[email protected]>
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.
Expand All @@ -9,4 +9,4 @@ url=https://github.com/khoih-prog/SAMD_TimerInterrupt
architectures=samd
repository=https://github.com/khoih-prog/SAMD_TimerInterrupt
license=MIT
includes=SAMDTimerInterrupt.h,SAMDTimerInterrupt.hpp,SAMD_ISR_Timer.h,SAMD_ISR_Timer.hpp
includes=SAMDTimerInterrupt.h, SAMDTimerInterrupt.hpp, SAMD_ISR_Timer.h, SAMD_ISR_Timer.hpp
3 changes: 2 additions & 1 deletion src/SAMDTimerInterrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Based on BlynkTimer.h
Author: Volodymyr Shymanskyy
Version: 1.7.0
Version: 1.8.0
Version Modified By Date Comments
------- ----------- ---------- -----------
Expand All @@ -30,6 +30,7 @@
1.5.0 K.Hoang 08/10/2021 Improve frequency precision by using float instead of ulong
1.6.0 K.Hoang 20/01/2022 Fix `multiple-definitions` linker error. Add support to many more boards
1.7.0 K.Hoang 25/04/2022 Optimize code for setInterval() of SAMD21 TC3
1.8.0 K.Hoang 07/05/2022 Scrap the buggy code in v1.7.0 for TC3
*****************************************************************************************************************************/
/*
SAMD21
Expand Down
Loading

0 comments on commit 73f17d1

Please sign in to comment.