//读状态寄存器
unsigned char FlashRdSr()
{
unsigned char ucRet;
FLASH_nCS_L;
SpiSend(RDSR);
ucRet=SpiRecv();
FLASH_nCS_H;
return ucRet;
}
bit FlashIfBusy()
{
unsigned char ucTmp=0;
ucTmp=FlashRdSr();
//Uart1SendByte(0xae);
//Uart1SendByte(ucTmp);
//Uart1SendByte(0xaf);
return (( ucTmp& 0x01) == 0x01) ? 1 : 0;
}
void FlashWaitIfBusy()
{
unsigned long i=0;
while(FlashIfBusy())
{
i++;
if(i>FLASH_TIMEOUT)
{
Uart1SendByte(0xae);
break;//超时也要退出
}
}
}
可能是什么原因呢,芯片是W25Q32FV |