mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
Merge branch 'bugfix/async_crc_timeout_v6.1' into 'release/v6.1'
fix(async_crc): limit blocking timeout support (v6.1) See merge request espressif/esp-idf!49242
This commit is contained in:
@@ -100,6 +100,7 @@ First, you need to install the Async CRC driver. The driver supports both AHB-GD
|
||||
When creating a driver instance, you need to configure:
|
||||
|
||||
- **backlog**: Maximum number of pending CRC requests that can be queued. Higher values use more memory but provide better throughput for bursty workloads.
|
||||
- **intr_priority**: DMA interrupt priority. Set to ``0`` to use the default low/medium priority, or set a non-zero value to request a specific interrupt priority.
|
||||
- **dma_burst_size**: DMA transfer burst size in bytes.
|
||||
|
||||
The driver handle ``crc_hdl`` is an opaque pointer that you use for all subsequent operations.
|
||||
@@ -161,15 +162,12 @@ For simpler use cases or when async operations are not required, use the blockin
|
||||
const char *data = "Hello, World!";
|
||||
size_t data_len = strlen(data);
|
||||
|
||||
// Blocking CRC with 1000ms timeout
|
||||
ESP_ERROR_CHECK(esp_crc_calc_blocking(crc_hdl, data, data_len, ¶ms, 1000, &crc_result));
|
||||
// Blocking CRC, wait indefinitely
|
||||
ESP_ERROR_CHECK(esp_crc_calc_blocking(crc_hdl, data, data_len, ¶ms, -1, &crc_result));
|
||||
|
||||
printf("CRC result: 0x%08X\n", crc_result);
|
||||
|
||||
The blocking API supports:
|
||||
|
||||
- **timeout_ms >= 0**: Wait for specified milliseconds
|
||||
- **timeout_ms < 0**: Wait indefinitely
|
||||
The blocking API only supports ``timeout_ms = -1``, which means waiting indefinitely until the CRC calculation completes.
|
||||
|
||||
Uninstalling the Driver
|
||||
------------------------
|
||||
|
||||
Reference in New Issue
Block a user