Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32b6654

Browse files
authored
Merge pull request#2572 from fpistm/HT_FIX
fix(hardwaretimer): avoid glitch when PWM configuration changed
2 parents339e2b9 +6c30d95 commit32b6654

File tree

3 files changed

+96
-100
lines changed

3 files changed

+96
-100
lines changed

‎keywords.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -862,8 +862,7 @@ GPIO_PIN_14LITERAL1
862862
GPIO_PIN_15LITERAL1
863863

864864
# HardwareTimer
865-
TIMER_DISABLEDLITERAL1
866-
TIMER_OUTPUT_COMPARELITERAL1
865+
TIMER_OUTPUT_DISABLEDLITERAL1
867866
TIMER_OUTPUT_COMPARE_ACTIVELITERAL1
868867
TIMER_OUTPUT_COMPARE_INACTIVELITERAL1
869868
TIMER_OUTPUT_COMPARE_TOGGLELITERAL1

‎libraries/SrcWrapper/inc/HardwareTimer.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@
3636
#defineTIMER_CHANNELS4// channel5 and channel 6 are not considered here has they don't have gpio output and they don't have interrupt
3737

3838
typedefenum {
39-
TIMER_DISABLED,// == TIM_OCMODE_TIMING no output, useful for only-interrupt
39+
TIMER_OUTPUT_DISABLED,// == TIM_OCMODE_TIMING no output, useful for only-interrupt
4040
// Output Compare
41-
TIMER_OUTPUT_COMPARE,// == Obsolete, use TIMER_DISABLED instead. Kept for compatibility reason
4241
TIMER_OUTPUT_COMPARE_ACTIVE,// == TIM_OCMODE_ACTIVE pin is set high when counter == channel compare
4342
TIMER_OUTPUT_COMPARE_INACTIVE,// == TIM_OCMODE_INACTIVE pin is set low when counter == channel compare
4443
TIMER_OUTPUT_COMPARE_TOGGLE,// == TIM_OCMODE_TOGGLE pin toggles when counter == channel compare
@@ -60,6 +59,10 @@ typedef enum {
6059
TIMER_NOT_USED =0xFFFF// This must be the last item of this enum
6160
} TimerModes_t;
6261

62+
// Backward compatibility
63+
#defineTIMER_DISABLED TIMER_OUTPUT_DISABLED
64+
#defineTIMER_OUTPUT_COMPARE TIMER_OUTPUT_DISABLED
65+
6366
typedefenum {
6467
TICK_FORMAT,// default
6568
MICROSEC_FORMAT,
@@ -177,10 +180,10 @@ class HardwareTimer {
177180

178181
// The following function(s) are available for more advanced timer options
179182
TIM_HandleTypeDef *getHandle();// return the handle address for HAL related configuration
180-
intgetChannel(uint32_t channel);
181-
intgetLLChannel(uint32_t channel);
182-
intgetIT(uint32_t channel);
183-
intgetAssociatedChannel(uint32_t channel);
183+
uint32_tgetChannel(uint32_t channel);
184+
uint32_tgetLLChannel(uint32_t channel);
185+
uint32_tgetIT(uint32_t channel);
186+
uint32_tgetAssociatedChannel(uint32_t channel);
184187

185188
private:
186189
// Store for each channel if regular, complementary or both are used

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp