Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions multi/stm32l4-multi/pwm_n6.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,9 @@ int pwm_setBitSequence(pwm_tim_id_t timer, pwm_ch_id_t chn, void *data, uint32_t
if (nbits > MAX_DSHOT_DMA) {
return -EINVAL;
}
if (((PWM_TIM_DMA >> timer) & 1) == 0) {
return -EINVAL;
}

mutexLock(pwm_common.dmalock);

Expand Down
1 change: 1 addition & 0 deletions multi/stm32l4-multi/pwm_n6.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define PWM_TIM_GP2 ((1 << pwm_tim9) | (1 << pwm_tim12) | (1 << pwm_tim15))
#define PWM_TIM_NO_MASTER_SLAVE ((1 << pwm_tim10) | (1 << pwm_tim11) | (1 << pwm_tim13) | (1 << pwm_tim14) | (1 << pwm_tim16) | (1 << pwm_tim17))
#define PWM_TIM_32BIT ((1 << pwm_tim2) | (1 << pwm_tim3) | (1 << pwm_tim4) | (1 << pwm_tim5))
#define PWM_TIM_DMA ((1 << pwm_tim1) | (1 << pwm_tim2) | (1 << pwm_tim3) | (1 << pwm_tim4) | (1 << pwm_tim5) | (1 << pwm_tim8) | (1 << pwm_tim15) | (1 << pwm_tim16) | (1 << pwm_tim17))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line is very long and exceeds common style guide recommendations for line length (e.g., 80 or 100 characters), which can make the code harder to read and maintain. Consider splitting it across multiple lines for improved readability.

Suggested change
#define PWM_TIM_DMA ((1 << pwm_tim1) | (1 << pwm_tim2) | (1 << pwm_tim3) | (1 << pwm_tim4) | (1 << pwm_tim5) | (1 << pwm_tim8) | (1 << pwm_tim15) | (1 << pwm_tim16) | (1 << pwm_tim17))
#define PWM_TIM_DMA ((1 << pwm_tim1) | (1 << pwm_tim2) | (1 << pwm_tim3) | (1 << pwm_tim4) | (1 << pwm_tim5) | \
(1 << pwm_tim8) | (1 << pwm_tim15) | (1 << pwm_tim16) | (1 << pwm_tim17))



/* Get the base clock frequency for a given timer. Returns 0 upon error. */
Expand Down
Loading