Skip to content

Commit

Permalink
Merge branch 'doc/ringbuffer' into 'master'
Browse files Browse the repository at this point in the history
docs(esp_ringbuf): Corrected example code block

Closes IDFGH-12748

See merge request espressif/esp-idf!30610
  • Loading branch information
0xjakob committed May 6, 2024
2 parents ade6a5e + 7100c6c commit 7f05633
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/en/api-reference/system/freertos_additions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions docs/zh_CN/api-reference/system/freertos_additions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -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);
Expand Down

0 comments on commit 7f05633

Please sign in to comment.