fix(coex): fix esp32c5 coexist hw timer issue

This commit is contained in:
liuning
2024-10-11 15:53:55 +08:00
committed by BOT
parent 3b8bd7b608
commit 18f959623c
6 changed files with 32 additions and 1 deletions

View File

@@ -152,6 +152,11 @@ static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
#endif #endif
} }
static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void)
{
return rtc_clk_xtal_freq_get();
}
coex_adapter_funcs_t g_coex_adapter_funcs = { coex_adapter_funcs_t g_coex_adapter_funcs = {
._version = COEX_ADAPTER_VERSION, ._version = COEX_ADAPTER_VERSION,
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
@@ -172,5 +177,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper,
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper,
._magic = COEX_ADAPTER_MAGIC, ._magic = COEX_ADAPTER_MAGIC,
}; };

View File

@@ -151,6 +151,11 @@ static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
#endif #endif
} }
static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void)
{
return rtc_clk_xtal_freq_get();
}
coex_adapter_funcs_t g_coex_adapter_funcs = { coex_adapter_funcs_t g_coex_adapter_funcs = {
._version = COEX_ADAPTER_VERSION, ._version = COEX_ADAPTER_VERSION,
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
@@ -170,5 +175,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper,
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper,
._magic = COEX_ADAPTER_MAGIC, ._magic = COEX_ADAPTER_MAGIC,
}; };

View File

@@ -152,6 +152,11 @@ static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
#endif #endif
} }
static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void)
{
return rtc_clk_xtal_freq_get();
}
coex_adapter_funcs_t g_coex_adapter_funcs = { coex_adapter_funcs_t g_coex_adapter_funcs = {
._version = COEX_ADAPTER_VERSION, ._version = COEX_ADAPTER_VERSION,
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
@@ -171,5 +176,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper,
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper,
._magic = COEX_ADAPTER_MAGIC, ._magic = COEX_ADAPTER_MAGIC,
}; };

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -152,6 +152,11 @@ static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
#endif #endif
} }
static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void)
{
return rtc_clk_xtal_freq_get();
}
coex_adapter_funcs_t g_coex_adapter_funcs = { coex_adapter_funcs_t g_coex_adapter_funcs = {
._version = COEX_ADAPTER_VERSION, ._version = COEX_ADAPTER_VERSION,
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
@@ -171,5 +176,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper,
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper,
._magic = COEX_ADAPTER_MAGIC, ._magic = COEX_ADAPTER_MAGIC,
}; };

View File

@@ -144,6 +144,11 @@ static int esp_coexist_debug_matrix_init_wrapper(int evt, int sig, bool rev)
#endif #endif
} }
static IRAM_ATTR int esp_coex_common_xtal_freq_get_wrapper(void)
{
return rtc_clk_xtal_freq_get();
}
coex_adapter_funcs_t g_coex_adapter_funcs = { coex_adapter_funcs_t g_coex_adapter_funcs = {
._version = COEX_ADAPTER_VERSION, ._version = COEX_ADAPTER_VERSION,
._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper, ._task_yield_from_isr = esp_coex_common_task_yield_from_isr_wrapper,
@@ -163,5 +168,6 @@ coex_adapter_funcs_t g_coex_adapter_funcs = {
._timer_setfn = esp_coex_common_timer_setfn_wrapper, ._timer_setfn = esp_coex_common_timer_setfn_wrapper,
._timer_arm_us = esp_coex_common_timer_arm_us_wrapper, ._timer_arm_us = esp_coex_common_timer_arm_us_wrapper,
._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper, ._debug_matrix_init = esp_coexist_debug_matrix_init_wrapper,
._xtal_freq_get = esp_coex_common_xtal_freq_get_wrapper,
._magic = COEX_ADAPTER_MAGIC, ._magic = COEX_ADAPTER_MAGIC,
}; };

View File

@@ -47,6 +47,7 @@ typedef struct {
void (* _timer_setfn)(void *ptimer, void *pfunction, void *parg); void (* _timer_setfn)(void *ptimer, void *pfunction, void *parg);
void (* _timer_arm_us)(void *ptimer, uint32_t us, bool repeat); void (* _timer_arm_us)(void *ptimer, uint32_t us, bool repeat);
int (* _debug_matrix_init)(int event, int signal, bool rev); int (* _debug_matrix_init)(int event, int signal, bool rev);
int (* _xtal_freq_get)(void);
int32_t _magic; int32_t _magic;
} coex_adapter_funcs_t; } coex_adapter_funcs_t;