]> granicus.if.org Git - esp-idf/commitdiff
component/bt : wifi/bt software coexist option
authorTian Hao <tianhao@espressif.com>
Thu, 24 Nov 2016 11:57:47 +0000 (19:57 +0800)
committerTian Hao <tianhao@espressif.com>
Thu, 24 Nov 2016 11:57:47 +0000 (19:57 +0800)
1. option of sw coexist
2. cpu set freq function modify
3. update lib
4. ld add static data address

components/bt/lib
components/esp32/Kconfig
components/esp32/cpu_freq.c
components/esp32/cpu_start.c
components/esp32/include/esp_coexist.h [new file with mode: 0644]
components/esp32/ld/esp32.rom.ld
components/esp32/lib
examples/07_blufi/components/blufi/blufi_task.c
examples/10_gatt_client/main/component.mk

index 5349ca363427758b9ef902f33e9ac0dae2c349e1..a0f2d0a961eef1a4926218b26b77011a89e8188f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5349ca363427758b9ef902f33e9ac0dae2c349e1
+Subproject commit a0f2d0a961eef1a4926218b26b77011a89e8188f
index 694f81a9e6876fa973e6de727e906c584a9fed29..8300b444c59ea3e1028849f5249b742c70498365 100644 (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
index 327ea63867dd9544b297d9d524323614892257fb..c9d31045945df41278ee1ff4a041a32fc6ba72b7 100644 (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);
 }
 
index 1eb0a5355e95672ecb3a514006485076ea7d182e..5ecb8546c051d8d254bf9c8117cafeedb798e152 100644 (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);
diff --git a/components/esp32/include/esp_coexist.h b/components/esp32/include/esp_coexist.h
new file mode 100644 (file)
index 0000000..09d38ac
--- /dev/null
@@ -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
index 5266a679bedc4e980efea141978e49f2c2101bcd..af9522976ba7426cd1552de7c19e8e3589e9520e 100644 (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 */
index e2e5781dc27e638c5e63f85bc23590dd21af1619..93fcc0324cd9b4de8ae381a876d371dfd4eff8e3 160000 (submodule)
@@ -1 +1 @@
-Subproject commit e2e5781dc27e638c5e63f85bc23590dd21af1619
+Subproject commit 93fcc0324cd9b4de8ae381a876d371dfd4eff8e3
index e4d4875c0d8276f8e5c361ea9d660a2b34945a14..8c46780b4970799f3c1f5e7db03297432da87dfa 100644 (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);
 }
index 24356f23ed2e292e153170d8edda3dd5dce430aa..afcb917c60d1482450756afff3bcdfd161744961 100644 (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