void wdt_init(void)
{
WTCON &= ~(0xff << 8);//设置时钟分频
WTCON |= (249 << 8);//一级:249
WTCON |= (3<<3);//二级 128
WTCON |= (1<<2);//使能中断位
WTCNT = 3125; //设置初始时间1s
WTCON |= (1<<5);使能看门狗计时器
}
int main()
{
wdt_init(); //看门狗初始化 1秒后会重启系统
while(1);
}