1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #13952 from akshaim/Kconfig_rn2xx3

drivers/rn2xx3 : Expose Configurations to Kconfig
This commit is contained in:
Leandro Lanzieri 2020-05-22 15:57:56 +02:00 committed by GitHub
commit d62cf184c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 3 deletions

View File

@ -6,6 +6,9 @@
#
mainmenu "RIOT Configuration"
# Load macro definitions
rsource "kconfig/Kconfig.consts"
# For now, get used modules as macros from this file (see kconfig.mk)
osource "$(KCONFIG_GENERATED_DEPENDENCIES)"

View File

@ -10,6 +10,7 @@ rsource "cc110x/Kconfig"
rsource "dose/Kconfig"
rsource "mrf24j40/Kconfig"
rsource "pn532/Kconfig"
rsource "rn2xx3/Kconfig"
rsource "slipdev/Kconfig"
source "$(RIOTCPU)/nrf52/radio/nrf802154/Kconfig"
endmenu # Network Device Drivers

View File

@ -64,8 +64,8 @@ extern "C" {
/**
* @brief Default sleep duration (in ms)
*/
#ifndef RN2XX3_DEFAULT_SLEEP
#define RN2XX3_DEFAULT_SLEEP (5000U)
#ifndef CONFIG_RN2XX3_DEFAULT_SLEEP
#define CONFIG_RN2XX3_DEFAULT_SLEEP (5000U)
#endif
/** @} */

23
drivers/rn2xx3/Kconfig Normal file
View File

@ -0,0 +1,23 @@
# Copyright (c) 2020 Freie Universitaet Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
menuconfig KCONFIG_MODULE_RN2XX3
bool "Configure RN2XX3 driver"
depends on MODULE_RN2XX3
help
Configure the RN2XX3 driver using Kconfig.
if KCONFIG_MODULE_RN2XX3
config RN2XX3_DEFAULT_SLEEP
int "Sleep duration in milliseconds [ms]"
range 100 $(UINT32_MAX)
default 5000
help
Set the sleep duration (in ms).
The value should be greater than RN2XX3_SLEEP_MIN (100 ms)
endif # KCONFIG_MODULE_RN2XX3

View File

@ -171,7 +171,7 @@ int rn2xx3_init(rn2xx3_t *dev)
dev->sleep_timer.callback = _sleep_timer_cb;
dev->sleep_timer.arg = dev;
rn2xx3_sys_set_sleep_duration(dev, RN2XX3_DEFAULT_SLEEP);
rn2xx3_sys_set_sleep_duration(dev, CONFIG_RN2XX3_DEFAULT_SLEEP);
/* sending empty command to clear uart buffer */
if (rn2xx3_write_cmd(dev) == RN2XX3_TIMEOUT) {

7
kconfig/Kconfig.consts Normal file
View File

@ -0,0 +1,7 @@
# Copyright (c) 2020 Freie Universitaet Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
UINT32_MAX:=4294967295