mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
refactor(gdma): pass channel count to retention test helper
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "esp_private/sleep_retention.h"
|
||||
#include "hal/gdma_ll.h"
|
||||
|
||||
void test_gdma_trigger_retention_backup(gdma_channel_handle_t chan, ...)
|
||||
void test_gdma_trigger_retention_backup(size_t chan_num, ...)
|
||||
{
|
||||
#if SOC_PAU_SUPPORTED && SOC_GDMA_SUPPORT_SLEEP_RETENTION
|
||||
// trigger a software retention to test GDMA retention correctnesss
|
||||
@@ -18,14 +18,13 @@ void test_gdma_trigger_retention_backup(gdma_channel_handle_t chan, ...)
|
||||
sleep_retention_do_extra_retention(true);
|
||||
|
||||
// 2. reset gdma registers to default value
|
||||
gdma_channel_handle_t chan_itor = chan;
|
||||
va_list args;
|
||||
int group_id = -1;
|
||||
va_start(args, chan);
|
||||
while (chan_itor) {
|
||||
gdma_get_group_channel_id(chan_itor, &group_id, NULL);
|
||||
va_start(args, chan_num);
|
||||
for (size_t i = 0; i < chan_num; i++) {
|
||||
gdma_channel_handle_t chan = va_arg(args, gdma_channel_handle_t);
|
||||
gdma_get_group_channel_id(chan, &group_id, NULL);
|
||||
_gdma_ll_reset_register(group_id);
|
||||
chan_itor = va_arg(args, gdma_channel_handle_t);
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include "sdkconfig.h"
|
||||
#include "esp_private/gdma.h"
|
||||
|
||||
@@ -28,10 +29,10 @@ extern "C" {
|
||||
*
|
||||
* @note Call this help function after the gdma set up is completed. Then check the gdma functionality is still working.
|
||||
*
|
||||
* @param chan GDMA channel handle to be reset
|
||||
* @param ... Other GDMA channel handle if any
|
||||
* @param chan_num Number of GDMA channel handles
|
||||
* @param ... GDMA channel handles to be reset
|
||||
*/
|
||||
void test_gdma_trigger_retention_backup(gdma_channel_handle_t chan, ...);
|
||||
void test_gdma_trigger_retention_backup(size_t chan_num, ...);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ static void test_gdma_m2m_transaction(gdma_channel_handle_t tx_chan, gdma_channe
|
||||
TEST_ESP_OK(gdma_link_mount_buffers(rx_link_list, 0, &rx_buf_mount_config, 1, NULL));
|
||||
|
||||
if (trig_retention_backup) {
|
||||
test_gdma_trigger_retention_backup(tx_chan, rx_chan);
|
||||
test_gdma_trigger_retention_backup(2, tx_chan, rx_chan);
|
||||
}
|
||||
|
||||
TEST_ESP_OK(gdma_start(rx_chan, gdma_link_get_head_addr(rx_link_list)));
|
||||
|
||||
Reference in New Issue
Block a user