1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

pkg/openthread: add support for kw41z radios

pkg/openthread: fix some indentation errors

pkg/openthread: remove unnecessary library

Co-authored-by: José Alamos <jialamos@uc.cl>
This commit is contained in:
Arwin Verhoeven 2020-07-25 11:22:44 +02:00
parent 42eb044ec6
commit 579a2d8fe0
2 changed files with 20 additions and 1 deletions

View File

@ -4,7 +4,7 @@ APPLICATION = openthread
BOARD ?= samr21-xpro
# These are the boards that OpenThread stack has been tested on
BOARD_WHITELIST := samr21-xpro iotlab-m3 fox iotlab-a8-m3
BOARD_WHITELIST := samr21-xpro iotlab-m3 fox iotlab-a8-m3 frdm-kw41z openlabs-kw41z-mini-256kib openlabs-kw41z-mini phynode-kw41z usb-kw41z
# This has to be the absolute path to the RIOT base directory:
RIOTBASE ?= $(CURDIR)/../..
@ -41,6 +41,9 @@ endif
ifneq (,$(filter iotlab-m3 fox iotlab-a8-m3,$(BOARD)))
DRIVER := at86rf231
endif
ifneq (,$(filter frdm-kw41z openlabs-kw41z-mini-256kib openlabs-kw41z-mini phynode-kw41z usb-kw41z,$(BOARD)))
DRIVER := kw41zrf
endif
USEMODULE += $(DRIVER)

View File

@ -30,6 +30,10 @@
#include "at86rf2xx_params.h"
#endif
#ifdef MODULE_KW41ZRF
#include "kw41zrf.h"
#endif
#define ENABLE_DEBUG (0)
#include "debug.h"
@ -37,10 +41,18 @@
#define OPENTHREAD_NETIF_NUMOF ARRAY_SIZE(at86rf2xx_params)
#endif
#ifdef MODULE_KW41ZRF
#define OPENTHREAD_NETIF_NUMOF (1U)
#endif
#ifdef MODULE_AT86RF2XX
static at86rf2xx_t at86rf2xx_dev;
#endif
#ifdef MODULE_KW41ZRF
static kw41zrf_t kw41z_dev;
#endif
static uint8_t rx_buf[OPENTHREAD_NETDEV_BUFLEN];
static uint8_t tx_buf[OPENTHREAD_NETDEV_BUFLEN];
static char ot_thread_stack[2 * THREAD_STACKSIZE_MAIN];
@ -55,6 +67,10 @@ void openthread_bootstrap(void)
at86rf2xx_setup(&at86rf2xx_dev, &at86rf2xx_params[0]);
netdev_t *netdev = (netdev_t *) &at86rf2xx_dev;
#endif
#ifdef MODULE_KW41ZRF
kw41zrf_setup(&kw41z_dev);
netdev_t *netdev = (netdev_t *) &kw41z_dev;
#endif
openthread_radio_init(netdev, tx_buf, rx_buf);
openthread_netdev_init(ot_thread_stack, sizeof(ot_thread_stack), THREAD_PRIORITY_MAIN - 5, "openthread", netdev);