mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-13 20:50:00 +00:00
nimble/ll: Add option to extend T_MAFS
By default we try to schedule any AUX/SYNC/CHAIN within T_MAFS to make extended/periodic advertising events as short as possible. However, on slower MCUs like Cortex-M0 300us (T_MAFS) may be too short to schedule and start TX of subsequent PDU and we may drop some packets. This patch adds an option to extend these times in scheduler. Note that it is strongly recommended to keep these new settings at default values unless you know what you are doing!
This commit is contained in:
@@ -1411,7 +1411,7 @@ ble_ll_adv_aux_schedule_next(struct ble_ll_adv_sm *advsm)
|
||||
max_usecs = ble_ll_pdu_tx_time_get(aux_next->payload_len, advsm->sec_phy);
|
||||
|
||||
aux_next->start_time = aux->sch.end_time +
|
||||
ble_ll_usecs_to_ticks_round_up(BLE_LL_MAFS);
|
||||
ble_ll_usecs_to_ticks_round_up(BLE_LL_MAFS + MYNEWT_VAL(BLE_LL_SCHED_AUX_CHAIN_MAFS_DELAY));
|
||||
|
||||
sch = &aux_next->sch;
|
||||
sch->start_time = aux_next->start_time - g_ble_ll_sched_offset_ticks;
|
||||
@@ -1530,7 +1530,7 @@ ble_ll_adv_aux_set_start_time(struct ble_ll_adv_sm *advsm)
|
||||
adv_event_dur = (adv_pdu_dur * chans) + (9 * (chans - 1));
|
||||
|
||||
advsm->aux[0].start_time = advsm->adv_event_start_time + adv_event_dur +
|
||||
ble_ll_usecs_to_ticks_round_up(BLE_LL_MAFS);
|
||||
ble_ll_usecs_to_ticks_round_up(BLE_LL_MAFS + MYNEWT_VAL(BLE_LL_SCHED_AUX_MAFS_DELAY));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2267,7 +2267,7 @@ ble_ll_adv_periodic_schedule_next(struct ble_ll_adv_sm *advsm)
|
||||
max_usecs = ble_ll_pdu_tx_time_get(sync_next->payload_len, advsm->sec_phy);
|
||||
|
||||
sync_next->start_time = sync->sch.end_time +
|
||||
ble_ll_usecs_to_ticks_round_up(BLE_LL_MAFS);
|
||||
ble_ll_usecs_to_ticks_round_up(BLE_LL_MAFS + MYNEWT_VAL(BLE_LL_SCHED_AUX_CHAIN_MAFS_DELAY));
|
||||
|
||||
sch = &sync_next->sch;
|
||||
sch->start_time = sync_next->start_time - g_ble_ll_sched_offset_ticks;
|
||||
|
||||
@@ -340,6 +340,20 @@ syscfg.defs:
|
||||
was sent from controller.
|
||||
value: -1
|
||||
|
||||
# Below settings allow to change scheduler timings. These should be left at
|
||||
# default values unless you know what you are doing!
|
||||
BLE_LL_SCHED_AUX_MAFS_DELAY:
|
||||
description: >
|
||||
Additional delay [us] between last ADV_EXT_IND and AUX_ADV_IND PDUs
|
||||
when scheduling extended advertising event. This extends T_MAFS.
|
||||
value: 0
|
||||
BLE_LL_SCHED_AUX_CHAIN_MAFS_DELAY:
|
||||
description: >
|
||||
Additional delay [us] between consecutive AUX_CHAIN_IND PDUs
|
||||
when scheduling extended or periodic advertising event. This extends
|
||||
T_MAFS.
|
||||
value: 0
|
||||
|
||||
# deprecated settings (to be defunct/removed eventually)
|
||||
BLE_LL_DIRECT_TEST_MODE:
|
||||
description: use BLE_LL_DTM instead
|
||||
|
||||
Reference in New Issue
Block a user