From bc2f2a31003e9a2f50025ed3b33b8f87804fe31d Mon Sep 17 00:00:00 2001 From: liuning Date: Tue, 5 Jul 2022 19:53:35 +0800 Subject: [PATCH] esp_wifi: select slowclk as coex hardware timer source on esp32c2 --- components/esp_rom/esp32c2/ld/esp32c2.rom.ld | 2 +- components/esp_wifi/esp32c2/esp_adapter.c | 2 ++ .../esp_wifi/include/esp_coexist_adapter.h | 20 +++++++------------ components/esp_wifi/lib | 2 +- tools/ci/check_copyright_ignore.txt | 1 - 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld index 73977ee67a..8da65d990b 100644 --- a/components/esp_rom/esp32c2/ld/esp32c2.rom.ld +++ b/components/esp_rom/esp32c2/ld/esp32c2.rom.ld @@ -2195,7 +2195,7 @@ coex_schm_unlock = 0x400021a8; coex_status_get = 0x400021ac; coex_wifi_release = 0x400021b0; esp_coex_ble_conn_dynamic_prio_get = 0x400021b4; -coex_hw_timer_tick_get = 0x400021b8; +/*coex_hw_timer_tick_get = 0x400021b8;*/ /* Data (.data, .bss, .rodata) */ coex_env_ptr = 0x3fcdfabc; coex_pti_tab_ptr = 0x3fcdfab8; diff --git a/components/esp_wifi/esp32c2/esp_adapter.c b/components/esp_wifi/esp32c2/esp_adapter.c index 5fa204d1d2..2b7827683a 100644 --- a/components/esp_wifi/esp32c2/esp_adapter.c +++ b/components/esp_wifi/esp32c2/esp_adapter.c @@ -789,5 +789,7 @@ coex_adapter_funcs_t g_coex_adapter_funcs = { ._malloc_internal = malloc_internal_wrapper, ._free = free, ._esp_timer_get_time = esp_timer_get_time, + ._env_is_chip = env_is_chip_wrapper, + ._slowclk_cal_get = esp_clk_slowclk_cal_get_wrapper, ._magic = COEX_ADAPTER_MAGIC, }; diff --git a/components/esp_wifi/include/esp_coexist_adapter.h b/components/esp_wifi/include/esp_coexist_adapter.h index eaac86d0ce..d36a45ec87 100644 --- a/components/esp_wifi/include/esp_coexist_adapter.h +++ b/components/esp_wifi/include/esp_coexist_adapter.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_COEXIST_ADAPTER_H__ #define __ESP_COEXIST_ADAPTER_H__ @@ -51,6 +43,8 @@ typedef struct { void (* _timer_arm_us)(void *ptimer, uint32_t us, bool repeat); #endif int64_t (* _esp_timer_get_time)(void); + bool (* _env_is_chip)(void); + uint32_t (* _slowclk_cal_get)(void); int32_t _magic; } coex_adapter_funcs_t; diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 4b1daf3775..1cf0524060 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 4b1daf3775bc399296482ef2760f1efe9855e6f1 +Subproject commit 1cf0524060df61fc67d1f5527775cc2956050791 diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index dd57bf50bf..a6dff96f71 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -674,7 +674,6 @@ components/esp_system/ubsan.c components/esp_timer/test/test_esp_timer.c components/esp_timer/test/test_esp_timer_light_sleep.c components/esp_timer/test/test_ets_timer.c -components/esp_wifi/include/esp_coexist_adapter.h components/esp_wifi/include/esp_mesh_internal.h components/esp_wifi/include/esp_private/esp_wifi_types_private.h components/esp_wifi/include/esp_private/wifi_types.h