|
19 | 19 | #error This code is designed to run on STM32F/L/H/G/WB/MP1 platform! Please check your Tools->Board setting.
|
20 | 20 | #endif
|
21 | 21 |
|
22 |
| -// These define's must be placed at the beginning before #include "ESP32_PWM.h" |
| 22 | +// These define's must be placed at the beginning before #include "STM32_Slow_PWM.h" |
23 | 23 | // _PWM_LOGLEVEL_ from 0 to 4
|
24 | 24 | // Don't define _PWM_LOGLEVEL_ > 0. Only for special ISR debugging only. Can hang the system.
|
25 |
| -#define _PWM_LOGLEVEL_ 4 |
| 25 | +#define _PWM_LOGLEVEL_ 3 |
26 | 26 |
|
27 | 27 | #define USING_MICROS_RESOLUTION true //false
|
28 | 28 |
|
@@ -86,19 +86,19 @@ void TimerHandler()
|
86 | 86 | uint32_t PWM_Pin = LED_BUILTIN;
|
87 | 87 |
|
88 | 88 | // You can assign any interval for any timer here, in Hz
|
89 |
| -float PWM_Freq1 = 1.0f; |
| 89 | +float PWM_Freq1 = 200.0f; //1.0f; |
90 | 90 | // You can assign any interval for any timer here, in Hz
|
91 |
| -float PWM_Freq2 = 2.0f; |
| 91 | +float PWM_Freq2 = 100.0f; //2.0f; |
92 | 92 |
|
93 | 93 | // You can assign any interval for any timer here, in microseconds
|
94 | 94 | uint32_t PWM_Period1 = 1000000 / PWM_Freq1;
|
95 | 95 | // You can assign any interval for any timer here, in microseconds
|
96 | 96 | uint32_t PWM_Period2 = 1000000 / PWM_Freq2;
|
97 | 97 |
|
98 | 98 | // You can assign any duty_cycle for any PWM here, from 0-100
|
99 |
| -float PWM_DutyCycle1 = 50.0; |
| 99 | +float PWM_DutyCycle1 = 1.0f; //50.0f; |
100 | 100 | // You can assign any duty_cycle for any PWM here, from 0-100
|
101 |
| -float PWM_DutyCycle2 = 90.0; |
| 101 | +float PWM_DutyCycle2 = 5.55f; //90.0f; |
102 | 102 |
|
103 | 103 | // Channel number used to identify associated channel
|
104 | 104 | int channelNum;
|
@@ -148,8 +148,8 @@ void changePWM()
|
148 | 148 | {
|
149 | 149 | static uint8_t count = 1;
|
150 | 150 |
|
151 |
| - double PWM_Freq; |
152 |
| - uint32_t PWM_DutyCycle; |
| 151 | + float PWM_Freq; |
| 152 | + float PWM_DutyCycle; |
153 | 153 |
|
154 | 154 | if (count++ % 2)
|
155 | 155 | {
|
|
0 commit comments