📄 main.c
字号:
#include "stm32f10x.h"
#include "custom.h"
#include "stm32f10x_rcc.h"
#include "stm32f10x_flash.h"
#include "stm32f10x_usart.h"
#include "stm32f10x_fsmc.h"
#include "stm32f10x_spi.h"
#include "main.h"
#include "config.h"
#include "ILI9325.h"
#include "gui.h"
#include "fsmc_sram.h"
#include "bmp.h"
#include "nrf24l01.h"
uchar T2 = 0;
uchar It1 = 0;
uchar It6 = 0;
uchar num[] = "0123456789.";
uint tt; //for循环专用
uint temp; //装除数
uint test;//独立计算时使用
uchar s;
int main(void)
{
/*--------Configuration-----------*/
RCC_Configuration();
GPIO_Configuration();
USART_Configuration();
EXTI_Configuration();
NVIC_Configuration();
SPI_Configuration();
/*---------Init-------------------*/
Time_Init();
FSMC_LCD_Init();
ILI9325_Init();
GUI_clearscreen(0);
nRF24L01_Initial();
RX_Mode();
for(;;)
{
/*---------Timer2 respond----------*/
if(T2 == 1)
{
T2 = 0;
/*--------------发送数据----------------------*/
TxBuf[0] = s;
TxBuf[1] = s;
TX_Mode(TxBuf);
temp = 100;
for(tt = 0;tt < 3;tt++)
{
GUI_sprintf_char(8 * tt, 20,num[TxBuf[0] / temp],RED,BLACK);
TxBuf[0] %= temp;
temp /= 10;
}
}
/*---------Exti1 respond------------*/
if(It1 == 1)
{
It1 = 0;
/*-----------接收数据-----------------------*/
rec_rf_data(RxBuf);
temp = 100;
for(tt = 0;tt < 3;tt++)
{
GUI_sprintf_char(8 * tt, 0,num[RxBuf[0] / temp],RED,BLACK);
RxBuf[0] %= temp;
temp /= 10;
}
}
/*---------Exti6 respond------------*/
if(It6 == 1)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -