forked from espressif/esp-idf
component/bt : wifi/bt software coexist option
1. option of sw coexist 2. cpu set freq function modify 3. update lib 4. ld add static data address
This commit is contained in:
Submodule components/bt/lib updated: 5349ca3634...a0f2d0a961
@@ -38,6 +38,14 @@ config ESP32_ENABLE_STACK_BT
|
|||||||
# bool "None"
|
# bool "None"
|
||||||
#endchoice
|
#endchoice
|
||||||
|
|
||||||
|
config SW_COEXIST_ENABLE
|
||||||
|
bool "Software do control of wifi/bt coexisit"
|
||||||
|
depends on ESP32_ENABLE_STACK_BT && ESP32_ENABLE_STACK_WIFI
|
||||||
|
default "n"
|
||||||
|
help
|
||||||
|
Software do something control of wifi/bt coexist. For some heavy traffic senario,
|
||||||
|
do sotware coexist, may be better.
|
||||||
|
|
||||||
config MEMMAP_BT
|
config MEMMAP_BT
|
||||||
bool
|
bool
|
||||||
depends on ESP32_ENABLE_STACK_BT
|
depends on ESP32_ENABLE_STACK_BT
|
||||||
|
@@ -33,8 +33,8 @@ typedef enum{
|
|||||||
extern void phy_get_romfunc_addr();
|
extern void phy_get_romfunc_addr();
|
||||||
|
|
||||||
// TODO: these functions need to be moved from librtc to ESP-IDF
|
// TODO: these functions need to be moved from librtc to ESP-IDF
|
||||||
extern void rtc_init_lite();
|
extern void rtc_init_lite(xtal_freq_t xtal_freq);
|
||||||
extern void rtc_set_cpu_freq(xtal_freq_t xtal_freq, cpu_freq_t cpu_freq);
|
extern void rtc_set_cpu_freq(cpu_freq_t cpu_freq);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is not exposed as an API at this point,
|
* This function is not exposed as an API at this point,
|
||||||
@@ -52,7 +52,7 @@ void esp_set_cpu_freq(void)
|
|||||||
// wait uart tx finish, otherwise some uart output will be lost
|
// wait uart tx finish, otherwise some uart output will be lost
|
||||||
uart_tx_wait_idle(0);
|
uart_tx_wait_idle(0);
|
||||||
|
|
||||||
rtc_init_lite();
|
rtc_init_lite(XTAL_AUTO);
|
||||||
cpu_freq_t freq = CPU_80M;
|
cpu_freq_t freq = CPU_80M;
|
||||||
switch(freq_mhz) {
|
switch(freq_mhz) {
|
||||||
case 240:
|
case 240:
|
||||||
@@ -73,7 +73,7 @@ void esp_set_cpu_freq(void)
|
|||||||
// wait uart tx finish, otherwise some uart output will be lost
|
// wait uart tx finish, otherwise some uart output will be lost
|
||||||
uart_tx_wait_idle(0);
|
uart_tx_wait_idle(0);
|
||||||
|
|
||||||
rtc_set_cpu_freq(XTAL_AUTO, freq);
|
rtc_set_cpu_freq(freq);
|
||||||
ets_update_cpu_frequency(freq_mhz);
|
ets_update_cpu_frequency(freq_mhz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -51,6 +51,7 @@
|
|||||||
#include "esp_int_wdt.h"
|
#include "esp_int_wdt.h"
|
||||||
#include "esp_task_wdt.h"
|
#include "esp_task_wdt.h"
|
||||||
#include "esp_phy_init.h"
|
#include "esp_phy_init.h"
|
||||||
|
#include "esp_coexist.h"
|
||||||
#include "trax.h"
|
#include "trax.h"
|
||||||
|
|
||||||
void start_cpu0(void) __attribute__((weak, alias("start_cpu0_default")));
|
void start_cpu0(void) __attribute__((weak, alias("start_cpu0_default")));
|
||||||
@@ -194,6 +195,12 @@ void start_cpu0_default(void)
|
|||||||
do_phy_init();
|
do_phy_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if CONFIG_SW_COEXIST_ENABLE
|
||||||
|
if (coexist_init() == ESP_OK) {
|
||||||
|
coexist_set_enable(true);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
xTaskCreatePinnedToCore(&main_task, "main",
|
xTaskCreatePinnedToCore(&main_task, "main",
|
||||||
ESP_TASK_MAIN_STACK, NULL,
|
ESP_TASK_MAIN_STACK, NULL,
|
||||||
ESP_TASK_MAIN_PRIO, NULL, 0);
|
ESP_TASK_MAIN_PRIO, NULL, 0);
|
||||||
|
46
components/esp32/include/esp_coexist.h
Normal file
46
components/esp32/include/esp_coexist.h
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
// Copyright 2015-2016 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.
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Init software coexist
|
||||||
|
*
|
||||||
|
* @return Init ok or failed.
|
||||||
|
*/
|
||||||
|
esp_err_t coexist_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get software coexist enable or not
|
||||||
|
*
|
||||||
|
* @return software coexist enable status.
|
||||||
|
*/
|
||||||
|
bool coexist_get_enable(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set software coexist enable or not
|
||||||
|
*
|
||||||
|
* @param enable software coexist or disable it
|
||||||
|
*
|
||||||
|
* @return Void.
|
||||||
|
*/
|
||||||
|
void coexist_set_enable(bool enable);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
@@ -1841,3 +1841,22 @@ PROVIDE ( _xtos_syscall_handler = 0x40000790 );
|
|||||||
PROVIDE ( _xtos_unhandled_exception = 0x4000c024 );
|
PROVIDE ( _xtos_unhandled_exception = 0x4000c024 );
|
||||||
PROVIDE ( _xtos_unhandled_interrupt = 0x4000c01c );
|
PROVIDE ( _xtos_unhandled_interrupt = 0x4000c01c );
|
||||||
PROVIDE ( _xtos_vpri_enabled = 0x3ffe0654 );
|
PROVIDE ( _xtos_vpri_enabled = 0x3ffe0654 );
|
||||||
|
/* Following are static data, but can be used, not generated by script <<<<< btdm data */
|
||||||
|
PROVIDE ( ld_acl_env = 0x3ffb8258 );
|
||||||
|
PROVIDE ( ld_active_ch_map = 0x3ffb8334 );
|
||||||
|
PROVIDE ( ld_bcst_acl_env = 0x3ffb8274 );
|
||||||
|
PROVIDE ( ld_csb_rx_env = 0x3ffb8278 );
|
||||||
|
PROVIDE ( ld_csb_tx_env = 0x3ffb827c );
|
||||||
|
PROVIDE ( ld_env = 0x3ffb9510 );
|
||||||
|
PROVIDE ( ld_fm_env = 0x3ffb8284 );
|
||||||
|
PROVIDE ( ld_inq_env = 0x3ffb82e4 );
|
||||||
|
PROVIDE ( ld_iscan_env = 0x3ffb82e8 );
|
||||||
|
PROVIDE ( ld_page_env = 0x3ffb82f0 );
|
||||||
|
PROVIDE ( ld_pca_env = 0x3ffb82f4 );
|
||||||
|
PROVIDE ( ld_pscan_env = 0x3ffb8308 );
|
||||||
|
PROVIDE ( ld_sched_env = 0x3ffb830c );
|
||||||
|
PROVIDE ( ld_sched_params = 0x3ffb96c0 );
|
||||||
|
PROVIDE ( ld_sco_env = 0x3ffb824c );
|
||||||
|
PROVIDE ( ld_sscan_env = 0x3ffb832c );
|
||||||
|
PROVIDE ( ld_strain_env = 0x3ffb8330 );
|
||||||
|
/* Above are static data, but can be used, not generated by script >>>>> btdm data */
|
||||||
|
Submodule components/esp32/lib updated: e2e5781dc2...93fcc0324c
@@ -79,7 +79,7 @@ static esp_err_t blufi_task_post(uint32_t sig, void *par, void *cb, void *arg)
|
|||||||
|
|
||||||
esp_err_t blufi_transfer_context(blufi_task_cb_t cb, void *arg)
|
esp_err_t blufi_transfer_context(blufi_task_cb_t cb, void *arg)
|
||||||
{
|
{
|
||||||
LOG_DEBUG("%s cb %08x, arg %u\n", __func__, cb, arg);
|
LOG_DEBUG("%s cb %08x, arg %u\n", __func__, (uint32_t)cb, (uint32_t)arg);
|
||||||
|
|
||||||
return blufi_task_post(BLUFI_SIG_SWITCH_CONTEXT, 0, cb, arg);
|
return blufi_task_post(BLUFI_SIG_SWITCH_CONTEXT, 0, cb, arg);
|
||||||
}
|
}
|
||||||
|
@@ -7,4 +7,4 @@
|
|||||||
# please read the ESP-IDF documents if you need to do this.
|
# please read the ESP-IDF documents if you need to do this.
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(IDF_PATH)/make/component_common.mk
|
#include $(IDF_PATH)/make/component_common.mk
|
||||||
|
Reference in New Issue
Block a user