mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-21 18:57:16 +08:00
优化互补PWM输出功能的实现逻辑,兼容原本API,增加互补PWM使能/失能命令
This commit is contained in:
@@ -309,8 +309,12 @@ static rt_err_t drv_pwm_control(struct rt_device_pwm *device, int cmd, void *arg
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case PWMN_CMD_ENABLE:
|
||||
configuration->complementary = RT_TRUE;
|
||||
case PWM_CMD_ENABLE:
|
||||
return drv_pwm_enable(htim, configuration, RT_TRUE);
|
||||
case PWMN_CMD_DISABLE:
|
||||
configuration->complementary = RT_FALSE;
|
||||
case PWM_CMD_DISABLE:
|
||||
return drv_pwm_enable(htim, configuration, RT_FALSE);
|
||||
case PWM_CMD_SET:
|
||||
|
||||
Reference in New Issue
Block a user