mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
fix(esp_hw_support): use iterator for regdma_link_stats to save stack consume
Closes https://github.com/espressif/esp-idf/issues/13288
This commit is contained in:
parent
58a9d0e27b
commit
f5f020f6e7
@ -445,9 +445,22 @@ static void regdma_link_update_stats_wrapper(void *link, int entry, int depth)
|
||||
regdma_link_update_stats(regdma_link_get_stats(link), entry, depth);
|
||||
}
|
||||
|
||||
static void regdma_link_iterator(void *link, int entry, void (*hook)(void *, int, int))
|
||||
{
|
||||
assert(entry < REGDMA_LINK_ENTRY_NUM);
|
||||
|
||||
int iter = 0;
|
||||
while (link) {
|
||||
if (hook) {
|
||||
(*hook)(link, entry, iter++);
|
||||
}
|
||||
link = regdma_link_get_next(link, entry);
|
||||
}
|
||||
}
|
||||
|
||||
void regdma_link_stats(void *link, int entry)
|
||||
{
|
||||
regdma_link_recursive_impl(link, entry, 0, regdma_link_update_stats_wrapper);
|
||||
regdma_link_iterator(link, entry, regdma_link_update_stats_wrapper);
|
||||
}
|
||||
|
||||
static void regdma_link_destroy_wrapper(void *link, int entry, int depth)
|
||||
|
Loading…
Reference in New Issue
Block a user