这是main函数
#include "sys.h"
#include "delay.h"
#include "usart.h"
#include "led.h"
#include "lcd.h"
#include "key.h"
#include "w25qxx.h"
#include "ff.h"
//ALIENTEK ì½Ë÷ÕßSTM32F407¿a·¢°å êμÑé25
//SPIí¨DŽó¿úêμÑé-¿aoˉêy°æ±¾
//¼¼êõÖ§3Ö£o
www.openedv.com
//ìÔ±|μêÆì£ohttp://eboard.taobao.com
//1ãÖYêDDÇòíμç×ó¿Æ¼¼óDÏT1«Ë¾
//×÷ÕߣoÕyμãÔ-×ó @ALIENTEK
//òaD′èëμ½W25Q16μÄ×Ö·û′®êy×é
const u8 TEXT_Buffer[]={"Explorer STM32F4 SPI TEST"};
#define SIZE sizeof(TEXT_Buffer)
u16 i=0;
int main(void)
{
u8 key;
u16 i=0;
u8 datatemp[SIZE];
u32 FLASH_SIZE;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//éèÖÃÏμí3ÖD¶ÏóÅÏ輶·Ö×é2
delay_init(168); //3õê¼»ˉÑóê±oˉêy
uart_init(115200); //3õê¼»ˉ′®¿ú2¨ìØÂêÎa115200
LED_Init(); //3õê¼»ˉLED
LCD_Init(); //LCD3õê¼»ˉ
KEY_Init(); //°′¼ü3õê¼»ˉ
W25QXX_Init(); //W25QXX3õê¼»ˉ
id=W25QXX_ReadID();
printf("%X
",id);
W25QXX_Write((u8*)TEXT_Buffer,FLASH_SIZE-100,SIZE); //′óμ1êyμú100¸öμØÖ·′|¿aê¼,D′èëSIZE3¤¶èμÄêy¾Y
delay_ms(100);
W25QXX_Read(datatemp,FLASH_SIZE-100,SIZE); //′óμ1êyμú100¸öμØÖ·′|¿aê¼,¶á3öSIZE¸ö×Ö½ú
printf("%s
",datatemp);
while(1)
{
}
}
不知为何printf没东西
一周热门 更多>