#include<SH79F166.h>
#include<intrins.H>
#define uchar unsigned char
#define uint unsigned int
void ISR_Timer3 (void);
void init_devices(void);
void main(void)
{init_devices();}
void init_devices()
{EA=0;
Time3_init();
CLKCON=0x00; //
PWM10ms_data=PWM10ms;
EA=1;
}
void Time3_init (void)
{T3CON=0x90;
TL3=0x96;
TR3=1;
}
void ISR_Timer3 (void)
{
if(in_AC_cycle!=0)in_AC_cycle--;
if(Cycle_dat<0xfe){Cycle_dat++;}else{Input_AcValue=0;}
if(delay_us_timer!=0)delay_us_timer--;//
if(OnInvDelay!=0){OnInvDelay--;}
//off_RedLED;//
if(sys==bat_work||sys==Test)
{
if(OnInvDelay==0)
{if(PWMflag==0){run_pwm0();}
if(PWMflag==1){run_pwmx();}
if(PWMflag==2){run_pwm1();}
if(PWMflag==3){run_pwmx();} }
}
else{close_PWM();}
}
不进入定时器3,哪里设置有问题啊? |