mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/cc2538_rf: set event_callback before init
This commit is contained in:
parent
5d5e8d6163
commit
f259292df9
@ -36,13 +36,13 @@ int netdev_ieee802154_minimal_init_devs(netdev_event_cb_t cb) {
|
|||||||
netdev_register(netdev, NETDEV_CC2538, 0);
|
netdev_register(netdev, NETDEV_CC2538, 0);
|
||||||
netdev_ieee802154_submac_init(&cc2538_rf);
|
netdev_ieee802154_submac_init(&cc2538_rf);
|
||||||
|
|
||||||
|
/* set the application-provided callback */
|
||||||
|
netdev->event_callback = cb;
|
||||||
|
|
||||||
/* setup and initialize the specific driver */
|
/* setup and initialize the specific driver */
|
||||||
cc2538_rf_hal_setup(&cc2538_rf.submac.dev);
|
cc2538_rf_hal_setup(&cc2538_rf.submac.dev);
|
||||||
cc2538_init();
|
cc2538_init();
|
||||||
|
|
||||||
/* set the application-provided callback */
|
|
||||||
netdev->event_callback = cb;
|
|
||||||
|
|
||||||
/* initialize the device driver */
|
/* initialize the device driver */
|
||||||
int res = netdev->driver->init(netdev);
|
int res = netdev->driver->init(netdev);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user