fix(bsp/st/driver): Fix bugs in STM32 PIN and PWM device drivers.
1.Fixed the bug where PIN was missing an if judgment condition(thanks to 'Zuosir'). 2.Fix the PWM parameter detection error (Thanks to '决浮云').
This commit is contained in:
@@ -192,7 +192,7 @@ static int drv_pin_configure(struct mr_pin *pin, int number, int mode)
|
||||
{
|
||||
HAL_NVIC_DisableIRQ(pin_irq_map[exti_line]);
|
||||
}
|
||||
} else
|
||||
} else if ((exti_line >= 10) && (exti_line <= 15))
|
||||
{
|
||||
if ((pin_irq_mask[10] == -1) &&
|
||||
(pin_irq_mask[11] == -1) &&
|
||||
|
||||
@@ -303,7 +303,7 @@ static int drv_pwm_read(struct mr_pwm *pwm, int channel, uint32_t *compare_value
|
||||
uint32_t Channel = (channel - 1) << 2;
|
||||
|
||||
#ifdef MR_USING_PWM_CHANNEL_CHECK
|
||||
if ((Channel & TIM_CHANNEL_ALL) || (Channel == 0))
|
||||
if (Channel & TIM_CHANNEL_ALL)
|
||||
{
|
||||
return MR_EINVAL;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ static int drv_pwm_write(struct mr_pwm *pwm, int channel, uint32_t compare_value
|
||||
uint32_t Channel = (channel - 1) << 2;
|
||||
|
||||
#ifdef MR_USING_PWM_CHANNEL_CHECK
|
||||
if ((Channel & TIM_CHANNEL_ALL) || (Channel == 0))
|
||||
if (Channel & TIM_CHANNEL_ALL)
|
||||
{
|
||||
return MR_EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user