mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-10 11:10:03 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user