1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:32:46 +01:00

pkg/uwb_core: configure and set autoack in init

This commit is contained in:
Francisco Molina 2021-09-06 10:59:07 +02:00
parent 1704c7e686
commit c860fc99bf
2 changed files with 5 additions and 9 deletions

View File

@ -227,20 +227,11 @@ void init_ranging(void)
(uint16_t)ceilf(uwb_dwt_usecs_to_usecs(rng->config.
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(),
uwb_ev_cb, rng);
dpl_callout_reset(&_rng_req_callout, RANGE_REQUEST_T_MS);
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)) {
printf("Node role: ANCHOR \n");
udev->my_short_address = ANCHOR_ADDRESS;

View File

@ -47,6 +47,9 @@ void uwb_core_init(void)
uwb_dw1000_setup(&dev, (void *) &dw1000_params[0]);
/* this will start a thread handling dw1000 device */
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 */
#if IS_USED(MODULE_UWB_CORE_RNG)
@ -64,6 +67,8 @@ void uwb_core_init(void)
#endif
#if IS_USED(MODULE_UWB_CORE_TWR_SS_ACK)
twr_ss_ack_pkg_init();
uwb_set_autoack(&dev.uwb_dev, true);
uwb_set_autoack_delay(&dev.uwb_dev, 12);
#endif
#if IS_USED(MODULE_UWB_CORE_TWR_SS_EXT)
twr_ss_ext_pkg_init();