求教关于SSIDataPut()与SSIDataGet()这两条指令的执行的问题,SSIDataGet()这条函数如果未使用SSI模块的中断,若接收FIFO中没有数据是否会停在此处导致MCU无法执行其它任务呢?SSIDataPut()这条指令是否会产生同样的问题呢?谢谢各位了先!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
求教关于SSIDataPut()与SSIDataGet()这两条指令的执行的问题,SSIDataGet()这条函数如果未使用SSI模块的中断,若接收FIFO中没有数据是否会停在此处导致MCU无法执行其它任务呢?SSIDataPut()这条指令是否会产生同样的问题呢?谢谢各位了先!
hongyue,
如果FIFO没有数据,则CPU会停留在这个函数中,直到FIFO有数据。你可以看一下这个函数的源码:
SSIDataGet(unsigned long ulBase, unsigned long *pulData)
{ // Check the arguments.
ASSERT(SSIBaseValid(ulBase));
// Wait until there is data to be read.
while(!(HWREG(ulBase + SSI_O_SR) & SSI_SR_RNE)) { }
SSIDataPut也有同样的问题。
但是API库中也有类似的函数不带这个block功能的,即SSIDataPutNonBlocking, SSIDataGetNonBlocking.
Eric