if( pwmch == 2 )
{
/* 更新当前通道的PWM波形 */
if( pwmwidth >1 )
{
/* 把PWM所在引脚切换PWM*/
PWM0_P12_OUTPUT_ENABLE;
PWM0H = pwmwidth/255;
PWM0L = pwmwidth%255;
}
else
{
PWM0H = 0;
PWM0L = 0;
/* 把PWM所在引脚切换GPIO*/
PWM0_P12_OUTPUT_DISABLE;
/* 强制改引脚归1*/
LASER_PWM = 1;
}
}
/* 更新pwm寄存器 */
set_LOAD; |