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

Kconfig: Expose gnrc/lorawan configurations #12923

Merged
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
6 changes: 3 additions & 3 deletions sys/include/net/gnrc/lorawan.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ extern "C" {
* @{
*/
/**
* @brief maximum timer drift in percentage
* @brief maximum timer drift in per mille
*
* @note this is only a workaround to compensate inaccurate timers.
*
* E.g a value of 0.1 means there's a positive drift of 0.1% (set timeout to
* E.g a value of 1 means there's a positive drift of 0.1% (set timeout to
* 1000 ms => triggers after 1001 ms)
*/
#ifndef CONFIG_GNRC_LORAWAN_TIMER_DRIFT
#define CONFIG_GNRC_LORAWAN_TIMER_DRIFT 1
#define CONFIG_GNRC_LORAWAN_TIMER_DRIFT 10
#endif

/**
Expand Down
1 change: 1 addition & 0 deletions sys/net/gnrc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
menu "GNRC Network stack"
depends on MODULE_GNRC

rsource "link_layer/lorawan/Kconfig"
rsource "network_layer/ipv6/blacklist/Kconfig"
rsource "network_layer/ipv6/whitelist/Kconfig"

Expand Down
30 changes: 30 additions & 0 deletions sys/net/gnrc/link_layer/lorawan/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright (c) 2019 HAW Hamburg
#
# 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_GNRC_LORAWAN
bool "Configure GNRC LoRaWAN"
depends on MODULE_GNRC_LORAWAN
help
Configure GNRC LoRaWAN module using Kconfig.

if KCONFIG_MODULE_GNRC_LORAWAN

config GNRC_LORAWAN_TIMER_DRIFT
int "Maximum timer drift"
default 10
range -1000 1000
help
The value is expressed in per mille. This is only a workaround to
compensate inaccurate timers. E.g. a value of 1 means there's a
positive drift of 0.1% (set timeout to 1000 ms => triggers after
1001 ms)

config GNRC_LORAWAN_MIN_SYMBOLS_TIMEOUT
int "Minimum symbols to detect a LoRa preamble"
default 30
leandrolanzieri marked this conversation as resolved.
Show resolved Hide resolved
leandrolanzieri marked this conversation as resolved.
Show resolved Hide resolved
range 0 1024

endif # KCONFIG_MODULE_GNRC_LORAWAN
2 changes: 1 addition & 1 deletion sys/net/gnrc/link_layer/lorawan/gnrc_lorawan.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/* This factor is used for converting "real" seconds into microcontroller
* microseconds. This is done in order to correct timer drift.
*/
#define _DRIFT_FACTOR (int) (US_PER_SEC * 100 / (100 + CONFIG_GNRC_LORAWAN_TIMER_DRIFT))
#define _DRIFT_FACTOR (int) (US_PER_SEC * 100 / (100 + (CONFIG_GNRC_LORAWAN_TIMER_DRIFT / 10.0)))

#define GNRC_LORAWAN_DL_RX2_DR_MASK (0x0F) /**< DL Settings DR Offset mask */
#define GNRC_LORAWAN_DL_RX2_DR_POS (0) /**< DL Settings DR Offset pos */
Expand Down