Merge branch 'bugfix/async_crc_timeout' into 'master'

fix(async_crc): limit blocking timeout support

See merge request espressif/esp-idf!49226
This commit is contained in:
morris
2026-06-03 18:59:44 +08:00
5 changed files with 21 additions and 33 deletions

View File

@@ -100,6 +100,7 @@
创建驱动程序实例时,您需要配置:
- **backlog**:可排队等待的最大 CRC 请求数。较高的值使用更多内存,但在突发工作负载下提供更好的吞吐量。
- **intr_priority**DMA 中断优先级。设置为 ``0`` 时使用默认的低/中优先级;设置为非零值时请求指定的中断优先级。
- **dma_burst_size**DMA 传输突发大小(字节)。
驱动程序句柄 ``crc_hdl`` 是一个不透明指针,用于所有后续操作。
@@ -161,15 +162,12 @@ CRC 计算完成时会在中断上下文中调用回调函数。回调接收:
const char *data = "Hello, World!";
size_t data_len = strlen(data);
// 阻塞 CRC1000ms 超时
ESP_ERROR_CHECK(esp_crc_calc_blocking(crc_hdl, data, data_len, &params, 1000, &crc_result));
// 阻塞 CRC无限期等待
ESP_ERROR_CHECK(esp_crc_calc_blocking(crc_hdl, data, data_len, &params, -1, &crc_result));
printf("CRC 结果: 0x%08X\n", crc_result);
阻塞 API 支持
- **timeout_ms >= 0**:等待指定的毫秒数
- **timeout_ms < 0**:无限期等待
阻塞 API 支持 ``timeout_ms = -1``,表示无限期等待直到 CRC 计算完成。
卸载驱动程序
------------