Hello, I am testing the following function.
When calling this function continuously, it may freeze for waiting to receive.
This problem is solved to put "Dummy data transmission" just before "Flush receive FIFO", or remove "Flush receive FIFO" itself.
Does anyone know why?
void Sample( uint8_t *pData ) { uint32_t Buf; uint32_t i; SSIDataPut( SSI0_BASE, 0x00 ); //Send dummy data while( SSIDataGetNonBlocking( SSI0_BASE, &Buf ) != 0 ); //Flush receive FIFO for( i = 0; i < 64; i++ ) { SSIDataPut( SSI0_BASE, 0x00 ); //Send dummy data SSIDataGet( SSI0_BASE, &Buf ); //Receive data *(pData++) = ( uint8_t )( Buf & 0x000000FF ); //Store data to pointer } }