📄 main.c
字号:
/***********************Copyright (c) iFLY of Robotic Institute,BUAA**********************\
FCS-SOFT: Fstar Control System Software
主程序
2007.8.28
Author: ainy
\******************************************************************************************/
#include "config.h"
#include "uart0.h"
#include "uart1.h"
#include "timer0.h"
#include "led.h"
#include "spi.h"
int main(void)
{
int TimerIndex;
// uint8 rcvdata;
for(TimerIndex=0;TimerIndex<1000000;TimerIndex++);
spiR=0;
send_point=0;
send_data[0]=0x55;
send_data[1]=0xaa;
send_data[2]=0x01;
send_data[3]=0x04;
send_data[4]=0x26;
send_data[5]=0x00;
send_data[6]=0x64;
send_data[7]=0x00;
send_data[8]=0x64;
send_data[9]=0xF2;
PINSEL1=0x00000000;
IO1DIR=0x00010000;
UART0_Init(19200);
UART1_Init(19200);
initial_timer0();
SSpiIni();
PCONP |=(1<<8);
PCONP |=(1<<10);
// SSendData(0x55);
while(1)
{
//UART0_SendByte(0x24);
// rcvdata=SRcvData();
// UART0_SendByte(rcvdata);
/* if(1==spiR)
{
SSendData(0x30);
SSendData(0x55);
spiR=0;
}
*/
IO1SET=0x00010000;
delay_ns(300);
IO1CLR=0x00010000;
delay_ns(300);
// led_on();
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -