diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index b62916f5c1e..bffb29a7602 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -55,8 +54,8 @@ #endif /* Peripheral timeout to initialize Connection Parameter Update procedure */ -#define CONN_UPDATE_TIMEOUT (5 * sys_clock_ticks_per_sec) -#define RPA_TIMEOUT (CONFIG_BLUETOOTH_RPA_TIMEOUT * sys_clock_ticks_per_sec) +#define CONN_UPDATE_TIMEOUT (5 * MSEC_PER_SEC) +#define RPA_TIMEOUT (CONFIG_BLUETOOTH_RPA_TIMEOUT * MSEC_PER_SEC) /* Stacks for the fibers */ static BT_STACK_NOINIT(rx_fiber_stack, CONFIG_BLUETOOTH_RX_STACK_SIZE); @@ -431,12 +430,12 @@ static int le_set_rpa(void) } /* restart timer even if failed to set new RPA */ - nano_delayed_work_submit(&bt_dev.rpa_update, RPA_TIMEOUT); + k_delayed_work_submit(&bt_dev.rpa_update, RPA_TIMEOUT); return err; } -static void rpa_timeout(struct nano_work *work) +static void rpa_timeout(struct k_work *work) { BT_DBG(""); @@ -664,8 +663,8 @@ static void update_conn_param(struct bt_conn *conn) * The Peripheral device should not perform a Connection Parameter * Update procedure within 5 s after establishing a connection. */ - nano_delayed_work_submit(&conn->le.update_work, - conn->role == BT_HCI_ROLE_MASTER ? TICKS_NONE : + k_delayed_work_submit(&conn->le.update_work, + conn->role == BT_HCI_ROLE_MASTER ? K_NO_WAIT : CONN_UPDATE_TIMEOUT); } @@ -3573,7 +3572,7 @@ static int bt_init(void) return err; } - nano_delayed_work_init(&bt_dev.rpa_update, rpa_timeout); + k_delayed_work_init(&bt_dev.rpa_update, rpa_timeout); #endif bt_monitor_send(BT_MONITOR_OPEN_INDEX, NULL, 0); diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index 126aa504be2..5efe7580190 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -129,7 +129,7 @@ struct bt_dev { uint8_t irk[16]; /* Work used for RPA rotation */ - struct nano_delayed_work rpa_update; + struct k_delayed_work rpa_update; #endif };