Hi
I have a function writeCallbackFxn (below) from the I2S, it states that I should not you the I2S_stopwrite() function, is this correct and if so what's the best way to handle the call back.
static void writeCallbackFxn(I2S_Handle handle, int_fast16_t status, I2S_Transaction *transactionPtr) { // Nothing to do here: the buffer(s) are queued in a ring list, the transfers are // executed without any action from the application. // We must consider the previous transaction (ok, when you have only one transaction it's the same) I2S_Transaction *transactionFinished = (I2S_Transaction*)List_prev(&transactionPtr->queueElement); if(transactionFinished != NULL){ // After an arbitrary number of completion of the transaction, we will stop writting if(no_of_repetition == NULL){ } else if(no_of_repetition != NULL){ if(transactionFinished->numberOfCompletions >= no_of_repetition) { // Note: You cannot use I2S_stopRead() / I2S_stopWrite() in the callback. // The execution of these functions is potentially blocking and can mess up the // system. writeFinished = (bool)true; I2S_stopWrite(i2sHandle); I2S_stopClocks(i2sHandle); } } }
Kind Regards
David