refactor(etm): move etm_periph.c to hal component

This commit is contained in:
morris
2025-11-16 22:13:30 +08:00
committed by suda-morris
parent 6c118b39c0
commit a5a355d17f
25 changed files with 104 additions and 75 deletions
@@ -10,15 +10,15 @@
#include "freertos/task.h"
#include "unity.h"
#include "esp_etm.h"
#include "soc/etm_periph.h"
#include "hal/etm_periph.h"
TEST_CASE("etm_channel_install_uninstall", "[etm]")
{
printf("install etm channels exhaustively\r\n");
esp_etm_channel_handle_t etm_chans[SOC_ETM_ATTR(INST_NUM)][SOC_ETM_ATTR(CHANS_PER_INST)];
esp_etm_channel_handle_t etm_chans[ETM_LL_GET(INST_NUM)][ETM_LL_GET(CHANS_PER_INST)];
esp_etm_channel_config_t config = {};
for (int i = 0; i < SOC_ETM_ATTR(INST_NUM); i++) {
for (int j = 0; j < SOC_ETM_ATTR(CHANS_PER_INST); j++) {
for (int i = 0; i < ETM_LL_GET(INST_NUM); i++) {
for (int j = 0; j < ETM_LL_GET(CHANS_PER_INST); j++) {
TEST_ESP_OK(esp_etm_new_channel(&config, &etm_chans[i][j]));
}
TEST_ESP_ERR(ESP_ERR_NOT_FOUND, esp_etm_new_channel(&config, &etm_chans[0][0]));
@@ -30,8 +30,8 @@ TEST_CASE("etm_channel_install_uninstall", "[etm]")
TEST_ESP_ERR(ESP_ERR_INVALID_STATE, esp_etm_del_channel(etm_chans[0][0]));
TEST_ESP_OK(esp_etm_channel_disable(etm_chans[0][0]));
for (int i = 0; i < SOC_ETM_ATTR(INST_NUM); i++) {
for (int j = 0; j < SOC_ETM_ATTR(CHANS_PER_INST); j++) {
for (int i = 0; i < ETM_LL_GET(INST_NUM); i++) {
for (int j = 0; j < ETM_LL_GET(CHANS_PER_INST); j++) {
TEST_ESP_OK(esp_etm_del_channel(etm_chans[i][j]));
}
}