global: Uses CCOUNT API instead of XTHAL macro

This commit is contained in:
KonstantinKondrashov
2021-01-11 21:03:45 +08:00
parent cee0e17b7f
commit dada7cd035
27 changed files with 78 additions and 47 deletions

View File

@@ -29,14 +29,13 @@
#include "soc/cpu.h"
#include "soc/dport_reg.h"
#include "soc/spi_periph.h"
#include "hal/cpu_hal.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"
#include "xtensa/core-macros.h"
#include "sdkconfig.h"
#ifndef CONFIG_FREERTOS_UNICORE
@@ -78,7 +77,7 @@ void IRAM_ATTR esp_dport_access_stall_other_cpu_start(void)
int cpu_id = xPortGetCoreID();
#ifdef DPORT_ACCESS_BENCHMARK
ccount_start[cpu_id] = XTHAL_GET_CCOUNT();
ccount_start[cpu_id] = cpu_hal_get_cycle_count();
#endif
if (dport_access_ref[cpu_id] == 0) {
@@ -135,7 +134,7 @@ void IRAM_ATTR esp_dport_access_stall_other_cpu_end(void)
}
#ifdef DPORT_ACCESS_BENCHMARK
ccount_end[cpu_id] = XTHAL_GET_CCOUNT();
ccount_end[cpu_id] = cpu_hal_get_cycle_count();
ccount_margin[cpu_id][ccount_margin_cnt] = ccount_end[cpu_id] - ccount_start[cpu_id];
ccount_margin_cnt = (ccount_margin_cnt + 1)&(DPORT_ACCESS_BENCHMARK_STORE_NUM - 1);
#endif