Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/cc110x : Expose Configurations to Kconfig #13897

Merged
merged 2 commits into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/Kconfig.net
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# directory for more details.

menu "Network Device Drivers"
rsource "cc110x/Kconfig"
rsource "mrf24j40/Kconfig"
source "$(RIOTCPU)/nrf52/radio/nrf802154/Kconfig"
endmenu # Network Device Drivers
Expand Down
24 changes: 24 additions & 0 deletions drivers/cc110x/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# 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_CC110X
bool "Configure CC110X driver"
depends on MODULE_CC110X
help
Configure the CC110X driver using Kconfig.

if KCONFIG_MODULE_CC110X

config CC110X_DEFAULT_CHANNEL
int "Configure default channel"
range 0 7
default 0
help
Set the default channel for transmission from the allowed
maximum of 8 (0-7) Channels.
Default channel is 0.

endif # KCONFIG_MODULE_CC110X
2 changes: 1 addition & 1 deletion drivers/cc110x/cc110x_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static int cc110x_init(netdev_t *netdev)
* cc110x_full_calibration
*/
retval = cc110x_apply_config(dev, dev->params.config, dev->params.channels,
CC110X_DEFAULT_CHANNEL);
CONFIG_CC110X_DEFAULT_CHANNEL);
if (retval) {
gpio_irq_disable(dev->params.gdo0);
gpio_irq_disable(dev->params.gdo2);
Expand Down
4 changes: 2 additions & 2 deletions drivers/include/cc110x.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ extern "C" {
/**
* @brief The default channel to set up after initializing the device
*/
#ifndef CC110X_DEFAULT_CHANNEL
#define CC110X_DEFAULT_CHANNEL (0U)
#ifndef CONFIG_CC110X_DEFAULT_CHANNEL
#define CONFIG_CC110X_DEFAULT_CHANNEL (0U)
#endif
/** @} */

Expand Down
2 changes: 1 addition & 1 deletion makefiles/default-radio-settings.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ifndef CONFIG_KCONFIG_MODULE_IEEE802154
ifneq (,$(DEFAULT_CHANNEL))
ifneq (,$(filter cc110x,$(USEMODULE))) # radio is cc110x sub-GHz
CFLAGS += -DCC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL)
CFLAGS += -DCONFIG_CC110X_DEFAULT_CHANNEL=$(DEFAULT_CHANNEL)
endif

ifneq (,$(filter at86rf212b,$(USEMODULE))) # radio is IEEE 802.15.4 sub-GHz
Expand Down