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.

[参考译文] TMS320F28388D:文件:usbringbuf.c 函数:USBRingBufWrite

Guru**** 2616675 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/928762/tms320f28388d-file-usbringbuf-c-function-usbringbufwrite

器件型号:TMS320F28388D

您好!

我认为这是一个问题、数据总是被写入

psUSBRingBuf->pui8Buf[psUSBRingBuf->ui32WriteIndex]

//
//将数据写入环形缓冲区。
//
for (ui32Temp = 0;ui32Temp < ui32Length;ui32Temp++)
{

//
//写入数据字节。
//
psUSBRingBuf->pui8Buf[psUSBRingBuf->ui32WriteIndex]=
pui8Data[ui32Temp];
} 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Peter:

    是的、这是一个问题。 在 C200Ware 的未来版本中、将提出缺陷并修复缺陷。

    索引必须在复制期间递增。 但是,根据此代码,来自源缓冲区的数据总是被写入具有索引"psUSBRingBuf->ui32WriteIndex"的同一目标缓冲区单元中,因为此索引在复制期间不会递增。

    此致

    Siddharth