mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-26 06:53:52 +01:00
pkg/uwb-core: use mynewt-core pkg
This commit is contained in:
parent
7b2debcbd8
commit
eb74b3ace6
@ -1,10 +1,11 @@
|
||||
PKG_NAME=uwb-core
|
||||
PKG_URL=https://github.com/Decawave/uwb-core
|
||||
PKG_VERSION=8ffba63755a932a89d841872ce5bdf35b9c78777
|
||||
PKG_VERSION=66f468659ec3353cf7fd6f2bd14f3a6cef397f4e
|
||||
PKG_LICENSE=Apache-2.0
|
||||
|
||||
include $(RIOTBASE)/pkg/pkg.mk
|
||||
|
||||
CFLAGS += -Wno-enum-compare
|
||||
CFLAGS += -Wno-implicit-int
|
||||
CFLAGS += -Wno-int-conversion
|
||||
CFLAGS += -Wno-strict-prototypes
|
||||
|
||||
@ -3,9 +3,6 @@ USEMODULE += uwb-core_contrib
|
||||
|
||||
DEFAULT_MODULE += auto_init_uwb-core
|
||||
|
||||
USEMODULE += sema
|
||||
USEMODULE += event_callback
|
||||
USEMODULE += xtimer
|
||||
USEMODULE += fmt
|
||||
|
||||
FEATURES_REQUIRED += periph_gpio_irq
|
||||
@ -25,12 +22,17 @@ ifneq (,$(filter uwb-core_uwbcfg,$(USEMODULE)))
|
||||
USEMODULE += uwb-core_config
|
||||
endif
|
||||
|
||||
ifneq (,$(filter uwb-core_dpl,$(USEMODULE)))
|
||||
USEPKG += mynewt-core
|
||||
USEMODULE += mynewt-core_os
|
||||
ifneq (,$(filter nrf%,$(CPU)))
|
||||
USEMODULE += mynewt-core_nrf5x_hal
|
||||
endif
|
||||
endif
|
||||
|
||||
# Some stdlib functions used by the pkg are not in avr-gcc
|
||||
FEATURES_BLACKLIST += arch_avr8
|
||||
# uwb-core has specific compilation sources when compiling kernel
|
||||
# libraries these introduce additional compilation issues that have not
|
||||
# been addressed in this port
|
||||
FEATURES_BLACKLIST += arch_native
|
||||
|
||||
# LLVM ARM shows issues with missing definitions for stdatomic
|
||||
TOOLCHAINS_BLACKLIST += llvm
|
||||
|
||||
@ -14,9 +14,7 @@ INCLUDES += -I$(PKGDIRBASE)/uwb-core/hw/drivers/uwb/include/ \
|
||||
-I$(RIOTPKG)/uwb-core/include \
|
||||
#
|
||||
|
||||
DIRS += $(RIOTPKG)/uwb-core/dpl \
|
||||
$(RIOTPKG)/uwb-core/contrib \
|
||||
#
|
||||
PSEUDOMODULES += uwb-core_dpl
|
||||
|
||||
# A cflag to indicate in pkg code that we are building for RIOT
|
||||
CFLAGS += -DRIOT
|
||||
DIRS += $(RIOTPKG)/uwb-core/contrib \
|
||||
#
|
||||
|
||||
@ -17,13 +17,14 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdatomic.h>
|
||||
|
||||
#include "thread.h"
|
||||
#include "event.h"
|
||||
#include "event/callback.h"
|
||||
#include "uwb_core.h"
|
||||
|
||||
#include "os/os_cputime.h"
|
||||
#include "hal/hal_timer.h"
|
||||
|
||||
#ifndef UWB_CORE_STACKSIZE
|
||||
#define UWB_CORE_STACKSIZE (THREAD_STACKSIZE_LARGE)
|
||||
#endif
|
||||
@ -35,11 +36,10 @@ static char _stack_uwb_core[UWB_CORE_STACKSIZE];
|
||||
|
||||
static event_queue_t _queue;
|
||||
|
||||
atomic_uint dpl_in_critical = 0;
|
||||
|
||||
static void *_uwb_core_thread(void *arg)
|
||||
{
|
||||
(void)arg;
|
||||
|
||||
event_queue_init(&_queue);
|
||||
event_loop(&_queue);
|
||||
/* never reached */
|
||||
|
||||
@ -45,35 +45,35 @@ void uwb_core_init(void)
|
||||
uwb_dw1000_set_buffs(&dev, _dw1000_tx_buffer, _dw1000_rx_buffer);
|
||||
/* setup dw1000 device */
|
||||
uwb_dw1000_setup(&dev, (void *) &dw1000_params[0]);
|
||||
/* this will start a thread handling dw1000 device*/
|
||||
/* this will start a thread handling dw1000 device */
|
||||
uwb_dw1000_config_and_start(&dev);
|
||||
|
||||
/* init uwb pkg's */
|
||||
if (IS_USED(MODULE_UWB_CORE_RNG)) {
|
||||
extern void uwb_rng_pkg_init(void);
|
||||
uwb_rng_pkg_init();
|
||||
}
|
||||
#if IS_USED(MODULE_UWB_CORE_RNG)
|
||||
extern void uwb_rng_pkg_init(void);
|
||||
uwb_rng_pkg_init();
|
||||
#endif
|
||||
|
||||
/* uwb configuration module */
|
||||
if (IS_USED(MODULE_UWB_CORE_UWBCFG)) {
|
||||
extern int uwbcfg_pkg_init(void);
|
||||
uwbcfg_pkg_init();
|
||||
}
|
||||
#if IS_USED(MODULE_UWB_CORE_UWBCFG)
|
||||
extern int uwbcfg_pkg_init(void);
|
||||
uwbcfg_pkg_init();
|
||||
#endif
|
||||
|
||||
/* ranging algorithms */
|
||||
if (IS_USED(MODULE_UWB_CORE_RNG)) {
|
||||
twr_ss_pkg_init();
|
||||
}
|
||||
if (IS_USED(MODULE_UWB_CORE_RNG)) {
|
||||
twr_ss_ack_pkg_init();
|
||||
}
|
||||
if (IS_USED(MODULE_UWB_CORE_RNG)) {
|
||||
twr_ss_ext_pkg_init();
|
||||
}
|
||||
if (IS_USED(MODULE_UWB_CORE_RNG)) {
|
||||
twr_ds_pkg_init();
|
||||
}
|
||||
if (IS_USED(MODULE_UWB_CORE_RNG)) {
|
||||
twr_ds_ext_pkg_init();
|
||||
}
|
||||
#if IS_USED(MODULE_UWB_CORE_TWR_SS)
|
||||
twr_ss_pkg_init();
|
||||
#endif
|
||||
#if IS_USED(MODULE_UWB_CORE_TWR_SS_ACK)
|
||||
twr_ss_ack_pkg_init();
|
||||
#endif
|
||||
#if IS_USED(MODULE_UWB_CORE_TWR_SS_EXT)
|
||||
twr_ss_ext_pkg_init();
|
||||
#endif
|
||||
#if IS_USED(MODULE_UWB_CORE_TWR_DS)
|
||||
twr_ds_pkg_init();
|
||||
#endif
|
||||
#if IS_USED(MODULE_UWB_CORE_TWR_DS_EXT)
|
||||
twr_ds_ext_pkg_init();
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1,3 +0,0 @@
|
||||
MODULE = uwb-core_dpl
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief uwb-core DPL (Decawave Porting Layer) callout
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include "xtimer.h"
|
||||
#include "dpl/dpl_callout.h"
|
||||
|
||||
static void _dpl_callout_timer_cb(void* arg)
|
||||
{
|
||||
struct dpl_callout *c = (struct dpl_callout *) arg;
|
||||
assert(c);
|
||||
|
||||
/* post the event if there is a queue, otherwise call the callback
|
||||
here */
|
||||
if (c->c_q) {
|
||||
dpl_eventq_put(c->c_q, &c->c_e);
|
||||
} else {
|
||||
c->c_e.e.callback(&c->c_e);
|
||||
}
|
||||
}
|
||||
|
||||
void dpl_callout_init(struct dpl_callout *c, struct dpl_eventq *q,
|
||||
dpl_event_fn *e_cb, void *e_arg)
|
||||
{
|
||||
dpl_event_init(&c->c_e, e_cb, e_arg);
|
||||
c->c_q = q;
|
||||
c->timer.callback = _dpl_callout_timer_cb;
|
||||
c->timer.arg = (void*) c;
|
||||
}
|
||||
|
||||
dpl_error_t dpl_callout_reset(struct dpl_callout *c, dpl_time_t ticks)
|
||||
{
|
||||
xtimer_ticks32_t val = {.ticks32 = ticks};
|
||||
xtimer_set(&(c->timer), xtimer_usec_from_ticks(val));
|
||||
return DPL_OK;
|
||||
}
|
||||
|
||||
void dpl_callout_stop(struct dpl_callout *c)
|
||||
{
|
||||
xtimer_remove(&(c->timer));
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Decawave Porting Layer mutex RIOT wrapper
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "mutex.h"
|
||||
#include "dpl/dpl_mutex.h"
|
||||
|
||||
dpl_error_t dpl_mutex_init(struct dpl_mutex *mu)
|
||||
{
|
||||
if (!mu) {
|
||||
return DPL_INVALID_PARAM;
|
||||
}
|
||||
mutex_init(&mu->mutex);
|
||||
return DPL_OK;
|
||||
}
|
||||
|
||||
dpl_error_t dpl_mutex_release(struct dpl_mutex *mu)
|
||||
{
|
||||
if (!mu) {
|
||||
return DPL_INVALID_PARAM;
|
||||
}
|
||||
|
||||
mutex_unlock(&mu->mutex);
|
||||
return DPL_OK;
|
||||
}
|
||||
|
||||
dpl_error_t dpl_mutex_pend(struct dpl_mutex *mu, uint32_t timeout)
|
||||
{
|
||||
int rc = DPL_OK;
|
||||
|
||||
if (!mu) {
|
||||
return DPL_INVALID_PARAM;
|
||||
}
|
||||
|
||||
if (!timeout) {
|
||||
rc = mutex_trylock(&mu->mutex);
|
||||
}
|
||||
else {
|
||||
/* TODO: no timeout equivalent */
|
||||
mutex_lock(&mu->mutex);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Decawave Porting Layer semaphore RIOT wrapper
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "irq.h"
|
||||
#include "dpl/dpl_sem.h"
|
||||
|
||||
dpl_error_t dpl_sem_init(struct dpl_sem *sem, uint16_t tokens)
|
||||
{
|
||||
if (!sem) {
|
||||
return DPL_INVALID_PARAM;
|
||||
}
|
||||
|
||||
sema_create(&sem->sema, tokens);
|
||||
return DPL_OK;
|
||||
}
|
||||
|
||||
dpl_error_t dpl_sem_release(struct dpl_sem *sem)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!sem) {
|
||||
return DPL_INVALID_PARAM;
|
||||
}
|
||||
|
||||
ret = sema_post(&sem->sema);
|
||||
|
||||
return (ret) ? DPL_ERROR : DPL_OK;
|
||||
}
|
||||
|
||||
uint16_t dpl_sem_get_count(struct dpl_sem *sem)
|
||||
{
|
||||
unsigned state = irq_disable();
|
||||
unsigned int value = sem->sema.value;
|
||||
irq_restore(state);
|
||||
return value;
|
||||
}
|
||||
|
||||
dpl_error_t dpl_sem_pend(struct dpl_sem *sem, dpl_time_t timeout)
|
||||
{
|
||||
int ret = sema_wait_timed(&sem->sema, timeout);
|
||||
return (ret) ? DPL_ERROR : DPL_OK;
|
||||
}
|
||||
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Decawave Porting Layer tasks RIOT wrapper
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include "dpl/dpl_error.h"
|
||||
#include "dpl/dpl_tasks.h"
|
||||
#include "thread.h"
|
||||
|
||||
#ifndef LOG_LEVEL
|
||||
#define LOG_LEVEL LOG_INFO
|
||||
#endif
|
||||
#include "log.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int dpl_task_init(struct dpl_task *t, const char *name, dpl_task_func_t func,
|
||||
void *arg, uint8_t prio, dpl_time_t sanity_itvl,
|
||||
dpl_stack_t *stack_bottom, uint16_t stack_size)
|
||||
{
|
||||
(void) sanity_itvl;
|
||||
|
||||
LOG_INFO("dpl: starting thread %s\n", name);
|
||||
|
||||
kernel_pid_t pid = thread_create(stack_bottom, (int) stack_size,
|
||||
prio, THREAD_CREATE_STACKTEST,
|
||||
func, arg, name);
|
||||
|
||||
t->pid = pid;
|
||||
|
||||
return (pid) ? DPL_ERROR : DPL_OK;;
|
||||
}
|
||||
|
||||
int dpl_task_remove(struct dpl_task *t)
|
||||
{
|
||||
thread_zombify();
|
||||
return thread_kill_zombie(t->pid);
|
||||
}
|
||||
|
||||
uint8_t dpl_task_count(void)
|
||||
{
|
||||
return sched_num_threads;
|
||||
}
|
||||
|
||||
void dpl_task_yield(void)
|
||||
{
|
||||
thread_yield();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@ -32,7 +32,6 @@
|
||||
#include "dpl/dpl_tasks.h"
|
||||
#include "dpl/dpl_time.h"
|
||||
#include "kernel_defines.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@ -23,23 +23,17 @@
|
||||
#ifndef DPL_DPL_CALLOUT_H
|
||||
#define DPL_DPL_CALLOUT_H
|
||||
|
||||
#include "xtimer.h"
|
||||
|
||||
#include "dpl/dpl_types.h"
|
||||
#include "dpl/dpl_eventq.h"
|
||||
#include "dpl/dpl_error.h"
|
||||
#include "os/os_callout.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief callout structure
|
||||
* @brief dpl callout wrapper
|
||||
*/
|
||||
struct dpl_callout {
|
||||
xtimer_t timer; /**< timer */
|
||||
struct dpl_event c_e; /**< callout event */
|
||||
struct dpl_eventq *c_q; /**< callout event queue */
|
||||
struct os_callout co; /**< the callout */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -56,8 +50,11 @@ struct dpl_callout {
|
||||
* @param[in] e_cb callback function
|
||||
* @param[in] e_arg callback function argument
|
||||
*/
|
||||
void dpl_callout_init(struct dpl_callout *c, struct dpl_eventq *q,
|
||||
dpl_event_fn *e_cb, void *e_arg);
|
||||
static inline void dpl_callout_init(struct dpl_callout *c, struct dpl_eventq *q,
|
||||
dpl_event_fn *e_cb, void *e_arg)
|
||||
{
|
||||
os_callout_init(&c->co, &q->evq, (os_event_fn *) e_cb, e_arg);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reset the callout to fire off in 'ticks' ticks.
|
||||
@ -67,14 +64,20 @@ void dpl_callout_init(struct dpl_callout *c, struct dpl_eventq *q,
|
||||
*
|
||||
* @return 0 on success, non-zero on failure
|
||||
*/
|
||||
dpl_error_t dpl_callout_reset(struct dpl_callout *c, dpl_time_t ticks);
|
||||
static inline dpl_error_t dpl_callout_reset(struct dpl_callout *c, dpl_time_t ticks)
|
||||
{
|
||||
return (dpl_error_t) os_callout_reset(&c->co, ticks);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Stops the callout from firing.
|
||||
*
|
||||
* @param[in] c the callout to stop
|
||||
*/
|
||||
void dpl_callout_stop(struct dpl_callout *c);
|
||||
static inline void dpl_callout_stop(struct dpl_callout *c)
|
||||
{
|
||||
os_callout_stop(&c->co);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -24,10 +24,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "xtimer.h"
|
||||
#include "hal/hal_timer.h"
|
||||
#include "os/os_cputime.h"
|
||||
|
||||
/**
|
||||
* Returns the low 32 bits of cputime.
|
||||
@ -36,7 +33,7 @@ extern "C" {
|
||||
*/
|
||||
static inline uint32_t dpl_cputime_get32(void)
|
||||
{
|
||||
return xtimer_now().ticks32;
|
||||
return os_cputime_get32();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -48,7 +45,7 @@ static inline uint32_t dpl_cputime_get32(void)
|
||||
*/
|
||||
static inline uint32_t dpl_cputime_usecs_to_ticks(uint32_t usecs)
|
||||
{
|
||||
return xtimer_ticks_from_usec(usecs).ticks32;
|
||||
return os_cputime_usecs_to_ticks(usecs);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -60,8 +57,7 @@ static inline uint32_t dpl_cputime_usecs_to_ticks(uint32_t usecs)
|
||||
*/
|
||||
static inline uint32_t dpl_cputime_ticks_to_usecs(uint32_t ticks)
|
||||
{
|
||||
xtimer_ticks32_t val = {.ticks32 = ticks};
|
||||
return xtimer_usec_from_ticks(val);
|
||||
return os_cputime_ticks_to_usecs(ticks);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,8 +67,7 @@ static inline uint32_t dpl_cputime_ticks_to_usecs(uint32_t ticks)
|
||||
*/
|
||||
static inline void dpl_cputime_delay_ticks(uint32_t ticks)
|
||||
{
|
||||
xtimer_ticks32_t val = {.ticks32 = ticks};
|
||||
xtimer_tsleep32((xtimer_ticks32_t) val);
|
||||
os_cputime_delay_ticks(ticks);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,7 +77,7 @@ static inline void dpl_cputime_delay_ticks(uint32_t ticks)
|
||||
*/
|
||||
static inline void dpl_cputime_delay_usecs(uint32_t usecs)
|
||||
{
|
||||
xtimer_usleep(usecs);
|
||||
os_cputime_delay_usecs(usecs);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,8 +90,7 @@ static inline void dpl_cputime_delay_usecs(uint32_t usecs)
|
||||
static inline void dpl_cputime_timer_init(struct hal_timer *timer, hal_timer_cb fp,
|
||||
void *arg)
|
||||
{
|
||||
timer->timer.callback = fp;
|
||||
timer->timer.arg = arg;
|
||||
os_cputime_timer_init(timer, fp, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -107,15 +101,14 @@ static inline void dpl_cputime_timer_init(struct hal_timer *timer, hal_timer_cb
|
||||
*
|
||||
* @param timer Pointer to timer to start. Cannot be NULL.
|
||||
* @param cputime The cputime at which the timer should expire.
|
||||
*
|
||||
*time
|
||||
* @return int 0 on success; EINVAL if timer already started or timer struct
|
||||
* invalid
|
||||
*
|
||||
*/
|
||||
static inline int dpl_cputime_timer_start(struct hal_timer *timer, uint32_t cputime)
|
||||
{
|
||||
xtimer_set(&timer->timer, xtimer_now_usec() + cputime);
|
||||
return 0;
|
||||
return os_cputime_timer_start(timer, cputime);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,13 +125,7 @@ static inline int dpl_cputime_timer_start(struct hal_timer *timer, uint32_t cput
|
||||
*/
|
||||
static inline int dpl_cputime_timer_relative(struct hal_timer *timer, uint32_t usecs)
|
||||
{
|
||||
uint32_t now = xtimer_now_usec();
|
||||
if (now > usecs) {
|
||||
xtimer_set(&timer->timer, now);
|
||||
} else {
|
||||
xtimer_set(&timer->timer, 0);
|
||||
}
|
||||
return 0;
|
||||
return os_cputime_timer_relative(timer, usecs);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,7 +139,7 @@ static inline int dpl_cputime_timer_relative(struct hal_timer *timer, uint32_t u
|
||||
*/
|
||||
static inline void dpl_cputime_timer_stop(struct hal_timer *timer)
|
||||
{
|
||||
xtimer_remove(&timer->timer);
|
||||
os_cputime_timer_stop(timer);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -24,29 +24,31 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "os/os_error.h"
|
||||
|
||||
/**
|
||||
* @brief DPL error types
|
||||
*/
|
||||
enum dpl_error {
|
||||
DPL_OK = 0,
|
||||
DPL_ENOMEM = 1,
|
||||
DPL_EINVAL = 2,
|
||||
DPL_INVALID_PARAM = 3,
|
||||
DPL_MEM_NOT_ALIGNED = 4,
|
||||
DPL_BAD_MUTEX = 5,
|
||||
DPL_TIMEOUT = 6,
|
||||
DPL_ERR_IN_ISR = 7,
|
||||
DPL_ERR_PRIV = 8,
|
||||
DPL_OS_NOT_STARTED = 9,
|
||||
DPL_ENOENT = 10,
|
||||
DPL_EBUSY = 11,
|
||||
DPL_ERROR = 12,
|
||||
DPL_OK = OS_OK,
|
||||
DPL_ENOMEM = OS_ENOMEM,
|
||||
DPL_EINVAL = OS_EINVAL,
|
||||
DPL_INVALID_PARAM = OS_INVALID_PARM,
|
||||
DPL_MEM_NOT_ALIGNED = OS_MEM_NOT_ALIGNED,
|
||||
DPL_BAD_MUTEX = OS_BAD_MUTEX,
|
||||
DPL_TIMEOUT = OS_TIMEOUT,
|
||||
DPL_ERR_IN_ISR = OS_ERR_IN_ISR,
|
||||
DPL_ERR_PRIV = OS_ERR_PRIV,
|
||||
DPL_OS_NOT_STARTED = OS_NOT_STARTED,
|
||||
DPL_ENOENT = OS_ENOENT,
|
||||
DPL_EBUSY = OS_EBUSY,
|
||||
DPL_ERROR = OS_ERROR ,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief dep error type
|
||||
* @brief dpl error type
|
||||
*/
|
||||
typedef enum dpl_error dpl_error_t;
|
||||
typedef os_error_t dpl_error_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
|
||||
#include <dpl/dpl_types.h>
|
||||
|
||||
#include "os/os_eventq.h"
|
||||
#include "uwb_core.h"
|
||||
#include "event/callback.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -32,18 +32,15 @@ extern "C" {
|
||||
/**
|
||||
* @brief dpl event wrapper
|
||||
*/
|
||||
struct dpl_event
|
||||
{
|
||||
event_callback_t e; /**< the event callback */
|
||||
void *arg; /**< the event argument */
|
||||
struct dpl_event {
|
||||
struct os_event ev; /**< the envent */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief dpl event queue wrapper
|
||||
*/
|
||||
struct dpl_eventq
|
||||
{
|
||||
event_queue_t q; /**< the event queue */
|
||||
struct dpl_eventq {
|
||||
struct os_eventq evq; /**< the event queue */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -61,13 +58,7 @@ typedef void dpl_event_fn(struct dpl_event *ev);
|
||||
static inline void dpl_event_init(struct dpl_event *ev, dpl_event_fn * fn,
|
||||
void *arg)
|
||||
{
|
||||
/*
|
||||
* Need to clear list_node manually since init function below does not do
|
||||
* this.
|
||||
*/
|
||||
ev->e.super.list_node.next = NULL;
|
||||
event_callback_init(&ev->e, (void(*)(void *))fn, ev);
|
||||
ev->arg = arg;
|
||||
os_event_init(&ev->ev, (os_event_fn*) fn, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -79,7 +70,7 @@ static inline void dpl_event_init(struct dpl_event *ev, dpl_event_fn * fn,
|
||||
*/
|
||||
static inline bool dpl_event_is_queued(struct dpl_event *ev)
|
||||
{
|
||||
return (ev->e.super.list_node.next != NULL);
|
||||
return os_event_is_queued(&ev->ev);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,7 +80,7 @@ static inline bool dpl_event_is_queued(struct dpl_event *ev)
|
||||
*/
|
||||
static inline void *dpl_event_get_arg(struct dpl_event *ev)
|
||||
{
|
||||
return ev->arg;
|
||||
return os_event_get_arg(&ev->ev);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -100,7 +91,7 @@ static inline void *dpl_event_get_arg(struct dpl_event *ev)
|
||||
*/
|
||||
static inline void dpl_event_set_arg(struct dpl_event *ev, void *arg)
|
||||
{
|
||||
ev->arg = arg;
|
||||
os_event_set_arg(&ev->ev, arg);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -110,7 +101,7 @@ static inline void dpl_event_set_arg(struct dpl_event *ev, void *arg)
|
||||
*/
|
||||
static inline void dpl_event_run(struct dpl_event *ev)
|
||||
{
|
||||
ev->e.super.handler(&ev->e.super);
|
||||
os_event_run(&ev->ev);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,7 +111,7 @@ static inline void dpl_event_run(struct dpl_event *ev)
|
||||
*/
|
||||
static inline void dpl_eventq_init(struct dpl_eventq *evq)
|
||||
{
|
||||
event_queue_init_detached(&evq->q);
|
||||
os_eventq_init(&evq->evq);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -130,7 +121,7 @@ static inline void dpl_eventq_init(struct dpl_eventq *evq)
|
||||
*/
|
||||
static inline int dpl_eventq_inited(struct dpl_eventq *evq)
|
||||
{
|
||||
return evq->q.waiter != NULL;
|
||||
return os_eventq_inited(&evq->evq);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,11 +146,7 @@ static inline void dpl_eventq_deinit(struct dpl_eventq *evq)
|
||||
*/
|
||||
static inline struct dpl_event * dpl_eventq_get(struct dpl_eventq *evq)
|
||||
{
|
||||
if (evq->q.waiter == NULL) {
|
||||
event_queue_claim(&evq->q);
|
||||
}
|
||||
|
||||
return (struct dpl_event *) event_wait(&evq->q);
|
||||
return (struct dpl_event *) os_eventq_get(&evq->evq, DPL_WAIT_FOREVER);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -169,11 +156,7 @@ static inline struct dpl_event * dpl_eventq_get(struct dpl_eventq *evq)
|
||||
*/
|
||||
static inline struct dpl_event * dpl_eventq_get_no_wait(struct dpl_eventq *evq)
|
||||
{
|
||||
if (evq->q.waiter == NULL) {
|
||||
event_queue_claim(&evq->q);
|
||||
}
|
||||
|
||||
return (struct dpl_event *) event_get(&evq->q);
|
||||
return (struct dpl_event *) os_eventq_get_no_wait(&evq->evq);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -184,7 +167,7 @@ static inline struct dpl_event * dpl_eventq_get_no_wait(struct dpl_eventq *evq)
|
||||
*/
|
||||
static inline void dpl_eventq_put(struct dpl_eventq *evq, struct dpl_event *ev)
|
||||
{
|
||||
event_post(&evq->q, &ev->e.super);
|
||||
os_eventq_put(&evq->evq, &ev->ev);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -195,7 +178,7 @@ static inline void dpl_eventq_put(struct dpl_eventq *evq, struct dpl_event *ev)
|
||||
*/
|
||||
static inline void dpl_eventq_remove(struct dpl_eventq *evq, struct dpl_event *ev)
|
||||
{
|
||||
event_cancel(&evq->q, &ev->e.super);
|
||||
os_eventq_remove(&evq->evq, &ev->ev);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -205,8 +188,7 @@ static inline void dpl_eventq_remove(struct dpl_eventq *evq, struct dpl_event *e
|
||||
*/
|
||||
static inline void dpl_eventq_run(struct dpl_eventq *evq)
|
||||
{
|
||||
struct dpl_event *ev = dpl_eventq_get(evq);
|
||||
dpl_event_run(ev);
|
||||
os_eventq_run(&evq->evq);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -218,7 +200,7 @@ static inline void dpl_eventq_run(struct dpl_eventq *evq)
|
||||
*/
|
||||
static inline bool dpl_eventq_is_empty(struct dpl_eventq *evq)
|
||||
{
|
||||
return clist_count(&(evq->q.event_list)) == 0;
|
||||
return os_eventq_is_empty(&evq->evq);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -231,7 +213,7 @@ static inline bool dpl_eventq_is_empty(struct dpl_eventq *evq)
|
||||
*/
|
||||
static inline struct dpl_eventq * dpl_eventq_dflt_get(void)
|
||||
{
|
||||
return (struct dpl_eventq*) uwb_core_get_eventq();
|
||||
return (struct dpl_eventq *) uwb_core_get_eventq();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -20,10 +20,7 @@
|
||||
#ifndef DPL_DPL_MUTEX_H
|
||||
#define DPL_DPL_MUTEX_H
|
||||
|
||||
#include "dpl_types.h"
|
||||
#include "dpl_error.h"
|
||||
|
||||
#include "mutex.h"
|
||||
#include "os/os_mutex.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -33,7 +30,7 @@ extern "C" {
|
||||
* @brief dpl mutex wrapper
|
||||
*/
|
||||
struct dpl_mutex {
|
||||
mutex_t mutex; /**< the mutex */
|
||||
struct os_mutex mu; /**< the mutex */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -41,7 +38,10 @@ struct dpl_mutex {
|
||||
*
|
||||
* @param[out] mu pre-allocated mutex structure, must not be NULL.
|
||||
*/
|
||||
dpl_error_t dpl_mutex_init(struct dpl_mutex *mu);
|
||||
static inline dpl_error_t dpl_mutex_init(struct dpl_mutex *mu)
|
||||
{
|
||||
return (dpl_error_t) os_mutex_init(&mu->mu);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pend (wait) for a mutex.
|
||||
@ -55,7 +55,10 @@ dpl_error_t dpl_mutex_init(struct dpl_mutex *mu);
|
||||
* DPL_INVALID_PARM mutex passed in was NULL
|
||||
* DPL_OK no error
|
||||
*/
|
||||
dpl_error_t dpl_mutex_pend(struct dpl_mutex *mu, dpl_time_t timeout);
|
||||
static inline dpl_error_t dpl_mutex_pend(struct dpl_mutex *mu, dpl_time_t timeout)
|
||||
{
|
||||
return (dpl_error_t) os_mutex_pend(&mu->mu, timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
@ -65,7 +68,10 @@ dpl_error_t dpl_mutex_pend(struct dpl_mutex *mu, dpl_time_t timeout);
|
||||
* DPL_INVALID_PARM mutex was NULL
|
||||
* DPL_OK no error
|
||||
*/
|
||||
dpl_error_t dpl_mutex_release(struct dpl_mutex *mu);
|
||||
static inline dpl_error_t dpl_mutex_release(struct dpl_mutex *mu)
|
||||
{
|
||||
return (dpl_error_t) os_mutex_release(&mu->mu);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief uwb-core DPL (Decawave Porting Layer) error types
|
||||
* @brief uwb-core DPL (Decawave Porting Layer) os abstraction layer
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
@ -20,12 +20,7 @@
|
||||
#ifndef DPL_DPL_OS_H
|
||||
#define DPL_DPL_OS_H
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdint.h>
|
||||
#include <stdatomic.h>
|
||||
|
||||
#include "irq.h"
|
||||
#include "dpl/dpl_types.h"
|
||||
#include "os/os.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -35,20 +30,15 @@ extern "C" {
|
||||
* @name Entering and exiting critical section defines
|
||||
* @{
|
||||
*/
|
||||
#define DPL_ENTER_CRITICAL(_sr) (_sr = dpl_hw_enter_critical())
|
||||
#define DPL_EXIT_CRITICAL(_sr) (dpl_hw_exit_critical(_sr))
|
||||
#define DPL_ASSERT_CRITICAL() assert(dpl_hw_is_in_critical())
|
||||
#define DPL_ENTER_CRITICAL(_sr) (_sr = os_hw_enter_critical())
|
||||
#define DPL_EXIT_CRITICAL(_sr) (os_hw_exit_critical(_sr))
|
||||
#define DPL_ASSERT_CRITICAL() assert(os_hw_is_in_critical())
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief variable to check if ISR are disabled
|
||||
*/
|
||||
extern atomic_uint dpl_in_critical;
|
||||
|
||||
/**
|
||||
* @brief CPU status register
|
||||
*/
|
||||
typedef uint32_t dpl_sr_t;
|
||||
typedef os_sr_t dpl_sr_t;
|
||||
|
||||
/**
|
||||
* @brief Disable ISRs
|
||||
@ -57,10 +47,7 @@ typedef uint32_t dpl_sr_t;
|
||||
*/
|
||||
static inline uint32_t dpl_hw_enter_critical(void)
|
||||
{
|
||||
uint32_t ctx = irq_disable();
|
||||
unsigned int count = atomic_load(&dpl_in_critical);
|
||||
atomic_store(&dpl_in_critical, count + 1);
|
||||
return ctx;
|
||||
return os_hw_enter_critical();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,9 +57,7 @@ static inline uint32_t dpl_hw_enter_critical(void)
|
||||
*/
|
||||
static inline void dpl_hw_exit_critical(uint32_t ctx)
|
||||
{
|
||||
unsigned int count = atomic_load(&dpl_in_critical);
|
||||
atomic_store(&dpl_in_critical, count - 1);
|
||||
irq_restore((unsigned)ctx);
|
||||
os_hw_exit_critical(ctx);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -82,12 +67,7 @@ static inline void dpl_hw_exit_critical(uint32_t ctx)
|
||||
*/
|
||||
static inline bool dpl_hw_is_in_critical(void)
|
||||
{
|
||||
/*
|
||||
* XXX Currently RIOT does not support an API for finding out if interrupts
|
||||
* are currently disabled, hence in a critical section in this context.
|
||||
* So for now, we use this global variable to keep this state for us.
|
||||
*/
|
||||
return (atomic_load(&dpl_in_critical) > 0);
|
||||
return os_hw_is_in_critical();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -22,10 +22,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "dpl_types.h"
|
||||
#include "dpl_error.h"
|
||||
|
||||
#include "sema.h"
|
||||
#include "os/os_sem.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -35,7 +32,7 @@ extern "C" {
|
||||
* @brief dpl semaphore wrapper
|
||||
*/
|
||||
struct dpl_sem {
|
||||
sema_t sema; /**< the semaphore */
|
||||
struct os_sem sem; /**< the semaphore */
|
||||
};
|
||||
|
||||
/**
|
||||
@ -48,7 +45,10 @@ struct dpl_sem {
|
||||
* DPL_INVALID_PARM Semaphore passed in was NULL.
|
||||
* DPL_OK no error.
|
||||
*/
|
||||
dpl_error_t dpl_sem_init(struct dpl_sem *sem, uint16_t tokens);
|
||||
static inline dpl_error_t dpl_sem_init(struct dpl_sem *sem, uint16_t tokens)
|
||||
{
|
||||
return (dpl_error_t) os_sem_init(&sem->sem, tokens);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Pend (wait) for a semaphore.
|
||||
@ -64,7 +64,10 @@ dpl_error_t dpl_sem_init(struct dpl_sem *sem, uint16_t tokens);
|
||||
* DPL_TIMEOUT semaphore was owned by another task and timeout=0
|
||||
* DPL_OK no error
|
||||
*/
|
||||
dpl_error_t dpl_sem_pend(struct dpl_sem *sem, dpl_time_t timeout);
|
||||
static inline dpl_error_t dpl_sem_pend(struct dpl_sem *sem, dpl_time_t timeout)
|
||||
{
|
||||
return (dpl_error_t) os_sem_pend(&sem->sem, timeout);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Release a semaphore.
|
||||
@ -75,12 +78,18 @@ dpl_error_t dpl_sem_pend(struct dpl_sem *sem, dpl_time_t timeout);
|
||||
* DPL_INVALID_PARM semaphore passed in was NULL.
|
||||
* DPL_OK no error
|
||||
*/
|
||||
dpl_error_t dpl_sem_release(struct dpl_sem *sem);
|
||||
static inline dpl_error_t dpl_sem_release(struct dpl_sem *sem)
|
||||
{
|
||||
return (dpl_error_t) os_sem_release(&sem->sem);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get current semaphore's count
|
||||
*/
|
||||
uint16_t dpl_sem_get_count(struct dpl_sem *sem);
|
||||
static inline int16_t dpl_sem_get_count(struct dpl_sem *sem)
|
||||
{
|
||||
return os_sem_get_count(&sem->sem);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -20,10 +20,7 @@
|
||||
#ifndef DPL_DPL_TASKS_H
|
||||
#define DPL_DPL_TASKS_H
|
||||
|
||||
#include "dpl_types.h"
|
||||
|
||||
#include "sched.h"
|
||||
#include "thread.h"
|
||||
#include "os/os_task.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -33,13 +30,13 @@ extern "C" {
|
||||
* @brief dpl task wrapper
|
||||
*/
|
||||
struct dpl_task {
|
||||
kernel_pid_t pid; /**< the process id */
|
||||
struct os_task t; /**< os task */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief dpl task function
|
||||
*/
|
||||
typedef thread_task_func_t dpl_task_func_t;
|
||||
typedef os_task_func_t dpl_task_func_t;
|
||||
|
||||
/**
|
||||
* @brief Initialize a task.
|
||||
@ -60,28 +57,39 @@ typedef thread_task_func_t dpl_task_func_t;
|
||||
*
|
||||
* @return 0 on success, non-zero on failure.
|
||||
*/
|
||||
int dpl_task_init(struct dpl_task *t, const char *name, dpl_task_func_t func,
|
||||
static inline int dpl_task_init(struct dpl_task *t, const char *name, dpl_task_func_t func,
|
||||
void *arg, uint8_t prio, dpl_time_t sanity_itvl,
|
||||
dpl_stack_t *stack_bottom, uint16_t stack_size);
|
||||
|
||||
dpl_stack_t *stack_bottom, uint16_t stack_size)
|
||||
{
|
||||
return os_task_init(&t->t, name, func, arg, prio, sanity_itvl, stack_bottom, stack_size);
|
||||
}
|
||||
/**
|
||||
* @brief removes specified task
|
||||
*
|
||||
* NOTE: This interface is currently experimental and not ready for common use
|
||||
*/
|
||||
int dpl_task_remove(struct dpl_task *t);
|
||||
static inline int dpl_task_remove(struct dpl_task *t)
|
||||
{
|
||||
return os_task_remove(&t->t);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Return the number of tasks initialized.
|
||||
*
|
||||
* @return number of tasks initialized
|
||||
*/
|
||||
uint8_t dpl_task_count(void);
|
||||
static inline uint8_t dpl_task_count(void)
|
||||
{
|
||||
return os_task_count();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Lets current thread yield.
|
||||
*/
|
||||
void dpl_task_yield(void);
|
||||
static inline void dpl_task_yield(void)
|
||||
{
|
||||
return os_task_yield();
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -20,17 +20,12 @@
|
||||
#ifndef DPL_DPL_TIME_H
|
||||
#define DPL_DPL_TIME_H
|
||||
|
||||
#include "xtimer.h"
|
||||
#include "os/os_time.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief DPL ticks per seconds
|
||||
*/
|
||||
#define DPL_TICKS_PER_SEC (XTIMER_HZ)
|
||||
|
||||
/**
|
||||
* @brief Returns the low 32 bits of cputime.
|
||||
*
|
||||
@ -38,7 +33,7 @@ extern "C" {
|
||||
*/
|
||||
static inline dpl_time_t dpl_time_get(void)
|
||||
{
|
||||
return xtimer_now().ticks32;
|
||||
return os_time_get();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,8 +46,7 @@ static inline dpl_time_t dpl_time_get(void)
|
||||
*/
|
||||
static inline dpl_error_t dpl_time_ms_to_ticks(uint32_t ms, dpl_time_t *out_ticks)
|
||||
{
|
||||
*out_ticks = xtimer_ticks_from_usec(ms * US_PER_MS).ticks32;
|
||||
return DPL_OK;
|
||||
return (dpl_error_t) os_time_ms_to_ticks(ms, out_ticks);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,9 +59,7 @@ static inline dpl_error_t dpl_time_ms_to_ticks(uint32_t ms, dpl_time_t *out_tick
|
||||
*/
|
||||
static inline dpl_error_t dpl_time_ticks_to_ms(dpl_time_t ticks, uint32_t *out_ms)
|
||||
{
|
||||
xtimer_ticks32_t val = {.ticks32 = ticks};
|
||||
*out_ms = xtimer_usec_from_ticks(val) * US_PER_MS;
|
||||
return DPL_OK;
|
||||
return (dpl_error_t) os_time_ticks_to_ms(ticks, out_ms);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -79,7 +71,7 @@ static inline dpl_error_t dpl_time_ticks_to_ms(dpl_time_t ticks, uint32_t *out_
|
||||
*/
|
||||
static inline dpl_time_t dpl_time_ms_to_ticks32(uint32_t ms)
|
||||
{
|
||||
return xtimer_ticks_from_usec(ms * US_PER_MS).ticks32;
|
||||
return os_time_ms_to_ticks32(ms);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -91,8 +83,7 @@ static inline dpl_time_t dpl_time_ms_to_ticks32(uint32_t ms)
|
||||
*/
|
||||
static inline dpl_time_t dpl_time_ticks_to_ms32(dpl_time_t ticks)
|
||||
{
|
||||
xtimer_ticks32_t val = {.ticks32 = ticks};
|
||||
return xtimer_usec_from_ticks(val) * US_PER_MS;
|
||||
return os_time_ticks_to_ms32(ticks);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -102,8 +93,7 @@ static inline dpl_time_t dpl_time_ticks_to_ms32(dpl_time_t ticks)
|
||||
*/
|
||||
static inline void dpl_time_delay(dpl_time_t ticks)
|
||||
{
|
||||
xtimer_ticks32_t val = {.ticks32 = ticks};
|
||||
xtimer_tsleep32((xtimer_ticks32_t) val);
|
||||
return os_time_delay(ticks);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "os/os_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -38,26 +40,26 @@ extern "C" {
|
||||
* @name Macro to wait forever on events and mutexes
|
||||
* @{
|
||||
*/
|
||||
#define DPL_TIMEOUT_NEVER (UINT32_MAX)
|
||||
#define DPL_WAIT_FOREVER (DPL_TIMEOUT_NEVER)
|
||||
#define DPL_TIMEOUT_NEVER (OS_TIMEOUT_NEVER)
|
||||
#define DPL_WAIT_FOREVER (OS_WAIT_FOREVER)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Decawave porting layer (DPL) stack alignment requirement
|
||||
* @{
|
||||
*/
|
||||
#define DPL_STACK_ALIGNMENT (4)
|
||||
#define DPL_STACK_ALIGNMENT (OS_ALIGNMENT)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief dpl time type
|
||||
*/
|
||||
typedef uint32_t dpl_time_t;
|
||||
typedef os_time_t dpl_time_t;
|
||||
|
||||
/**
|
||||
* @brief dpl stack buffer type
|
||||
*/
|
||||
typedef char dpl_stack_t;
|
||||
typedef os_stack_t dpl_stack_t;
|
||||
|
||||
/**
|
||||
* @brief dpl float 32 type
|
||||
|
||||
@ -17,17 +17,17 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef MCU_MCU_H
|
||||
#define MCU_MCU_H
|
||||
#ifndef DPL_QUEUE_H
|
||||
#define DPL_QUEUE_H
|
||||
|
||||
#include "os/os_queue.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* empty header */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MCU_MCU_H */
|
||||
#endif /* DPL_QUEUE_H */
|
||||
@ -18,8 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_TWR_DS_H
|
||||
#define SYSCFG_SYSCFG_TWR_DS_H
|
||||
#ifndef DPL_SYSCFG_SYSCFG_TWR_DS_H
|
||||
#define DPL_SYSCFG_SYSCFG_TWR_DS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -50,4 +50,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_TWR_DS_H */
|
||||
#endif /* DPL_SYSCFG_SYSCFG_TWR_DS_H */
|
||||
@ -18,8 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_TWR_DS_EXT_H
|
||||
#define SYSCFG_SYSCFG_TWR_DS_EXT_H
|
||||
#ifndef DPL_SYSCFG_SYSCFG_TWR_DS_EXT_H
|
||||
#define DPL_SYSCFG_SYSCFG_TWR_DS_EXT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -50,4 +50,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_TWR_DS_EXT_H */
|
||||
#endif /* DPL_SYSCFG_SYSCFG_TWR_DS_EXT_H */
|
||||
@ -18,8 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_TWR_SS_H
|
||||
#define SYSCFG_SYSCFG_TWR_SS_H
|
||||
#ifndef DPL_SYSCFG_SYSCFG_TWR_SS_H
|
||||
#define DPL_SYSCFG_SYSCFG_TWR_SS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -50,4 +50,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_TWR_SS_H */
|
||||
#endif /* DPL_SYSCFG_SYSCFG_TWR_SS_H */
|
||||
@ -18,8 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_TWR_SS_ACK_H
|
||||
#define SYSCFG_SYSCFG_TWR_SS_ACK_H
|
||||
#ifndef DPL_SYSCFG_SYSCFG_TWR_SS_ACK_H
|
||||
#define DPL_SYSCFG_SYSCFG_TWR_SS_ACK_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -50,4 +50,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_TWR_SS_ACK_H */
|
||||
#endif /* DPL_SYSCFG_SYSCFG_TWR_SS_ACK_H */
|
||||
@ -18,8 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_TWR_SS_EXT_H
|
||||
#define SYSCFG_SYSCFG_TWR_SS_EXT_H
|
||||
#ifndef DPL_SYSCFG_SYSCFG_TWR_SS_EXT_H
|
||||
#define DPL_SYSCFG_SYSCFG_TWR_SS_EXT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -50,4 +50,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_TWR_SS_EXT_H */
|
||||
#endif /* DPL_SYSCFG_SYSCFG_TWR_SS_EXT_H */
|
||||
@ -18,8 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_UWB_H
|
||||
#define SYSCFG_SYSCFG_UWB_H
|
||||
#ifndef DPL_SYSCFG_SYSCFG_UWB_H
|
||||
#define DPL_SYSCFG_SYSCFG_UWB_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -50,7 +50,7 @@ extern "C" {
|
||||
* @brief Enable init messages showing each package has been initialised
|
||||
*/
|
||||
#ifndef MYNEWT_VAL_UWB_PKG_INIT_LOG
|
||||
#define MYNEWT_VAL_UWB_PKG_INIT_LOG (1)
|
||||
#define MYNEWT_VAL_UWB_PKG_INIT_LOG (0)
|
||||
#endif
|
||||
|
||||
/**
|
||||
@ -141,4 +141,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_UWB_H */
|
||||
#endif /* DPL_SYSCFG_SYSCFG_UWB_H */
|
||||
@ -18,8 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_UWB_RNG_H
|
||||
#define SYSCFG_SYSCFG_UWB_RNG_H
|
||||
#ifndef DPL_SYSCFG_SYSCFG_UWB_RNG_H
|
||||
#define DPL_SYSCFG_SYSCFG_UWB_RNG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -64,4 +64,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_UWB_RNG_H */
|
||||
#endif /* DPL_SYSCFG_SYSCFG_UWB_RNG_H */
|
||||
@ -18,8 +18,8 @@
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_UWBCFG_H
|
||||
#define SYSCFG_SYSCFG_UWBCFG_H
|
||||
#ifndef DPL_SYSCFG_SYSCFG_UWBCFG_H
|
||||
#define DPL_SYSCFG_SYSCFG_UWBCFG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -238,4 +238,4 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_UWBCFG_H */
|
||||
#endif /* DPL_SYSCFG_SYSCFG_UWBCFG_H */
|
||||
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief System logging header for uwb-core
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef LOG_DPL_LOG_H
|
||||
#define LOG_DPL_LOG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "log.h"
|
||||
|
||||
/**
|
||||
* @name Logging convenience defines wrappers
|
||||
* @{
|
||||
*/
|
||||
#define LOG_WARN(...) LOG(LOG_WARNING, __VA_ARGS__)
|
||||
#define LOG_CRITICAL(...) LOG(LOG_ERROR, __VA_ARGS__)
|
||||
#define log_register(__X, __Y, __Z, __A, __B) {}
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Empty log structure
|
||||
*/
|
||||
struct log {
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LOG_DPL_LOG_H */
|
||||
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Abstraction layer for RIOT adaption
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
#ifndef OS_OS_H
|
||||
#define OS_OS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OS_OS_H */
|
||||
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Abstraction layer for RIOT adaption
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
#ifndef OS_OS_DEV_H
|
||||
#define OS_OS_DEV_H
|
||||
|
||||
#include "dpl/dpl.h"
|
||||
#include "dpl/queue.h"
|
||||
|
||||
#include "net/ieee802154.h"
|
||||
#include "net/netdev.h"
|
||||
#include "net/netdev/ieee802154.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Device structure.
|
||||
*/
|
||||
struct os_dev {
|
||||
netdev_ieee802154_t netdev; /**< Netdev parent struct */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Unused define, void cast
|
||||
*/
|
||||
#define OS_DEV_SETHANDLERS(__dev, __open, __close) \
|
||||
(void) __dev; \
|
||||
(void) __open; \
|
||||
(void) __close;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OS_OS_DEV_H */
|
||||
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Abstraction layer for RIOT adaption
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef STATS_STATS_H
|
||||
#define STATS_STATS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* empty header */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* STATS_STATS_H */
|
||||
@ -1,75 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief uwb-core system configurations
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSCFG_SYSCFG_H
|
||||
#define SYSCFG_SYSCFG_H
|
||||
|
||||
#include "kernel_defines.h"
|
||||
|
||||
/**
|
||||
* @name MyNewt header inclusion macro definitions
|
||||
* @{
|
||||
*
|
||||
* This macro exists to ensure code includes this header when needed. If code
|
||||
* checks the existence of a setting directly via ifdef without including this
|
||||
* header, the setting macro will silently evaluate to 0. In contrast, an
|
||||
* attempt to use these macros without including this header will result in a
|
||||
* compiler error.
|
||||
*/
|
||||
#define MYNEWT_VAL(_name) MYNEWT_VAL_ ## _name
|
||||
#define MYNEWT_VAL_CHOICE(_name, _val) MYNEWT_VAL_ ## _name ## __ ## _val
|
||||
/** @} */
|
||||
|
||||
|
||||
/*** @decawave-uwb-core/hw/drivers/uwb */
|
||||
#include "syscfg_uwb.h"
|
||||
|
||||
/*** @decawave-uwb-core/lib/twr_ds */
|
||||
#include "syscfg_twr_ds.h"
|
||||
|
||||
/*** @decawave-uwb-core/lib/twr_ds_ext */
|
||||
#include "syscfg_twr_ds_ext.h"
|
||||
|
||||
/*** @decawave-uwb-core/lib/twr_ss */
|
||||
#include "syscfg_twr_ss.h"
|
||||
|
||||
/*** @decawave-uwb-core/lib/twr_ss_ack */
|
||||
#include "syscfg_twr_ss_ack.h"
|
||||
|
||||
/*** @decawave-uwb-core/lib/twr_ss_ext */
|
||||
#include "syscfg_twr_ss_ext.h"
|
||||
|
||||
/*** @decawave-uwb-core/lib/uwb_rng */
|
||||
#include "syscfg_uwb_rng.h"
|
||||
|
||||
/*** @decawave-uwb-core/sys/uwbcfg */
|
||||
#include "syscfg_uwbcfg.h"
|
||||
|
||||
/*** @decawave-uwb-dw1000/hw/drivers/uwb/uwb_dw1000 */
|
||||
#include "syscfg_uwb_dw1000.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSCFG_SYSCFG_H */
|
||||
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Inria
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup pkg_uwb_core
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief sysinit abstraction layer for RIOT adaption
|
||||
*
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifndef SYSINIT_SYSINIT_H
|
||||
#define SYSINIT_SYSINIT_H
|
||||
|
||||
#include "assert.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief DPL assert macro
|
||||
*/
|
||||
#define SYSINIT_PANIC_ASSERT(rc) assert(rc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSINIT_SYSINIT_H */
|
||||
@ -1,14 +1,14 @@
|
||||
From 0a9b2ebbe97dbe10a7bc9afdf3914b099c0264da Mon Sep 17 00:00:00 2001
|
||||
From 2bda36deef20463ae499298751d1e575fca09480 Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Fri, 14 Aug 2020 14:14:23 +0200
|
||||
Subject: [PATCH 1/7] uwb/uwb.c: use RIOT specific uwb_dev_idx_lookup()
|
||||
Subject: [PATCH 1/5] uwb/uwb.c: use RIOT specific uwb_dev_idx_lookup()
|
||||
|
||||
---
|
||||
hw/drivers/uwb/src/uwb.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/hw/drivers/uwb/src/uwb.c b/hw/drivers/uwb/src/uwb.c
|
||||
index 70c1b71..69e6714 100644
|
||||
index 70c1b71..8a4105f 100644
|
||||
--- a/hw/drivers/uwb/src/uwb.c
|
||||
+++ b/hw/drivers/uwb/src/uwb.c
|
||||
@@ -31,6 +31,8 @@
|
||||
@ -16,7 +16,7 @@ index 70c1b71..69e6714 100644
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
+
|
||||
+#if !defined(RIOT)
|
||||
+#if !defined(RIOT_VERSION)
|
||||
struct uwb_dev*
|
||||
uwb_dev_idx_lookup(int idx)
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
From b7dd28c1fa7610baa00950e8798392102dfd69f9 Mon Sep 17 00:00:00 2001
|
||||
From f4c345b41b6c40c2d57c700fbbff31a92647a2dc Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Thu, 17 Sep 2020 17:00:09 +0200
|
||||
Subject: [PATCH 6/7] lib/json/src: use fmt to avoid newlib issue
|
||||
Subject: [PATCH 2/5] lib/json/src: use fmt to avoid newlib issue
|
||||
|
||||
---
|
||||
lib/json/src/json_encode.c | 8 ++++----
|
||||
@ -1,758 +0,0 @@
|
||||
From cac1c7aeb1db0732519fa6ae27f3f34234c83615 Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Fri, 14 Aug 2020 14:22:29 +0200
|
||||
Subject: [PATCH 2/7] lib/twr_*: enable stats optionally
|
||||
|
||||
---
|
||||
lib/twr_ds/src/twr_ds.c | 41 +++++++++++++----------
|
||||
lib/twr_ds/syscfg.yml | 3 ++
|
||||
lib/twr_ds_ext/src/twr_ds_ext.c | 17 +++++++---
|
||||
lib/twr_ds_ext/syscfg.yml | 3 ++
|
||||
lib/twr_ds_ext_nrng/src/twr_ds_ext_nrng.c | 16 ++++++---
|
||||
lib/twr_ds_ext_nrng/syscfg.yml | 3 ++
|
||||
lib/twr_ds_nrng/src/twr_ds_nrng.c | 16 ++++++---
|
||||
lib/twr_ds_nrng/syscfg.yml | 3 ++
|
||||
lib/twr_ss/src/twr_ss.c | 6 ++++
|
||||
lib/twr_ss/syscfg.yml | 3 ++
|
||||
lib/twr_ss_ack/src/twr_ss_ack.c | 8 +++--
|
||||
lib/twr_ss_ack/syscfg.yml | 3 ++
|
||||
lib/twr_ss_ext/src/twr_ss_ext.c | 15 ++++++---
|
||||
lib/twr_ss_ext/syscfg.yml | 3 ++
|
||||
lib/twr_ss_ext_nrng/src/twr_ss_ext_nrng.c | 9 ++++-
|
||||
lib/twr_ss_ext_nrng/syscfg.yml | 3 ++
|
||||
lib/twr_ss_nrng/src/twr_ss_nrng.c | 39 ++++++++++++++++++---
|
||||
lib/twr_ss_nrng/syscfg.yml | 3 ++
|
||||
18 files changed, 151 insertions(+), 43 deletions(-)
|
||||
|
||||
diff --git a/lib/twr_ds/src/twr_ds.c b/lib/twr_ds/src/twr_ds.c
|
||||
index c73c412..cb5de6a 100644
|
||||
--- a/lib/twr_ds/src/twr_ds.c
|
||||
+++ b/lib/twr_ds/src/twr_ds.c
|
||||
@@ -51,6 +51,23 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+#if MYNEWT_VAL(TWR_DS_STATS)
|
||||
+STATS_SECT_START(twr_ds_stat_section)
|
||||
+ STATS_SECT_ENTRY(complete)
|
||||
+ STATS_SECT_ENTRY(start_tx_error)
|
||||
+STATS_SECT_END
|
||||
+
|
||||
+STATS_NAME_START(twr_ds_stat_section)
|
||||
+ STATS_NAME(twr_ds_stat_section, complete)
|
||||
+ STATS_NAME(twr_ds_stat_section, start_tx_error)
|
||||
+STATS_NAME_END(twr_ds_stat_section)
|
||||
+
|
||||
+STATS_SECT_DECL(twr_ds_stat_section) g_twr_ds_stat;
|
||||
+#define DS_STATS_INC(__X) STATS_INC(g_twr_ds_stat, __X)
|
||||
+#else
|
||||
+#define DS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
+
|
||||
static bool rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs);
|
||||
|
||||
static struct uwb_mac_interface g_cbs[] = {
|
||||
@@ -72,18 +89,6 @@ static struct uwb_mac_interface g_cbs[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
-STATS_SECT_START(twr_ds_stat_section)
|
||||
- STATS_SECT_ENTRY(complete)
|
||||
- STATS_SECT_ENTRY(start_tx_error)
|
||||
-STATS_SECT_END
|
||||
-
|
||||
-STATS_NAME_START(twr_ds_stat_section)
|
||||
- STATS_NAME(twr_ds_stat_section, complete)
|
||||
- STATS_NAME(twr_ds_stat_section, start_tx_error)
|
||||
-STATS_NAME_END(twr_ds_stat_section)
|
||||
-
|
||||
-STATS_SECT_DECL(twr_ds_stat_section) g_twr_ds_stat;
|
||||
-
|
||||
static struct uwb_rng_config g_config = {
|
||||
.tx_holdoff_delay = MYNEWT_VAL(TWR_DS_TX_HOLDOFF), // Send Time delay in usec.
|
||||
.rx_timeout_delay = MYNEWT_VAL(TWR_DS_RX_TIMEOUT) // Receive response timeout in usec
|
||||
@@ -137,6 +142,7 @@ void twr_ds_pkg_init(void)
|
||||
uwb_rng_append_config(g_cbs[i].inst_ptr, &g_rng_cfgs[i]);
|
||||
}
|
||||
|
||||
+#if MYNEWT_VAL(TWR_DS_STATS)
|
||||
rc = stats_init(
|
||||
STATS_HDR(g_twr_ds_stat),
|
||||
STATS_SIZE_INIT_PARMS(g_twr_ds_stat, STATS_SIZE_32),
|
||||
@@ -145,6 +151,7 @@ void twr_ds_pkg_init(void)
|
||||
|
||||
rc = stats_register("twr_ds", STATS_HDR(g_twr_ds_stat));
|
||||
assert(rc == 0);
|
||||
+#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -231,7 +238,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
|
||||
/* Start tx now, the remaining settings can be done whilst sending anyway */
|
||||
if (uwb_start_tx(inst).start_tx_error){
|
||||
- STATS_INC(g_twr_ds_stat, start_tx_error);
|
||||
+ DS_STATS_INC(start_tx_error);
|
||||
dpl_sem_release(&rng->sem);
|
||||
}
|
||||
|
||||
@@ -291,7 +298,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
uwb_set_rxauto_disable(inst, true);
|
||||
|
||||
if (uwb_start_tx(inst).start_tx_error){
|
||||
- STATS_INC(g_twr_ds_stat, start_tx_error);
|
||||
+ DS_STATS_INC(start_tx_error);
|
||||
dpl_sem_release(&rng->sem);
|
||||
}
|
||||
/* Setup when to listen for response, relative the end of our transmitted frame */
|
||||
@@ -337,11 +344,11 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
uwb_set_delay_start(inst, txd.response_tx_delay);
|
||||
|
||||
if (uwb_start_tx(inst).start_tx_error) {
|
||||
- STATS_INC(g_twr_ds_stat, start_tx_error);
|
||||
+ DS_STATS_INC(start_tx_error);
|
||||
dpl_sem_release(&rng->sem);
|
||||
rng_issue_complete(inst);
|
||||
} else {
|
||||
- STATS_INC(g_twr_ds_stat, complete);
|
||||
+ DS_STATS_INC(complete);
|
||||
rng->control.complete_after_tx = 1;
|
||||
}
|
||||
|
||||
@@ -352,7 +359,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
// This code executes on the device that initialed the original request, and has now receive the final response timestamp.
|
||||
// This marks the completion of the double-single-two-way request.
|
||||
|
||||
- STATS_INC(g_twr_ds_stat, complete);
|
||||
+ DS_STATS_INC(complete);
|
||||
dpl_sem_release(&rng->sem);
|
||||
rng_issue_complete(inst);
|
||||
break;
|
||||
diff --git a/lib/twr_ds/syscfg.yml b/lib/twr_ds/syscfg.yml
|
||||
index cb12594..288b8fd 100644
|
||||
--- a/lib/twr_ds/syscfg.yml
|
||||
+++ b/lib/twr_ds/syscfg.yml
|
||||
@@ -10,3 +10,6 @@ syscfg.defs:
|
||||
TWR_DS_RX_TIMEOUT:
|
||||
description: 'TOA timeout delay for DS TWR (usec)'
|
||||
value: ((uint16_t)0x30)
|
||||
+ TWR_DS_STATS:
|
||||
+ description: 'Enable statistics for the twr_ds module'
|
||||
+ value: 1
|
||||
diff --git a/lib/twr_ds_ext/src/twr_ds_ext.c b/lib/twr_ds_ext/src/twr_ds_ext.c
|
||||
index 95f38fe..07cc28c 100644
|
||||
--- a/lib/twr_ds_ext/src/twr_ds_ext.c
|
||||
+++ b/lib/twr_ds_ext/src/twr_ds_ext.c
|
||||
@@ -67,6 +67,7 @@ static struct uwb_mac_interface g_cbs[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
+#if MYNEWT_VAL(TWR_DS_EXT_STATS)
|
||||
STATS_SECT_START(twr_ds_ext_stat_section)
|
||||
STATS_SECT_ENTRY(complete)
|
||||
STATS_SECT_ENTRY(tx_error)
|
||||
@@ -78,6 +79,10 @@ STATS_NAME_START(twr_ds_ext_stat_section)
|
||||
STATS_NAME_END(twr_ds_ext_stat_section)
|
||||
|
||||
static STATS_SECT_DECL(twr_ds_ext_stat_section) g_twr_ds_ext_stat;
|
||||
+#define DS_STATS_INC(__X) STATS_INC(g_twr_ds_ext_stat, __X)
|
||||
+#else
|
||||
+#define DS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
|
||||
static struct uwb_rng_config g_config = {
|
||||
.tx_holdoff_delay = MYNEWT_VAL(TWR_DS_EXT_TX_HOLDOFF), // Send Time delay in usec.
|
||||
@@ -132,6 +137,7 @@ void twr_ds_ext_pkg_init(void)
|
||||
uwb_rng_append_config(g_cbs[i].inst_ptr, &g_rng_cfgs[i]);
|
||||
}
|
||||
|
||||
+#if MYNEWT_VAL(TWR_DS_EXT_STATS)
|
||||
rc = stats_init(
|
||||
STATS_HDR(g_twr_ds_ext_stat),
|
||||
STATS_SIZE_INIT_PARMS(g_twr_ds_ext_stat, STATS_SIZE_32),
|
||||
@@ -140,6 +146,7 @@ void twr_ds_ext_pkg_init(void)
|
||||
|
||||
rc = stats_register("twr_ds_ext", STATS_HDR(g_twr_ds_ext_stat));
|
||||
assert(rc == 0);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -224,7 +231,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
uwb_set_rxauto_disable(inst, true);
|
||||
|
||||
if (uwb_start_tx(inst).start_tx_error){
|
||||
- STATS_INC(g_twr_ds_ext_stat, tx_error);
|
||||
+ DS_STATS_INC(tx_error);
|
||||
dpl_sem_release(&rng->sem);
|
||||
}
|
||||
|
||||
@@ -293,7 +300,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
uwb_set_rxauto_disable(inst, true);
|
||||
|
||||
if (uwb_start_tx(inst).start_tx_error){
|
||||
- STATS_INC(g_twr_ds_ext_stat, tx_error);
|
||||
+ DS_STATS_INC(tx_error);
|
||||
dpl_sem_release(&rng->sem);
|
||||
}
|
||||
/* Setup when to listen for response, relative the end of our transmitted frame */
|
||||
@@ -348,11 +355,11 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
uwb_rng_clear_twr_data(&frame->remote);
|
||||
|
||||
if (uwb_start_tx(inst).start_tx_error) {
|
||||
- STATS_INC(g_twr_ds_ext_stat, tx_error);
|
||||
+ DS_STATS_INC(tx_error);
|
||||
dpl_sem_release(&rng->sem);
|
||||
rng_issue_complete(inst);
|
||||
}else{
|
||||
- STATS_INC(g_twr_ds_ext_stat, complete);
|
||||
+ DS_STATS_INC(complete);
|
||||
rng->control.complete_after_tx = 1;
|
||||
}
|
||||
break;
|
||||
@@ -362,7 +369,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
// This code executes on the device that initialed the original request, and has now receive the final response timestamp.
|
||||
// This marks the completion of the double-single-two-way request.
|
||||
|
||||
- STATS_INC(g_twr_ds_ext_stat, complete);
|
||||
+ DS_STATS_INC(complete);
|
||||
dpl_sem_release(&rng->sem);
|
||||
rng_issue_complete(inst);
|
||||
break;
|
||||
diff --git a/lib/twr_ds_ext/syscfg.yml b/lib/twr_ds_ext/syscfg.yml
|
||||
index 199a671..fe80282 100644
|
||||
--- a/lib/twr_ds_ext/syscfg.yml
|
||||
+++ b/lib/twr_ds_ext/syscfg.yml
|
||||
@@ -10,3 +10,6 @@ syscfg.defs:
|
||||
TWR_DS_EXT_RX_TIMEOUT:
|
||||
description: 'TOA timeout delay for DS TWR extended frame (usec)'
|
||||
value: ((uint16_t)0x40)
|
||||
+ TWR_DS_EXT_STATS:
|
||||
+ description: 'Enable statistics for the twr_ds_ext module'
|
||||
+ value: 1
|
||||
diff --git a/lib/twr_ds_ext_nrng/src/twr_ds_ext_nrng.c b/lib/twr_ds_ext_nrng/src/twr_ds_ext_nrng.c
|
||||
index b2a821e..2b15ae1 100644
|
||||
--- a/lib/twr_ds_ext_nrng/src/twr_ds_ext_nrng.c
|
||||
+++ b/lib/twr_ds_ext_nrng/src/twr_ds_ext_nrng.c
|
||||
@@ -65,6 +65,7 @@ static struct uwb_mac_interface g_cbs = {
|
||||
.final_cb = tx_final_cb,
|
||||
};
|
||||
|
||||
+#if MYNEWT_VAL(TWR_DS_EXT_NRNG_STATS)
|
||||
STATS_SECT_START(twr_ds_ext_nrng_stat_section)
|
||||
STATS_SECT_ENTRY(complete)
|
||||
STATS_SECT_ENTRY(rx_error)
|
||||
@@ -78,6 +79,11 @@ STATS_NAME_START(twr_ds_ext_nrng_stat_section)
|
||||
STATS_NAME_END(twr_ds_ext_nrng_stat_section)
|
||||
|
||||
static STATS_SECT_DECL(twr_ds_ext_nrng_stat_section) g_stat;
|
||||
+#define DS_STATS_INC(__X) STATS_INC(g_stat, __X)
|
||||
+#else
|
||||
+#define DS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
+
|
||||
|
||||
static struct uwb_rng_config g_config = {
|
||||
.tx_holdoff_delay = MYNEWT_VAL(TWR_DS_EXT_NRNG_TX_HOLDOFF), // Send Time delay in usec.
|
||||
@@ -96,6 +102,7 @@ void twr_ds_ext_nrng_pkg_init(void){
|
||||
printf("{\"utime\": %lu,\"msg\": \"twr_ds_ext_nrng_pkg_init\"}\n",os_cputime_ticks_to_usecs(os_cputime_get32()));
|
||||
uwb_mac_append_interface(hal_dw1000_inst(0), &g_cbs);
|
||||
|
||||
+#if MYNEWT_VAL(TWR_DS_EXT_NRNG_STATS)
|
||||
int rc = stats_init(
|
||||
STATS_HDR(g_stat),
|
||||
STATS_SIZE_INIT_PARMS(g_stat, STATS_SIZE_32),
|
||||
@@ -104,6 +111,7 @@ void twr_ds_ext_nrng_pkg_init(void){
|
||||
|
||||
rc = stats_register("twr_ds_ext_nrng", STATS_HDR(g_stat));
|
||||
assert(rc == 0);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -145,7 +153,7 @@ rx_timeout_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs){
|
||||
if(inst->fctrl != FCNTL_IEEE_N_RANGES_16){
|
||||
return false;
|
||||
}
|
||||
- STATS_INC(g_stat, rx_timeout);
|
||||
+ DS_STATS_INC(rx_timeout);
|
||||
assert(inst->nrng);
|
||||
switch(inst->nrng->code){
|
||||
case UWB_DATA_CODE_DS_TWR_NRNG_EXT ... UWB_DATA_CODE_DS_TWR_NRNG_EXT_FINAL:
|
||||
@@ -191,7 +199,7 @@ rx_error_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs){
|
||||
if(inst->fctrl != FCNTL_IEEE_N_RANGES_16){
|
||||
return false;
|
||||
}
|
||||
- STATS_INC(g_stat, rx_error);
|
||||
+ DS_STATS_INC(rx_error);
|
||||
assert(inst->nrng);
|
||||
struct nrng_instance * nrng = inst->nrng;
|
||||
os_error_t err = os_sem_release(&nrng->sem);
|
||||
@@ -371,7 +379,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
if (cbs!=NULL && cbs->start_tx_error_cb)
|
||||
cbs->start_tx_error_cb(inst, cbs);
|
||||
}else{
|
||||
- STATS_INC(g_stat, complete);
|
||||
+ DS_STATS_INC(complete);
|
||||
os_sem_release(&nrng->sem);
|
||||
struct uwb_mac_interface * cbs = NULL;
|
||||
if(!(SLIST_EMPTY(&inst->interface_cbs))){
|
||||
@@ -416,7 +424,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
if(idx == nnodes -1){
|
||||
os_sem_release(&nrng->sem);
|
||||
nrng->resp_count = 0;
|
||||
- STATS_INC(g_stat, complete);
|
||||
+ DS_STATS_INC(complete);
|
||||
struct uwb_mac_interface * cbs = NULL;
|
||||
if(!(SLIST_EMPTY(&inst->interface_cbs))){
|
||||
SLIST_FOREACH(cbs, &inst->interface_cbs, next){
|
||||
diff --git a/lib/twr_ds_ext_nrng/syscfg.yml b/lib/twr_ds_ext_nrng/syscfg.yml
|
||||
index 5fd3404..92a952b 100644
|
||||
--- a/lib/twr_ds_ext_nrng/syscfg.yml
|
||||
+++ b/lib/twr_ds_ext_nrng/syscfg.yml
|
||||
@@ -12,3 +12,6 @@ syscfg.defs:
|
||||
value: ((uint16_t)0x10)
|
||||
TWR_DS_EXT_NRNG_TX_GUARD_DELAY:
|
||||
value: ((uint16_t)0x150)
|
||||
+ TWR_DS_EXT_NRNG_STATS:
|
||||
+ description: 'Enable statistics for the twr_ds_ext_nrng module'
|
||||
+ value: 1
|
||||
diff --git a/lib/twr_ds_nrng/src/twr_ds_nrng.c b/lib/twr_ds_nrng/src/twr_ds_nrng.c
|
||||
index b32b2f8..3aea94a 100644
|
||||
--- a/lib/twr_ds_nrng/src/twr_ds_nrng.c
|
||||
+++ b/lib/twr_ds_nrng/src/twr_ds_nrng.c
|
||||
@@ -61,6 +61,7 @@ static struct uwb_mac_interface g_cbs = {
|
||||
.rx_error_cb = rx_error_cb,
|
||||
};
|
||||
|
||||
+#if MYNEWT_VAL(TWR_DS_NRNG_STATS)
|
||||
STATS_SECT_START(twr_ds_nrng_stat_section)
|
||||
STATS_SECT_ENTRY(complete)
|
||||
STATS_SECT_ENTRY(rx_timeout)
|
||||
@@ -74,6 +75,10 @@ STATS_NAME_START(twr_ds_nrng_stat_section)
|
||||
STATS_NAME_END(twr_ds_nrng_stat_section)
|
||||
|
||||
static STATS_SECT_DECL(twr_ds_nrng_stat_section) g_stat;
|
||||
+#define DS_STATS_INC(__X) STATS_INC(g_stat, __X)
|
||||
+#else
|
||||
+#define DS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
|
||||
static struct uwb_rng_config g_config = {
|
||||
.tx_holdoff_delay = MYNEWT_VAL(TWR_DS_NRNG_TX_HOLDOFF), // Send Time delay in usec.
|
||||
@@ -101,6 +106,7 @@ void twr_ds_nrng_pkg_init(void){
|
||||
uwb_mac_append_interface(uwb_dev_idx_lookup(0), &g_cbs);
|
||||
nrng_append_config(nrng, &g_rng_cfgs);
|
||||
|
||||
+#if MYNEWT_VAL(TWR_DS_NRNG_STATS)
|
||||
int rc = stats_init(
|
||||
STATS_HDR(g_stat),
|
||||
STATS_SIZE_INIT_PARMS(g_stat, STATS_SIZE_32),
|
||||
@@ -109,7 +115,7 @@ void twr_ds_nrng_pkg_init(void){
|
||||
|
||||
rc = stats_register("twr_ds_nrng", STATS_HDR(g_stat));
|
||||
assert(rc == 0);
|
||||
-
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +145,7 @@ rx_timeout_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs){
|
||||
if(inst->fctrl != FCNTL_IEEE_N_RANGES_16){
|
||||
return false;
|
||||
}
|
||||
- STATS_INC(g_stat, rx_timeout);
|
||||
+ DS_STATS_INC(rx_timeout);
|
||||
switch(inst->nrng->code){
|
||||
case UWB_DATA_CODE_DS_TWR_NRNG ... UWB_DATA_CODE_DS_TWR_NRNG_FINAL:
|
||||
{
|
||||
@@ -183,7 +189,7 @@ rx_error_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs){
|
||||
if(inst->fctrl != FCNTL_IEEE_N_RANGES_16){
|
||||
return false;
|
||||
}
|
||||
- STATS_INC(g_stat, rx_error);
|
||||
+ DS_STATS_INC(rx_error);
|
||||
assert(inst->nrng);
|
||||
struct nrng_instance * nrng = inst->nrng;
|
||||
if(os_sem_get_count(&nrng->sem) == 0){
|
||||
@@ -381,7 +387,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
if (cbs!=NULL && cbs->start_tx_error_cb)
|
||||
cbs->start_tx_error_cb(inst, cbs);
|
||||
}else{
|
||||
- STATS_INC(g_stat, complete);
|
||||
+ DS_STATS_INC(complete);
|
||||
os_sem_release(&nrng->sem);
|
||||
struct uwb_mac_interface * cbs = NULL;
|
||||
if(!(SLIST_EMPTY(&inst->interface_cbs))){
|
||||
@@ -430,7 +436,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
frame->transmission_timestamp = dw1000_read_txtime_lo(inst);
|
||||
if(idx == nnodes -1)
|
||||
{
|
||||
- STATS_INC(g_stat, complete);
|
||||
+ DS_STATS_INC(complete);
|
||||
os_sem_release(&nrng->sem);
|
||||
struct uwb_mac_interface * cbs = NULL;
|
||||
if(!(SLIST_EMPTY(&inst->interface_cbs))){
|
||||
diff --git a/lib/twr_ds_nrng/syscfg.yml b/lib/twr_ds_nrng/syscfg.yml
|
||||
index 804234a..28777c1 100644
|
||||
--- a/lib/twr_ds_nrng/syscfg.yml
|
||||
+++ b/lib/twr_ds_nrng/syscfg.yml
|
||||
@@ -12,3 +12,6 @@ syscfg.defs:
|
||||
value: ((uint16_t)0x10)
|
||||
TWR_DS_NRNG_TX_GUARD_DELAY:
|
||||
value: ((uint16_t)0x100)
|
||||
+ TWR_DS_NRNG_STATS:
|
||||
+ description: 'Enable statistics for the twr_ds_nrng module'
|
||||
+ value: 1
|
||||
diff --git a/lib/twr_ss/src/twr_ss.c b/lib/twr_ss/src/twr_ss.c
|
||||
index 84c5084..7394ef4 100644
|
||||
--- a/lib/twr_ss/src/twr_ss.c
|
||||
+++ b/lib/twr_ss/src/twr_ss.c
|
||||
@@ -76,6 +76,7 @@ static struct uwb_mac_interface g_cbs[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
+#if MYNEWT_VAL(TWR_SS_STATS)
|
||||
STATS_SECT_START(twr_ss_stat_section)
|
||||
STATS_SECT_ENTRY(complete)
|
||||
STATS_SECT_ENTRY(tx_error)
|
||||
@@ -88,6 +89,9 @@ STATS_NAME_END(twr_ss_stat_section)
|
||||
|
||||
STATS_SECT_DECL(twr_ss_stat_section) g_twr_ss_stat;
|
||||
#define SS_STATS_INC(__X) STATS_INC(g_twr_ss_stat, __X)
|
||||
+#else
|
||||
+#define SS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
|
||||
static struct uwb_rng_config g_config = {
|
||||
.tx_holdoff_delay = MYNEWT_VAL(TWR_SS_TX_HOLDOFF), // Send Time delay in usec.
|
||||
@@ -143,6 +147,7 @@ twr_ss_pkg_init(void)
|
||||
uwb_rng_append_config(g_cbs[i].inst_ptr, &g_rng_cfgs[i]);
|
||||
}
|
||||
|
||||
+#if MYNEWT_VAL(TWR_SS_STATS)
|
||||
rc = stats_init(
|
||||
STATS_HDR(g_twr_ss_stat),
|
||||
STATS_SIZE_INIT_PARMS(g_twr_ss_stat, STATS_SIZE_32),
|
||||
@@ -151,6 +156,7 @@ twr_ss_pkg_init(void)
|
||||
|
||||
rc |= stats_register("twr_ss", STATS_HDR(g_twr_ss_stat));
|
||||
assert(rc == 0);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/lib/twr_ss/syscfg.yml b/lib/twr_ss/syscfg.yml
|
||||
index e2ab7a5..05dc497 100644
|
||||
--- a/lib/twr_ss/syscfg.yml
|
||||
+++ b/lib/twr_ss/syscfg.yml
|
||||
@@ -10,3 +10,6 @@ syscfg.defs:
|
||||
TWR_SS_RX_TIMEOUT:
|
||||
description: 'TOA timeout delay for SS TWR (usec)'
|
||||
value: ((uint16_t)0x30)
|
||||
+ TWR_SS_STATS:
|
||||
+ description: 'Enable statistics for the twr_ss module'
|
||||
+ value: 1
|
||||
diff --git a/lib/twr_ss_ack/src/twr_ss_ack.c b/lib/twr_ss_ack/src/twr_ss_ack.c
|
||||
index f0e0884..a64ce37 100644
|
||||
--- a/lib/twr_ss_ack/src/twr_ss_ack.c
|
||||
+++ b/lib/twr_ss_ack/src/twr_ss_ack.c
|
||||
@@ -78,7 +78,7 @@ static struct uwb_mac_interface g_cbs[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
-
|
||||
+#if MYNEWT_VAL(TWR_SS_ACK_STATS)
|
||||
STATS_SECT_START(twr_ss_ack_stat_section)
|
||||
STATS_SECT_ENTRY(complete)
|
||||
STATS_SECT_ENTRY(tx_error)
|
||||
@@ -97,7 +97,9 @@ STATS_NAME_END(twr_ss_ack_stat_section)
|
||||
|
||||
STATS_SECT_DECL(twr_ss_ack_stat_section) g_twr_ss_ack_stat;
|
||||
#define SS_STATS_INC(__X) STATS_INC(g_twr_ss_ack_stat, __X)
|
||||
-
|
||||
+#else
|
||||
+#define SS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
|
||||
static struct uwb_rng_config g_config = {
|
||||
.tx_holdoff_delay = MYNEWT_VAL(TWR_SS_ACK_TX_HOLDOFF), // Send Time delay in usec.
|
||||
@@ -154,6 +156,7 @@ twr_ss_ack_pkg_init(void)
|
||||
uwb_rng_append_config(g_cbs[i].inst_ptr, &g_rng_cfgs[i]);
|
||||
}
|
||||
|
||||
+#if MYNEWT_VAL(TWR_SS_ACK_STATS)
|
||||
rc = stats_init(
|
||||
STATS_HDR(g_twr_ss_ack_stat),
|
||||
STATS_SIZE_INIT_PARMS(g_twr_ss_ack_stat, STATS_SIZE_32),
|
||||
@@ -162,6 +165,7 @@ twr_ss_ack_pkg_init(void)
|
||||
|
||||
rc |= stats_register("twr_ss_ack", STATS_HDR(g_twr_ss_ack_stat));
|
||||
assert(rc == 0);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/lib/twr_ss_ack/syscfg.yml b/lib/twr_ss_ack/syscfg.yml
|
||||
index 4a27a9c..52177a2 100644
|
||||
--- a/lib/twr_ss_ack/syscfg.yml
|
||||
+++ b/lib/twr_ss_ack/syscfg.yml
|
||||
@@ -10,3 +10,6 @@ syscfg.defs:
|
||||
TWR_SS_ACK_RX_TIMEOUT:
|
||||
description: 'TOA timeout delay for SS TWR (usec)'
|
||||
value: ((uint16_t)0x100)
|
||||
+ TWR_SS_ACK_STATS:
|
||||
+ description: 'Enable statistics for the twr_ss_ack module'
|
||||
+ value: 1
|
||||
diff --git a/lib/twr_ss_ext/src/twr_ss_ext.c b/lib/twr_ss_ext/src/twr_ss_ext.c
|
||||
index 6e55a13..2ea3384 100644
|
||||
--- a/lib/twr_ss_ext/src/twr_ss_ext.c
|
||||
+++ b/lib/twr_ss_ext/src/twr_ss_ext.c
|
||||
@@ -74,6 +74,7 @@ static struct uwb_mac_interface g_cbs[] = {
|
||||
#endif
|
||||
};
|
||||
|
||||
+#if MYNEWT_VAL(TWR_SS_EXT_STATS)
|
||||
STATS_SECT_START(twr_ss_ext_stat_section)
|
||||
STATS_SECT_ENTRY(complete)
|
||||
STATS_SECT_ENTRY(tx_error)
|
||||
@@ -85,6 +86,10 @@ STATS_NAME_START(twr_ss_ext_stat_section)
|
||||
STATS_NAME_END(twr_ss_ext_stat_section)
|
||||
|
||||
static STATS_SECT_DECL(twr_ss_ext_stat_section) g_twr_ss_ext_stat;
|
||||
+#define SS_STATS_INC(__X) STATS_INC(g_twr_ss_ext_stat __X)
|
||||
+#else
|
||||
+#define SS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
|
||||
static struct uwb_rng_config g_config = {
|
||||
.tx_holdoff_delay = MYNEWT_VAL(TWR_SS_EXT_TX_HOLDOFF), // Send Time delay in usec.
|
||||
@@ -140,12 +145,14 @@ twr_ss_ext_pkg_init(void)
|
||||
uwb_rng_append_config(g_cbs[i].inst_ptr, &g_rng_cfgs[i]);
|
||||
}
|
||||
|
||||
+#if MYNEWT_VAL(TWR_SS_EXT_STATS)
|
||||
rc = stats_init(
|
||||
STATS_HDR(g_twr_ss_ext_stat),
|
||||
STATS_SIZE_INIT_PARMS(g_twr_ss_ext_stat, STATS_SIZE_32),
|
||||
STATS_NAME_INIT_PARMS(twr_ss_ext_stat_section));
|
||||
rc |= stats_register("twr_ss_ext", STATS_HDR(g_twr_ss_ext_stat));
|
||||
assert(rc == 0);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,7 +248,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
uwb_set_delay_start(inst, txd.response_tx_delay);
|
||||
|
||||
if (uwb_start_tx(inst).start_tx_error){
|
||||
- STATS_INC(g_twr_ss_ext_stat, tx_error);
|
||||
+ SS_STATS_INC(tx_error);
|
||||
dpl_sem_release(&rng->sem);
|
||||
}
|
||||
/* Setup when to listen for response, relative the end of our transmitted frame */
|
||||
@@ -284,12 +291,12 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
uwb_set_delay_start(inst, txd.response_tx_delay);
|
||||
|
||||
if (uwb_start_tx(inst).start_tx_error){
|
||||
- STATS_INC(g_twr_ss_ext_stat, tx_error);
|
||||
+ SS_STATS_INC(tx_error);
|
||||
dpl_sem_release(&rng->sem);
|
||||
rng_issue_complete(inst);
|
||||
}
|
||||
else{
|
||||
- STATS_INC(g_twr_ss_ext_stat, complete);
|
||||
+ SS_STATS_INC(complete);
|
||||
rng->control.complete_after_tx = 1;
|
||||
}
|
||||
break;
|
||||
@@ -301,7 +308,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
if (inst->frame_len != sizeof(twr_frame_final_t))
|
||||
break;
|
||||
|
||||
- STATS_INC(g_twr_ss_ext_stat, complete);
|
||||
+ SS_STATS_INC(complete);
|
||||
dpl_sem_release(&rng->sem);
|
||||
rng_issue_complete(inst);
|
||||
break;
|
||||
diff --git a/lib/twr_ss_ext/syscfg.yml b/lib/twr_ss_ext/syscfg.yml
|
||||
index fcca45a..a71963f 100644
|
||||
--- a/lib/twr_ss_ext/syscfg.yml
|
||||
+++ b/lib/twr_ss_ext/syscfg.yml
|
||||
@@ -10,3 +10,6 @@ syscfg.defs:
|
||||
TWR_SS_EXT_RX_TIMEOUT:
|
||||
description: 'TOA timeout delay for SS EXT TWR (usec)'
|
||||
value: ((uint16_t)0x40)
|
||||
+ TWR_SS_EXT_STATS:
|
||||
+ description: 'Enable statistics for the twr_ss_ext module'
|
||||
+ value: 1
|
||||
diff --git a/lib/twr_ss_ext_nrng/src/twr_ss_ext_nrng.c b/lib/twr_ss_ext_nrng/src/twr_ss_ext_nrng.c
|
||||
index 3808785..759f928 100644
|
||||
--- a/lib/twr_ss_ext_nrng/src/twr_ss_ext_nrng.c
|
||||
+++ b/lib/twr_ss_ext_nrng/src/twr_ss_ext_nrng.c
|
||||
@@ -67,6 +67,7 @@ static struct uwb_mac_interface g_cbs = {
|
||||
.final_cb = tx_final_cb,
|
||||
};
|
||||
|
||||
+#if MYNEWT_VAL(TWR_SS_EXT_NRNG_STATS)
|
||||
STATS_SECT_START(twr_ss_ext_nrng_stat_section)
|
||||
STATS_SECT_ENTRY(complete)
|
||||
STATS_SECT_ENTRY(rx_error)
|
||||
@@ -80,6 +81,10 @@ STATS_NAME_START(twr_ss_ext_nrng_stat_section)
|
||||
STATS_NAME_END(twr_ss_ext_nrng_stat_section)
|
||||
|
||||
static STATS_SECT_DECL(twr_ss_ext_nrng_stat_section) g_stat;
|
||||
+#define SS_STATS_INC(__X) STATS_INC(g_stat, __X)
|
||||
+#else
|
||||
+#define SS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
|
||||
static struct uwb_rng_config g_config = {
|
||||
.tx_holdoff_delay = MYNEWT_VAL(TWR_SS_EXT_NRNG_TX_HOLDOFF), // Send Time delay in usec.
|
||||
@@ -107,12 +112,14 @@ void twr_ss_ext_nrng_pkg_init(void)
|
||||
uwb_mac_append_interface(uwb_dev_idx_lookup(0), &g_cbs);
|
||||
nrng_append_config(nrng, &g_rng_cfgs);
|
||||
|
||||
+#if MYNEWT_VAL(TWR_SS_EXT_NRNG_STATS)
|
||||
int rc = stats_init(
|
||||
STATS_HDR(g_stat),
|
||||
STATS_SIZE_INIT_PARMS(g_stat, STATS_SIZE_32),
|
||||
STATS_NAME_INIT_PARMS(twr_ss_ext_nrng_stat_section));
|
||||
rc |= stats_register("ss_ext_nrng", STATS_HDR(g_stat));
|
||||
assert(rc == 0);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,7 +151,7 @@ rx_error_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs){
|
||||
}
|
||||
struct uwb_rng_instance * rng = inst->rng;
|
||||
if(os_sem_get_count(&rng->sem) == 0){
|
||||
- STATS_INC(g_stat, rx_error);
|
||||
+ SS_STATS_INC(rx_error);
|
||||
os_error_t err = os_sem_release(&rng->sem);
|
||||
assert(err == OS_OK);
|
||||
return true;
|
||||
diff --git a/lib/twr_ss_ext_nrng/syscfg.yml b/lib/twr_ss_ext_nrng/syscfg.yml
|
||||
index 997def3..ff8c789 100644
|
||||
--- a/lib/twr_ss_ext_nrng/syscfg.yml
|
||||
+++ b/lib/twr_ss_ext_nrng/syscfg.yml
|
||||
@@ -12,6 +12,9 @@ syscfg.defs:
|
||||
value: ((uint16_t)0x10)
|
||||
TWR_SS_EXT_NRNG_TX_GUARD_DELAY:
|
||||
value: ((uint32_t)0x90)
|
||||
+ TWR_SS_EXT_NRNG_STATS:
|
||||
+ description: 'Enable statistics for the twr_ss_ext_nrng module'
|
||||
+ value: 1
|
||||
CELL_ENABLED:
|
||||
description: 'Cell network model on slot decoding'
|
||||
value: 0
|
||||
diff --git a/lib/twr_ss_nrng/src/twr_ss_nrng.c b/lib/twr_ss_nrng/src/twr_ss_nrng.c
|
||||
index b6550f6..f5a60fc 100644
|
||||
--- a/lib/twr_ss_nrng/src/twr_ss_nrng.c
|
||||
+++ b/lib/twr_ss_nrng/src/twr_ss_nrng.c
|
||||
@@ -52,6 +52,24 @@
|
||||
#define DIAGMSG(s,u)
|
||||
#endif
|
||||
|
||||
+#if MYNEWT_VAL(TWR_SS_NRNG_STATS)
|
||||
+STATS_SECT_START(twr_ss_nrng_stat_section)
|
||||
+ STATS_SECT_ENTRY(complete)
|
||||
+ STATS_SECT_ENTRY(start_tx_error)
|
||||
+STATS_SECT_END
|
||||
+
|
||||
+STATS_NAME_START(twr_ss_nrng_stat_section)
|
||||
+ STATS_NAME(twr_ss_nrng_stat_section, complete)
|
||||
+ STATS_NAME(twr_ss_nrng_stat_section, start_tx_error)
|
||||
+STATS_NAME_END(twr_ss_nrng_stat_section)
|
||||
+
|
||||
+STATS_SECT_DECL(twr_ss_nrng_stat_section) g_twr_ss_nrng_stat;
|
||||
+#define SS_STATS_INC(__X) STATS_INC(g_twr_ss_nrng_stat, __X)
|
||||
+#else
|
||||
+#define SS_STATS_INC(__X) {}
|
||||
+#endif
|
||||
+
|
||||
+
|
||||
static bool rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs);
|
||||
static bool rx_timeout_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs);
|
||||
static bool rx_error_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs);
|
||||
@@ -93,6 +111,17 @@ void twr_ss_nrng_pkg_init(void)
|
||||
g_cbs.inst_ptr = nrng;
|
||||
uwb_mac_append_interface(udev, &g_cbs);
|
||||
nrng_append_config(nrng, &g_rng_cfgs);
|
||||
+
|
||||
+#if MYNEWT_VAL(TWR_SS_NRNG_STATS)
|
||||
+ int rc = stats_init(
|
||||
+ STATS_HDR(g_twr_ss_nrng_stat),
|
||||
+ STATS_SIZE_INIT_PARMS(g_twr_ss_nrng_stat, STATS_SIZE_32),
|
||||
+ STATS_NAME_INIT_PARMS(twr_ss_nrng_stat_section));
|
||||
+ assert(rc == 0);
|
||||
+
|
||||
+ rc = stats_register("twr_ss_nrng", STATS_HDR(g_twr_ss_nrng_stat));
|
||||
+ assert(rc == 0);
|
||||
+#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +155,7 @@ rx_error_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
return false;
|
||||
|
||||
if(dpl_sem_get_count(&nrng->sem) == 0){
|
||||
- NRNG_STATS_INC(rx_error);
|
||||
+ SS_STATS_INC(rx_error);
|
||||
dpl_error_t err = dpl_sem_release(&nrng->sem);
|
||||
assert(err == DPL_OK);
|
||||
return true;
|
||||
@@ -150,7 +179,7 @@ rx_timeout_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
return false;
|
||||
|
||||
if(dpl_sem_get_count(&nrng->sem) == 0){
|
||||
- NRNG_STATS_INC(rx_timeout);
|
||||
+ SS_STATS_INC(rx_timeout);
|
||||
// In the case of a NRNG timeout is used to mark the end of the request
|
||||
// and is used to call the completion callback
|
||||
if(!(SLIST_EMPTY(&inst->interface_cbs))){
|
||||
@@ -179,7 +208,7 @@ reset_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
if(dpl_sem_get_count(&nrng->sem) == 0){
|
||||
dpl_error_t err = dpl_sem_release(&nrng->sem);
|
||||
assert(err == DPL_OK);
|
||||
- NRNG_STATS_INC(reset);
|
||||
+ SS_STATS_INC(reset);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -203,7 +232,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
|
||||
if(dpl_sem_get_count(&nrng->sem) == 1){
|
||||
// unsolicited inbound
|
||||
- NRNG_STATS_INC(rx_unsolicited);
|
||||
+ SS_STATS_INC(rx_unsolicited);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -213,7 +242,7 @@ rx_complete_cb(struct uwb_dev * inst, struct uwb_mac_interface * cbs)
|
||||
if (_frame->dst_address != inst->my_short_address && _frame->dst_address != UWB_BROADCAST_ADDRESS)
|
||||
return true;
|
||||
|
||||
- NRNG_STATS_INC(rx_complete);
|
||||
+ SS_STATS_INC(rx_complete);
|
||||
|
||||
switch(_frame->code){
|
||||
case UWB_DATA_CODE_SS_TWR_NRNG:
|
||||
diff --git a/lib/twr_ss_nrng/syscfg.yml b/lib/twr_ss_nrng/syscfg.yml
|
||||
index 7ef5969..a296efd 100644
|
||||
--- a/lib/twr_ss_nrng/syscfg.yml
|
||||
+++ b/lib/twr_ss_nrng/syscfg.yml
|
||||
@@ -12,6 +12,9 @@ syscfg.defs:
|
||||
value: ((uint16_t)0x10)
|
||||
TWR_SS_NRNG_TX_GUARD_DELAY:
|
||||
value: ((uint32_t)0x120)
|
||||
+ TWR_SS_NRNG_STATS:
|
||||
+ description: 'Enable statistics for the twr_ss_nrng module'
|
||||
+ value: 1
|
||||
CELL_ENABLED:
|
||||
description: 'Cell network model on slot decoding'
|
||||
value: 1
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 478d952b17c33ed5644172c9b4aebf4cdf7bec62 Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Fri, 14 Aug 2020 15:04:20 +0200
|
||||
Subject: [PATCH 3/7] lib/tofdb/: use DPL_ENOENT instead of OS_ENOENT
|
||||
|
||||
---
|
||||
lib/tofdb/src/tofdb.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/tofdb/src/tofdb.c b/lib/tofdb/src/tofdb.c
|
||||
index e6c8015..7d75942 100644
|
||||
--- a/lib/tofdb/src/tofdb.c
|
||||
+++ b/lib/tofdb/src/tofdb.c
|
||||
@@ -28,7 +28,7 @@ int tofdb_get_tof(uint16_t addr, uint32_t *tof)
|
||||
goto ret;
|
||||
}
|
||||
}
|
||||
- return OS_ENOENT;
|
||||
+ return DPL_ENOENT;
|
||||
ret:
|
||||
return OS_OK;
|
||||
}
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
From f51123d3cfcd811090367a65d5bf029897aceb98 Mon Sep 17 00:00:00 2001
|
||||
From 46dfbfe2551d5fd10de7dd8956a3b210e6030c44 Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Mon, 21 Sep 2020 13:42:56 +0200
|
||||
Subject: [PATCH 7/7] lib/uwb_rng: always set rssi to vrssi[0]
|
||||
Subject: [PATCH 3/5] lib/uwb_rng: always set rssi to vrssi[0]
|
||||
|
||||
---
|
||||
lib/uwb_rng/src/uwb_rng.c | 5 +++++
|
||||
479
pkg/uwb-core/patches/0004-porting-dpl-add-riot-files.patch
Normal file
479
pkg/uwb-core/patches/0004-porting-dpl-add-riot-files.patch
Normal file
@ -0,0 +1,479 @@
|
||||
From 15d99a7e8e518f306bb0cebfc729e830eab81633 Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Tue, 3 Nov 2020 14:12:01 +0100
|
||||
Subject: [PATCH 4/5] porting/dpl: add riot files
|
||||
|
||||
---
|
||||
porting/dpl/riot/include/config/config.h | 369 +++++++++++++++++++++++
|
||||
porting/dpl/riot/src/config.c | 83 +++++
|
||||
2 files changed, 452 insertions(+)
|
||||
create mode 100644 porting/dpl/riot/include/config/config.h
|
||||
create mode 100644 porting/dpl/riot/src/config.c
|
||||
|
||||
diff --git a/porting/dpl/riot/include/config/config.h b/porting/dpl/riot/include/config/config.h
|
||||
new file mode 100644
|
||||
index 0000000..4dc4b69
|
||||
--- /dev/null
|
||||
+++ b/porting/dpl/riot/include/config/config.h
|
||||
@@ -0,0 +1,369 @@
|
||||
+/*
|
||||
+ * Licensed to the Apache Software Foundation (ASF) under one
|
||||
+ * or more contributor license agreements. See the NOTICE file
|
||||
+ * distributed with this work for additional information
|
||||
+ * regarding copyright ownership. The ASF licenses this file
|
||||
+ * to you under the Apache License, Version 2.0 (the
|
||||
+ * "License"); you may not use this file except in compliance
|
||||
+ * with the License. You may obtain a copy of the License at
|
||||
+ *
|
||||
+ * http://www.apache.org/licenses/LICENSE-2.0
|
||||
+ *
|
||||
+ * Unless required by applicable law or agreed to in writing,
|
||||
+ * software distributed under the License is distributed on an
|
||||
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
+ * KIND, either express or implied. See the License for the
|
||||
+ * specific language governing permissions and limitations
|
||||
+ * under the License.
|
||||
+ */
|
||||
+#ifndef __SYS_CONFIG_H_
|
||||
+#define __SYS_CONFIG_H_
|
||||
+
|
||||
+/**
|
||||
+ * @addtogroup SysConfig Configuration of Apache Mynewt System
|
||||
+ * @{
|
||||
+ */
|
||||
+
|
||||
+#include <errno.h>
|
||||
+#include <dpl/queue.h>
|
||||
+#include <stdio.h>
|
||||
+#include <stdint.h>
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+extern "C" {
|
||||
+#endif
|
||||
+
|
||||
+/** @cond INTERNAL_HIDDEN */
|
||||
+
|
||||
+#define CONF_MAX_DIR_DEPTH 8 /* max depth of config tree */
|
||||
+#define CONF_MAX_NAME_LEN (8 * CONF_MAX_DIR_DEPTH)
|
||||
+#define CONF_MAX_VAL_LEN 256
|
||||
+#define CONF_NAME_SEPARATOR "/"
|
||||
+
|
||||
+#define CONF_NMGR_OP 0
|
||||
+
|
||||
+/** @endcond */
|
||||
+
|
||||
+/**
|
||||
+ * Type of configuration value.
|
||||
+ */
|
||||
+typedef enum conf_type {
|
||||
+ CONF_NONE = 0,
|
||||
+ CONF_DIR,
|
||||
+ /** 8-bit signed integer */
|
||||
+ CONF_INT8,
|
||||
+ /** 16-bit signed integer */
|
||||
+ CONF_INT16,
|
||||
+ /** 32-bit signed integer */
|
||||
+ CONF_INT32,
|
||||
+ /** 64-bit signed integer */
|
||||
+ CONF_INT64,
|
||||
+ /** String */
|
||||
+ CONF_STRING,
|
||||
+ /** Bytes */
|
||||
+ CONF_BYTES,
|
||||
+ /** Floating point */
|
||||
+ CONF_FLOAT,
|
||||
+ /** Double precision */
|
||||
+ CONF_DOUBLE,
|
||||
+ /** Boolean */
|
||||
+ CONF_BOOL,
|
||||
+} __attribute__((__packed__)) conf_type_t;
|
||||
+
|
||||
+/**
|
||||
+ * Parameter to commit handler describing where data is going to.
|
||||
+ */
|
||||
+enum conf_export_tgt {
|
||||
+ /** Value is to be persisted */
|
||||
+ CONF_EXPORT_PERSIST,
|
||||
+ /** Value is to be display */
|
||||
+ CONF_EXPORT_SHOW
|
||||
+};
|
||||
+
|
||||
+typedef enum conf_export_tgt conf_export_tgt_t;
|
||||
+
|
||||
+/**
|
||||
+ * Handler for getting configuration items, this handler is called
|
||||
+ * per-configuration section. Configuration sections are delimited
|
||||
+ * by '/', for example:
|
||||
+ *
|
||||
+ * - section/name/value
|
||||
+ *
|
||||
+ * Would be passed as:
|
||||
+ *
|
||||
+ * - argc = 3
|
||||
+ * - argv[0] = section
|
||||
+ * - argv[1] = name
|
||||
+ * - argv[2] = value
|
||||
+ *
|
||||
+ * The handler returns the value into val, null terminated, up to
|
||||
+ * val_len_max.
|
||||
+ *
|
||||
+ * @param argc The number of sections in the configuration variable
|
||||
+ * @param argv The array of configuration sections
|
||||
+ * @param val A pointer to the buffer to return the configuration
|
||||
+ * value into.
|
||||
+ * @param val_len_max The maximum length of the val buffer to copy into.
|
||||
+ *
|
||||
+ * @return A pointer to val or NULL if error.
|
||||
+ */
|
||||
+typedef char *(*conf_get_handler_t)(int argc, char **argv, char *val, int val_len_max);
|
||||
+
|
||||
+/**
|
||||
+ * Set the configuration variable pointed to by argc and argv. See
|
||||
+ * description of ch_get_handler_t for format of these variables. This sets the
|
||||
+ * configuration variable to the shadow value, but does not apply the configuration
|
||||
+ * change. In order to apply the change, call the ch_commit() handler.
|
||||
+ *
|
||||
+ * @param argc The number of sections in the configuration variable.
|
||||
+ * @param argv The array of configuration sections
|
||||
+ * @param val The value to configure that variable to
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero error code on failure.
|
||||
+ */
|
||||
+typedef int (*conf_set_handler_t)(int argc, char **argv, char *val);
|
||||
+
|
||||
+/**
|
||||
+ * Commit shadow configuration state to the active configuration.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero error code on failure.
|
||||
+ */
|
||||
+typedef int (*conf_commit_handler_t)(void);
|
||||
+
|
||||
+/**
|
||||
+ * Called per-configuration variable being exported.
|
||||
+ *
|
||||
+ * @param name The name of the variable to export
|
||||
+ * @param val The value of the variable to export
|
||||
+ */
|
||||
+typedef void (*conf_export_func_t)(char *name, char *val);
|
||||
+
|
||||
+/**
|
||||
+ * Export all of the configuration variables, calling the export_func
|
||||
+ * per variable being exported.
|
||||
+ *
|
||||
+ * @param export_func The export function to call.
|
||||
+ * @param tgt The target of the export, either for persistence or display.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero error code on failure.
|
||||
+ */
|
||||
+typedef int (*conf_export_handler_t)(conf_export_func_t export_func,
|
||||
+ conf_export_tgt_t tgt);
|
||||
+
|
||||
+/**
|
||||
+ * Configuration handler, used to register a config item/subtree.
|
||||
+ */
|
||||
+struct conf_handler {
|
||||
+ SLIST_ENTRY(conf_handler) ch_list;
|
||||
+ /**
|
||||
+ * The name of the conifguration item/subtree
|
||||
+ */
|
||||
+ char *ch_name;
|
||||
+ /** Get configuration value */
|
||||
+ conf_get_handler_t ch_get;
|
||||
+ /** Set configuration value */
|
||||
+ conf_set_handler_t ch_set;
|
||||
+ /** Commit configuration value */
|
||||
+ conf_commit_handler_t ch_commit;
|
||||
+ /** Export configuration value */
|
||||
+ conf_export_handler_t ch_export;
|
||||
+};
|
||||
+
|
||||
+void conf_init(void);
|
||||
+void conf_store_init(void);
|
||||
+
|
||||
+/**
|
||||
+ * Register a handler for configurations items.
|
||||
+ *
|
||||
+ * @param cf Structure containing registration info.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+//int conf_register(struct conf_handler *cf);
|
||||
+#define conf_register(__A) printf("%s:%d not implemented", __func__, __LINE__)
|
||||
+
|
||||
+/**
|
||||
+ * Load configuration from registered persistence sources. Handlers for
|
||||
+ * configuration subtrees registered earlier will be called for encountered
|
||||
+ * values.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_load(void);
|
||||
+
|
||||
+/**
|
||||
+ * Load configuration from a specific registered persistence source.
|
||||
+ * Handlers will be called for configuration subtree for
|
||||
+ * encountered values.
|
||||
+ *
|
||||
+ * @param name of the configuration subtree.
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_load_one(char *name);
|
||||
+
|
||||
+/**
|
||||
+ * @brief Loads the configuration if it hasn't been loaded since reboot.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_ensure_loaded(void);
|
||||
+
|
||||
+/**
|
||||
+ * Config setting comes as a result of conf_load().
|
||||
+ *
|
||||
+ * @return 1 if yes, 0 if not.
|
||||
+ */
|
||||
+int conf_set_from_storage(void);
|
||||
+
|
||||
+/**
|
||||
+ * Save currently running configuration. All configuration which is different
|
||||
+ * from currently persisted values will be saved.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_save(void);
|
||||
+
|
||||
+/**
|
||||
+ * Save currently running configuration for configuration subtree.
|
||||
+ *
|
||||
+ * @param name Name of the configuration subtree.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_save_tree(char *name);
|
||||
+
|
||||
+/**
|
||||
+ * Write a single configuration value to persisted storage (if it has
|
||||
+ * changed value).
|
||||
+ *
|
||||
+ * @param name Name/key of the configuration item.
|
||||
+ * @param var Value of the configuration item.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_save_one(const char *name, char *var);
|
||||
+
|
||||
+/**
|
||||
+ * Set configuration item identified by @p name to be value @p val_str.
|
||||
+ * This finds the configuration handler for this subtree and calls it's
|
||||
+ * set handler.
|
||||
+ *
|
||||
+ * @param name Name/key of the configuration item.
|
||||
+ * @param val_str Value of the configuration item.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_set_value(char *name, char *val_str);
|
||||
+
|
||||
+/**
|
||||
+ * Get value of configuration item identified by @p name.
|
||||
+ * This calls the configuration handler ch_get for the subtree.
|
||||
+ *
|
||||
+ * Configuration handler can copy the string to @p buf, the maximum
|
||||
+ * number of bytes it will copy is limited by @p buf_len.
|
||||
+ *
|
||||
+ * Return value will be pointer to beginning of the value. Note that
|
||||
+ * this might, or might not be the same as buf.
|
||||
+ *
|
||||
+ * @param name Name/key of the configuration item.
|
||||
+ * @param val_str Value of the configuration item.
|
||||
+ *
|
||||
+ * @return pointer to value on success, NULL on failure.
|
||||
+ */
|
||||
+char *conf_get_value(char *name, char *buf, int buf_len);
|
||||
+
|
||||
+/**
|
||||
+ * Get stored value of configuration item identified by @p name.
|
||||
+ * This traverses the configuration area(s), and copies the value
|
||||
+ * of the latest value.
|
||||
+ *
|
||||
+ * Value is copied to @p buf, the maximum number of bytes it will copy is
|
||||
+ * limited by @p buf_len.
|
||||
+ *
|
||||
+ * @param name Name/key of the configuration item.
|
||||
+ * @param val_str Value of the configuration item.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_get_stored_value(char *name, char *buf, int buf_len);
|
||||
+
|
||||
+/**
|
||||
+ * Call commit for all configuration handler. This should apply all
|
||||
+ * configuration which has been set, but not applied yet.
|
||||
+ *
|
||||
+ * @param name Name of the configuration subtree, or NULL to commit everything.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_commit(char *name);
|
||||
+
|
||||
+/**
|
||||
+ * Convenience routine for converting value passed as a string to native
|
||||
+ * data type.
|
||||
+ *
|
||||
+ * @param val_str Value of the configuration item as string.
|
||||
+ * @param type Type of the value to convert to.
|
||||
+ * @param vp Pointer to variable to fill with the decoded value.
|
||||
+ * @param vp Size of that variable.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_value_from_str(char *val_str, enum conf_type type, void *vp,
|
||||
+ int maxlen);
|
||||
+
|
||||
+/**
|
||||
+ * Convenience routine for converting byte array passed as a base64
|
||||
+ * encoded string.
|
||||
+ *
|
||||
+ * @param val_str Value of the configuration item as string.
|
||||
+ * @param vp Pointer to variable to fill with the decoded value.
|
||||
+ * @param len Size of that variable. On return the number of bytes in the array.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+int conf_bytes_from_str(char *val_str, void *vp, int *len);
|
||||
+
|
||||
+/**
|
||||
+ * Convenience routine for converting native data type to a string.
|
||||
+ *
|
||||
+ * @param type Type of the value to convert from.
|
||||
+ * @param vp Pointer to variable to convert.
|
||||
+ * @param buf Buffer where string value will be stored.
|
||||
+ * @param buf_len Size of the buffer.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+char *conf_str_from_value(enum conf_type type, void *vp, char *buf,
|
||||
+ int buf_len);
|
||||
+
|
||||
+/** Return the length of a configuration string from buffer length. */
|
||||
+#define CONF_STR_FROM_BYTES_LEN(len) (((len) * 4 / 3) + 4)
|
||||
+
|
||||
+/**
|
||||
+ * Convenience routine for converting byte array into a base64
|
||||
+ * encoded string.
|
||||
+ *
|
||||
+ * @param vp Pointer to variable to convert.
|
||||
+ * @param vp_len Number of bytes to convert.
|
||||
+ * @param buf Buffer where string value will be stored.
|
||||
+ * @param buf_len Size of the buffer.
|
||||
+ *
|
||||
+ * @return 0 on success, non-zero on failure.
|
||||
+ */
|
||||
+char *conf_str_from_bytes(void *vp, int vp_len, char *buf, int buf_len);
|
||||
+
|
||||
+/**
|
||||
+ * Convert a string into a value of type
|
||||
+ */
|
||||
+#define CONF_VALUE_SET(str, type, val) \
|
||||
+ conf_value_from_str((str), (type), &(val), sizeof(val))
|
||||
+
|
||||
+#ifdef __cplusplus
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
+/**
|
||||
+ * @} SysConfig
|
||||
+ */
|
||||
+
|
||||
+#endif /* __SYS_CONFIG_H_ */
|
||||
diff --git a/porting/dpl/riot/src/config.c b/porting/dpl/riot/src/config.c
|
||||
new file mode 100644
|
||||
index 0000000..9e4bde1
|
||||
--- /dev/null
|
||||
+++ b/porting/dpl/riot/src/config.c
|
||||
@@ -0,0 +1,83 @@
|
||||
+/*
|
||||
+ * Licensed to the Apache Software Foundation (ASF) under one
|
||||
+ * or more contributor license agreements. See the NOTICE file
|
||||
+ * distributed with this work for additional information
|
||||
+ * regarding copyright ownership. The ASF licenses this file
|
||||
+ * to you under the Apache License, Version 2.0 (the
|
||||
+ * "License"); you may not use this file except in compliance
|
||||
+ * with the License. You may obtain a copy of the License at
|
||||
+ *
|
||||
+ * http://www.apache.org/licenses/LICENSE-2.0
|
||||
+ *
|
||||
+ * Unless required by applicable law or agreed to in writing,
|
||||
+ * software distributed under the License is distributed on an
|
||||
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
+ * KIND, either express or implied. See the License for the
|
||||
+ * specific language governing permissions and limitations
|
||||
+ * under the License.
|
||||
+ */
|
||||
+
|
||||
+#include "config/config.h"
|
||||
+#include <stdio.h>
|
||||
+#include <stdbool.h>
|
||||
+#include <stdlib.h>
|
||||
+#include <string.h>
|
||||
+
|
||||
+int conf_value_from_str(char *val_str, enum conf_type type, void *vp, int maxlen)
|
||||
+{
|
||||
+ int32_t val;
|
||||
+ int64_t val64;
|
||||
+ char *eptr;
|
||||
+
|
||||
+ if (!val_str) {
|
||||
+ goto err;
|
||||
+ }
|
||||
+ switch (type) {
|
||||
+ case CONF_INT8:
|
||||
+ case CONF_INT16:
|
||||
+ case CONF_INT32:
|
||||
+ case CONF_BOOL:
|
||||
+ val = strtol(val_str, &eptr, 0);
|
||||
+ if (*eptr != '\0') {
|
||||
+ goto err;
|
||||
+ }
|
||||
+ if (type == CONF_BOOL) {
|
||||
+ if (val < 0 || val > 1) {
|
||||
+ goto err;
|
||||
+ }
|
||||
+ *(bool *)vp = val;
|
||||
+ } else if (type == CONF_INT8) {
|
||||
+ if (val < INT8_MIN || val > UINT8_MAX) {
|
||||
+ goto err;
|
||||
+ }
|
||||
+ *(int8_t *)vp = val;
|
||||
+ } else if (type == CONF_INT16) {
|
||||
+ if (val < INT16_MIN || val > UINT16_MAX) {
|
||||
+ goto err;
|
||||
+ }
|
||||
+ *(int16_t *)vp = val;
|
||||
+ } else if (type == CONF_INT32) {
|
||||
+ *(int32_t *)vp = val;
|
||||
+ }
|
||||
+ break;
|
||||
+ case CONF_INT64:
|
||||
+ val64 = strtoll(val_str, &eptr, 0);
|
||||
+ if (*eptr != '\0') {
|
||||
+ goto err;
|
||||
+ }
|
||||
+ *(int64_t *)vp = val64;
|
||||
+ break;
|
||||
+ case CONF_STRING:
|
||||
+ val = strlen(val_str);
|
||||
+ if (val + 1 > maxlen) {
|
||||
+ goto err;
|
||||
+ }
|
||||
+ strcpy(vp, val_str);
|
||||
+ break;
|
||||
+ default:
|
||||
+ goto err;
|
||||
+ }
|
||||
+ return 0;
|
||||
+err:
|
||||
+ return EINVAL;
|
||||
+}
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 2304bef6c63b15411fae3050554edc0538ae93d9 Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Fri, 14 Aug 2020 15:08:22 +0200
|
||||
Subject: [PATCH 4/7] sys/uwbcfg: use DPL_ENOENT instead of OS_ENOENT
|
||||
|
||||
---
|
||||
sys/uwbcfg/src/uwbcfg.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/sys/uwbcfg/src/uwbcfg.c b/sys/uwbcfg/src/uwbcfg.c
|
||||
index 595c19b..4c4678e 100644
|
||||
--- a/sys/uwbcfg/src/uwbcfg.c
|
||||
+++ b/sys/uwbcfg/src/uwbcfg.c
|
||||
@@ -149,7 +149,7 @@ uwbcfg_set(int argc, char **argv, char *val)
|
||||
return CONF_VALUE_SET(val, CONF_STRING, g_uwb_config[i]);
|
||||
}
|
||||
}
|
||||
- return OS_ENOENT;
|
||||
+ return DPL_ENOENT;
|
||||
}
|
||||
|
||||
char*
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -0,0 +1,24 @@
|
||||
From f87d1a3ca89118b654a32cea58f4b03774042c17 Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Fri, 13 Nov 2020 15:20:42 +0100
|
||||
Subject: [PATCH 5/5] hw/drivers/uwb/include/uwb: add UWB_ROLE_TAG role
|
||||
|
||||
---
|
||||
hw/drivers/uwb/include/uwb/uwb.h | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/hw/drivers/uwb/include/uwb/uwb.h b/hw/drivers/uwb/include/uwb/uwb.h
|
||||
index 2872e46..00017be 100644
|
||||
--- a/hw/drivers/uwb/include/uwb/uwb.h
|
||||
+++ b/hw/drivers/uwb/include/uwb/uwb.h
|
||||
@@ -68,6 +68,7 @@ typedef enum uwb_extension_id {
|
||||
} uwb_extension_id_t;
|
||||
|
||||
//! Device Roles
|
||||
+#define UWB_ROLE_TAG (0x0000) //!< Act as a TAG
|
||||
#define UWB_ROLE_CCP_MASTER (0x0001) //!< Act as Clock Master for the network
|
||||
#define UWB_ROLE_PAN_MASTER (0x0002) //!< Act as Pan Master handing out slots and addresses
|
||||
#define UWB_ROLE_ANCHOR (0x0004) //!< Act as an Anchor, a non-mobile unit
|
||||
--
|
||||
2.28.0
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
From 86db74c73938d86a3bcf581af2174991cef632fe Mon Sep 17 00:00:00 2001
|
||||
From: Francisco Molina <femolina@uc.cl>
|
||||
Date: Fri, 14 Aug 2020 15:11:06 +0200
|
||||
Subject: [PATCH 5/7] treewide: use dpl_log.h instaed of log.h to avoid
|
||||
conflict
|
||||
|
||||
---
|
||||
lib/panmaster/src/panmaster.c | 10 +++++-----
|
||||
sys/uwbcfg/src/uwbcfg.c | 2 +-
|
||||
sys/uwbcfg/src/uwbcfg_priv.h | 10 +++++-----
|
||||
3 files changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/lib/panmaster/src/panmaster.c b/lib/panmaster/src/panmaster.c
|
||||
index a1234b6..f2d9fef 100644
|
||||
--- a/lib/panmaster/src/panmaster.c
|
||||
+++ b/lib/panmaster/src/panmaster.c
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <dpl/dpl.h>
|
||||
#include <syscfg/syscfg.h>
|
||||
#include <sysinit/sysinit.h>
|
||||
-#include <log/log.h>
|
||||
+#include <log/dpl_log.h>
|
||||
#include <config/config.h>
|
||||
|
||||
#include "panmaster/panmaster.h"
|
||||
@@ -23,10 +23,10 @@ static uint16_t pan_id = 0x0000;
|
||||
static volatile int nodes_loaded = 0;
|
||||
|
||||
#define LOG_MODULE_PAN_MASTER (91)
|
||||
-#define PM_INFO(...) LOG_INFO(&_log, LOG_MODULE_PAN_MASTER, __VA_ARGS__)
|
||||
-#define PM_DEBUG(...) LOG_DEBUG(&_log, LOG_MODULE_PAN_MASTER, __VA_ARGS__)
|
||||
-#define PM_WARN(...) LOG_WARN(&_log, LOG_MODULE_PAN_MASTER, __VA_ARGS__)
|
||||
-#define PM_ERR(...) LOG_ERROR(&_log, LOG_MODULE_PAN_MASTER, __VA_ARGS__)
|
||||
+#define PM_INFO(...) LOG_INFO(__VA_ARGS__)
|
||||
+#define PM_DEBUG(...) LOG_DEBUG(__VA_ARGS__)
|
||||
+#define PM_WARN(...) LOG_WARN(__VA_ARGS__)
|
||||
+#define PM_ERR(...) LOG_ERROR(__VA_ARGS__)
|
||||
static struct log _log;
|
||||
|
||||
/*
|
||||
diff --git a/sys/uwbcfg/src/uwbcfg.c b/sys/uwbcfg/src/uwbcfg.c
|
||||
index 4c4678e..c7c97ea 100644
|
||||
--- a/sys/uwbcfg/src/uwbcfg.c
|
||||
+++ b/sys/uwbcfg/src/uwbcfg.c
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include <dpl/dpl.h>
|
||||
-#include <log/log.h>
|
||||
+#include <log/dpl_log.h>
|
||||
#include <syscfg/syscfg.h>
|
||||
#include <sysinit/sysinit.h>
|
||||
#include <config/config.h>
|
||||
diff --git a/sys/uwbcfg/src/uwbcfg_priv.h b/sys/uwbcfg/src/uwbcfg_priv.h
|
||||
index 8f7f05b..4158b34 100644
|
||||
--- a/sys/uwbcfg/src/uwbcfg_priv.h
|
||||
+++ b/sys/uwbcfg/src/uwbcfg_priv.h
|
||||
@@ -20,12 +20,12 @@
|
||||
#ifndef __UWBCFG_PRIV_H_
|
||||
#define __UWBCFG_PRIV_H_
|
||||
|
||||
-#include <log/log.h>
|
||||
+#include <log/dpl_log.h>
|
||||
#define LOG_MODULE_UWBCFG (92)
|
||||
-#define UC_INFO(...) LOG_INFO(&_uwbcfg_log, LOG_MODULE_UWBCFG, __VA_ARGS__)
|
||||
-#define UC_DEBUG(...) LOG_DEBUG(&_uwbcfg_log, LOG_MODULE_UWBCFG, __VA_ARGS__)
|
||||
-#define UC_WARN(...) LOG_WARN(&_uwbcfg_log, LOG_MODULE_UWBCFG, __VA_ARGS__)
|
||||
-#define UC_ERR(...) LOG_ERROR(&_uwbcfg_log, LOG_MODULE_UWBCFG, __VA_ARGS__)
|
||||
+#define UC_INFO(...) LOG_INFO(__VA_ARGS__)
|
||||
+#define UC_DEBUG(...) LOG_DEBUG(__VA_ARGS__)
|
||||
+#define UC_WARN(...) LOG_WARN(__VA_ARGS__)
|
||||
+#define UC_ERR(...) LOG_ERROR(__VA_ARGS__)
|
||||
|
||||
enum {
|
||||
CFGSTR_CH=0,
|
||||
--
|
||||
2.28.0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user