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

Commit 7698bc4

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 655e979 commit 7698bc4

File tree

17 files changed

+111
-32
lines changed

17 files changed

+111
-32
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ void setup()
408408
#define _PWM_LOGLEVEL_ 4
409409
410410
#define USING_MICROS_RESOLUTION true //false
411+
412+
// Default is true, uncomment to false
413+
//#define CHANGING_PWM_END_OF_CYCLE false
411414
412415
#define MAX_STM32_PWM_FREQ 1000
413416
@@ -982,7 +985,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
982985

983986
```
984987
Starting ISR_16_PWMs_Array_Complex on NUCLEO_H743ZI2
985-
STM32_SLOW_PWM v1.2.0
988+
STM32_SLOW_PWM v1.2.1
986989
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 240000000
987990
[PWM] Frequency = 1000000.00 , _count = 20
988991
Starting ITimer OK, micros() = 2015843
@@ -1047,7 +1050,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
10471050

10481051
```
10491052
Starting ISR_16_PWMs_Array_Complex on NUCLEO_F767ZI
1050-
STM32_SLOW_PWM v1.2.0
1053+
STM32_SLOW_PWM v1.2.1
10511054
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 216000000 , Timer Clock Frequency = 1000000.00
10521055
[PWM] Timer Frequency = 50000.00 , _count = 20
10531056
Starting ITimer OK, micros() = 2016553
@@ -1112,7 +1115,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
11121115

11131116
```
11141117
Starting ISR_16_PWMs_Array_Complex on NUCLEO_L552ZE_Q
1115-
STM32_SLOW_PWM v1.1.0
1118+
STM32_SLOW_PWM v1.2.1
11161119
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 110000000
11171120
[PWM] Frequency = 1000000.00 , _count = 20
11181121
Starting ITimer OK, micros() = 2016141
@@ -1177,7 +1180,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
11771180

11781181
```
11791182
Starting ISR_16_PWMs_Array_Complex on BLUEPILL_F103CB
1180-
STM32_SLOW_PWM v1.1.0
1183+
STM32_SLOW_PWM v1.2.1
11811184
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 72000000
11821185
[PWM] Frequency = 1000000.00 , _count = 20
11831186
Starting ITimer OK, micros() = 3390333
@@ -1241,7 +1244,7 @@ The following is the sample terminal output when running example [ISR_Modify_PWM
12411244

12421245
```
12431246
Starting ISR_Modify_PWM on NUCLEO_F767ZI
1244-
STM32_SLOW_PWM v1.2.0
1247+
STM32_SLOW_PWM v1.2.1
12451248
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 216000000 , Timer Clock Frequency = 1000000.00
12461249
[PWM] Timer Frequency = 50000.00 , _count = 20
12471250
Starting ITimer OK, micros() = 2016545
@@ -1264,7 +1267,7 @@ The following is the sample terminal output when running example [ISR_Changing_P
12641267

12651268
```
12661269
Starting ISR_Changing_PWM on NUCLEO_F767ZI
1267-
STM32_SLOW_PWM v1.2.0
1270+
STM32_SLOW_PWM v1.2.1
12681271
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 216000000 , Timer Clock Frequency = 1000000.00
12691272
[PWM] Timer Frequency = 50000.00 , _count = 20
12701273
Starting ITimer OK, micros() = 2016547
@@ -1334,7 +1337,7 @@ Submit issues to: [STM32_Slow_PWM issues](https://github.com/khoih-prog/STM32_Sl
13341337
6. Improve accuracy by using `double`, instead of `uint32_t` for `dutycycle`, `period`. Check [Change Duty Cycle #1](https://github.com/khoih-prog/ESP8266_PWM/issues/1#issuecomment-1024969658)
13351338
7. Optimize library code by using `reference-passing` instead of `value-passing`
13361339
8. Fix reattachInterrupt() bug. Check [bugfix: reattachInterrupt() pass wrong frequency value to setFrequency() #19](https://github.com/khoih-prog/ESP8266TimerInterrupt/pull/19)
1337-
1340+
9. DutyCycle to be optionally updated at the end current PWM period instead of immediately
13381341

13391342
---
13401343
---

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_16_PWMs_Array/ISR_16_PWMs_Array.ino

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

27-
#define USING_MICROS_RESOLUTION true //false
27+
#define USING_MICROS_RESOLUTION true //false
28+
29+
// Default is true, uncomment to false
30+
//#define CHANGING_PWM_END_OF_CYCLE false
2831

2932
#define MAX_STM32_PWM_FREQ 1000
3033

examples/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
#define _PWM_LOGLEVEL_ 4
2626

2727
#define USING_MICROS_RESOLUTION true //false
28+
29+
// Default is true, uncomment to false
30+
//#define CHANGING_PWM_END_OF_CYCLE false
2831

2932
#define MAX_STM32_PWM_FREQ 1000
3033

examples/ISR_16_PWMs_Array_Simple/ISR_16_PWMs_Array_Simple.ino

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

27-
#define USING_MICROS_RESOLUTION true //false
27+
#define USING_MICROS_RESOLUTION true //false
28+
29+
// Default is true, uncomment to false
30+
//#define CHANGING_PWM_END_OF_CYCLE false
2831

2932
#define MAX_STM32_PWM_FREQ 1000
3033

examples/ISR_Changing_PWM/ISR_Changing_PWM.ino

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

27-
#define USING_MICROS_RESOLUTION true //false
27+
#define USING_MICROS_RESOLUTION true //false
28+
29+
// Default is true, uncomment to false
30+
//#define CHANGING_PWM_END_OF_CYCLE false
2831

2932
#define MAX_STM32_PWM_FREQ 1000
3033

examples/ISR_Modify_PWM/ISR_Modify_PWM.ino

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

27-
#define USING_MICROS_RESOLUTION true //false
27+
#define USING_MICROS_RESOLUTION true //false
28+
29+
// Default is true, uncomment to false
30+
//#define CHANGING_PWM_END_OF_CYCLE false
2831

2932
#define MAX_STM32_PWM_FREQ 1000
3033

examples/multiFileProject/multiFileProject.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414

1515
#define USING_MICROS_RESOLUTION true //false
1616

17+
// Default is true, uncomment to false
18+
//#define CHANGING_PWM_END_OF_CYCLE false
19+
1720
// Can be included as many times as necessary, without `Multiple Definitions` Linker Error
1821
#include "STM32_Slow_PWM.hpp"

keywords.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ STM32_SLOW_PWM_VERSION_INT LITERAL1
5959

6060
INVALID_STM32_PIN LITERAL1
6161

62+
USING_MICROS_RESOLUTION LITERAL1
63+
CHANGING_PWM_END_OF_CYCLE LITERAL1
64+

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "STM32_Slow_PWM",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"keywords": "timing, device, control, timer, pwm, interrupt, isr, isr-based, hardware-timer, mission-critical, accuracy, non-blocking, stm32, stm32h7, stm32l5, stm32f1, stm32f4, stm32f7, stm32g4, precise, hardware",
55
"description": "This library enables you to use Hardware Timers on STM32F/L/H/G/WB/MP1 boards to create and output PWM to pins. The most important feature is they're purely hardware-based PWM channels. 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. PWM feature can now be used. Max PWM frequency is limited at 1000Hz. Now you can change the PWM settings on-the-fly",
66
"authors":

0 commit comments

Comments
 (0)