diff --git a/docs/en/api-reference/system/freertos_additions.rst b/docs/en/api-reference/system/freertos_additions.rst index 832baf43b3..a4e8ea8f11 100644 --- a/docs/en/api-reference/system/freertos_additions.rst +++ b/docs/en/api-reference/system/freertos_additions.rst @@ -97,9 +97,9 @@ The following example demonstrates the usage of :cpp:func:`xRingbufferSendAcquir //Retrieve space for DMA descriptor and corresponding data buffer //This has to be done with SendAcquire, or the address may be different when we copy - dma_item_t item; + dma_item_t *item; UBaseType_t res = xRingbufferSendAcquire(buf_handle, - &item, DMA_ITEM_SIZE(buffer_size), pdMS_TO_TICKS(1000)); + (void**) &item, DMA_ITEM_SIZE(buffer_size), pdMS_TO_TICKS(1000)); if (res != pdTRUE) { printf("Failed to acquire memory for item\n"); } @@ -108,7 +108,7 @@ The following example demonstrates the usage of :cpp:func:`xRingbufferSendAcquir .length = buffer_size, .eof = 0, .owner = 1, - .buf = &item->buf, + .buf = item->buf, }; //Actually send to the ring buffer for consumer to use res = xRingbufferSendComplete(buf_handle, &item); diff --git a/docs/zh_CN/api-reference/system/freertos_additions.rst b/docs/zh_CN/api-reference/system/freertos_additions.rst index 0f8db58e71..eb2f0f41b4 100644 --- a/docs/zh_CN/api-reference/system/freertos_additions.rst +++ b/docs/zh_CN/api-reference/system/freertos_additions.rst @@ -97,9 +97,9 @@ ESP-IDF 环形 buffer 是一个典型的 FIFO buffer,支持任意大小的数 //为 DMA 描述符和相应的数据 buffer 检索空间 //此步骤必须通过 SendAcquire 完成,否则,复制时地址可能会不同 - dma_item_t item; + dma_item_t *item; UBaseType_t res = xRingbufferSendAcquire(buf_handle, - &item, DMA_ITEM_SIZE(buffer_size), pdMS_TO_TICKS(1000)); + (void**) &item, DMA_ITEM_SIZE(buffer_size), pdMS_TO_TICKS(1000)); if (res != pdTRUE) { printf("Failed to acquire memory for item\n"); } @@ -108,7 +108,7 @@ ESP-IDF 环形 buffer 是一个典型的 FIFO buffer,支持任意大小的数 .length = buffer_size, .eof = 0, .owner = 1, - .buf = &item->buf, + .buf = item->buf, }; //实际发送到环形 buffer 以供使用 res = xRingbufferSendComplete(buf_handle, &item);