本帖最后由 123456wm 于 2012-5-2 19:32 编辑
- while (TxIdx < BufferSize)
- {
- /* Wait for SPIy Tx buffer empty */
- while (SPI_I2S_GetFlagStatus(SPIy, SPI_I2S_FLAG_TXE) == RESET);
- /* Send SPIz data */
- SPI_I2S_SendData(SPIz, SPIz_Buffer_Tx[TxIdx]); //为什么不用判断SPIz的SPI_I2S_FLAG_TXE为空
- /* Send SPIy data */
- SPI_I2S_SendData(SPIy, SPIy_Buffer_Tx[TxIdx++]);
- /* Wait for SPIz data reception */
- while (SPI_I2S_GetFlagStatus(SPIz, SPI_I2S_FLAG_RXNE) == RESET);
- /* Read SPIz received data */
- SPIz_Buffer_Rx[RxIdx] = SPI_I2S_ReceiveData(SPIz);
- /* Wait for SPIy data reception */
- while (SPI_I2S_GetFlagStatus(SPIy, SPI_I2S_FLAG_RXNE) == RESET);
- /* Read SPIy received data */
- SPIy_Buffer_Rx[RxIdx++] = SPI_I2S_ReceiveData(SPIy);
- }
|