diff --git a/README.md b/README.md index de8d8eb..4e48050 100644 --- a/README.md +++ b/README.md @@ -421,7 +421,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar ``` Starting ISR_4_PWMs_Array_Complex on SAMD_NANO_33_IOT -SAMD_Slow_PWM v1.2.2 +SAMD_Slow_PWM v1.2.3 Starting ITimer OK, micros() = 2750362 Channel : 0 Period : 1000000 OnTime : 50000 Start_Time : 2750883 Channel : 1 Period : 500000 OnTime : 50000 Start_Time : 2751343 @@ -458,7 +458,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar ``` Starting ISR_16_PWMs_Array_Complex on ITSYBITSY_M4 -SAMD_Slow_PWM v1.2.2 +SAMD_Slow_PWM v1.2.3 Starting ITimer OK, micros() = 3830244 Channel : 0 Period : 1000000 OnTime : 50000 Start_Time : 3830538 Channel : 1 Period : 500000 OnTime : 50000 Start_Time : 3830903 @@ -521,7 +521,7 @@ The following is the sample terminal output when running example [ISR_4_PWMs_Arr ``` Starting ISR_16_PWMs_Array_Complex on SEEED_XIAO_M0 -SAMD_Slow_PWM v1.2.2 +SAMD_Slow_PWM v1.2.3 Starting ITimer OK, micros() = 2681651 Channel : 0 Period : 1000000 OnTime : 50000 Start_Time : 2682003 Channel : 1 Period : 500000 OnTime : 50000 Start_Time : 2682003 @@ -547,14 +547,24 @@ The following is the sample terminal output when running example [ISR_Modify_PWM ``` Starting ISR_Modify_PWM on SAMD_NANO_33_IOT -SAMD_Slow_PWM v1.2.2 -Starting ITimer OK, micros() = 3070515 -Using PWM Freq = 1.00, PWM DutyCycle = 50.00 -Channel : 0 Period : 1000000 OnTime : 500000 Start_Time : 3071411 -Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 13071416 -Channel : 0 New Period : 1000000 OnTime : 500000 Start_Time : 23071416 -Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 32571416 -Channel : 0 New Period : 1000000 OnTime : 500000 Start_Time : 43071416 +SAMD_Slow_PWM v1.2.3 +[PWM] SAMDTimerInterrupt: F_CPU (MHz) = 48 , TIMER_HZ = 48 +[PWM] TC3_Timer::startTimer _Timer = 0x 42002c00 , TC3 = 0x 42002c00 +Starting ITimer OK, micros() = 3761339 +Using PWM Freq = 200.00, PWM DutyCycle = 1.00 +Channel : 0 Period : 5000 OnTime : 50 Start_Time : 3762307 +Channel : 0 Period : 10000 OnTime : 555 Start_Time : 13762340 +Channel : 0 Period : 5000 OnTime : 50 Start_Time : 23757340 +Channel : 0 Period : 10000 OnTime : 555 Start_Time : 33762390 +Channel : 0 Period : 5000 OnTime : 50 Start_Time : 43757390 +Channel : 0 Period : 10000 OnTime : 555 Start_Time : 53762390 +Channel : 0 Period : 5000 OnTime : 50 Start_Time : 63767390 +Channel : 0 Period : 10000 OnTime : 555 Start_Time : 73767390 +Channel : 0 Period : 5000 OnTime : 50 Start_Time : 83762390 +Channel : 0 Period : 10000 OnTime : 555 Start_Time : 93767390 +Channel : 0 Period : 5000 OnTime : 50 Start_Time : 103762390 +Channel : 0 Period : 10000 OnTime : 555 Start_Time : 113772440 +Channel : 0 Period : 5000 OnTime : 50 Start_Time : 123767440 ``` --- @@ -565,7 +575,7 @@ The following is the sample terminal output when running example [ISR_Changing_P ``` Starting ISR_Changing_PWM on SAMD_NANO_33_IOT -SAMD_Slow_PWM v1.2.2 +SAMD_Slow_PWM v1.2.3 Starting ITimer OK, micros() = 2820370 Using PWM Freq = 1.00, PWM DutyCycle = 50.00 Channel : 0 Period : 1000000 OnTime : 500000 Start_Time : 2821335 @@ -591,7 +601,7 @@ The following is the sample terminal output when running example [ISR_Modify_PWM ``` Starting ISR_Modify_PWM on ITSYBITSY_M4 -SAMD_Slow_PWM v1.2.2 +SAMD_Slow_PWM v1.2.3 Starting ITimer OK, micros() = 3320212 Using PWM Freq = 1.00, PWM DutyCycle = 50.00 Channel : 0 Period : 1000000 OnTime : 500000 Start_Time : 3320837 @@ -622,7 +632,7 @@ The following is the sample terminal output when running example [ISR_Changing_P ``` Starting ISR_Changing_PWM on ITSYBITSY_M4 -SAMD_Slow_PWM v1.2.2 +SAMD_Slow_PWM v1.2.3 Starting ITimer OK, micros() = 3660252 Using PWM Freq = 1.00, PWM DutyCycle = 50.00 Channel : 0 Period : 1000000 OnTime : 500000 Start_Time : 3660870 @@ -692,11 +702,14 @@ Submit issues to: [SAMD_Slow_PWM issues](https://github.com/khoih-prog/SAMD_Slow Many thanks for everyone for bug reporting, new feature suggesting, testing and contributing to the development of this library. -1. [toniMephis](https://github.com/toniMephis) to report issue [missing header #2](https://github.com/khoih-prog/SAMD_Slow_PWM/issues/2) leading to version v1.2.2. +1. [toniMephis](https://github.com/toniMephis) to report + +- issue [missing header #2](https://github.com/khoih-prog/SAMD_Slow_PWM/issues/2) leading to version v1.2.2 +- issues [float precisison of DutyCycle only sometimes working #3](https://github.com/khoih-prog/SAMD_Slow_PWM/issues/3) and [random dropouts #4](https://github.com/khoih-prog/SAMD_Slow_PWM/issues/4) leading to version v1.2.3 - +
toniMephis
toniMephis

toniMephis
⭐️ toniMephis

diff --git a/changelog.md b/changelog.md index 6a80356..fd23d2c 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,7 @@ ## Table of Contents * [Changelog](#changelog) + * [Releases v1.2.3](#releases-v123) * [Releases v1.2.2](#releases-v122) * [Releases v1.2.1](#releases-v121) * [Releases v1.2.0](#releases-v120) @@ -23,6 +24,13 @@ ## Changelog +### Releases v1.2.3 + +1. Fix `DutyCycle` bug. Check [float precisison of DutyCycle only sometimes working #3](https://github.com/khoih-prog/SAMD_Slow_PWM/issues/3) +2. Fix `New Period` display bug. Check [random dropouts #4](https://github.com/khoih-prog/SAMD_Slow_PWM/issues/4) +3. Update examples + + ### Releases v1.2.2 1. Use correct `PWM_Generic_Debug.h` file. Check [missing header #2](https://github.com/khoih-prog/SAMD_Slow_PWM/issues/2) diff --git a/examples/SAMD21/ISR_4_PWMs_Array/ISR_4_PWMs_Array.ino b/examples/SAMD21/ISR_4_PWMs_Array/ISR_4_PWMs_Array.ino index 43dd5b3..afed054 100644 --- a/examples/SAMD21/ISR_4_PWMs_Array/ISR_4_PWMs_Array.ino +++ b/examples/SAMD21/ISR_4_PWMs_Array/ISR_4_PWMs_Array.ino @@ -22,8 +22,7 @@ // These define's must be placed at the beginning before #include "SAMD_Slow_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 -// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 3 #define USING_MICROS_RESOLUTION true //false diff --git a/examples/SAMD21/ISR_4_PWMs_Array_Complex/ISR_4_PWMs_Array_Complex.ino b/examples/SAMD21/ISR_4_PWMs_Array_Complex/ISR_4_PWMs_Array_Complex.ino index 901d48c..9a43464 100644 --- a/examples/SAMD21/ISR_4_PWMs_Array_Complex/ISR_4_PWMs_Array_Complex.ino +++ b/examples/SAMD21/ISR_4_PWMs_Array_Complex/ISR_4_PWMs_Array_Complex.ino @@ -25,8 +25,7 @@ // These define's must be placed at the beginning before #include "SAMD_Slow_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 -// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 1 #define USING_MICROS_RESOLUTION true //false diff --git a/examples/SAMD21/ISR_4_PWMs_Array_Simple/ISR_4_PWMs_Array_Simple.ino b/examples/SAMD21/ISR_4_PWMs_Array_Simple/ISR_4_PWMs_Array_Simple.ino index 3d9ce40..f2efbc3 100644 --- a/examples/SAMD21/ISR_4_PWMs_Array_Simple/ISR_4_PWMs_Array_Simple.ino +++ b/examples/SAMD21/ISR_4_PWMs_Array_Simple/ISR_4_PWMs_Array_Simple.ino @@ -22,8 +22,7 @@ // These define's must be placed at the beginning before #include "SAMD_Slow_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 -// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 3 #define USING_MICROS_RESOLUTION true //false diff --git a/examples/SAMD21/ISR_Changing_PWM/ISR_Changing_PWM.ino b/examples/SAMD21/ISR_Changing_PWM/ISR_Changing_PWM.ino index 21b85b0..a9f8b77 100644 --- a/examples/SAMD21/ISR_Changing_PWM/ISR_Changing_PWM.ino +++ b/examples/SAMD21/ISR_Changing_PWM/ISR_Changing_PWM.ino @@ -22,8 +22,7 @@ // These define's must be placed at the beginning before #include "SAMD_Slow_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 -// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 3 #define USING_MICROS_RESOLUTION true //false diff --git a/examples/SAMD21/ISR_Modify_PWM/ISR_Modify_PWM.ino b/examples/SAMD21/ISR_Modify_PWM/ISR_Modify_PWM.ino index fc1971f..73a5a75 100644 --- a/examples/SAMD21/ISR_Modify_PWM/ISR_Modify_PWM.ino +++ b/examples/SAMD21/ISR_Modify_PWM/ISR_Modify_PWM.ino @@ -22,8 +22,7 @@ // These define's must be placed at the beginning before #include "SAMD_Slow_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 -// Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 3 #define USING_MICROS_RESOLUTION true //false @@ -82,9 +81,9 @@ void TimerHandler() uint32_t PWM_Pin = LED_BUILTIN; // You can assign any interval for any timer here, in Hz -float PWM_Freq1 = 1.0f; +float PWM_Freq1 = 200.0f; //1.0f; // You can assign any interval for any timer here, in Hz -float PWM_Freq2 = 2.0f; +float PWM_Freq2 = 100.0f; //2.0f; // You can assign any interval for any timer here, in microseconds uint32_t PWM_Period1 = 1000000 / PWM_Freq1; @@ -92,9 +91,9 @@ uint32_t PWM_Period1 = 1000000 / PWM_Freq1; uint32_t PWM_Period2 = 1000000 / PWM_Freq2; // You can assign any duty_cycle for any PWM here, from 0-100 -float PWM_DutyCycle1 = 50.0; +float PWM_DutyCycle1 = 1.0f; //50.0f; // You can assign any duty_cycle for any PWM here, from 0-100 -float PWM_DutyCycle2 = 90.0; +float PWM_DutyCycle2 = 5.55f; //90.0f; // Channel number used to identify associated channel int channelNum; @@ -144,8 +143,8 @@ void changePWM() { static uint8_t count = 1; - double PWM_Freq; - uint32_t PWM_DutyCycle; + float PWM_Freq; + float PWM_DutyCycle; if (count++ % 2) { diff --git a/examples/SAMD21/multiFileProject/multiFileProject.ino b/examples/SAMD21/multiFileProject/multiFileProject.ino index 06e7c00..41db584 100644 --- a/examples/SAMD21/multiFileProject/multiFileProject.ino +++ b/examples/SAMD21/multiFileProject/multiFileProject.ino @@ -19,8 +19,8 @@ #error This code is designed to run on SAMD21 platform! Please check your Tools->Board setting. #endif -#define SAMD_SLOW_PWM_VERSION_MIN_TARGET "SAMD_Slow_PWM v1.2.1" -#define SAMD_SLOW_PWM_VERSION_MIN 1002001 +#define SAMD_SLOW_PWM_VERSION_MIN_TARGET "SAMD_Slow_PWM v1.2.3" +#define SAMD_SLOW_PWM_VERSION_MIN 1002003 #include "multiFileProject.h" diff --git a/examples/SAMD51/ISR_16_PWMs_Array/ISR_16_PWMs_Array.ino b/examples/SAMD51/ISR_16_PWMs_Array/ISR_16_PWMs_Array.ino index c205320..df3d2f4 100644 --- a/examples/SAMD51/ISR_16_PWMs_Array/ISR_16_PWMs_Array.ino +++ b/examples/SAMD51/ISR_16_PWMs_Array/ISR_16_PWMs_Array.ino @@ -20,7 +20,7 @@ // These define's must be placed at the beginning before #include "ESP32_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 // Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 3 #define USING_MICROS_RESOLUTION true //false diff --git a/examples/SAMD51/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino b/examples/SAMD51/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino index c883d7e..db16db5 100644 --- a/examples/SAMD51/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino +++ b/examples/SAMD51/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino @@ -20,7 +20,7 @@ // These define's must be placed at the beginning before #include "ESP32_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 // Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 1 #define USING_MICROS_RESOLUTION true //false diff --git a/examples/SAMD51/ISR_16_PWMs_Array_Simple/ISR_16_PWMs_Array_Simple.ino b/examples/SAMD51/ISR_16_PWMs_Array_Simple/ISR_16_PWMs_Array_Simple.ino index c435c41..9f55f96 100644 --- a/examples/SAMD51/ISR_16_PWMs_Array_Simple/ISR_16_PWMs_Array_Simple.ino +++ b/examples/SAMD51/ISR_16_PWMs_Array_Simple/ISR_16_PWMs_Array_Simple.ino @@ -20,7 +20,7 @@ // These define's must be placed at the beginning before #include "ESP32_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 // Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 3 #define USING_MICROS_RESOLUTION true //false diff --git a/examples/SAMD51/ISR_Changing_PWM/ISR_Changing_PWM.ino b/examples/SAMD51/ISR_Changing_PWM/ISR_Changing_PWM.ino index ca140f0..2061e26 100644 --- a/examples/SAMD51/ISR_Changing_PWM/ISR_Changing_PWM.ino +++ b/examples/SAMD51/ISR_Changing_PWM/ISR_Changing_PWM.ino @@ -20,7 +20,7 @@ // These define's must be placed at the beginning before #include "ESP32_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 // Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 3 #define USING_MICROS_RESOLUTION true //false diff --git a/examples/SAMD51/ISR_Modify_PWM/ISR_Modify_PWM.ino b/examples/SAMD51/ISR_Modify_PWM/ISR_Modify_PWM.ino index dd65fd0..85fa4dd 100644 --- a/examples/SAMD51/ISR_Modify_PWM/ISR_Modify_PWM.ino +++ b/examples/SAMD51/ISR_Modify_PWM/ISR_Modify_PWM.ino @@ -20,7 +20,7 @@ // These define's must be placed at the beginning before #include "ESP32_PWM.h" // _PWM_LOGLEVEL_ from 0 to 4 // Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system. -#define _PWM_LOGLEVEL_ 4 +#define _PWM_LOGLEVEL_ 3 #define USING_MICROS_RESOLUTION true //false @@ -137,8 +137,8 @@ void changePWM() { static uint8_t count = 1; - double PWM_Freq; - uint32_t PWM_DutyCycle; + float PWM_Freq; + float PWM_DutyCycle; if (count++ % 2) { diff --git a/examples/SAMD51/multiFileProject/multiFileProject.ino b/examples/SAMD51/multiFileProject/multiFileProject.ino index 8c83414..2517d42 100644 --- a/examples/SAMD51/multiFileProject/multiFileProject.ino +++ b/examples/SAMD51/multiFileProject/multiFileProject.ino @@ -14,8 +14,8 @@ #error This code is designed to run on SAMD51 platform! Please check your Tools->Board setting. #endif -#define SAMD_SLOW_PWM_VERSION_MIN_TARGET "SAMD_Slow_PWM v1.2.1" -#define SAMD_SLOW_PWM_VERSION_MIN 1002001 +#define SAMD_SLOW_PWM_VERSION_MIN_TARGET "SAMD_Slow_PWM v1.2.3" +#define SAMD_SLOW_PWM_VERSION_MIN 1002003 #include "multiFileProject.h" diff --git a/library.json b/library.json index 74e6832..16c57ad 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "SAMD_Slow_PWM", - "version": "1.2.2", + "version": "1.2.3", "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 Hardware Timers on SAMD21/SAMD51 boards to create and output PWM to pins. These PWM channels, using SAMD21/SAMD51 Hardware Timers, 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 mandatory if you need to measure some data requiring better accuracy. 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. Max PWM frequency is limited at 1000Hz. Now you can change the PWM settings on-the-fly", "authors": diff --git a/library.properties b/library.properties index de3325a..ba56d54 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SAMD_Slow_PWM -version=1.2.2 +version=1.2.3 author=Khoi Hoang maintainer=Khoi Hoang sentence=This library enables you to use Hardware Timers on SAMD21/SAMD51 boards to create and output PWM to pins. diff --git a/src/PWM_Generic_Debug.h b/src/PWM_Generic_Debug.h index 02cc0c7..ea13280 100644 --- a/src/PWM_Generic_Debug.h +++ b/src/PWM_Generic_Debug.h @@ -12,7 +12,7 @@ Therefore, their executions are not blocked by bad-behaving functions / tasks. This important feature is absolutely necessary for mission-critical tasks. - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -21,6 +21,7 @@ 1.2.0 K Hoang 31/01/2022 Fix multiple-definitions linker error. Improve accuracy. Change DutyCycle update 1.2.1 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period 1.2.2 K Hoang 02/03/2022 Use correct PWM_Generic_Debug.h file. Display informational warning when debug level > 3 + 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs *****************************************************************************************************************************/ #pragma once diff --git a/src/SAMD_Slow_PWM.h b/src/SAMD_Slow_PWM.h index 0452cec..571e6ec 100644 --- a/src/SAMD_Slow_PWM.h +++ b/src/SAMD_Slow_PWM.h @@ -12,7 +12,7 @@ Therefore, their executions are not blocked by bad-behaving functions / tasks. This important feature is absolutely necessary for mission-critical tasks. - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -21,6 +21,7 @@ 1.2.0 K Hoang 31/01/2022 Fix multiple-definitions linker error. Improve accuracy. Change DutyCycle update 1.2.1 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period 1.2.2 K Hoang 02/03/2022 Use correct PWM_Generic_Debug.h file. Display informational warning when debug level > 3 + 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs *****************************************************************************************************************************/ #pragma once diff --git a/src/SAMD_Slow_PWM.hpp b/src/SAMD_Slow_PWM.hpp index fd0a300..cbc640f 100644 --- a/src/SAMD_Slow_PWM.hpp +++ b/src/SAMD_Slow_PWM.hpp @@ -12,7 +12,7 @@ Therefore, their executions are not blocked by bad-behaving functions / tasks. This important feature is absolutely necessary for mission-critical tasks. - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -21,6 +21,7 @@ 1.2.0 K Hoang 31/01/2022 Fix multiple-definitions linker error. Improve accuracy. Change DutyCycle update 1.2.1 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period 1.2.2 K Hoang 02/03/2022 Use correct PWM_Generic_Debug.h file. Display informational warning when debug level > 3 + 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs *****************************************************************************************************************************/ #pragma once @@ -145,13 +146,13 @@ #include "Arduino.h" #ifndef SAMD_SLOW_PWM_VERSION - #define SAMD_SLOW_PWM_VERSION "SAMD_Slow_PWM v1.2.2" + #define SAMD_SLOW_PWM_VERSION "SAMD_Slow_PWM v1.2.3" #define SAMD_SLOW_PWM_VERSION_MAJOR 1 #define SAMD_SLOW_PWM_VERSION_MINOR 2 - #define SAMD_SLOW_PWM_VERSION_PATCH 2 + #define SAMD_SLOW_PWM_VERSION_PATCH 3 - #define SAMD_SLOW_PWM_VERSION_INT 1002002 + #define SAMD_SLOW_PWM_VERSION_INT 1002003 #endif #include "PWM_Generic_Debug.h" diff --git a/src/SAMD_Slow_PWM_ISR.h b/src/SAMD_Slow_PWM_ISR.h index 15ae0a0..c639f4a 100644 --- a/src/SAMD_Slow_PWM_ISR.h +++ b/src/SAMD_Slow_PWM_ISR.h @@ -12,7 +12,7 @@ Therefore, their executions are not blocked by bad-behaving functions / tasks. This important feature is absolutely necessary for mission-critical tasks. - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -21,6 +21,7 @@ 1.2.0 K Hoang 31/01/2022 Fix multiple-definitions linker error. Improve accuracy. Change DutyCycle update 1.2.1 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period 1.2.2 K Hoang 02/03/2022 Use correct PWM_Generic_Debug.h file. Display informational warning when debug level > 3 + 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs *****************************************************************************************************************************/ #pragma once diff --git a/src/SAMD_Slow_PWM_ISR.hpp b/src/SAMD_Slow_PWM_ISR.hpp index e2f2614..81e4beb 100644 --- a/src/SAMD_Slow_PWM_ISR.hpp +++ b/src/SAMD_Slow_PWM_ISR.hpp @@ -12,7 +12,7 @@ Therefore, their executions are not blocked by bad-behaving functions / tasks. This important feature is absolutely necessary for mission-critical tasks. - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -21,6 +21,7 @@ 1.2.0 K Hoang 31/01/2022 Fix multiple-definitions linker error. Improve accuracy. Change DutyCycle update 1.2.1 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period 1.2.2 K Hoang 02/03/2022 Use correct PWM_Generic_Debug.h file. Display informational warning when debug level > 3 + 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs *****************************************************************************************************************************/ #pragma once @@ -152,7 +153,7 @@ class SAMD_Slow_PWM_ISR // Return the channelNum if OK, -1 if error int setPWM_Period(const uint32_t& pin, const uint32_t& period, const float& dutycycle, timer_callback StartCallback = nullptr, timer_callback StopCallback = nullptr) - { + { return setupPWMChannel(pin, period, dutycycle, (void *) StartCallback, (void *) StopCallback); } @@ -179,7 +180,7 @@ class SAMD_Slow_PWM_ISR PWM_LOGERROR("Error: Invalid frequency, max is 1000Hz"); return false; } - + return modifyPWMChannel_Period(channelNum, pin, period, dutycycle); } diff --git a/src/SAMD_Slow_PWM_ISR_Impl.h b/src/SAMD_Slow_PWM_ISR_Impl.h index 1492e57..850a3a4 100644 --- a/src/SAMD_Slow_PWM_ISR_Impl.h +++ b/src/SAMD_Slow_PWM_ISR_Impl.h @@ -12,7 +12,7 @@ Therefore, their executions are not blocked by bad-behaving functions / tasks. This important feature is absolutely necessary for mission-critical tasks. - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -21,6 +21,7 @@ 1.2.0 K Hoang 31/01/2022 Fix multiple-definitions linker error. Improve accuracy. Change DutyCycle update 1.2.1 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period 1.2.2 K Hoang 02/03/2022 Use correct PWM_Generic_Debug.h file. Display informational warning when debug level > 3 + 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs *****************************************************************************************************************************/ #pragma once @@ -236,7 +237,7 @@ bool SAMD_Slow_PWM_ISR::modifyPWMChannel_Period(const uint8_t& channelNum, const PWM[channelNum].newOnTime = ( period * dutycycle ) / 100; PWM_LOGINFO0("Channel : "); PWM_LOGINFO0(channelNum); - PWM_LOGINFO0("\tNew Period : "); PWM_LOGINFO0(PWM[channelNum].newPeriod); + PWM_LOGINFO0("\t Period : "); PWM_LOGINFO0(period); PWM_LOGINFO0("\t\tOnTime : "); PWM_LOGINFO0(PWM[channelNum].newOnTime); PWM_LOGINFO0("\tStart_Time : "); PWM_LOGINFOLN0(PWM[channelNum].prevTime); diff --git a/src/SAMD_Slow_PWM_Impl.h b/src/SAMD_Slow_PWM_Impl.h index 1c15337..5091dc3 100644 --- a/src/SAMD_Slow_PWM_Impl.h +++ b/src/SAMD_Slow_PWM_Impl.h @@ -12,7 +12,7 @@ Therefore, their executions are not blocked by bad-behaving functions / tasks. This important feature is absolutely necessary for mission-critical tasks. - Version: 1.2.2 + Version: 1.2.3 Version Modified By Date Comments ------- ----------- ---------- ----------- @@ -21,6 +21,7 @@ 1.2.0 K Hoang 31/01/2022 Fix multiple-definitions linker error. Improve accuracy. Change DutyCycle update 1.2.1 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period 1.2.2 K Hoang 02/03/2022 Use correct PWM_Generic_Debug.h file. Display informational warning when debug level > 3 + 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs *****************************************************************************************************************************/ #pragma once