1.配置项优化。

This commit is contained in:
MacRsh
2024-01-10 16:47:46 +08:00
parent c1291a6c66
commit 7eea1155b3
2 changed files with 156 additions and 104 deletions

239
Kconfig
View File

@@ -16,16 +16,8 @@ menu "Device configure"
help help
"Use this option allows the use of assert statements in the code." "Use this option allows the use of assert statements in the code."
# Console # Printf
config MR_USING_CONSOLE menu "Printf configure"
bool "Use console"
default y
help
"Use this option allows for the use of the console."
menu "Console configure"
depends on MR_USING_CONSOLE
config MR_CFG_PRINTF_BUFSZ config MR_CFG_PRINTF_BUFSZ
int "Printf buffer size" int "Printf buffer size"
default 128 default 128
@@ -33,35 +25,21 @@ menu "Device configure"
help help
"This option sets the buffer size used by the printf function." "This option sets the buffer size used by the printf function."
config MR_CFG_CONSOLE_NAME config MR_CFG_PRINTF_DEV_NAME
string "Console device name" string "Printf device name"
default "serial1" default "serial1"
help help
"This option sets the name of the console device." "This option sets the name of the device used by the printf function."
config MR_USING_CONSOLE_NONBLOCK config MR_USING_PRINTF_NONBLOCKING
bool "Use console non-blocking" bool "Use printf non-blocking"
default n default n
help help
"Use this option allows for the use of the console device in non-blocking mode." "Use this option allows for the use of the printf device non-blocking."
endmenu endmenu
# Log # Log
config MR_USING_LOG menu "Log configure"
bool "Use log"
default y
help
"Use this option allows for the use of log."
menu "Logging configure"
depends on MR_USING_LOG
config MR_USING_LOG_COLOR
bool "Use color log"
default y
help
"Use this option allows for the use of color log."
config MR_USING_LOG_ERROR config MR_USING_LOG_ERROR
bool "Use error log" bool "Use error log"
default y default y
@@ -91,20 +69,26 @@ menu "Device configure"
default y default y
help help
"Use this option allows for the use of success log." "Use this option allows for the use of success log."
config MR_USING_LOG_COLOR
bool "Use print color log"
default n
help
"Use this option allows for the use of print color log."
endmenu endmenu
# Device # Device
config MR_CFG_DEV_NAME_MAX config MR_CFG_DEV_NAME_MAX
int "Name max length" int "Name max length"
default 8
range 4 1024 range 4 1024
default 12
help help
"This option sets the max length of the name." "This option sets the max length of the name."
config MR_CFG_DESC_MAX config MR_CFG_DESC_MAX
int "Descriptors max number" int "Descriptors max number"
default 64
range 16 1024 range 16 1024
default 64
help help
"This option sets the max number of descriptors." "This option sets the max number of descriptors."
@@ -114,117 +98,166 @@ menu "Device configure"
help help
"Use this option allows for read and write control of devices." "Use this option allows for read and write control of devices."
config MR_USING_ADC # ADC
bool "Use ADC device" config MR_USING_ADC
default n bool "Use ADC device"
help default n
"Use this option allows for the use of ADC (Analog-to-Digital Converter) devices." help
"Use this option allows for the use of ADC (Analog-to-Digital Converter) devices."
menu "ADC configure"
depends on MR_USING_ADC
config MR_USING_CAN config MR_USING_ADC_CHANNEL_CHECK
bool "Use CAN device" bool "Use channel available check"
default n default y
help help
"Use this option allows for the use of CAN (Controller Area Network) devices." "Use this option to allow you to check whether the channel is available."
config MR_USING_ADC_AUTO_DISABLE
bool "Use auto disable channel"
default y
help
"Use this option to allow the channel to be automatically disabled when the device is turned off."
endmenu
# CAN
config MR_USING_CAN
bool "Use CAN device"
default n
help
"Use this option allows for the use of CAN (Controller Area Network) devices."
menu "CAN configure" menu "CAN configure"
depends on MR_USING_CAN depends on MR_USING_CAN
config MR_CFG_CAN_RD_BUFSZ config MR_CFG_CAN_RD_BUFSZ
int "RX buffer size" int "RX buffer size"
default 32
range 0 MR_CFG_HEAP_SIZE range 0 MR_CFG_HEAP_SIZE
default 32
help help
"This option sets the size of the RX (receive) buffer used by the CAN device." "This option sets the size of the RX (receive) buffer used by the CAN device."
endmenu endmenu
config MR_USING_DAC # DAC
bool "Use DAC device" config MR_USING_DAC
default n bool "Use DAC device"
help default n
"Use this option allows for the use of DAC (Digital-to-Analog Converter) devices." help
"Use this option allows for the use of DAC (Digital-to-Analog Converter) devices."
menu "DAC configure"
depends on MR_USING_DAC
config MR_USING_I2C config MR_USING_DAC_AUTO_DISABLE
bool "Use I2C device" bool "Use auto disable channel"
default n default y
help help
"Use this option allows for the use of I2C (Inter-Integrated Circuit) devices." "Use this option to allow the channel to be automatically disabled when the device is turned off."
config MR_USING_DAC_CHANNEL_CHECK
bool "Use channel available check"
default y
help
"Use this option to allow you to check whether the channel is available."
endmenu
# I2C
config MR_USING_I2C
bool "Use I2C device"
default n
help
"Use this option allows for the use of I2C devices."
menu "I2C configure" menu "I2C configure"
depends on MR_USING_I2C depends on MR_USING_I2C
config MR_CFG_I2C_RD_BUFSZ config MR_CFG_I2C_RD_BUFSZ
int "RX buffer size" int "RX buffer size"
default 32 range 0 MR_CFG_HEAP_SIZE
range 0 MR_CFG_HEAP_SIZE default 32
help help
"This option sets the size of the RX (receive) buffer used by the I2C device." "This option sets the size of the RX (receive) buffer used by the I2C device."
config MR_USING_SOFT_I2C config MR_USING_SOFT_I2C
depends on MR_USING_PIN
bool "Use Soft I2C" bool "Use Soft I2C"
default n default y
help help
"Use this option allows for the use of soft I2C." "Use this option allows for the use of soft I2C."
endmenu endmenu
config MR_USING_PIN # Pin
bool "Use Pin device" config MR_USING_PIN
default n bool "Use Pin device"
help default n
"Use this option allows for the use of Pin devices." help
"Use this option allows for the use of Pin devices."
menu "Pin configure"
depends on MR_USING_PIN
config MR_USING_PIN_CHECK
bool "Use pin available check"
default y
help
"Use this option to allow you to check whether the pin is available."
endmenu
# PWM
config MR_USING_PWM config MR_USING_PWM
bool "Use PWM device" bool "Use PWM device"
default n default n
help help
"Use this option allows for the use of PWM devices." "Use this option allows for the use of PWM devices."
menu "PWM configure"
depends on MR_USING_PWM
endmenu
config MR_USING_SERIAL # Serial
bool "Use Serial device" config MR_USING_SERIAL
default n bool "Use Serial device"
help default n
"Use this option allows for the use of Serial devices." help
"Use this option allows for the use of Serial devices."
menu "Serial configure" menu "Serial configure"
depends on MR_USING_SERIAL depends on MR_USING_SERIAL
config MR_CFG_SERIAL_RD_BUFSZ config MR_CFG_SERIAL_RD_BUFSZ
int "RX buffer size" int "RX buffer size"
default 32 range 0 MR_CFG_HEAP_SIZE
range 0 MR_CFG_HEAP_SIZE default 32
help help
"This option sets the size of the RX (receive) buffer used by the Serial device." "This option sets the size of the RX (receive) buffer used by the Serial device."
config MR_CFG_SERIAL_WR_BUFSZ config MR_CFG_SERIAL_WR_BUFSZ
int "TX buffer size for Serial" int "TX buffer size"
default 0 range 0 MR_CFG_HEAP_SIZE
range 0 MR_CFG_HEAP_SIZE default 0
help help
"This option sets the size of the TX (transmit) buffer used by the Serial device." "This option sets the size of the TX (transmit) buffer used by the Serial device."
endmenu endmenu
config MR_USING_SPI # SPI
bool "Use SPI device" config MR_USING_SPI
default n bool "Use SPI device"
help default n
"Use this option allows for the use of SPI (Serial Peripheral Interface) devices." help
"Use this option allows for the use of SPI (Serial Peripheral Interface) devices."
menu "SPI configure" menu "SPI configure"
depends on MR_USING_SPI depends on MR_USING_SPI
config MR_CFG_SPI_RD_BUFSZ config MR_CFG_SPI_RD_BUFSZ
int "RX buffer size" int "RX buffer size"
default 32 range 0 MR_CFG_HEAP_SIZE
range 0 MR_CFG_HEAP_SIZE default 32
help help
"This option sets the size of the RX (receive) buffer used by the SPI device." "This option sets the size of the RX (receive) buffer used by the SPI device."
endmenu endmenu
# Timer
config MR_USING_TIMER config MR_USING_TIMER
bool "Use Timer device" bool "Use Timer device"
default n default n
help help
"Use this option allows for the use of Timer devices." "Use this option allows for the use of Timer devices."
menu "Timer configure"
depends on MR_USING_TIMER
endmenu
endmenu endmenu
# Driver # Driver

View File

@@ -6,9 +6,9 @@ menu "Components configure"
default n default n
help help
"Use this option allows for the use of the shell." "Use this option allows for the use of the shell."
menu "Msh configure" menu "Msh configure"
depends on MR_USING_MSH depends on MR_USING_MSH
config MR_CFG_MSH_BUFSZ config MR_CFG_MSH_BUFSZ
int "Msh buffer size" int "Msh buffer size"
default 32 default 32
@@ -30,6 +30,25 @@ menu "Components configure"
help help
"This option sets the max number of arguments." "This option sets the max number of arguments."
config MR_CFG_MSH_DEV_NAME
string "Msh device name"
default "serial1"
help
"This option sets the name of the device used by the shell."
config MR_CFG_MSH_NONBLOCKING
bool "Use msh non-blocking"
default n
help
"Use this option allows for the use of the shell non-blocking."
config MR_CFG_MSH_PRINTF_BUFSZ
int "Printf buffer size"
default 128
range 32 2147483647
help
"This option sets the buffer size used by the printf function."
config MR_CFG_MSH_PROMPT config MR_CFG_MSH_PROMPT
string "Msh prompt" string "Msh prompt"
default "msh>" default "msh>"