//Select the FLASH: Chip Select low
SPI_FLASH_CS_LOW();
//Send "Read Status Register" instruction
SPI_FLASH_SendByte(0x05);
//Loop as long as the memory is busy with a write cycle
do
{
//Send a dummy byte to generate the clock needed by the FLASH
//and put the value of the status register in FLASH_Status variable
flashstatus = SPI_FLASH_SendByte(DUMMY_BYTE);
}
while ((flashstatus & WIP_FLAG) == SET); //Write in progress
//Deselect the FLASH: Chip Select high
SPI_FLASH_CS_HIGH();
}
调了两天了快,不知道什么原因