初级会员
- 积分
- 114
- 金钱
- 114
- 注册时间
- 2015-1-13
- 在线时间
- 8 小时
|
楼主 |
发表于 2016-1-10 22:33:16
|
显示全部楼层
本帖最后由 dogwaves 于 2016-1-10 22:34 编辑
#include "sys.h"
#include "usart.h"
#include "delay.h"
#include "led.h"
#include "key.h"
#include "exti.h"
#include "wdg.h"
#include "timer.h"
#include "lcd.h"
#include "usmart.h"
#include "rtc.h"
#include "wkup.h"
#include "dma.h"
#include "24cxx.h"
#include "flash.h"
#include "touch.h"
#include "malloc.h"
#include "string.h"
#include "mmc_sd.h"
#include "ff.h"
#include "exfuns.h"
#include "fontupd.h"
#include "text.h"
#include "usart2.h"
#include "usart3.h"
#include "common.h"
#include "sim900a.h"
int main(void)
{
u8 key,fontok=0,i=5;
Stm32_Clock_Init(9); //Ïμí3ê±ÖóéèÖÃ
delay_init(72); //Ñóê±3õê¼»ˉ
uart_init(72,115200); //′®¿ú13õê¼»ˉ
usart3_init(36,115200); //′®¿ú33õê¼»ˉ
LCD_Init(); //3õê¼»ˉòo¾§
LED_Init(); //LED3õê¼»ˉ
KEY_Init(); //°′¼ü3õê¼»ˉ
usmart_dev.init(72); //usmart3õê¼»ˉ
USART2_Init(36,115200); //3õê¼»ˉ′®¿ú2
TP_Init(); //3õê¼»ˉ′¥ÃtÆá
mem_init(SRAMIN); //3õê¼»ˉÄú2¿Äú′æ3Ø
exfuns_init(); //ÎafatfsÏà1رäá¿éêÇëÄú′æ
f_mount(0,fs[0]); //1òÔØSD¿¨
key=KEY_Scan(0);
if(key==KEY_RIGHT) //Ç¿ÖÆD£×¼
{
LCD_Clear(WHITE); //ÇåÆá
TP_Adjust(); //ÆáÄ»D£×¼
TP_Save_Adjdata();
LCD_Clear(WHITE); //ÇåÆá
}
fontok=font_init(); //¼ì2é×Ö¿aêÇ·ñOK
if(fontok||key==KEY_DOWN)//Dèòa¸üDÂ×Ö¿a
{
LCD_Clear(WHITE); //ÇåÆá
POINT_COLOR=RED; //éèÖÃ×ÖìåÎaoìé«
LCD_ShowString(60,50,200,16,16,"ALIENTEK STM32");
while(SD_Initialize()) //¼ì2aSD¿¨
{
LCD_ShowString(60,70,200,16,16,"SD Card Failed!");
delay_ms(200);
LCD_Fill(60,70,200+60,70+16,WHITE);
delay_ms(200);
}
LCD_ShowString(60,70,200,16,16,"SD Card OK");
LCD_ShowString(60,90,200,16,16,"Font Updating...");
key=update_font(20,110,16,0);//′óSD¿¨¸üDÂ
while(key)//¸üDÂ꧰ü
{
LCD_ShowString(60,110,200,16,16,"Font Update Failed!");
delay_ms(200);
LCD_Fill(20,110,200+20,110+16,WHITE);
delay_ms(200);
}
LCD_ShowString(60,110,200,16,16,"Font Update Success!");
delay_ms(1500);
LCD_Clear(WHITE);//ÇåÆá
}
///////////////// ESP 2aêÔ //////////////////////
LCD_ShowString(60,90,200,16,16,"WIFI Updating...");
while(atk_8266_send_cmd("AT","OK",200))//¼ì2éWIFIÄ£¿éêÇ·ñÔúÏß
{
atk_8266_quit_trans();//íË3öí¸′«
printf("wifi\r\n");
atk_8266_send_cmd("AT+CIPMODE=0","OK",200); //1رÕí¸′«Ä£ê½
delay_ms(800);
}
while(atk_8266_send_cmd("ATE0","OK",200));//1رջØÏÔ
delay_ms(10);
atk_8266_at_response(1);//¼ì2éATK-ESP8266Ä£¿é·¢Ëí1yà′μÄêy¾Y,¼°ê±éÏ′«¸øμçÄÔ
while(i--)
{delay_ms(500);
printf("test1\r\n");
}
///////////////////////// ////////////////////////////////////
sim900a_test();
}
|
|