Skip to content

Commit

Permalink
Kconfig: Simplify the conditional default statement
Browse files Browse the repository at this point in the history
Signed-off-by: Xiang Xiao <[email protected]>
  • Loading branch information
xiaoxiang781216 authored and anchao committed Jul 25, 2023
1 parent d46dce5 commit 8083b09
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 30 deletions.
9 changes: 3 additions & 6 deletions examples/foc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,15 @@ endif # EXAMPLES_FOC_SENSORED
config EXAMPLES_FOC_HAVE_OPENLOOP
bool "FOC example have open-loop controller"
select INDUSTRY_FOC_ANGLE_OPENLOOP
default y if EXAMPLES_FOC_SENSORLESS
default n
default EXAMPLES_FOC_SENSORLESS

config EXAMPLES_FOC_HAVE_TORQ
bool "FOC example torque controller support"
default n

config EXAMPLES_FOC_HAVE_VEL
bool "FOC example velocity controller support"
default y if EXAMPLES_FOC_SENSORLESS
default n
default EXAMPLES_FOC_SENSORLESS

config EXAMPLES_FOC_HAVE_POS
bool "FOC example position controller support"
Expand Down Expand Up @@ -414,8 +412,7 @@ endmenu # FOC controller parameters

config EXAMPLES_FOC_HAVE_RUN
bool
default y if !EXAMPLES_FOC_RUN_DISABLE
default n
default !EXAMPLES_FOC_RUN_DISABLE

config EXAMPLES_FOC_RUN_DISABLE
bool "FOC Disable FOC motor controller"
Expand Down
3 changes: 1 addition & 2 deletions examples/mld/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ config EXAMPLES_MLD_STACKSIZE

config EXAMPLES_MLD_INIT
bool "Initialize network"
default n if NSH_NETINIT
default y if !NSH_NETINIT
default !NSH_NETINIT
---help---
Include logic to initialize the network. This should not be done if
the network is already initialized when nettest runs. This is
Expand Down
3 changes: 1 addition & 2 deletions examples/nettest/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ endchoice # IP Domain

config EXAMPLES_NETTEST_INIT
bool "Initialize network"
default n if NSH_NETINIT
default y if !NSH_NETINIT
default !NSH_NETINIT
depends on !EXAMPLES_NETTEST_LOOPBACK
---help---
Include logic to initialize the network. This should not be done if
Expand Down
3 changes: 1 addition & 2 deletions examples/tcpblaster/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ endchoice # IP Domain

config EXAMPLES_TCPBLASTER_INIT
bool "Initialize network"
default n if NSH_NETINIT
default y if !NSH_NETINIT
default !NSH_NETINIT
depends on !EXAMPLES_TCPBLASTER_LOOPBACK
---help---
Include logic to initialize the network. This should not be done if
Expand Down
3 changes: 1 addition & 2 deletions examples/udp/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ config EXAMPLES_UDP_DEVNAME

config EXAMPLES_UDP_NETINIT
bool "Initialize network"
default n if NSH_NETINIT
default y if !NSH_NETINIT
default !NSH_NETINIT
---help---
Selecting this option will enable logic in the example to perform
some basic initialization of the network. You would probably only
Expand Down
3 changes: 1 addition & 2 deletions examples/udpblaster/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ endchoice # IP Domain

config EXAMPLES_UDPBLASTER_INIT
bool "Initialize network"
default n if NSH_NETINIT
default y if !NSH_NETINIT
default !NSH_NETINIT
depends on !EXAMPLES_UDPBLASTER_LOOPBACK
---help---
Include logic to initialize the network. This should not be done if
Expand Down
3 changes: 1 addition & 2 deletions graphics/nxwidgets/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ menu "NX Server/Device Configuration"

config NXWIDGETS_FLICKERFREE
bool "Enable Flicker Reduction Logic"
default y if NX_LCDDRIVER
default n if !NX_LCDDRIVER
default NX_LCDDRIVER
---help---
Because of their performance an in the manner in which they are
updated, LCDs may be prone to "flicker" in the displays when Widgets
Expand Down
6 changes: 2 additions & 4 deletions graphics/nxwm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ comment "Background Image"

config NXWM_DISABLE_BACKGROUND_IMAGE
bool "Disable Background Image"
default n if !NXWM_DISABLE_MINIMIZE
default y if NXWM_DISABLE_MINIMIZE
default NXWM_DISABLE_MINIMIZE
---help---
Disable support for the "Desktop" background image.

Expand Down Expand Up @@ -465,8 +464,7 @@ menu "NxWM Touchscreen Configuration"

config NXWM_TOUCHSCREEN
bool "Touchscreen Support"
default y if INPUT
default n if !INPUT
default INPUT
---help---
Define to build in touchscreen support.

Expand Down
9 changes: 3 additions & 6 deletions netutils/webserver/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ if NETUTILS_WEBSERVER

config NETUTILS_HTTPD_SINGLECONNECT
bool "Single Connection"
default n if !DISABLE_PTHREAD
default y if DISABLE_PTHREAD
default DISABLE_PTHREAD
---help---
By default, the uIP web server will create a new, independent thread
for each connection. This can, however, use a lot of stack space
Expand All @@ -28,15 +27,13 @@ config NETUTILS_HTTPD_SINGLECONNECT

config NETUTILS_HTTPD_SCRIPT_DISABLE
bool "Disable %! scripting"
default y if NETUTILS_HTTPD_SENDFILE
default n if !NETUTILS_HTTPD_SENDFILE
default NETUTILS_HTTPD_SENDFILE
---help---
This option, if selected, will elide the %! scripting

config NETUTILS_HTTPD_ENABLE_CHUNKED_ENCODING
bool "Enable HTTP chunked encoding"
default y if !NETUTILS_HTTPD_SCRIPT_DISABLE
default n if NETUTILS_HTTPD_SCRIPT_DISABLE
default !NETUTILS_HTTPD_SCRIPT_DISABLE
---help---
This option, if selected, will cause transmissions of blocks of
initially unknown size (e.g. dynamic content creation) to be sent
Expand Down
3 changes: 1 addition & 2 deletions nshlib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,7 @@ config NSH_DISABLE_XD

config NSH_DISABLE_RESET_CAUSE
bool "Disable reset cause"
default n if !DEFAULT_SMALL
default y if DEFAULT_SMALL
default DEFAULT_SMALL
depends on BOARDCTL_RESET_CAUSE

endmenu
Expand Down

0 comments on commit 8083b09

Please sign in to comment.