mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
auto_init/cc2538_rf: add support for SubMAC
This commit is contained in:
parent
d0a0190d58
commit
1de5b34adf
@ -19,6 +19,8 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "net/gnrc/netif/ieee802154.h"
|
||||
#include "net/ieee802154/radio.h"
|
||||
#include "net/netdev/ieee802154_submac.h"
|
||||
|
||||
#include "cc2538_rf.h"
|
||||
|
||||
@ -31,7 +33,12 @@
|
||||
#define CC2538_MAC_PRIO (GNRC_NETIF_PRIO)
|
||||
#endif
|
||||
|
||||
#if IS_USED(MODULE_IEEE802154_RADIO_HAL)
|
||||
extern ieee802154_dev_t cc2538_rf_dev;
|
||||
static netdev_ieee802154_submac_t cc2538_rf_submac;
|
||||
#else
|
||||
static cc2538_rf_t cc2538_rf_dev;
|
||||
#endif
|
||||
static char _cc2538_rf_stack[CC2538_MAC_STACKSIZE];
|
||||
static gnrc_netif_t _netif;
|
||||
|
||||
@ -39,10 +46,18 @@ void auto_init_cc2538_rf(void)
|
||||
{
|
||||
LOG_DEBUG("[auto_init_netif] initializing cc2538 radio\n");
|
||||
|
||||
netdev_t *netdev;
|
||||
#if IS_USED(MODULE_IEEE802154_RADIO_HAL)
|
||||
netdev_ieee802154_submac_init(&cc2538_rf_submac, &cc2538_rf_dev);
|
||||
netdev = (netdev_t*) &cc2538_rf_submac;
|
||||
cc2538_init();
|
||||
#else
|
||||
netdev = &cc2538_rf_dev.netdev.netdev;
|
||||
cc2538_setup(&cc2538_rf_dev);
|
||||
#endif
|
||||
gnrc_netif_ieee802154_create(&_netif, _cc2538_rf_stack,
|
||||
CC2538_MAC_STACKSIZE,
|
||||
CC2538_MAC_PRIO, "cc2538_rf",
|
||||
(netdev_t *)&cc2538_rf_dev);
|
||||
netdev);
|
||||
}
|
||||
/** @} */
|
||||
|
Loading…
Reference in New Issue
Block a user