本帖最后由 zryblog 于 2018-12-21 11:01 编辑
if(++r_pwmctrl==254)
r_pwmctrl=0;
r_p3buf=0x0f;
if(r_pwmctrl<r_pwmbuf[0])
r_p3buf&=0xfe;
if(r_pwmctrl<r_pwmbuf[1])
r_p3buf&=0xfd;
if(r_pwmctrl<r_pwmbuf[2])
r_p3buf&=0xfb;
if(r_pwmctrl<r_pwmbuf[3])
r_p3buf&=0xf7;
P3=r_p3buf
中断里面这么做。
|