mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'doc/ringbuffer_v5.3' into 'release/v5.3'
docs(esp_ringbuf): Corrected example code block (v5.3) See merge request espressif/esp-idf!30631
This commit is contained in:
commit
c19e762c89
@ -97,9 +97,9 @@ The following example demonstrates the usage of :cpp:func:`xRingbufferSendAcquir
|
|||||||
|
|
||||||
//Retrieve space for DMA descriptor and corresponding data buffer
|
//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
|
//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,
|
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) {
|
if (res != pdTRUE) {
|
||||||
printf("Failed to acquire memory for item\n");
|
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,
|
.length = buffer_size,
|
||||||
.eof = 0,
|
.eof = 0,
|
||||||
.owner = 1,
|
.owner = 1,
|
||||||
.buf = &item->buf,
|
.buf = item->buf,
|
||||||
};
|
};
|
||||||
//Actually send to the ring buffer for consumer to use
|
//Actually send to the ring buffer for consumer to use
|
||||||
res = xRingbufferSendComplete(buf_handle, &item);
|
res = xRingbufferSendComplete(buf_handle, &item);
|
||||||
|
@ -97,9 +97,9 @@ ESP-IDF 环形 buffer 是一个典型的 FIFO buffer,支持任意大小的数
|
|||||||
|
|
||||||
//为 DMA 描述符和相应的数据 buffer 检索空间
|
//为 DMA 描述符和相应的数据 buffer 检索空间
|
||||||
//此步骤必须通过 SendAcquire 完成,否则,复制时地址可能会不同
|
//此步骤必须通过 SendAcquire 完成,否则,复制时地址可能会不同
|
||||||
dma_item_t item;
|
dma_item_t *item;
|
||||||
UBaseType_t res = xRingbufferSendAcquire(buf_handle,
|
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) {
|
if (res != pdTRUE) {
|
||||||
printf("Failed to acquire memory for item\n");
|
printf("Failed to acquire memory for item\n");
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ ESP-IDF 环形 buffer 是一个典型的 FIFO buffer,支持任意大小的数
|
|||||||
.length = buffer_size,
|
.length = buffer_size,
|
||||||
.eof = 0,
|
.eof = 0,
|
||||||
.owner = 1,
|
.owner = 1,
|
||||||
.buf = &item->buf,
|
.buf = item->buf,
|
||||||
};
|
};
|
||||||
//实际发送到环形 buffer 以供使用
|
//实际发送到环形 buffer 以供使用
|
||||||
res = xRingbufferSendComplete(buf_handle, &item);
|
res = xRingbufferSendComplete(buf_handle, &item);
|
||||||
|
Loading…
Reference in New Issue
Block a user