金牌会员
 
- 积分
- 2686

- 威望
- 1771
- 贡献
- 53
- 兑换币
- 1177
- 注册时间
- 2013-5-28
- 在线时间
- 431 小时
|
void main(void)
{
//1 主程序使用的变量定义
uint32 runcount; //运行计数器
//2 关中断
DisableInterrupts; //禁止总中断
//3 模块初始化
light_init(Light_Run_PORT,Light_Run1,Light_OFF); //指示灯初始化
uart_init (UART0,periph_clk_khz,9600); //串口初始化
//4 开中断
// enableuartreint(UART0,UART0irq); //开串口0接收中断
//EnableInterrupts; //开总中断
uart_sendN(UART0,(uint8*)"Hello World!",12);
//主循环
while(1)
{
//1 主循环计数到一定的值,使小灯的亮、暗状态切换
runcount++;
if(runcount>=5000000)
{
light_change(Light_Run_PORT,Light_Run1);//指示灯的亮、暗状态切换
runcount=0;
}
}
}
用的是pl2303串口转换通信,程序下进去了,小灯也闪烁,但调试助手一点反应也没有啊!郁闷。。。
|
|