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

Commit 3e25822

Browse files
authored
v1.7.0 to fix bug disabling TCB0
### Release v1.7.0 1. Fix bug disabling `TCB0`. Check [TimerB0 does not trigger interrupt #4](#4) 2. Use `allman astyle` and add `utils`
1 parent 59d45e4 commit 3e25822

File tree

1 file changed

+29
-25
lines changed

1 file changed

+29
-25
lines changed

README.md

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Donate to my libraries using BuyMeACoffee" style="height: 50px !important;width: 181px !important;" ></a>
1010
<a href="https://www.buymeacoffee.com/khoihprog6" title="Donate to my libraries using BuyMeACoffee"><img src="https://img.shields.io/badge/buy%20me%20a%20coffee-donate-orange.svg?logo=buy-me-a-coffee&logoColor=FFDD00" style="height: 20px !important;width: 200px !important;" ></a>
11+
<a href="https://profile-counter.glitch.me/khoih-prog/count.svg" title="Total Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog/count.svg" style="height: 30px;width: 200px;"></a>
12+
<a href="https://profile-counter.glitch.me/khoih-prog-megaAVR_TimerInterrupt/count.svg" title="Visitor count"><img src="https://profile-counter.glitch.me/khoih-prog-megaAVR_TimerInterrupt/count.svg" style="height: 30px;width: 200px;"></a>
1113

1214

1315
---
@@ -140,7 +142,7 @@ The catch is your function is now part of an ISR (Interrupt Service Routine), an
140142

141143
1. [`Arduino IDE 1.8.19+` for Arduino](https://github.com/arduino/Arduino). [![GitHub release](https://img.shields.io/github/release/arduino/Arduino.svg)](https://github.com/arduino/Arduino/releases/latest)
142144
2. [`Arduino megaAVR core 1.8.7+`](https://github.com/arduino/ArduinoCore-megaavr/releases) for Arduino megaAVR boards. Use Arduino Board Manager to install.
143-
3. [`MegaCoreX megaAVR core 1.0.10+`](https://github.com/MCUdude/MegaCoreX/releases) for Arduino megaAVR boards. [![GitHub release](https://img.shields.io/github/release/MCUdude/MegaCoreX.svg)](https://github.com/MCUdude/MegaCoreX/releases/latest). Follow [**How to install**](https://github.com/MCUdude/MegaCoreX#how-to-install).
145+
3. [`MegaCoreX megaAVR core 1.1.0+`](https://github.com/MCUdude/MegaCoreX/releases) for Arduino megaAVR boards. [![GitHub release](https://img.shields.io/github/release/MCUdude/MegaCoreX.svg)](https://github.com/MCUdude/MegaCoreX/releases/latest). Follow [**How to install**](https://github.com/MCUdude/MegaCoreX#how-to-install).
144146
4. To use with certain example
145147
- [`SimpleTimer library`](https://github.com/jfturcot/SimpleTimer) for [ISR_Timers_Array_Simple](examples/ISR_Timers_Array_Simple) and [ISR_16_Timers_Array_Complex](examples/ISR_16_Timers_Array_Complex) examples.
146148

@@ -159,9 +161,9 @@ You can also use this link [![arduino-library-badge](https://www.ardu-badge.com/
159161
Another way to install is to:
160162

161163
1. Navigate to [**megaAVR_TimerInterrupt**](https://github.com/khoih-prog/megaAVR_TimerInterrupt) page.
162-
2. Download the latest release `megaAVR_TimerInterrupt-master.zip`.
163-
3. Extract the zip file to `megaAVR_TimerInterrupt-master` directory
164-
4. Copy whole `megaAVR_TimerInterrupt-master` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.
164+
2. Download the latest release `megaAVR_TimerInterrupt-main.zip`.
165+
3. Extract the zip file to `megaAVR_TimerInterrupt-main` directory
166+
4. Copy whole `megaAVR_TimerInterrupt-main` folder to Arduino libraries' directory such as `~/Arduino/libraries/`.
165167

166168
### VS Code & PlatformIO:
167169

@@ -179,7 +181,7 @@ The current library implementation, using `xyz-Impl.h` instead of standard `xyz.
179181

180182
You can include these `.hpp` files
181183

182-
```
184+
```cpp
183185
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
184186
#include "megaAVR_TimerInterrupt.hpp" //https://github.com/khoih-prog/megaAVR_TimerInterrupt
185187

@@ -189,7 +191,7 @@ You can include these `.hpp` files
189191

190192
in many files. But be sure to use the following `.h` files **in just 1 `.h`, `.cpp` or `.ino` file**, which must **not be included in any other file**, to avoid `Multiple Definitions` Linker Error
191193

192-
```
194+
```cpp
193195
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
194196
#include "megaAVR_TimerInterrupt.h" //https://github.com/khoih-prog/megaAVR_TimerInterrupt
195197

@@ -224,7 +226,7 @@ Before using any Timer, you have to make sure the Timer has not been used by any
224226

225227
### 1.1 Init Hardware Timer
226228

227-
```
229+
```cpp
228230
// Select USING_16MHZ == true for 16MHz to Timer TCBx => shorter timer, but better accuracy
229231
// Select USING_8MHZ == true for 8MHz to Timer TCBx => shorter timer, but better accuracy
230232
// Select USING_250KHZ == true for 250KHz to Timer TCBx => shorter timer, but better accuracy
@@ -247,7 +249,7 @@ ITimer1.init();
247249

248250
Use one of these functions with **interval in unsigned long milliseconds**
249251

250-
```
252+
```cpp
251253
// interval (in ms) and duration (in milliseconds). Duration = 0 or not specified => run indefinitely
252254
template<typename TArg> bool setInterval(unsigned long interval, void (*callback)(TArg), TArg params, unsigned long duration = 0);
253255

@@ -263,7 +265,7 @@ bool attachInterruptInterval(unsigned long interval, timer_callback callback, un
263265
264266
as follows
265267
266-
```
268+
```cpp
267269
void TimerHandler1()
268270
{
269271
// Doing something here inside ISR
@@ -287,7 +289,7 @@ void setup()
287289

288290
Use one of these functions with **frequency in float Hz**
289291

290-
```
292+
```cpp
291293
// frequency (in hertz) and duration (in milliseconds). Duration = 0 or not specified => run indefinitely
292294
bool setFrequency(float frequency, timer_callback_p callback, /* void* */ uint32_t params, unsigned long duration = 0);
293295

@@ -303,7 +305,7 @@ bool attachInterrupt(float frequency, timer_callback callback, unsigned long dur
303305
304306
as follows
305307
306-
```
308+
```cpp
307309
void TimerHandler1()
308310
{
309311
// Doing something here inside ISR
@@ -332,7 +334,7 @@ The 16 ISR_based Timers, designed for long timer intervals, only support using *
332334

333335
### 2.2 Init Hardware Timer and ISR-based Timer
334336

335-
```
337+
```cpp
336338
// Select USING_16MHZ == true for 16MHz to Timer TCBx => shorter timer, but better accuracy
337339
// Select USING_8MHZ == true for 8MHz to Timer TCBx => shorter timer, but better accuracy
338340
// Select USING_250KHZ == true for 250KHz to Timer TCBx => shorter timer, but better accuracy
@@ -353,7 +355,7 @@ ISR_Timer ISR_Timer1;
353355

354356
### 2.3 Set Hardware Timer Interval and attach Timer Interrupt Handler functions
355357

356-
```
358+
```cpp
357359
void TimerHandler()
358360
{
359361
ISR_Timer1.run();
@@ -435,7 +437,7 @@ void setup()
435437

436438
### Example [ISR_16_Timers_Array_Complex](examples/ISR_16_Timers_Array_Complex)
437439

438-
https://github.com/khoih-prog/megaAVR_TimerInterrupt/blob/97ef20cef96bbc9f8e9d22505605707f6fc72f5a/examples/ISR_16_Timers_Array_Complex/ISR_16_Timers_Array_Complex.ino#L16-L360
440+
https://github.com/khoih-prog/megaAVR_TimerInterrupt/blob/59d45e43d51518de3034f22c8a2409afd0714e4e/examples/ISR_16_Timers_Array_Complex/ISR_16_Timers_Array_Complex.ino#L16-L373
439441

440442

441443
---
@@ -451,7 +453,7 @@ While software timer, **programmed for 2s, is activated after more than 10.000s
451453

452454
```
453455
Starting ISR_16_Timers_Array_Complex on megaAVR Nano Every
454-
megaAVR_TimerInterrupt v1.6.1
456+
megaAVR_TimerInterrupt v1.7.0
455457
CPU Frequency = 16 MHz
456458
TCB Clock Frequency = 250KHz for lower accuracy but longer time
457459
Starting ITimer1 OK, millis() = 6
@@ -601,7 +603,7 @@ The following is the sample terminal output when running example [Change_Interva
601603

602604
```
603605
Starting Change_Interval on megaAVR Nano Every
604-
megaAVR_TimerInterrupt v1.6.1
606+
megaAVR_TimerInterrupt v1.7.0
605607
CPU Frequency = 16 MHz
606608
TCB Clock Frequency = 250KHz for lower accuracy but longer time
607609
Starting ITimer1 OK, millis() = 1
@@ -630,7 +632,7 @@ Changing Interval, Timer1 = 100, Timer2 = 200
630632

631633
```
632634
Starting ISR_16_Timers_Array_Complex on megaAVR Nano Every
633-
megaAVR_TimerInterrupt v1.6.1
635+
megaAVR_TimerInterrupt v1.7.0
634636
CPU Frequency = 16 MHz
635637
TCB Clock Frequency = 16MHz for highest accuracy
636638
Starting ITimer1 OK, millis() = 6
@@ -716,7 +718,7 @@ Timer : 15, programmed : 80000, actual : 80000
716718
```
717719
718720
Starting ISR_16_Timers_Array_Complex on megaAVR Nano Every
719-
megaAVR_TimerInterrupt v1.6.1
721+
megaAVR_TimerInterrupt v1.7.0
720722
CPU Frequency = 16 MHz
721723
TCB Clock Frequency = 8MHz for very high accuracy
722724
Starting ITimer1 OK, millis() = 10
@@ -784,7 +786,7 @@ Timer : 15, programmed : 80000, actual : 80000
784786

785787
```
786788
Starting ISR_16_Timers_Array_Complex on megaAVR Nano Every
787-
megaAVR_TimerInterrupt v1.6.1
789+
megaAVR_TimerInterrupt v1.7.0
788790
CPU Frequency = 16 MHz
789791
TCB Clock Frequency = 250KHz for lower accuracy but longer time
790792
Starting ITimer1 OK, millis() = 11
@@ -870,7 +872,7 @@ The following is the sample terminal output when running example [Change_Interva
870872

871873
```
872874
Starting Change_Interval_HF on megaAVR Nano Every
873-
megaAVR_TimerInterrupt v1.6.1
875+
megaAVR_TimerInterrupt v1.7.0
874876
CPU Frequency = 16 MHz
875877
TCB Clock Frequency = 16MHz for highest accuracy
876878
[TISR] TCB 1
@@ -909,7 +911,7 @@ While software timer, **programmed for 2s, is activated after more than 10.000s
909911

910912
```
911913
Starting ISR_16_Timers_Array_Complex on MegaCoreX ATmega4809
912-
megaAVR_TimerInterrupt v1.6.1
914+
megaAVR_TimerInterrupt v1.7.0
913915
CPU Frequency = 16 MHz
914916
TCB Clock Frequency = 16MHz for highest accuracy
915917
[TISR] TCB1
@@ -1112,12 +1114,12 @@ Submit issues to: [megaAVR_TimerInterrupt issues](https://github.com/khoih-prog/
11121114
5. Fix some bugs in v1.0.0
11131115
6. Add more examples.
11141116
7. Similar library for ESP32, ESP8266, SAMD21/SAMD51, nRF52, Mbed-OS Nano-33-BLE, STM32
1115-
8. Add support to ATmega4809-based boards, such as **Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.**
1117+
8. Add support to `ATmega4809-based` boards, such as **Arduino UNO WiFi Rev2, AVR_NANO_EVERY, etc.**
11161118
9. Selectable **TCB Clock 16MHz, 8MHz or 250KHz** depending on necessary accuracy
11171119
10. Fix `multiple-definitions` linker error
11181120
11. Optimize library code by using `reference-passing` instead of `value-passing`
1119-
12. Add support to `MegaCoreX` core, including ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808
1120-
1121+
12. Add support to `MegaCoreX` core, including `ATmega4809, ATmega4808, ATmega3209, ATmega3208, ATmega1609, ATmega1608, ATmega809 and ATmega808`
1122+
13. Use `allman astyle` and add `utils`
11211123

11221124
---
11231125
---
@@ -1127,12 +1129,14 @@ Submit issues to: [megaAVR_TimerInterrupt issues](https://github.com/khoih-prog/
11271129
Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library. Especially to these people who have directly or indirectly contributed to this [megaAVR_TimerInterrupt library](https://github.com/khoih-prog/megaAVR_TimerInterrupt)
11281130

11291131
1. Thanks to good work of [Miguel Wisintainer](https://github.com/tcpipchip) for initiating, inspriring, working with, developing, debugging, testing and maintaining.
1130-
2. Thanks to [Bill Wuttke](https://github.com/wcwuttke) to report the issue [Interrupt interval 2X requested interval #1](https://github.com/khoih-prog/megaAVR_TimerInterrupt/issues/1) leading to new release v1.4.0 to fix bug in using higher frequencies than 250Hz.
1132+
2. Thanks to [Bill Wuttke](https://github.com/wcwuttke) to report the issue [Interrupt interval 2X requested interval #1](https://github.com/khoih-prog/megaAVR_TimerInterrupt/issues/1) leading to new release v1.4.0 to fix bug in using higher frequencies than 250Hz
1133+
3. Thanks to [cattledogGH](https://github.com/cattledogGH) to report the issue [Interrupt interval 2X requested interval #1](https://github.com/khoih-prog/megaAVR_TimerInterrupt/issues/1) leading to new release v1.7.0 to fix bug disabling `TCB0`
11311134

11321135
<table>
11331136
<tr>
11341137
<td align="center"><a href="https://github.com/tcpipchip"><img src="https://github.com/tcpipchip.png" width="100px;" alt="tcpipchip"/><br/><sub><b>⭐️ Miguel Wisintainer</b></sub></a><br/></td>
11351138
<td align="center"><a href="https://github.com/wcwuttke"><img src="https://github.com/wcwuttke.png" width="100px;" alt="wcwuttke"/><br/><sub><b>Bill Wuttke</b></sub></a><br/></td>
1139+
<td align="center"><a href="https://github.com/cattledogGH"><img src="https://github.com/cattledogGH.png" width="100px;" alt="cattledogGH"/><br/><sub><b>cattledogGH</b></sub></a><br/></td>
11361140
</tr>
11371141
</table>
11381142

0 commit comments

Comments
 (0)