mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-29 16:31:18 +01:00
gnrc/lorawan: Express timer drift in per mille instead of percentage
This commit is contained in:
parent
7d4082a6a3
commit
449da7602d
@ -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
|
||||
|
||||
/**
|
||||
|
||||
@ -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 */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user