Merge branch 'feature/config_wifi_bt' into 'master'

Clean up WiFi & Bluetooth config options

* Splits "WiFi" configuration out from ESP32 configuration submenu to its own menu.
* Renames "BT" to "Bluetooth", enabling Bluetooth is now in this option not the ESP32 submenu.

* Also disables compiling/linking of BT stack if Bluetooth is disabled, saves some build time.

See merge request !397
This commit is contained in:
Ivan Grokhotkov 2017-01-11 18:38:30 +08:00
commit 5fbea86a9e
11 changed files with 154 additions and 220 deletions

View file

@ -1,41 +1,24 @@
menu "BT config"
visible if MEMMAP_BT
config BT_ENABLED
bool
depends on ESP32_ENABLE_STACK_BT
menuconfig BT_ENABLED
bool "Bluetooth"
help
This compiles in the low-level BT stack.
Select this option to enable Bluetooth stack and show the submenu with Bluetooth configuration choices.
config BTC_TASK_STACK_SIZE
int "BT event (callback to application) task stack size"
int "Bluetooth event (callback to application) task stack size"
depends on BT_ENABLED
default 3072
help
This select btc task stack size
config BLUEDROID_MEM_DEBUG
bool "Bluedroid memory debug"
default no
depends on BT_ENABLED
default n
help
Bluedroid memory debug
#config BT_BTLE
# bool "Enable BTLE"
# depends on BT_ENABLED
# help
# This compiles BTLE support
#
#config BT_BT
# bool "Enable classic BT"
# depends on BT_ENABLED
# help
# This enables classic BT support
endmenu
# Memory reserved at start of DRAM for Bluetooth stack
config BT_RESERVE_DRAM
hex
default 0x10000 if MEMMAP_BT
default 0x10000 if BT_ENABLED
default 0

View file

@ -1,6 +1,7 @@
#
# Component Makefile
#
ifdef CONFIG_BT_ENABLED
COMPONENT_ADD_INCLUDEDIRS := bluedroid/bta/include \
bluedroid/bta/sys/include \
@ -71,3 +72,5 @@ COMPONENT_SRCDIRS := bluedroid/bta/dm \
.
COMPONENT_SUBMODULES += lib
endif

View file

@ -7,3 +7,5 @@ COMPONENT_ADD_INCLUDEDIRS := port/include port/include/coap libcoap/include libc
COMPONENT_OBJS = libcoap/src/address.o libcoap/src/async.o libcoap/src/block.o libcoap/src/coap_time.o libcoap/src/debug.o libcoap/src/encode.o libcoap/src/hashkey.o libcoap/src/mem.o libcoap/src/net.o libcoap/src/option.o libcoap/src/pdu.o libcoap/src/resource.o libcoap/src/str.o libcoap/src/subscribe.o libcoap/src/uri.o port/coap_io_socket.o
COMPONENT_SRCDIRS := libcoap/src libcoap port
COMPONENT_SUBMODULES += libcoap

View file

@ -20,41 +20,6 @@ config ESP32_DEFAULT_CPU_FREQ_MHZ
default 160 if ESP32_DEFAULT_CPU_FREQ_160
default 240 if ESP32_DEFAULT_CPU_FREQ_240
#choice ESP32_WIFI_OR_BT
# prompt "Select stack to enable (WiFi or BT)"
# default ESP32_ENABLE_WIFI
# help
# Temporarily, WiFi and BT stacks can not be used at the same time.
# Select which stack to enable.
config ESP32_ENABLE_STACK_WIFI
bool "WiFi"
select WIFI_ENABLED if ESP32_ENABLE_STACK_WIFI
config ESP32_ENABLE_STACK_BT
bool "BT"
select MEMMAP_BT if ESP32_ENABLE_STACK_BT
select BT_ENABLED if ESP32_ENABLE_STACK_BT
#config ESP32_ENABLE_STACK_NONE
# 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
help
The Bluetooth stack uses memory that cannot be used as generic memory anymore. This
reserves the space for that within the memory map of the compiled binary.
This option is required to enable BT stack.
Temporarily, this option is not compatible with WiFi stack.
config MEMMAP_SMP
bool "Reserve memory for two cores"
default "y"
@ -99,15 +64,6 @@ config MEMMAP_SPISRAM
main memory map. Enable this if you have this hardware and want to use it in the same
way as on-chip RAM.
config WIFI_ENABLED
bool
default "y"
depends on ESP32_ENABLE_STACK_WIFI
help
This compiles in the low-level WiFi stack.
Temporarily, this option is not compatible with BT stack.
config SYSTEM_EVENT_QUEUE_SIZE
int "System event queue size"
default 32
@ -451,7 +407,6 @@ config ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL
depends on DOCUMENTATION_FOR_RTC_CNTL
endchoice
config ESP32_DEEP_SLEEP_WAKEUP_DELAY
int "Extra delay in deep sleep wake stub (in us)"
default 0
@ -470,9 +425,26 @@ config ESP32_DEEP_SLEEP_WAKEUP_DELAY
If you are seeing "flash read err, 1000" message printed to the
console after deep sleep reset, try increasing this value.
endmenu
menuconfig WIFI_ENABLED
bool "WiFi"
default y
help
Select this option to enable WiFi stack and show the submenu with WiFi configuration choices.
config SW_COEXIST_ENABLE
bool "Software controls WiFi/Bluetooth coexistence"
depends on WIFI_ENABLED && BT_ENABLED
default n
help
If enabled, WiFi & Bluetooth coexistence is controlled by software rather than hardware.
Recommended for heavy traffic scenarios. Both coexistence configuration options are
automatically managed, no user intervention is required.
config ESP32_PHY_AUTO_INIT
bool "Initialize PHY in startup code"
depends on WIFI_ENABLED
default y
help
If enabled, PHY will be initialized in startup code, before
@ -487,6 +459,7 @@ config ESP32_PHY_AUTO_INIT
config ESP32_PHY_INIT_DATA_IN_PARTITION
bool "Use a partition to store PHY init data"
depends on WIFI_ENABLED
default n
help
If enabled, PHY init data will be loaded from a partition.
@ -505,17 +478,17 @@ config ESP32_PHY_MAX_TX_POWER
int "Max TX power (dBm)"
range 0 20
default 20
depends on WIFI_ENABLED
help
Set maximum transmit power. Actual transmit power for high
data rates may be lower than this setting.
config ESP32_WIFI_RX_BUFFER_NUM
int "Max number of WiFi RX buffers"
depends on WIFI_ENABLED
range 2 25
default 25
help
Set the number of WiFi rx buffers. Each buffer takes approximately 1.6KB of RAM.
Larger number for higher throughput but more memory. Smaller number for lower
throughput but less memory.
endmenu

View file

@ -192,7 +192,7 @@ void heap_alloc_caps_init() {
// TODO: this region should be checked, since we don't need to knock out all region finally
disable_mem_region((void*)0x3ffe0000, (void*)0x3ffe8000); //knock out ROM data region
#if CONFIG_MEMMAP_BT
#if CONFIG_BT_ENABLED
disable_mem_region((void*)0x3ffb0000, (void*)0x3ffc0000); //knock out BT data region
#endif

View file

@ -1,8 +1,8 @@
menuconfig ETHERNET
bool "Enable Ethernet"
bool "Ethernet"
default n
help
Enable this option to enable ethernet driver and show the menu with ethernet features.
Select this option to enable ethernet driver and show the submenu with ethernet features.
config DMA_RX_BUF_NUM
int "DMA Rx Buf Num"

View file

@ -32,6 +32,7 @@
#include <sys/cdefs.h>
#include <sys/_types.h>
#include <stdint.h>
#if __has_extension(c_atomic) || __has_extension(cxx_atomic)
#define __CLANG_ATOMICS

View file

@ -5,10 +5,3 @@
# BT config
#
CONFIG_BT_ENABLED=y
#
# ESP32-specific config
#
CONFIG_ESP32_ENABLE_STACK_BT=y
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
CONFIG_MEMMAP_BT=y

View file

@ -5,10 +5,3 @@
# BT config
#
CONFIG_BT_ENABLED=y
#
# ESP32-specific config
#
CONFIG_ESP32_ENABLE_STACK_BT=y
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
CONFIG_MEMMAP_BT=y

View file

@ -5,10 +5,3 @@
# BT config
#
CONFIG_BT_ENABLED=y
#
# ESP32-specific config
#
CONFIG_ESP32_ENABLE_STACK_BT=y
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
CONFIG_MEMMAP_BT=y

View file

@ -5,10 +5,3 @@
# BT config
#
CONFIG_BT_ENABLED=y
#
# ESP32-specific config
#
CONFIG_ESP32_ENABLE_STACK_BT=y
# CONFIG_ESP32_ENABLE_STACK_NONE is not set
CONFIG_MEMMAP_BT=y