while(1)
{
printf("t:%d
",t);
if(USART_RX_STA&0x8000)
{
en=USART_RX_STA&0x3fff;//得到此次接收到的数据长度
LCD_Clear(WHITE); //填充白底颜 {MOD}
 
OINT_COLOR=BLACK; //字体颜 {MOD}
TEXT_Buffer[x] = USART_RX_BUF[x];
// LCD_ShowString(x,40,210,24,24,TEXT_Buffer);
x++;
USART_RX_STA = 0;
STMFLASH_Write(FLASH_SAVE_ADDR,(u32*)TEXT_Buffer,SIZE);
STMFLASH_Read(FLASH_SAVE_ADDR,(u32*)datatemp,SIZE);
LCD_ShowString(30,190,200,16,16,datatemp);//显示读到的字符串
}
LED0=!LED0;
delay_ms(1000);
}
如果将
STMFLASH_Write(),和STMFLASH_Read()写到if外面,这样是不是很容易把芯片写毁了,还有F4的芯片,flash可擦出多少次?
一周热门 更多>