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.

i2s buf的初始化导致设备无法被连接上

你好,碰到一个很奇怪的问题,

协议栈 3.20  multi_role 例程

使用手机 nrf connect连接2640r2

    I2S_init();
.....//中间略去
    uint8_t k;
    /* Half the transactions are initially stored in the read queue */
    for(k = 0; k < NUMBUFS/2; k++) {
        I2S_Transaction_init(i2sTransactionList[k]);
        i2sTransactionList[k]->bufPtr  = i2sBufList[k];
        i2sTransactionList[k]->bufSize = BUFSIZE;
        List_put(&i2sReadList, (List_Elem*)i2sTransactionList[k]);
    }
    /* The second half of the transactions is stored in the write queue */
    for(k = NUMBUFS/2; k < NUMBUFS; k++) {
        I2S_Transaction_init(i2sTransactionList[k]);
        i2sTransactionList[k]->bufPtr  = i2sBufList[k];
        i2sTransactionList[k]->bufSize = BUFSIZE;
        List_put(&i2sWriteList, (List_Elem*)i2sTransactionList[k]);
    }
    I2S_setReadQueueHead(i2sHandle,  (I2S_Transaction*) List_head(&i2sReadList));
    I2S_setWriteQueueHead(i2sHandle, (I2S_Transaction*) List_head(&i2sWriteList));
问题出在加粗的部分,去掉加粗的部分,连接正常,否则软件一直转圈无法连接。
程序运行正常!
非常感谢。