在提供的xsips.c文件中有这样一句代码:
* Clear the RX FIFO and drop any data.*/
Check = (XSpiPs_ReadReg(InstancePtr->Config.BaseAddress,
XSPIPS_SR_OFFSET) & XSPIPS_IXR_RXNEMPTY_MASK);
while (Check != (u32)0U) {
Temp = (u8)XSpiPs_RecvByte(InstancePtr->Config.BaseAddress);
if(Temp != (u8)0U){
}
Check = (XSpiPs_ReadReg(InstancePtr->Config.BaseAddress,
XSPIPS_SR_OFFSET) & XSPIPS_IXR_RXNEMPTY_MASK);
}就是读取地址为0xe000_6004的寄存器的fifo中的数据数目 1: FIFO has more than or equal to THRESHOLDentries
0: FIFO has less than RX THRESHOLD entries。下面的一句代码就有意思了,while (Check != (u32)0U)这是在有比阈值多或者相等的情况下一直执行吗?程序不就一直卡在这里了吗?这里是不是应该改成 if(Check != (u32)0U),还是说SDK中的程序也是并行执行的?不会吧