mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 17:12:43 +01:00
pkg/uwb_core: configure and set autoack in init
This commit is contained in:
parent
1704c7e686
commit
c860fc99bf
@ -227,20 +227,11 @@ void init_ranging(void)
|
|||||||
(uint16_t)ceilf(uwb_dwt_usecs_to_usecs(rng->config.
|
(uint16_t)ceilf(uwb_dwt_usecs_to_usecs(rng->config.
|
||||||
tx_holdoff_delay)));
|
tx_holdoff_delay)));
|
||||||
|
|
||||||
if (IS_USED(MODULE_UWB_CORE_TWR_SS_ACK)) {
|
|
||||||
uwb_set_autoack(udev, true);
|
|
||||||
uwb_set_autoack_delay(udev, 12);
|
|
||||||
}
|
|
||||||
|
|
||||||
dpl_callout_init(&_rng_req_callout, dpl_eventq_dflt_get(),
|
dpl_callout_init(&_rng_req_callout, dpl_eventq_dflt_get(),
|
||||||
uwb_ev_cb, rng);
|
uwb_ev_cb, rng);
|
||||||
dpl_callout_reset(&_rng_req_callout, RANGE_REQUEST_T_MS);
|
dpl_callout_reset(&_rng_req_callout, RANGE_REQUEST_T_MS);
|
||||||
dpl_event_init(&_slot_event, _slot_complete_cb, rng);
|
dpl_event_init(&_slot_event, _slot_complete_cb, rng);
|
||||||
|
|
||||||
/* Apply config */
|
|
||||||
uwb_mac_config(udev, NULL);
|
|
||||||
uwb_txrf_config(udev, &udev->config.txrf);
|
|
||||||
|
|
||||||
if ((udev->role & UWB_ROLE_ANCHOR)) {
|
if ((udev->role & UWB_ROLE_ANCHOR)) {
|
||||||
printf("Node role: ANCHOR \n");
|
printf("Node role: ANCHOR \n");
|
||||||
udev->my_short_address = ANCHOR_ADDRESS;
|
udev->my_short_address = ANCHOR_ADDRESS;
|
||||||
|
@ -47,6 +47,9 @@ void uwb_core_init(void)
|
|||||||
uwb_dw1000_setup(&dev, (void *) &dw1000_params[0]);
|
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);
|
uwb_dw1000_config_and_start(&dev);
|
||||||
|
/* apply default configuration */
|
||||||
|
uwb_mac_config(&dev.uwb_dev, NULL);
|
||||||
|
uwb_txrf_config(&dev.uwb_dev, &dev.uwb_dev.config.txrf);
|
||||||
|
|
||||||
/* init uwb pkg's */
|
/* init uwb pkg's */
|
||||||
#if IS_USED(MODULE_UWB_CORE_RNG)
|
#if IS_USED(MODULE_UWB_CORE_RNG)
|
||||||
@ -64,6 +67,8 @@ void uwb_core_init(void)
|
|||||||
#endif
|
#endif
|
||||||
#if IS_USED(MODULE_UWB_CORE_TWR_SS_ACK)
|
#if IS_USED(MODULE_UWB_CORE_TWR_SS_ACK)
|
||||||
twr_ss_ack_pkg_init();
|
twr_ss_ack_pkg_init();
|
||||||
|
uwb_set_autoack(&dev.uwb_dev, true);
|
||||||
|
uwb_set_autoack_delay(&dev.uwb_dev, 12);
|
||||||
#endif
|
#endif
|
||||||
#if IS_USED(MODULE_UWB_CORE_TWR_SS_EXT)
|
#if IS_USED(MODULE_UWB_CORE_TWR_SS_EXT)
|
||||||
twr_ss_ext_pkg_init();
|
twr_ss_ext_pkg_init();
|
||||||
|
Loading…
Reference in New Issue
Block a user