From 0743361da399c9aca96e81ea3feb78ad574f2083 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Mon, 20 Aug 2018 17:15:36 +1000 Subject: [PATCH] kconfiglib: Allow CONFIG_xxx= to disable booleans But replace all sdkconfig.defaults to use the explicit =n (more correct) --- .../a2dp_gatts_coex/sdkconfig.defaults | 22 +++++++++---------- .../bluetooth/a2dp_sink/sdkconfig.defaults | 8 +++---- .../bluetooth/a2dp_source/sdkconfig.defaults | 8 +++---- examples/bluetooth/blufi/sdkconfig.defaults | 22 +++++++++---------- .../bluetooth/bt_discovery/sdkconfig.defaults | 8 +++---- examples/wifi/iperf/sdkconfig.defaults | 8 +++---- tools/kconfig_new/kconfiglib.py | 3 +++ 7 files changed, 41 insertions(+), 38 deletions(-) diff --git a/examples/bluetooth/a2dp_gatts_coex/sdkconfig.defaults b/examples/bluetooth/a2dp_gatts_coex/sdkconfig.defaults index 07275e1e7d..8c46161238 100644 --- a/examples/bluetooth/a2dp_gatts_coex/sdkconfig.defaults +++ b/examples/bluetooth/a2dp_gatts_coex/sdkconfig.defaults @@ -2,29 +2,29 @@ # Classic BT is enabled and BT_DRAM_RELEASE is disabled CONFIG_BT_ENABLED=y CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0=y -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1= +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1=n CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y -CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4= +CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4=n CONFIG_BLUEDROID_ENABLED=y CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -CONFIG_BLUEDROID_PINNED_TO_CORE_1= +CONFIG_BLUEDROID_PINNED_TO_CORE_1=n CONFIG_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BTC_TASK_STACK_SIZE=3072 -CONFIG_BLUEDROID_MEM_DEBUG= +CONFIG_BLUEDROID_MEM_DEBUG=n CONFIG_CLASSIC_BT_ENABLED=y CONFIG_A2DP_ENABLE=y CONFIG_A2DP_SINK_ENABLE=y -CONFIG_A2DP_SRC_ENABLE= +CONFIG_A2DP_SRC_ENABLE=n CONFIG_A2DP_SINK_TASK_STACK_SIZE=2048 -CONFIG_BT_SPP_ENABLED= +CONFIG_BT_SPP_ENABLED=n CONFIG_GATTS_ENABLE=y -CONFIG_GATTC_ENABLE= -CONFIG_BLE_SMP_ENABLE= +CONFIG_GATTC_ENABLE=n +CONFIG_BLE_SMP_ENABLE=n CONFIG_BLE_ENABLE_SRVCHG_REG=y -CONFIG_BT_STACK_NO_LOG= +CONFIG_BT_STACK_NO_LOG=n CONFIG_BT_ACL_CONNECTIONS=4 -CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST= -CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY= +CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=n +CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=n CONFIG_SMP_ENABLE=y CONFIG_BT_RESERVE_DRAM=0x10000 diff --git a/examples/bluetooth/a2dp_sink/sdkconfig.defaults b/examples/bluetooth/a2dp_sink/sdkconfig.defaults index 82779f66ef..9769836c21 100644 --- a/examples/bluetooth/a2dp_sink/sdkconfig.defaults +++ b/examples/bluetooth/a2dp_sink/sdkconfig.defaults @@ -4,7 +4,7 @@ CONFIG_BT_ENABLED=y CONFIG_BLUEDROID_ENABLED=y CONFIG_CLASSIC_BT_ENABLED=y CONFIG_A2DP_ENABLE=y -CONFIG_BT_SPP_ENABLED= -CONFIG_GATTS_ENABLE= -CONFIG_GATTC_ENABLE= -CONFIG_BLE_SMP_ENABLE= +CONFIG_BT_SPP_ENABLED=n +CONFIG_GATTS_ENABLE=n +CONFIG_GATTC_ENABLE=n +CONFIG_BLE_SMP_ENABLE=n diff --git a/examples/bluetooth/a2dp_source/sdkconfig.defaults b/examples/bluetooth/a2dp_source/sdkconfig.defaults index 6625f76f4d..38b09494bd 100644 --- a/examples/bluetooth/a2dp_source/sdkconfig.defaults +++ b/examples/bluetooth/a2dp_source/sdkconfig.defaults @@ -4,7 +4,7 @@ CONFIG_BT_ENABLED=y CONFIG_BLUEDROID_ENABLED=y CONFIG_CLASSIC_BT_ENABLED=y CONFIG_A2DP_ENABLE=y -CONFIG_BT_SPP_ENABLED= -CONFIG_GATTS_ENABLE= -CONFIG_GATTC_ENABLE= -CONFIG_BLE_SMP_ENABLE= +CONFIG_BT_SPP_ENABLED=n +CONFIG_GATTS_ENABLE=n +CONFIG_GATTC_ENABLE=n +CONFIG_BLE_SMP_ENABLE=n diff --git a/examples/bluetooth/blufi/sdkconfig.defaults b/examples/bluetooth/blufi/sdkconfig.defaults index a0d1d3652f..2d73b06621 100644 --- a/examples/bluetooth/blufi/sdkconfig.defaults +++ b/examples/bluetooth/blufi/sdkconfig.defaults @@ -6,24 +6,24 @@ # CONFIG_BT_ENABLED=y CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_0=y -CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1= +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE_1=n CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y -CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4= +CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4=n CONFIG_BLUEDROID_ENABLED=y CONFIG_BLUEDROID_PINNED_TO_CORE_0=y -CONFIG_BLUEDROID_PINNED_TO_CORE_1= +CONFIG_BLUEDROID_PINNED_TO_CORE_1=n CONFIG_BLUEDROID_PINNED_TO_CORE=0 CONFIG_BTC_TASK_STACK_SIZE=3072 -CONFIG_BLUEDROID_MEM_DEBUG= -CONFIG_CLASSIC_BT_ENABLED= +CONFIG_BLUEDROID_MEM_DEBUG=n +CONFIG_CLASSIC_BT_ENABLED=n CONFIG_GATTS_ENABLE=y -CONFIG_GATTC_ENABLE= -CONFIG_BLE_SMP_ENABLE= +CONFIG_GATTC_ENABLE=n +CONFIG_BLE_SMP_ENABLE=n CONFIG_BLE_ENABLE_SRVCHG_REG=y -CONFIG_BT_STACK_NO_LOG= +CONFIG_BT_STACK_NO_LOG=n CONFIG_BT_ACL_CONNECTIONS=4 -CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST= -CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY= -CONFIG_SMP_ENABLE= +CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST=n +CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY=n +CONFIG_SMP_ENABLE=n CONFIG_BT_RESERVE_DRAM=0x10000 diff --git a/examples/bluetooth/bt_discovery/sdkconfig.defaults b/examples/bluetooth/bt_discovery/sdkconfig.defaults index ab028190f5..793fe05c22 100644 --- a/examples/bluetooth/bt_discovery/sdkconfig.defaults +++ b/examples/bluetooth/bt_discovery/sdkconfig.defaults @@ -2,7 +2,7 @@ # Classic BT is enabled and BT_DRAM_RELEASE is disabled CONFIG_BT_ENABLED=y CONFIG_CLASSIC_BT_ENABLED=y -CONFIG_A2DP_ENABLE= -CONFIG_GATTS_ENABLE= -CONFIG_GATTC_ENABLE= -CONFIG_BLE_SMP_ENABLE= +CONFIG_A2DP_ENABLE=n +CONFIG_GATTS_ENABLE=n +CONFIG_GATTC_ENABLE=n +CONFIG_BLE_SMP_ENABLE=n diff --git a/examples/wifi/iperf/sdkconfig.defaults b/examples/wifi/iperf/sdkconfig.defaults index 613b73f3f8..f084e4a675 100644 --- a/examples/wifi/iperf/sdkconfig.defaults +++ b/examples/wifi/iperf/sdkconfig.defaults @@ -12,18 +12,18 @@ CONFIG_ESP32_WIFI_TX_BA_WIN=32 CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=32 -CONFIG_FREERTOS_UNICORE= +CONFIG_FREERTOS_UNICORE=n CONFIG_FREERTOS_HZ=1000 -CONFIG_INT_WDT= -CONFIG_TASK_WDT= +CONFIG_INT_WDT=n +CONFIG_TASK_WDT=n CONFIG_TCP_SND_BUF_DEFAULT=65535 CONFIG_TCP_WND_DEFAULT=65535 CONFIG_TCP_RECVMBOX_SIZE=64 CONFIG_UDP_RECVMBOX_SIZE=64 CONFIG_TCPIP_RECVMBOX_SIZE=64 -CONFIG_LWIP_ETHARP_TRUST_IP_MAC= +CONFIG_LWIP_ETHARP_TRUST_IP_MAC=n CONFIG_FLASHMODE_QIO=y CONFIG_ESPTOOLPY_FLASHFREQ_40M=y diff --git a/tools/kconfig_new/kconfiglib.py b/tools/kconfig_new/kconfiglib.py index 261e72e6b0..929f30d4db 100644 --- a/tools/kconfig_new/kconfiglib.py +++ b/tools/kconfig_new/kconfiglib.py @@ -754,6 +754,9 @@ class Kconfig(object): continue if sym.orig_type in (BOOL, TRISTATE): + if val == "": + val = "n" # C implementation allows 'blank' for 'no' + # The C implementation only checks the first character # to the right of '=', for whatever reason if not ((sym.orig_type == BOOL and