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

Commit 7b4b1fb

Browse files
authored
1.2.1 to to not update DutyCycle immediately
### Releases v1.2.1 1. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](khoih-prog/ESP8266_PWM#2)
1 parent b7dcbd4 commit 7b4b1fb

18 files changed

+176
-67
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ void setup()
317317
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
318318
#define _PWM_LOGLEVEL_ 3
319319
320-
#define USING_MICROS_RESOLUTION true //false
320+
#define USING_MICROS_RESOLUTION true //false
321+
322+
// Default is true, uncomment to false
323+
//#define CHANGING_PWM_END_OF_CYCLE false
321324
322325
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
323326
#include "AVR_Slow_PWM.h"
@@ -790,7 +793,7 @@ The following is the sample terminal output when running example [ISR_8_PWMs_Arr
790793

791794
```
792795
Starting ISR_8_PWMs_Array_Complex on Arduino AVR ATMega32U4
793-
AVR_Slow_PWM v1.2.0
796+
AVR_Slow_PWM v1.2.1
794797
CPU Frequency = 16 MHz
795798
[PWM] T3
796799
[PWM] Freq * 1000 = 10000000.00
@@ -835,7 +838,7 @@ The following is the sample terminal output when running example [**ISR_8_PWMs_A
835838

836839
```
837840
Starting ISR_8_PWMs_Array_Complex on Arduino AVR Mega2560/ADK
838-
AVR_Slow_PWM v1.2.0
841+
AVR_Slow_PWM v1.2.1
839842
CPU Frequency = 16 MHz
840843
[PWM] T3
841844
[PWM] Freq * 1000 = 10000000.00
@@ -880,7 +883,7 @@ The following is the sample terminal output when running example [**ISR_8_PWMs_A
880883

881884
```
882885
Starting ISR_8_PWMs_Array_Complex on Arduino AVR UNO, Nano, etc.
883-
AVR_Slow_PWM v1.2.0
886+
AVR_Slow_PWM v1.2.1
884887
CPU Frequency = 16 MHz
885888
[PWM] T1
886889
[PWM] Freq * 1000 = 10000000.00
@@ -926,7 +929,7 @@ The following is the sample terminal output when running example [ISR_Modify_PWM
926929

927930
```
928931
Starting ISR_Modify_PWM on Arduino AVR Mega2560/ADK
929-
AVR_Slow_PWM v1.2.0
932+
AVR_Slow_PWM v1.2.1
930933
CPU Frequency = 16 MHz
931934
[PWM] T3
932935
[PWM] Freq * 1000 = 10000000.00
@@ -950,7 +953,7 @@ The following is the sample terminal output when running example [ISR_Changing_P
950953

951954
```
952955
Starting ISR_Changing_PWM on Arduino AVR Mega2560/ADK
953-
AVR_Slow_PWM v1.2.0
956+
AVR_Slow_PWM v1.2.1
954957
CPU Frequency = 16 MHz
955958
[PWM] T3
956959
[PWM] Freq * 1000 = 10000000.00
@@ -1017,6 +1020,8 @@ Submit issues to: [AVR_Slow_PWM issues](https://github.com/khoih-prog/AVR_Slow_P
10171020
5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
10181021
6. Improve accuracy by using `double`, instead of `uint32_t` for `dutycycle`, `period`
10191022
7. Optimize library code by using `reference-passing` instead of `value-passing`
1023+
8. DutyCycle to be optionally updated at the end current PWM period instead of immediately.
1024+
10201025

10211026
---
10221027
---

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.2.1](#releases-v121)
1516
* [Releases v1.2.0](#releases-v120)
1617
* [Releases v1.1.0](#releases-v110)
1718
* [Initial Releases v1.0.0](#Initial-Releases-v100)
@@ -21,6 +22,10 @@
2122

2223
## Changelog
2324

25+
### Releases v1.2.1
26+
27+
1. DutyCycle to be optionally updated at the end current PWM period instead of immediately. Check [DutyCycle to be updated at the end current PWM period #2](https://github.com/khoih-prog/ESP8266_PWM/issues/2)
28+
2429
### Releases v1.2.0
2530

2631
1. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories

examples/ISR_8_PWMs_Array/ISR_8_PWMs_Array.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
3838
#define _PWM_LOGLEVEL_ 3
3939

40-
#define USING_MICROS_RESOLUTION true //false
40+
#define USING_MICROS_RESOLUTION true //false
41+
42+
// Default is true, uncomment to false
43+
//#define CHANGING_PWM_END_OF_CYCLE false
4144

4245
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
4346
#include "AVR_Slow_PWM.h"

examples/ISR_8_PWMs_Array_Complex/ISR_8_PWMs_Array_Complex.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
3838
#define _PWM_LOGLEVEL_ 3
3939

40-
#define USING_MICROS_RESOLUTION true //false
40+
#define USING_MICROS_RESOLUTION true //false
41+
42+
// Default is true, uncomment to false
43+
//#define CHANGING_PWM_END_OF_CYCLE false
4144

4245
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
4346
#include "AVR_Slow_PWM.h"

examples/ISR_8_PWMs_Array_Simple/ISR_8_PWMs_Array_Simple.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
3838
#define _PWM_LOGLEVEL_ 3
3939

40-
#define USING_MICROS_RESOLUTION true //false
40+
#define USING_MICROS_RESOLUTION true //false
41+
42+
// Default is true, uncomment to false
43+
//#define CHANGING_PWM_END_OF_CYCLE false
4144

4245
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
4346
#include "AVR_Slow_PWM.h"

examples/ISR_Changing_PWM/ISR_Changing_PWM.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
3838
#define _PWM_LOGLEVEL_ 3
3939

40-
#define USING_MICROS_RESOLUTION true //false
40+
#define USING_MICROS_RESOLUTION true //false
41+
42+
// Default is true, uncomment to false
43+
//#define CHANGING_PWM_END_OF_CYCLE false
4144

4245
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
4346
#include "AVR_Slow_PWM.h"

examples/ISR_Modify_PWM/ISR_Modify_PWM.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
3838
#define _PWM_LOGLEVEL_ 3
3939

40-
#define USING_MICROS_RESOLUTION true //false
40+
#define USING_MICROS_RESOLUTION true //false
41+
42+
// Default is true, uncomment to false
43+
//#define CHANGING_PWM_END_OF_CYCLE false
4144

4245
// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
4346
#include "AVR_Slow_PWM.h"

examples/multiFileProject/multiFileProject.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212

1313
#pragma once
1414

15-
#define USING_MICROS_RESOLUTION true //false
15+
#define USING_MICROS_RESOLUTION true //false
16+
17+
// Default is true, uncomment to false
18+
//#define CHANGING_PWM_END_OF_CYCLE false
1619

1720
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
1821
#include "AVR_Slow_PWM.hpp"

keywords.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,6 @@ AVR_Slow_PWM_VERSION_PATCH LITERAL1
5757
AVR_Slow_PWM_VERSION_INT LITERAL1
5858

5959
INVALID_AVR_PIN LITERAL1
60+
61+
USING_MICROS_RESOLUTION LITERAL1
62+
CHANGING_PWM_END_OF_CYCLE LITERAL1

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "AVR_Slow_PWM",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"keywords": "timing, device, control, timer, interrupt, hardware, isr, isr-based, hardware-timer, mission-critical, accuracy, precise, non-blocking, avr, mega-2560, nano, uno, leonardo, 32u4, 16u4, at-mega",
55
"description": "This library enables you to use ISR-based PWM channels on AVR-based boards, such as Mega-2560, UNO,Nano, Leonardo, etc., to create and output PWM any GPIO pin. It now supports 16 ISR-based PWM channels, while consuming only 1 Hardware Timer. PWM channel interval can be very long (ulong microsecs / millisecs). The most important feature is they're ISR-based PWM channels, supporting lower PWM frequencies with suitable accuracy. Their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These ISR-based PWMs, still work even if other software functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software-based PWM using millis() or micros(). That's necessary if you need to control devices requiring high precision. Now you can change the PWM settings on-the-fly",
66
"authors":

0 commit comments

Comments
 (0)