]> granicus.if.org Git - esp-idf/commitdiff
component/esp32 : clear some minor thingsw about PM and coexistence
authorTian Hao <tianhao@espressif.com>
Tue, 3 Apr 2018 07:37:28 +0000 (15:37 +0800)
committerXia Xiaotian <xiaxiaotian@espressif.com>
Tue, 3 Apr 2018 12:13:49 +0000 (20:13 +0800)
.gitlab-ci.yml
components/esp32/coexist.c [new file with mode: 0644]
components/esp32/coexist_internal.h [new file with mode: 0644]
components/esp32/include/esp_coexist.h
components/esp32/lib
components/esp32/lib_printf.c
components/esp32/phy_init.c

index a41091c35a6522d3347c47af953ca41fdaf9458e..8167ac69e5d3c85075babfc089f3e33a1d9fc424 100644 (file)
@@ -98,8 +98,8 @@ build_template_app:
     - make all V=1
     # Check if there are any stray printf/ets_printf references in WiFi libs
     - cd ../components/esp32/lib
-    - test $(ls *.a|awk '{if ($1 != "libcoexist.a") print $1}' | xargs xtensa-esp32-elf-nm | grep -w printf | wc -l) -eq 0
-    - test $(ls *.a|awk '{if ($1 != "libcoexist.a") print $1}' | xargs xtensa-esp32-elf-nm | grep -w ets_printf | wc -l) -eq 0
+    - test $(xtensa-esp32-elf-nm *.a | grep -w printf | wc -l) -eq 0
+    - test $(xtensa-esp32-elf-nm *.a | grep -w ets_printf | wc -l) -eq 0
 
 
 .build_template: &build_template
diff --git a/components/esp32/coexist.c b/components/esp32/coexist.c
new file mode 100644 (file)
index 0000000..9eff308
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright 2018-2018 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 "esp_coexist.h"
+#include "coexist_internal.h"
+
+const char *esp_coex_version_get(void)
+{
+    return coex_version_get();
+}
+
+esp_err_t esp_coex_preference_set(esp_coex_prefer_t prefer)
+{
+    return coex_preference_set((coex_prefer_t)prefer);
+}
diff --git a/components/esp32/coexist_internal.h b/components/esp32/coexist_internal.h
new file mode 100644 (file)
index 0000000..fb21e24
--- /dev/null
@@ -0,0 +1,77 @@
+// Copyright 2018-2018 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.
+
+#ifndef __COEXIST_INTERNAL_H__
+#define __COEXIST_INTERNAL_H__
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+    COEX_PREFER_WIFI = 0,
+    COEX_PREFER_BT,
+    COEX_PREFER_BALANCE,
+    COEX_PREFER_NUM,
+} coex_prefer_t;
+
+/**
+ * @brief Init software coexist
+ *        extern function for internal use.
+ *
+ * @return Init ok or failed.
+ */
+esp_err_t coex_init(void);
+
+/**
+ * @brief De-init software coexist
+ *        extern function for internal use.
+ */
+void coex_deinit(void);
+
+/**
+ * @brief Pause software coexist
+ *        extern function for internal use.
+ */
+void coex_pause(void);
+
+/**
+ * @brief Resume software coexist
+ *        extern function for internal use.
+ */
+void coex_resume(void);
+
+/**
+ * @brief Get software coexist version string
+ *        extern function for internal use.
+ * @return : version string
+ */
+const char *coex_version_get(void);
+
+/**
+ * @brief Coexist performance preference set from libbt.a
+ *        extern function for internal use.
+ *
+ *  @param prefer : the prefer enumeration value
+ *  @return : ESP_OK - success, other - failed
+ */
+esp_err_t coex_preference_set(coex_prefer_t prefer);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __COEXIST_INTERNAL_H__ */
index 342652a197f7948c5a1f329f66bde438725dfd31..c9b241d3dc642ecf8883d0b162b575254ca7c798 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
+// Copyright 2015-2018 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.
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#ifndef __ESP_COEXIST_H__
+#define __ESP_COEXIST_H__
+
 #include <stdbool.h>
+#include "esp_err.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-typedef enum {
-    COEX_PREFER_WIFI = 0,
-    COEX_PREFER_BT,
-    COEX_PREFER_BALANCE,
-    COEX_PREFER_NUM,
-} coex_prefer_t;
-
-/**
- * @brief Init software coexist
- *        extern function for internal use.
- *
- * @return Init ok or failed.
- */
-esp_err_t coex_init(void);
-
 /**
- * @brief De-init software coexist
- *        extern function for internal use.
+ * @brief coex prefer value
  */
-void coex_deinit(void);
-
-/**
- * @brief Pause software coexist
- *        extern function for internal use.
- */
-void coex_pause(void);
-
-/**
- * @brief Resume software coexist
- *        extern function for internal use.
- */
-void coex_resume(void);
-
-/**
- * @brief Get software coexist version string
- *        extern function for internal use.
- * @return : version string
- */
-const char *coex_version_get(void);
-
-/**
- * @brief Coexist performance preference set from libbt.a
- *        extern function for internal use.
- *
- *  @param prefer : the prefer enumeration value
- *  @return : ESP_OK - success, other - failed
- */
-esp_err_t coex_preference_set(coex_prefer_t prefer);
+typedef enum {
+    ESP_COEX_PREFER_WIFI = 0,       /*!< Prefer to WiFi, WiFi will have more opportunity to use RF */
+    ESP_COEX_PREFER_BT,             /*!< Prefer to bluetooth, bluetooth will have more opportunity to use RF */
+    ESP_COEX_PREFER_BALANCE,        /*!< Do balance of WiFi and bluetooth */
+    ESP_COEX_PREFER_NUM,            /*!< Prefer value numbers */
+} esp_coex_prefer_t;
 
 /**
  * @brief Get software coexist version string
  *
  * @return : version string
  */
-static inline const char *esp_coex_version_get(void)
-{
-    return coex_version_get();
-}
+const char *esp_coex_version_get(void);
 
 /**
  * @brief Set coexist preference of performance
@@ -87,11 +49,11 @@ static inline const char *esp_coex_version_get(void)
  *  @param prefer : the prefer enumeration value
  *  @return : ESP_OK - success, other - failed
  */
-static inline esp_err_t esp_coex_preference_set(coex_prefer_t prefer)
-{
-    return coex_preference_set(prefer);
-}
+esp_err_t esp_coex_preference_set(esp_coex_prefer_t prefer);
 
 #ifdef __cplusplus
 }
 #endif
+
+
+#endif /* __ESP_COEXIST_H__ */
index 608bf369c66c33c15b0cc198e573e421c7103e1f..152e29aa93a3d3f95fd6ed53a924a92c98fcc13c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 608bf369c66c33c15b0cc198e573e421c7103e1f
+Subproject commit 152e29aa93a3d3f95fd6ed53a924a92c98fcc13c
index 417e71bdf752b24259d81307006c060454dfe947..a22cfb99e4627a652c0800b724daf621fe0c470d 100644 (file)
@@ -128,3 +128,12 @@ int net80211_printf(const char* format, ...)
     va_end(arg);
     return res;
 }
+
+int coexist_printf(const char* format, ...)
+{
+    va_list arg;
+    va_start(arg, format);
+    int res = lib_printf("coexist", format, arg);
+    va_end(arg);
+    return res;
+}
index 626891372fa2474cab149eec5fe5213a9e24b41a..625040fae70fa8442883fe83276bfe52bea05ad3 100644 (file)
@@ -36,7 +36,7 @@
 #include "freertos/portmacro.h"
 #include "phy.h"
 #include "phy_init_data.h"
-#include "esp_coexist.h"
+#include "coexist_internal.h"
 #include "driver/periph_ctrl.h"