本文主要是介绍nrf5340 zephyr添加一个宏定义,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1. prj.conf文件添加
CONFIG_FEA_NTC_DETECT_SUPPORT=y #y的前面不要有空格 不然编译报错
2. Kconfig文件添加
#
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#source "Kconfig.zephyr"####
#menu "Nordic LED-Button BLE GATT service sample"#config BT_LBS_SECURITY_ENABLED
# bool "Enable security"
# default y
# select BT_SMP
# select BT_SETTINGS
# select FLASH
# select FLASH_PAGE_LAYOUT
# select FLASH_MAP
# select NVS
# select SETTINGS
# help
# "Enable BLE security for the LED-Button service"#endmenu
####menu "Laisi Config"config PRODUCT_LS340boolselect _UNICODEdefault ymenu "LCM_CONFIG"comment "LCD: width = 360, height = 360, bitsperpixel = 16"config LCD_WIDTHint "LCD_WIDTH"default 360config LCD_HEIGHTint "LCD_HEIGHT"default 360config LCD_BITSPERPIXELint "bitsperpixel"default 16endmenumenu "Peripheral Driver"menuconfig ACC_SUPPORTbool "support_acc"default yif ACC_SUPPORTchoiceprompt "selcet acc ic"default ACC_ICM42607_SUPPORTconfig ACC_ICM42607_SUPPORTbool "icm42607"config ACC_QMA7981_SUPPORTbool "qma7981"endchoiceendifmenuconfig MAGNETIC_SUPPORTbool "support_magetic"default yif MAGNETIC_SUPPORTchoiceprompt "selcet megatic ic"default MAGNETIC_MMC5603_SUPPORTconfig MAGNETIC_MMC5603_SUPPORTbool "mmc5603"endchoiceendifmenuconfig BAROMETER_SUPPORTbool "support_barometer"default nif BAROMETER_SUPPORTchoiceprompt "selcet barometer ic"default BAROMETER_ICP10740_SUPPORTconfig BAROMETER_ICP10740_SUPPORTbool "icp10740"config BAROMETER_QMP6988_SUPPORTbool "qmp6988"endchoiceendifmenuconfig GNSS_SUPPORTbool "support_gnss"default yif GNSS_SUPPORTchoiceprompt "selcet gnss ic"default GNSS_UBLOX_SUPPORTconfig GNSS_UBLOX_SUPPORTbool "ublox"config GNSS_BCM4775B1_SUPPORTbool "bcm4775b1"endchoiceendifmenuconfig HR_SUPPORTbool "support_hr"default yif HR_SUPPORTchoiceprompt "selcet hr ic"default HR_ESconfig HR_ESbool "hr es"endchoiceendifconfig BO_SUPPORTbool "support_bloodoxygen"default yconfig BP_SUPPORTbool "support_bloodpressure"default yconfig LIGHT_SUPPORTbool "support_light_sensitive"default yconfig MOTO_PROTECTbool "support_moto_protect"default yendmenumenu "Function Config"config LIST_LOOP_SUPPORTbool "list loop"default yconfig SOFTKEYBAR_SUPPORTbool "softkeybar"default yconfig CYWEE_LIBbool "cywee_support"default y config USB_QUICKbool "usb_quick"default y config FEA_NTC_DETECT_SUPPORTbool "usb_quick"default y config PWM_CONTROL_BACKLIGHT_SUPPORTbool "pwm control backlight"default y config QRENCODEbool "qrencode"default y endmenuconfig BLE_NETWORK_COREbool "Both BLE host and controller run on network core"helpEnable the whole BLE stack running on network core
config EXAMPLE_RPC_IN_USEbool "load RPC usage example or not"helpif yes,load RPC usage example
choiceprompt "RPC usage mode"depends on EXAMPLE_RPC_IN_USEdefault RPC_REMOTE_APIhelpSelect which RPC mode to use:- API method- simulated UART modeconfig RPC_REMOTE_APIbool "app core and net core communicate by API. that is, app core call net core API, and net core can also call app core API" config RPC_SIMULATE_UARTbool "app core and net core communicate by tx and rx data directly, just like uart"
endchoice
config EXAMPLE_DFU_OTAbool "load DFU example over BLE SMP"helpif yes, load BLE OTA example
config DFU_EXTERNAL_FLASHbool "external flash is used as the secondary slot of MCUBoot"default nhelpif yes, external flash is used as the secondary slot of MCUBoot
endmenu
3. product_definition.h 文件的添加
#ifdef CONFIG_FEA_NTC_DETECT_SUPPORT#define FEA_NTC_DETECT_SUPPORT
#endif
这篇关于nrf5340 zephyr添加一个宏定义的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!