主函数:
main{}
{
u8 test_samnum[10] = {0xAA,0xAA,0xAA,0x96,0x69,0x00,0x03,0x12,0xFF,0xEe};
Stm32_Clock_Init(9); //系统时钟设置
delay_init(72); //延时初始化
uart1_init(72,115200); //串口初始化为
uart2_init(72,115200);
LED_Init(); //初始化与LED连接的硬件接口
while(1)
{
uart1_send(10,test_samnum);
uart2_send(10,test_samnum);
while(USART_RX_STA==0x01)
{
if(test_simnum()==success)
LED1=!LED1;
USART_RX_STA=0x00 ;
}
delay_ms(100);
LED0=!LED0;
}
}
} |