nimble/ll: Round XTAL settle time up

This makes sure XTAL settle time is at least 1 tick, even if value is
specified as less than a full tick. A side-effect of having settle time
calculated as 0 ticks (when enabled) is that item which enables XTAL can
be run after scheduler item which needs it since they will be scheduled
on os_cputime queue at the same tick so it depends on order on which
they are put there.
This commit is contained in:
Andrzej Kaczmarek
2019-11-19 09:40:04 +01:00
parent ade74a5bac
commit f7dbe6b125
+1 -1
View File
@@ -1517,7 +1517,7 @@ ble_ll_init(void)
/* Settling time of crystal, in ticks */
xtal_ticks = MYNEWT_VAL(BLE_XTAL_SETTLE_TIME);
BLE_LL_ASSERT(xtal_ticks != 0);
g_ble_ll_data.ll_xtal_ticks = os_cputime_usecs_to_ticks(xtal_ticks);
g_ble_ll_data.ll_xtal_ticks = ble_ll_usecs_to_ticks_round_up(xtal_ticks);
/* Initialize rf clock timer */
os_cputime_timer_init(&g_ble_ll_data.ll_rfclk_timer,