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

Commit 7b69f80

Browse files
authored
v1.2.1 to fix DutyCycle bug, etc.
### Releases v1.2.1 1. Fix `DutyCycle` bug. Check [float precisison of DutyCycle only sometimes working #3](khoih-prog/SAMD_Slow_PWM#3) 2. Fix `New Period` display bug. Check [random dropouts #4](khoih-prog/SAMD_Slow_PWM#4) 3. Display informational warning only when `_PWM_LOGLEVEL_` > 3 4. Add support to `Sparkfun Pro nRF52840 Mini` 5. Update examples 6. Update `Packages' Patches`
1 parent 12010b7 commit 7b69f80

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

examples/ISR_16_PWMs_Array/ISR_16_PWMs_Array.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
26-
#define _PWM_LOGLEVEL_ 4
26+
#define _PWM_LOGLEVEL_ 3
2727

2828
#define USING_MICROS_RESOLUTION true //false
2929

examples/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
26-
#define _PWM_LOGLEVEL_ 4
26+
#define _PWM_LOGLEVEL_ 3
2727

2828
#define USING_MICROS_RESOLUTION true //false
2929

examples/ISR_16_PWMs_Array_Simple/ISR_16_PWMs_Array_Simple.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
26-
#define _PWM_LOGLEVEL_ 4
26+
#define _PWM_LOGLEVEL_ 3
2727

2828
#define USING_MICROS_RESOLUTION true //false
2929

examples/ISR_Changing_PWM/ISR_Changing_PWM.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
26-
#define _PWM_LOGLEVEL_ 4
26+
#define _PWM_LOGLEVEL_ 3
2727

2828
#define USING_MICROS_RESOLUTION true //false
2929

examples/ISR_Modify_PWM/ISR_Modify_PWM.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// These define's must be placed at the beginning before #include "ESP32_PWM.h"
2424
// _PWM_LOGLEVEL_ from 0 to 4
2525
// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
26-
#define _PWM_LOGLEVEL_ 4
26+
#define _PWM_LOGLEVEL_ 3
2727

2828
#define USING_MICROS_RESOLUTION true //false
2929

@@ -75,19 +75,19 @@ void TimerHandler()
7575
uint32_t PWM_Pin = LED_BUILTIN;
7676

7777
// You can assign any interval for any timer here, in Hz
78-
float PWM_Freq1 = 1.0f;
78+
float PWM_Freq1 = 200.0f; //1.0f;
7979
// You can assign any interval for any timer here, in Hz
80-
float PWM_Freq2 = 2.0f;
80+
float PWM_Freq2 = 100.0f; //2.0f;
8181

8282
// You can assign any interval for any timer here, in microseconds
8383
uint32_t PWM_Period1 = 1000000 / PWM_Freq1;
8484
// You can assign any interval for any timer here, in microseconds
8585
uint32_t PWM_Period2 = 1000000 / PWM_Freq2;
8686

8787
// You can assign any duty_cycle for any PWM here, from 0-100
88-
float PWM_DutyCycle1 = 50.0;
88+
float PWM_DutyCycle1 = 1.0f; //50.0f;
8989
// You can assign any duty_cycle for any PWM here, from 0-100
90-
float PWM_DutyCycle2 = 90.0;
90+
float PWM_DutyCycle2 = 5.55f; //90.0f;
9191

9292
// Channel number used to identify associated channel
9393
int channelNum;
@@ -141,8 +141,8 @@ void changePWM()
141141
{
142142
static uint8_t count = 1;
143143

144-
double PWM_Freq;
145-
uint32_t PWM_DutyCycle;
144+
float PWM_Freq;
145+
float PWM_DutyCycle;
146146

147147
if (count++ % 2)
148148
{

examples/multiFileProject/multiFileProject.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#error This code is designed to run on nRF52 platform! Please check your Tools->Board setting.
1818
#endif
1919

20-
#define NRF52_SLOW_PWM_VERSION_MIN_TARGET "NRF52_Slow_PWM v1.2.0"
21-
#define NRF52_SLOW_PWM_VERSION_MIN 1002000
20+
#define NRF52_SLOW_PWM_VERSION_MIN_TARGET "NRF52_Slow_PWM v1.2.1"
21+
#define NRF52_SLOW_PWM_VERSION_MIN 1002001
2222

2323
#include "multiFileProject.h"
2424

0 commit comments

Comments
 (0)