stm32f407探索板spi例子 这条语句怎么会影响串口输出,主函数中也没有printf的命令什么的,如果不屏蔽掉写W25Q128语句打开串口助手,每按一次KEY1串口助手就显示一次显示“fe:fff”,但是屏蔽掉写W25Q128语句后串口就不会输出“fe:fff”了,请问这是为什么。下面是main.c中的代码
const u8 TEXT_Buffer[]={"Explorer STM32F4 SPI TEST"};
#define SIZE sizeof(TEXT_Buffer)
int main(void)
{
u8 key;
u16 i=0;
u8 datatemp[SIZE];
u32 FLASH_SIZE;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
delay_init(168);
uart_init(115200);
LED_Init();
LCD_Init();
KEY_Init();
W25QXX_Init();
POINT_COLOR=RED;
LCD_ShowString(30,50,200,16,16,"Explorer STM32F4");
LCD_ShowString(30,70,200,16,16,"SPI TEST");
LCD_ShowString(30,90,200,16,16,"ATOM@ALIENTEK");
LCD_ShowString(30,110,200,16,16,"2014/5/6");
LCD_ShowString(30,130,200,16,16,"KEY1:Write KEY0:Read");
while(W25QXX_ReadID()!=W25Q128)
{
LCD_ShowString(30,150,200,16,16,"W25Q128 Check Failed!");
delay_ms(500);
LCD_ShowString(30,150,200,16,16,"Please Check! ");
delay_ms(500);
LED0=!LED0;
}
LCD_ShowString(30,150,200,16,16,"W25Q128 Ready!");
FLASH_SIZE=16*1024*1024; //FLASH ′óD¡Îa16×Ö½ú
POINT_COLOR=BLUE;
while(1)
{
key=KEY_Scan(0);
if(key==KEY1_PRES)
{
LCD_Fill(0,170,239,319,WHITE);//Çå3y°ëÆá
LCD_ShowString(30,170,200,16,16,"Start Write W25Q128....");
// W25QXX_Write((u8*)TEXT_Buffer,FLASH_SIZE-100,SIZE);
LCD_ShowString(30,170,200,16,16,"W25Q128 Write Finished!");
}
if(key==KEY0_PRES)
{
LCD_ShowString(30,170,200,16,16,"Start Read W25Q128.... ");
W25QXX_Read(datatemp,FLASH_SIZE-100,SIZE);
LCD_ShowString(30,170,200,16,16,"The Data Readed Is: ");
LCD_ShowString(30,190,200,16,16,datatemp);
}
i++;
delay_ms(10);
if(i==20)
{
LED0=!LED0;//ìáê¾Ïμí3ÕyÔúÔËDD
i=0;
}
}
}
你可以屏蔽掉,就不会输出了
好的 谢谢原子哥的耐心解答
一周热门 更多>