From a8c66bd9fb589c56848f445d6453018f8fc87229 Mon Sep 17 00:00:00 2001
From: Khoi Hoang <57012152+khoih-prog@users.noreply.github.com>
Date: Fri, 4 Mar 2022 20:00:56 -0500
Subject: [PATCH] v1.2.3 to fix `DutyCycle` bug, etc.
### 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
---
CONTRIBUTING.md | 2 +-
README.md | 650 +++-------------------------------
changelog.md | 7 +
library.json | 2 +-
library.properties | 2 +-
src/PWM_Generic_Debug.h | 3 +-
src/STM32_Slow_PWM.h | 3 +-
src/STM32_Slow_PWM.hpp | 9 +-
src/STM32_Slow_PWM_ISR.h | 3 +-
src/STM32_Slow_PWM_ISR.hpp | 20 +-
src/STM32_Slow_PWM_ISR_Impl.h | 27 +-
11 files changed, 90 insertions(+), 638 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index dd31067..7c09a06 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -31,7 +31,7 @@ Arduino IDE version: 1.8.19
STM32 Core Version 2.2.0
Nucleo-144 STM32H7 NUCLEO_H743ZI2
OS: Ubuntu 20.04 LTS
-Linux xy-Inspiron-3593 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
+Linux xy-Inspiron-3593 5.4.0-100-generic #113-Ubuntu SMP Thu Feb 3 18:43:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Context:
I encountered a crash while using TimerInterrupt.
diff --git a/README.md b/README.md
index b0a408d..eb22458 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,8 @@
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](#Contributing)
[![GitHub issues](https://img.shields.io/github/issues/khoih-prog/STM32_Slow_PWM.svg)](http://github.com/khoih-prog/STM32_Slow_PWM/issues)
-
+
+
---
---
@@ -169,7 +170,7 @@ Another way to install is to:
1. Install [VS Code](https://code.visualstudio.com/)
2. Install [PlatformIO](https://platformio.org/platformio-ide)
-3. Install [**STM32_Slow_PWM** library](https://platformio.org/lib/show/12901/STM32_Slow_PWM) by using [Library Manager](https://platformio.org/lib/show/12901/STM32_Slow_PWM/installation). Search for **STM32_Slow_PWM** in [Platform.io Author's Libraries](https://platformio.org/lib/search?query=author:%22Khoi%20Hoang%22)
+3. Install [**STM32_Slow_PWM** library](https://registry.platformio.org/libraries/khoih-prog/STM32_Slow_PWM) by using [Library Manager](https://registry.platformio.org/libraries/khoih-prog/STM32_Slow_PWM/installation). Search for **STM32_Slow_PWM** in [Platform.io Author's Libraries](https://platformio.org/lib/search?query=author:%22Khoi%20Hoang%22)
4. Use included [platformio.ini](platformio/platformio.ini) file from examples to ensure that all dependent libraries will installed automatically. Please visit documentation for the other options and examples at [Project Configuration File](https://docs.platformio.org/page/projectconf.html)
---
@@ -408,585 +409,10 @@ void setup()
### Example [ISR_16_PWMs_Array_Complex](examples/ISR_16_PWMs_Array_Complex)
-```
-#if !( defined(STM32F0) || defined(STM32F1) || defined(STM32F2) || defined(STM32F3) ||defined(STM32F4) || defined(STM32F7) || \
- defined(STM32L0) || defined(STM32L1) || defined(STM32L4) || defined(STM32H7) ||defined(STM32G0) || defined(STM32G4) || \
- defined(STM32WB) || defined(STM32MP1) || defined(STM32L5))
- #error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
-#endif
-
-// 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 USING_MICROS_RESOLUTION true //false
-
-// Default is true, uncomment to false
-//#define CHANGING_PWM_END_OF_CYCLE false
-
-#define MAX_STM32_PWM_FREQ 1000
-
-// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
-#include "STM32_Slow_PWM.h"
-
-#define boolean bool
-
-#include // /~https://github.com/jfturcot/SimpleTimer
-
-#define LED_OFF LOW
-#define LED_ON HIGH
-
-#ifndef LED_BUILTIN
- #define LED_BUILTIN 13
-#endif
-
-#ifndef LED_BLUE
- #define LED_BLUE 2
-#endif
-
-#ifndef LED_RED
- #define LED_RED 3
-#endif
-
-#define HW_TIMER_INTERVAL_US 20L
-
-volatile uint64_t startMicros = 0;
-
-// Depending on the board, you can select H7 Hardware Timer from TIM1-TIM22
-// If you select a Timer not correctly, you'll get a message from compiler
-// 'TIMxx' was not declared in this scope; did you mean 'TIMyy'?
-
-// STM32 OK : TIM1, TIM4, TIM7, TIM8, TIM12, TIM13, TIM14, TIM15, TIM16, TIM17
-// STM32 Not OK : TIM2, TIM3, TIM5, TIM6, TIM18, TIM19, TIM20, TIM21, TIM22
-// STM32 No timer : TIM9, TIM10, TIM11. Only for F2, F4 and STM32L1
-// STM32 No timer : TIM18, TIM19, TIM20, TIM21, TIM22
-
-// Init timer TIM1
-STM32Timer ITimer(TIM1);
+/~https://github.com/khoih-prog/STM32_Slow_PWM/blob/5ff2144a1665df2d8ff6409fd9c425fc852f12c5/examples/ISR_16_PWMs_Array_Complex/ISR_16_PWMs_Array_Complex.ino#L16-L592
-// Init STM32_Slow_PWM
-STM32_Slow_PWM ISR_PWM;
-//////////////////////////////////////////////////////
-
-void TimerHandler()
-{
- ISR_PWM.run();
-}
-/////////////////////////////////////////////////
-
-#define NUMBER_ISR_PWMS 16
-
-#define PIN_D0 D0
-#define PIN_D1 D1
-#define PIN_D2 D2
-#define PIN_D3 D3
-#define PIN_D4 D4
-#define PIN_D5 D5
-#define PIN_D6 D6
-#define PIN_D7 D7
-#define PIN_D8 D8
-#define PIN_D9 D9
-#define PIN_D10 D10
-#define PIN_D11 D11
-#define PIN_D12 D12
-
-typedef void (*irqCallback) ();
-
-//////////////////////////////////////////////////////
-
-#define USE_COMPLEX_STRUCT true
-
-#define USING_PWM_FREQUENCY true
-
-//////////////////////////////////////////////////////
-
-#if USE_COMPLEX_STRUCT
-
-typedef struct
-{
- uint32_t PWM_Pin;
- irqCallback irqCallbackStartFunc;
- irqCallback irqCallbackStopFunc;
-
-#if USING_PWM_FREQUENCY
- float PWM_Freq;
-#else
- uint32_t PWM_Period;
-#endif
-
- float PWM_DutyCycle;
-
- uint64_t deltaMicrosStart;
- uint64_t previousMicrosStart;
-
- uint64_t deltaMicrosStop;
- uint64_t previousMicrosStop;
-
-} ISR_PWM_Data;
-
-// In NRF52, avoid doing something fancy in ISR, for example Serial.print()
-// The pure simple Serial.prints here are just for demonstration and testing. Must be eliminate in working environment
-// Or you can get this run-time error / crash
-
-void doingSomethingStart(int index);
-
-void doingSomethingStop(int index);
-
-#else // #if USE_COMPLEX_STRUCT
-
-volatile unsigned long deltaMicrosStart [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-volatile unsigned long previousMicrosStart [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-volatile unsigned long deltaMicrosStop [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-volatile unsigned long previousMicrosStop [] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-// You can assign pins here. Be carefull to select good pin to use or crash, e.g pin 6-11
-uint32_t PWM_Pin[] =
-{
- LED_BUILTIN, LED_BLUE, LED_RED, PIN_D0, PIN_D1, PIN_D2, PIN_D3, PIN_D4,
- PIN_D5, PIN_D6, PIN_D7, PIN_D8, PIN_D9, PIN_D10, PIN_D11, PIN_D12
-};
-
-// You can assign any interval for any timer here, in microseconds
-uint32_t PWM_Period[] =
-{
- 1000000, 500000, 333333, 250000, 200000, 166667, 142857, 125000,
- 111111, 100000, 66667, 50000, 40000, 33333, 25000, 20000
-};
-
-// You can assign any interval for any timer here, in Hz
-float PWM_Freq[] =
-{
- 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f,
- 9.0f, 10.0f, 15.0f, 20.0f, 25.0f, 30.0f, 40.0f, 50.0f
-};
-
-// You can assign any interval for any timer here, in milliseconds
-float PWM_DutyCycle[] =
-{
- 5.00, 10.00, 20.00, 30.00, 40.00, 45.00, 50.00, 55.00,
- 60.00, 65.00, 70.00, 75.00, 80.00, 85.00, 90.00, 95.00
-};
-
-void doingSomethingStart(int index)
-{
- unsigned long currentMicros = micros();
-
- deltaMicrosStart[index] = currentMicros - previousMicrosStart[index];
- previousMicrosStart[index] = currentMicros;
-}
-
-void doingSomethingStop(int index)
-{
- unsigned long currentMicros = micros();
-
- // Count from start to stop PWM pulse
- deltaMicrosStop[index] = currentMicros - previousMicrosStart[index];
- previousMicrosStop[index] = currentMicros;
-}
-
-#endif // #if USE_COMPLEX_STRUCT
-
-////////////////////////////////////
-// Shared
-////////////////////////////////////
-
-void doingSomethingStart0()
-{
- doingSomethingStart(0);
-}
-
-void doingSomethingStart1()
-{
- doingSomethingStart(1);
-}
-
-void doingSomethingStart2()
-{
- doingSomethingStart(2);
-}
-
-void doingSomethingStart3()
-{
- doingSomethingStart(3);
-}
-
-void doingSomethingStart4()
-{
- doingSomethingStart(4);
-}
-
-void doingSomethingStart5()
-{
- doingSomethingStart(5);
-}
-
-void doingSomethingStart6()
-{
- doingSomethingStart(6);
-}
-
-void doingSomethingStart7()
-{
- doingSomethingStart(7);
-}
-
-void doingSomethingStart8()
-{
- doingSomethingStart(8);
-}
-
-void doingSomethingStart9()
-{
- doingSomethingStart(9);
-}
-
-void doingSomethingStart10()
-{
- doingSomethingStart(10);
-}
-
-void doingSomethingStart11()
-{
- doingSomethingStart(11);
-}
-
-void doingSomethingStart12()
-{
- doingSomethingStart(12);
-}
-
-void doingSomethingStart13()
-{
- doingSomethingStart(13);
-}
-
-void doingSomethingStart14()
-{
- doingSomethingStart(14);
-}
-
-void doingSomethingStart15()
-{
- doingSomethingStart(15);
-}
-
-//////////////////////////////////////////////////////
-
-void doingSomethingStop0()
-{
- doingSomethingStop(0);
-}
-
-void doingSomethingStop1()
-{
- doingSomethingStop(1);
-}
-
-void doingSomethingStop2()
-{
- doingSomethingStop(2);
-}
-
-void doingSomethingStop3()
-{
- doingSomethingStop(3);
-}
-
-void doingSomethingStop4()
-{
- doingSomethingStop(4);
-}
-
-void doingSomethingStop5()
-{
- doingSomethingStop(5);
-}
-
-void doingSomethingStop6()
-{
- doingSomethingStop(6);
-}
-
-void doingSomethingStop7()
-{
- doingSomethingStop(7);
-}
-
-void doingSomethingStop8()
-{
- doingSomethingStop(8);
-}
-
-void doingSomethingStop9()
-{
- doingSomethingStop(9);
-}
-
-void doingSomethingStop10()
-{
- doingSomethingStop(10);
-}
-
-void doingSomethingStop11()
-{
- doingSomethingStop(11);
-}
-
-void doingSomethingStop12()
-{
- doingSomethingStop(12);
-}
-
-void doingSomethingStop13()
-{
- doingSomethingStop(13);
-}
-
-void doingSomethingStop14()
-{
- doingSomethingStop(14);
-}
-
-void doingSomethingStop15()
-{
- doingSomethingStop(15);
-}
-
-//////////////////////////////////////////////////////
-
-#if USE_COMPLEX_STRUCT
-
- #if USING_PWM_FREQUENCY
-
- ISR_PWM_Data curISR_PWM_Data[] =
- {
- // pin, irqCallbackStartFunc, irqCallbackStopFunc, PWM_Freq, PWM_DutyCycle, deltaMicrosStart, previousMicrosStart, deltaMicrosStop, previousMicrosStop
- { LED_BUILTIN, doingSomethingStart0, doingSomethingStop0, 1.0, 5.0, 0, 0, 0, 0 },
- { LED_BLUE, doingSomethingStart1, doingSomethingStop1, 2.0, 10.0, 0, 0, 0, 0 },
- { LED_RED, doingSomethingStart2, doingSomethingStop2, 3.0, 20.0, 0, 0, 0, 0 },
- { PIN_D0, doingSomethingStart3, doingSomethingStop3, 4.0, 30.0, 0, 0, 0, 0 },
- { PIN_D1, doingSomethingStart4, doingSomethingStop4, 5.0, 40.0, 0, 0, 0, 0 },
- { PIN_D2, doingSomethingStart5, doingSomethingStop5, 6.0, 45.0, 0, 0, 0, 0 },
- { PIN_D3, doingSomethingStart6, doingSomethingStop6, 7.0, 50.0, 0, 0, 0, 0 },
- { PIN_D4, doingSomethingStart7, doingSomethingStop7, 8.0, 55.0, 0, 0, 0, 0 },
- { PIN_D5, doingSomethingStart8, doingSomethingStop8, 9.0, 60.0, 0, 0, 0, 0 },
- { PIN_D6, doingSomethingStart9, doingSomethingStop9, 10.0, 65.0, 0, 0, 0, 0 },
- { PIN_D7, doingSomethingStart10, doingSomethingStop10, 15.0, 70.0, 0, 0, 0, 0 },
- { PIN_D8, doingSomethingStart11, doingSomethingStop11, 20.0, 75.0, 0, 0, 0, 0 },
- { PIN_D9, doingSomethingStart12, doingSomethingStop12, 25.0, 80.0, 0, 0, 0, 0 },
- { PIN_D10, doingSomethingStart13, doingSomethingStop13, 30.0, 85.0, 0, 0, 0, 0 },
- { PIN_D11, doingSomethingStart14, doingSomethingStop14, 40.0, 90.0, 0, 0, 0, 0 },
- { PIN_D12, doingSomethingStart15, doingSomethingStop15, 50.0, 95.0, 0, 0, 0, 0 }
- };
-
- #else // #if USING_PWM_FREQUENCY
-
- ISR_PWM_Data curISR_PWM_Data[] =
- {
- // pin, irqCallbackStartFunc, irqCallbackStopFunc, PWM_Period, PWM_DutyCycle, deltaMicrosStart, previousMicrosStart, deltaMicrosStop, previousMicrosStop
- { LED_BUILTIN, doingSomethingStart0, doingSomethingStop0, 1000000, 5.0, 0, 0, 0, 0 },
- { LED_BLUE, doingSomethingStart1, doingSomethingStop1, 500000, 10.0, 0, 0, 0, 0 },
- { LED_RED, doingSomethingStart2, doingSomethingStop2, 333333, 20.0, 0, 0, 0, 0 },
- { PIN_D0, doingSomethingStart3, doingSomethingStop3, 250000, 30.0, 0, 0, 0, 0 },
- { PIN_D1, doingSomethingStart4, doingSomethingStop4, 200000, 40.0, 0, 0, 0, 0 },
- { PIN_D2, doingSomethingStart5, doingSomethingStop5, 166667, 45.0, 0, 0, 0, 0 },
- { PIN_D3, doingSomethingStart6, doingSomethingStop6, 142857, 50.0, 0, 0, 0, 0 },
- { PIN_D4, doingSomethingStart7, doingSomethingStop7, 125000, 55.0, 0, 0, 0, 0 },
- { PIN_D5, doingSomethingStart8, doingSomethingStop8, 111111, 60.0, 0, 0, 0, 0 },
- { PIN_D6, doingSomethingStart9, doingSomethingStop9, 100000, 65.0, 0, 0, 0, 0 },
- { PIN_D7, doingSomethingStart10, doingSomethingStop10, 66667, 70.0, 0, 0, 0, 0 },
- { PIN_D8, doingSomethingStart11, doingSomethingStop11, 50000, 75.0, 0, 0, 0, 0 },
- { PIN_D9, doingSomethingStart12, doingSomethingStop12, 40000, 80.0, 0, 0, 0, 0 },
- { PIN_D10, doingSomethingStart13, doingSomethingStop13, 33333, 85.0.0, 0, 0, 0, 0 },
- { PIN_D11, doingSomethingStart14, doingSomethingStop14, 25000, 90.0, 0, 0, 0, 0 },
- { PIN_D12, doingSomethingStart15, doingSomethingStop15, 20000, 95.0, 0, 0, 0, 0 }
- };
-
- #endif // #if USING_PWM_FREQUENCY
-
-void doingSomethingStart(int index)
-{
- unsigned long currentMicros = micros();
-
- curISR_PWM_Data[index].deltaMicrosStart = currentMicros - curISR_PWM_Data[index].previousMicrosStart;
- curISR_PWM_Data[index].previousMicrosStart = currentMicros;
-}
-
-void doingSomethingStop(int index)
-{
- unsigned long currentMicros = micros();
-
- //curISR_PWM_Data[index].deltaMicrosStop = currentMicros - curISR_PWM_Data[index].previousMicrosStop;
- // Count from start to stop PWM pulse
- curISR_PWM_Data[index].deltaMicrosStop = currentMicros - curISR_PWM_Data[index].previousMicrosStart;
- curISR_PWM_Data[index].previousMicrosStop = currentMicros;
-}
-
-#else // #if USE_COMPLEX_STRUCT
-
-irqCallback irqCallbackStartFunc[] =
-{
- doingSomethingStart0, doingSomethingStart1, doingSomethingStart2, doingSomethingStart3,
- doingSomethingStart4, doingSomethingStart5, doingSomethingStart6, doingSomethingStart7,
- doingSomethingStart8, doingSomethingStart9, doingSomethingStart10, doingSomethingStart11,
- doingSomethingStart12, doingSomethingStart13, doingSomethingStart14, doingSomethingStart15
-};
-
-irqCallback irqCallbackStopFunc[] =
-{
- doingSomethingStop0, doingSomethingStop1, doingSomethingStop2, doingSomethingStop3,
- doingSomethingStop4, doingSomethingStop5, doingSomethingStop6, doingSomethingStop7,
- doingSomethingStop8, doingSomethingStop9, doingSomethingStop10, doingSomethingStop11,
- doingSomethingStop12, doingSomethingStop13, doingSomethingStop14, doingSomethingStop15
-};
-
-#endif // #if USE_COMPLEX_STRUCT
-
-//////////////////////////////////////////////////////
-
-#define SIMPLE_TIMER_MS 2000L
-
-// Init SimpleTimer
-SimpleTimer simpleTimer;
-
-// Here is software Timer, you can do somewhat fancy stuffs without many issues.
-// But always avoid
-// 1. Long delay() it just doing nothing and pain-without-gain wasting CPU power.Plan and design your code / strategy ahead
-// 2. Very long "do", "while", "for" loops without predetermined exit time.
-void simpleTimerDoingSomething2s()
-{
- static unsigned long previousMicrosStart = startMicros;
-
- unsigned long currMicros = micros();
-
- Serial.print(F("SimpleTimer (ms): ")); Serial.print(SIMPLE_TIMER_MS);
- Serial.print(F(", us : ")); Serial.print(currMicros);
- Serial.print(F(", Dus : ")); Serial.println(currMicros - previousMicrosStart);
-
- for (uint16_t i = 0; i < NUMBER_ISR_PWMS; i++)
- {
-#if USE_COMPLEX_STRUCT
- Serial.print(F("PWM Channel : ")); Serial.print(i);
- Serial.print(F(", programmed Period (uS): "));
-
- #if USING_PWM_FREQUENCY
- Serial.print(1000000 / curISR_PWM_Data[i].PWM_Freq);
- #else
- Serial.print(curISR_PWM_Data[i].PWM_Period);
- #endif
-
- Serial.print(F(", actual (uS) : ")); Serial.print(curISR_PWM_Data[i].deltaMicrosStart);
-
- Serial.print(F(", programmed DutyCycle : "));
-
- Serial.print(curISR_PWM_Data[i].PWM_DutyCycle);
-
- Serial.print(F(", actual : ")); Serial.println((float) curISR_PWM_Data[i].deltaMicrosStop * 100.0f / curISR_PWM_Data[i].deltaMicrosStart);
-
-#else
-
- Serial.print(F("PWM Channel : ")); Serial.print(i);
-
- #if USING_PWM_FREQUENCY
- Serial.print(1000000 / PWM_Freq[i]);
- #else
- Serial.print(PWM_Period[i]);
- #endif
-
- Serial.print(F(", programmed Period (uS): ")); Serial.print(PWM_Period[i]);
- Serial.print(F(", actual (uS): ")); Serial.print(deltaMicrosStart[i]);
-
- Serial.print(F(", programmed DutyCycle : "));
-
- Serial.print(PWM_DutyCycle[i]);
-
- Serial.print(F(", actual : ")); Serial.println( (float) deltaMicrosStop[i] * 100.0f / deltaMicrosStart[i]);
-#endif
- }
-
- previousMicrosStart = currMicros;
-}
-
-void setup()
-{
- Serial.begin(115200);
- while (!Serial);
-
- delay(2000);
-
- Serial.print(F("\nStarting ISR_16_PWMs_Array_Complex on ")); Serial.println(BOARD_NAME);
- Serial.println(STM32_SLOW_PWM_VERSION);
-
- // Interval in microsecs
- if (ITimer.attachInterruptInterval(HW_TIMER_INTERVAL_US, TimerHandler))
- {
- startMicros = micros();
- Serial.print(F("Starting ITimer OK, micros() = ")); Serial.println(startMicros);
- }
- else
- Serial.println(F("Can't set ITimer. Select another freq. or timer"));
-
- startMicros = micros();
-
- // Just to demonstrate, don't use too many ISR Timers if not absolutely necessary
- // You can use up to 16 timer for each ISR_PWM
-
- for (uint16_t i = 0; i < NUMBER_ISR_PWMS; i++)
- {
-#if USE_COMPLEX_STRUCT
- curISR_PWM_Data[i].previousMicrosStart = startMicros;
- //ISR_PWM.setInterval(curISR_PWM_Data[i].PWM_Period, curISR_PWM_Data[i].irqCallbackStartFunc);
-
- //void setPWM(uint32_t pin, float frequency, float dutycycle
- // , timer_callback_p StartCallback = nullptr, timer_callback_p StopCallback = nullptr)
-
- #if USING_PWM_FREQUENCY
- // You can use this with PWM_Freq in Hz
- ISR_PWM.setPWM(curISR_PWM_Data[i].PWM_Pin, curISR_PWM_Data[i].PWM_Freq, curISR_PWM_Data[i].PWM_DutyCycle,
- curISR_PWM_Data[i].irqCallbackStartFunc, curISR_PWM_Data[i].irqCallbackStopFunc);
- #else
- // Or You can use this with PWM_Period in us
- ISR_PWM.setPWM_Period(curISR_PWM_Data[i].PWM_Pin, curISR_PWM_Data[i].PWM_Period, curISR_PWM_Data[i].PWM_DutyCycle,
- curISR_PWM_Data[i].irqCallbackStartFunc, curISR_PWM_Data[i].irqCallbackStopFunc);
- #endif
-
-#else
- previousMicrosStart[i] = micros();
-
- #if USING_PWM_FREQUENCY
- // You can use this with PWM_Freq in Hz
- ISR_PWM.setPWM(PWM_Pin[i], PWM_Freq[i], PWM_DutyCycle[i], irqCallbackStartFunc[i], irqCallbackStopFunc[i]);
- #else
- // Or You can use this with PWM_Period in us
- ISR_PWM.setPWM_Period(PWM_Pin[i], PWM_Period[i], PWM_DutyCycle[i], irqCallbackStartFunc[i], irqCallbackStopFunc[i]);
- #endif
-
-#endif
- }
-
- // You need this timer for non-critical tasks. Avoid abusing ISR if not absolutely necessary.
- simpleTimer.setInterval(SIMPLE_TIMER_MS, simpleTimerDoingSomething2s);
-}
-
-#define BLOCKING_TIME_MS 10000L
-
-void loop()
-{
- // This unadvised blocking task is used to demonstrate the blocking effects onto the execution and accuracy to Software timer
- // You see the time elapse of ISR_PWM still accurate, whereas very unaccurate for Software Timer
- // The time elapse for 2000ms software timer now becomes 3000ms (BLOCKING_TIME_MS)
- // While that of ISR_PWM is still prefect.
- delay(BLOCKING_TIME_MS);
-
- // You need this Software timer for non-critical tasks. Avoid abusing ISR if not absolutely necessary
- // You don't need to and never call ISR_PWM.run() here in the loop(). It's already handled by ISR timer.
- simpleTimer.run();
-}
-```
---
---
@@ -999,7 +425,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
```
Starting ISR_16_PWMs_Array_Complex on NUCLEO_H743ZI2
-STM32_SLOW_PWM v1.2.2
+STM32_SLOW_PWM v1.2.3
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 240000000
[PWM] Frequency = 1000000.00 , _count = 20
Starting ITimer OK, micros() = 2015843
@@ -1064,7 +490,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
```
Starting ISR_16_PWMs_Array_Complex on NUCLEO_F767ZI
-STM32_SLOW_PWM v1.2.2
+STM32_SLOW_PWM v1.2.3
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 216000000 , Timer Clock Frequency = 1000000.00
[PWM] Timer Frequency = 50000.00 , _count = 20
Starting ITimer OK, micros() = 2016555
@@ -1129,7 +555,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
```
Starting ISR_16_PWMs_Array_Complex on NUCLEO_L552ZE_Q
-STM32_SLOW_PWM v1.2.2
+STM32_SLOW_PWM v1.2.3
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 110000000
[PWM] Frequency = 1000000.00 , _count = 20
Starting ITimer OK, micros() = 2016141
@@ -1194,7 +620,7 @@ The following is the sample terminal output when running example [ISR_16_PWMs_Ar
```
Starting ISR_16_PWMs_Array_Complex on BLUEPILL_F103CB
-STM32_SLOW_PWM v1.2.2
+STM32_SLOW_PWM v1.2.3
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 72000000
[PWM] Frequency = 1000000.00 , _count = 20
Starting ITimer OK, micros() = 3390333
@@ -1256,24 +682,28 @@ PWM Channel : 15, programmed Period (uS): 20000, actual (uS) : 19984, programmed
The following is the sample terminal output when running example [ISR_Modify_PWM](examples/ISR_Modify_PWM) on **NUCLEO_F767ZI** to demonstrate how to modify PWM settings on-the-fly without deleting the PWM channel
-```Starting ISR_Modify_PWM on NUCLEO_F767ZI
-STM32_SLOW_PWM v1.2.2
+```
+Starting ISR_Modify_PWM on NUCLEO_F767ZI
+STM32_SLOW_PWM v1.2.3
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 216000000 , Timer Clock Frequency = 1000000.00
[PWM] Timer Frequency = 50000.00 , _count = 20
Starting ITimer OK, micros() = 2016546
-Using PWM Freq = 1.00, PWM DutyCycle = 50.00
-Channel : 0 Period : 1000000 OnTime : 500000 Start_Time : 2022140
-Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 12022149
-Channel : 0 New Period : 1000000 OnTime : 500000 Start_Time : 22022149
-Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 31522169
-Channel : 0 New Period : 1000000 OnTime : 500000 Start_Time : 42022169
-Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 51522209
-Channel : 0 New Period : 1000000 OnTime : 500000 Start_Time : 62022229
-Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 71522229
-Channel : 0 New Period : 1000000 OnTime : 500000 Start_Time : 82022229
-Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 91522229
-Channel : 0 New Period : 1000000 OnTime : 500000 Start_Time : 102022229
-Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 111522289
+Using PWM Freq = 200.00, PWM DutyCycle = 1.00
+Channel : 0 Period : 5000 OnTime : 50 Start_Time : 2022139
+Channel : 0 Period : 10000 OnTime : 555 Start_Time : 12027668
+Channel : 0 Period : 5000 OnTime : 50 Start_Time : 22022668
+Channel : 0 Period : 10000 OnTime : 555 Start_Time : 32027668
+Channel : 0 Period : 5000 OnTime : 50 Start_Time : 42022668
+Channel : 0 Period : 10000 OnTime : 555 Start_Time : 52027668
+Channel : 0 Period : 5000 OnTime : 50 Start_Time : 62032668
+Channel : 0 Period : 10000 OnTime : 555 Start_Time : 72032668
+Channel : 0 Period : 5000 OnTime : 50 Start_Time : 82027668
+Channel : 0 Period : 10000 OnTime : 555 Start_Time : 92032668
+Channel : 0 Period : 5000 OnTime : 50 Start_Time : 102027668
+Channel : 0 Period : 10000 OnTime : 555 Start_Time : 112037668
+Channel : 0 Period : 5000 OnTime : 50 Start_Time : 122032668
+Channel : 0 Period : 10000 OnTime : 555 Start_Time : 132037668
+Channel : 0 Period : 5000 OnTime : 50 Start_Time : 142032668
```
---
@@ -1282,8 +712,9 @@ Channel : 0 New Period : 500000 OnTime : 450000 Start_Time : 111522289
The following is the sample terminal output when running example [ISR_Changing_PWM](examples/ISR_Changing_PWM) on **NUCLEO_F767ZI** to demonstrate how to modify PWM settings on-the-fly by deleting the PWM channel and reinit the PWM channel
-```Starting ISR_Changing_PWM on NUCLEO_F767ZI
-STM32_SLOW_PWM v1.2.2
+```
+Starting ISR_Changing_PWM on NUCLEO_F767ZI
+STM32_SLOW_PWM v1.2.3
[PWM] STM32TimerInterrupt: Timer Input Freq (Hz) = 216000000 , Timer Clock Frequency = 1000000.00
[PWM] Timer Frequency = 50000.00 , _count = 20
Starting ITimer OK, micros() = 2016548
@@ -1339,16 +770,17 @@ Submit issues to: [STM32_Slow_PWM issues](/~https://github.com/khoih-prog/STM32_Sl
## DONE
-1. Basic hardware multi-channel PWM for **STM32F/L/H/G/WB/MP1 boards** such as NUCLEO_H743ZI2, NUCLEO_L552ZE_Q, NUCLEO_F767ZI, BLUEPILL_F103CB, etc., using [`Arduino Core for STM32`](/~https://github.com/stm32duino/Arduino_Core_STM32)
-2. Add Table of Contents
-3. Add functions to modify PWM settings on-the-fly
-4. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories
-5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
-6. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`
-7. Optimize library code by using `reference-passing` instead of `value-passing`
-8. Fix reattachInterrupt() bug. Check [bugfix: reattachInterrupt() pass wrong frequency value to setFrequency() #19](/~https://github.com/khoih-prog/ESP8266TimerInterrupt/pull/19)
-9. DutyCycle to be optionally updated at the end current PWM period instead of immediately.
-
+ 1. Basic hardware multi-channel PWM for **STM32F/L/H/G/WB/MP1 boards** such as NUCLEO_H743ZI2, NUCLEO_L552ZE_Q, NUCLEO_F767ZI, BLUEPILL_F103CB, etc., using [`Arduino Core for STM32`](/~https://github.com/stm32duino/Arduino_Core_STM32)
+ 2. Add Table of Contents
+ 3. Add functions to modify PWM settings on-the-fly
+ 4. Fix `multiple-definitions` linker error. Drop `src_cpp` and `src_h` directories
+ 5. Add example [multiFileProject](examples/multiFileProject) to demo for multiple-file project
+ 6. Improve accuracy by using `float`, instead of `uint32_t` for `dutycycle`
+ 7. Optimize library code by using `reference-passing` instead of `value-passing`
+ 8. Fix reattachInterrupt() bug. Check [bugfix: reattachInterrupt() pass wrong frequency value to setFrequency() #19](/~https://github.com/khoih-prog/ESP8266TimerInterrupt/pull/19)
+ 9. DutyCycle to be optionally updated at the end current PWM period instead of immediately.
+10. Display informational warning only when `_PWM_LOGLEVEL_` > 3
+
---
---
diff --git a/changelog.md b/changelog.md
index bb5e40c..5cea89f 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,12 @@
## 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 `float` for `DutyCycle` and `Freq`, `uint32_t` for `period`.
diff --git a/library.json b/library.json
index c520578..30e44cd 100644
--- a/library.json
+++ b/library.json
@@ -1,6 +1,6 @@
{
"name": "STM32_Slow_PWM",
- "version": "1.2.2",
+ "version": "1.2.3",
"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",
"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",
"authors":
diff --git a/library.properties b/library.properties
index 90cdb5d..cb0ad67 100644
--- a/library.properties
+++ b/library.properties
@@ -1,5 +1,5 @@
name=STM32_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 STM32F/L/H/G/WB/MP1 boards to create and output PWM to pins.
diff --git a/src/PWM_Generic_Debug.h b/src/PWM_Generic_Debug.h
index e31d04b..d416439 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 29/01/2022 Fix multiple-definitions linker error. Improve accuracy
1.2.1 K Hoang 30/01/2022 DutyCycle to be updated at the end current PWM period
1.2.2 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period. Optimize code
+ 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs. Display warning only when debug level > 3
*****************************************************************************************************************************/
#pragma once
diff --git a/src/STM32_Slow_PWM.h b/src/STM32_Slow_PWM.h
index 72e39d0..9ad81a1 100644
--- a/src/STM32_Slow_PWM.h
+++ b/src/STM32_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 29/01/2022 Fix multiple-definitions linker error. Improve accuracy
1.2.1 K Hoang 30/01/2022 DutyCycle to be updated at the end current PWM period
1.2.2 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period. Optimize code
+ 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs. Display warning only when debug level > 3
*****************************************************************************************************************************/
#pragma once
diff --git a/src/STM32_Slow_PWM.hpp b/src/STM32_Slow_PWM.hpp
index 37e02d8..9801cd2 100644
--- a/src/STM32_Slow_PWM.hpp
+++ b/src/STM32_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 29/01/2022 Fix multiple-definitions linker error. Improve accuracy
1.2.1 K Hoang 30/01/2022 DutyCycle to be updated at the end current PWM period
1.2.2 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period. Optimize code
+ 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs. Display warning only when debug level > 3
*****************************************************************************************************************************/
#pragma once
@@ -43,13 +44,13 @@
#endif
#ifndef STM32_SLOW_PWM_VERSION
- #define STM32_SLOW_PWM_VERSION "STM32_SLOW_PWM v1.2.2"
+ #define STM32_SLOW_PWM_VERSION "STM32_SLOW_PWM v1.2.3"
#define STM32_SLOW_PWM_VERSION_MAJOR 1
#define STM32_SLOW_PWM_VERSION_MINOR 2
- #define STM32_SLOW_PWM_VERSION_PATCH 2
+ #define STM32_SLOW_PWM_VERSION_PATCH 3
- #define STM32_SLOW_PWM_VERSION_INT 1002002
+ #define STM32_SLOW_PWM_VERSION_INT 1002003
#endif
///////////////////////////////////////////
diff --git a/src/STM32_Slow_PWM_ISR.h b/src/STM32_Slow_PWM_ISR.h
index 1085572..9603034 100644
--- a/src/STM32_Slow_PWM_ISR.h
+++ b/src/STM32_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 29/01/2022 Fix multiple-definitions linker error. Improve accuracy
1.2.1 K Hoang 30/01/2022 DutyCycle to be updated at the end current PWM period
1.2.2 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period. Optimize code
+ 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs. Display warning only when debug level > 3
*****************************************************************************************************************************/
#pragma once
diff --git a/src/STM32_Slow_PWM_ISR.hpp b/src/STM32_Slow_PWM_ISR.hpp
index ca5c39f..ad2f327 100644
--- a/src/STM32_Slow_PWM_ISR.hpp
+++ b/src/STM32_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 29/01/2022 Fix multiple-definitions linker error. Improve accuracy
1.2.1 K Hoang 30/01/2022 DutyCycle to be updated at the end current PWM period
1.2.2 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period. Optimize code
+ 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs. Display warning only when debug level > 3
*****************************************************************************************************************************/
#pragma once
@@ -43,13 +44,13 @@
#endif
#ifndef STM32_SLOW_PWM_VERSION
- #define STM32_SLOW_PWM_VERSION "STM32_SLOW_PWM v1.2.2"
+ #define STM32_SLOW_PWM_VERSION "STM32_SLOW_PWM v1.2.3"
#define STM32_SLOW_PWM_VERSION_MAJOR 1
#define STM32_SLOW_PWM_VERSION_MINOR 2
- #define STM32_SLOW_PWM_VERSION_PATCH 2
+ #define STM32_SLOW_PWM_VERSION_PATCH 3
- #define STM32_SLOW_PWM_VERSION_INT 1002002
+ #define STM32_SLOW_PWM_VERSION_INT 1002003
#endif
#ifndef _PWM_LOGLEVEL_
@@ -68,12 +69,19 @@ typedef void (*timer_callback)();
typedef void (*timer_callback_p)(void *);
#if !defined(USING_MICROS_RESOLUTION)
- #warning Not USING_MICROS_RESOLUTION, using millis resolution
+
+ #if (_PWM_LOGLEVEL_ > 3)
+ #warning Not USING_MICROS_RESOLUTION, using millis resolution
+ #endif
+
#define USING_MICROS_RESOLUTION false
#endif
#if !defined(CHANGING_PWM_END_OF_CYCLE)
- #warning Using default CHANGING_PWM_END_OF_CYCLE == true
+ #if (_PWM_LOGLEVEL_ > 3)
+ #warning Using default CHANGING_PWM_END_OF_CYCLE == true
+ #endif
+
#define CHANGING_PWM_END_OF_CYCLE true
#endif
diff --git a/src/STM32_Slow_PWM_ISR_Impl.h b/src/STM32_Slow_PWM_ISR_Impl.h
index e931d09..2620201 100644
--- a/src/STM32_Slow_PWM_ISR_Impl.h
+++ b/src/STM32_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 29/01/2022 Fix multiple-definitions linker error. Improve accuracy
1.2.1 K Hoang 30/01/2022 DutyCycle to be updated at the end current PWM period
1.2.2 K Hoang 01/02/2022 Use float for DutyCycle and Freq, uint32_t for period. Optimize code
+ 1.2.3 K Hoang 03/03/2022 Fix `DutyCycle` and `New Period` display bugs. Display warning only when debug level > 3
*****************************************************************************************************************************/
#pragma once
@@ -194,10 +195,10 @@ int8_t STM32_SLOW_PWM_ISR::setupPWMChannel(const uint32_t& pin, const uint32_t&
PWM[channelNum].callbackStart = cbStartFunc;
PWM[channelNum].callbackStop = cbStopFunc;
- PWM_LOGDEBUG0("Channel : "); PWM_LOGDEBUG0(channelNum);
- PWM_LOGDEBUG0("\t Period : "); PWM_LOGDEBUG0(PWM[channelNum].period);
- PWM_LOGDEBUG0("\t\tOnTime : "); PWM_LOGDEBUG0(PWM[channelNum].onTime);
- PWM_LOGDEBUG0("\tStart_Time : "); PWM_LOGDEBUGLN0(PWM[channelNum].prevTime);
+ PWM_LOGINFO0("Channel : "); PWM_LOGINFO0(channelNum);
+ PWM_LOGINFO0("\t Period : "); PWM_LOGINFO0(PWM[channelNum].period);
+ PWM_LOGINFO0("\t\tOnTime : "); PWM_LOGINFO0(PWM[channelNum].onTime);
+ PWM_LOGINFO0("\tStart_Time : "); PWM_LOGINFOLN0(PWM[channelNum].prevTime);
numChannels++;
@@ -235,10 +236,10 @@ bool STM32_SLOW_PWM_ISR::modifyPWMChannel_Period(const uint8_t& channelNum, cons
PWM[channelNum].newDutyCycle = dutycycle;
PWM[channelNum].newOnTime = ( period * dutycycle ) / 100;
- PWM_LOGDEBUG0("Channel : "); PWM_LOGDEBUG0(channelNum);
- PWM_LOGDEBUG0("\tNew Period : "); PWM_LOGDEBUG0(PWM[channelNum].newPeriod);
- PWM_LOGDEBUG0("\t\tOnTime : "); PWM_LOGDEBUG0(PWM[channelNum].newOnTime);
- PWM_LOGDEBUG0("\tStart_Time : "); PWM_LOGDEBUGLN0(PWM[channelNum].prevTime);
+ PWM_LOGINFO0("Channel : "); PWM_LOGINFO0(channelNum);
+ 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);
#else
@@ -251,10 +252,10 @@ bool STM32_SLOW_PWM_ISR::modifyPWMChannel_Period(const uint8_t& channelNum, cons
PWM[channelNum].prevTime = timeNow();
- PWM_LOGDEBUG0("Channel : "); PWM_LOGDEBUG0(channelNum);
- PWM_LOGDEBUG0("\t Period : "); PWM_LOGDEBUG0(PWM[channelNum].period);
- PWM_LOGDEBUG0("\t\tOnTime : "); PWM_LOGDEBUG0(PWM[channelNum].onTime);
- PWM_LOGDEBUG0("\tStart_Time : "); PWM_LOGDEBUGLN0(PWM[channelNum].prevTime);
+ PWM_LOGINFO0("Channel : "); PWM_LOGINFO0(channelNum);
+ PWM_LOGINFO0("\t Period : "); PWM_LOGINFO0(PWM[channelNum].period);
+ PWM_LOGINFO0("\t\tOnTime : "); PWM_LOGINFO0(PWM[channelNum].onTime);
+ PWM_LOGINFO0("\tStart_Time : "); PWM_LOGINFOLN0(PWM[channelNum].prevTime);
#endif