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:
Tian Hao 2016-11-24 19:57:47 +08:00
parent 7a41ab6982
commit 55e0690f69
9 changed files with 88 additions and 8 deletions

@ -1 +1 @@
Subproject commit 5349ca363427758b9ef902f33e9ac0dae2c349e1
Subproject commit a0f2d0a961eef1a4926218b26b77011a89e8188f

View File

@ -38,6 +38,14 @@ config ESP32_ENABLE_STACK_BT
# bool "None"
#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
bool
depends on ESP32_ENABLE_STACK_BT

View File

@ -33,8 +33,8 @@ typedef enum{
extern void phy_get_romfunc_addr();
// TODO: these functions need to be moved from librtc to ESP-IDF
extern void rtc_init_lite();
extern void rtc_set_cpu_freq(xtal_freq_t xtal_freq, cpu_freq_t cpu_freq);
extern void rtc_init_lite(xtal_freq_t xtal_freq);
extern void rtc_set_cpu_freq(cpu_freq_t cpu_freq);
/*
* 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
uart_tx_wait_idle(0);
rtc_init_lite();
rtc_init_lite(XTAL_AUTO);
cpu_freq_t freq = CPU_80M;
switch(freq_mhz) {
case 240:
@ -73,7 +73,7 @@ void esp_set_cpu_freq(void)
// wait uart tx finish, otherwise some uart output will be lost
uart_tx_wait_idle(0);
rtc_set_cpu_freq(XTAL_AUTO, freq);
rtc_set_cpu_freq(freq);
ets_update_cpu_frequency(freq_mhz);
}

View File

@ -51,6 +51,7 @@
#include "esp_int_wdt.h"
#include "esp_task_wdt.h"
#include "esp_phy_init.h"
#include "esp_coexist.h"
#include "trax.h"
void start_cpu0(void) __attribute__((weak, alias("start_cpu0_default")));
@ -194,6 +195,12 @@ void start_cpu0_default(void)
do_phy_init();
#endif
#if CONFIG_SW_COEXIST_ENABLE
if (coexist_init() == ESP_OK) {
coexist_set_enable(true);
}
#endif
xTaskCreatePinnedToCore(&main_task, "main",
ESP_TASK_MAIN_STACK, NULL,
ESP_TASK_MAIN_PRIO, NULL, 0);

View 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

View File

@ -1841,3 +1841,22 @@ PROVIDE ( _xtos_syscall_handler = 0x40000790 );
PROVIDE ( _xtos_unhandled_exception = 0x4000c024 );
PROVIDE ( _xtos_unhandled_interrupt = 0x4000c01c );
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 */

@ -1 +1 @@
Subproject commit e2e5781dc27e638c5e63f85bc23590dd21af1619
Subproject commit 93fcc0324cd9b4de8ae381a876d371dfd4eff8e3

View File

@ -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)
{
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);
}

View File

@ -7,4 +7,4 @@
# 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