diff --git a/samples/bluetooth/central_hr/src/main.c b/samples/bluetooth/central_hr/src/main.c index f0a03dff964..01e75758afc 100644 --- a/samples/bluetooth/central_hr/src/main.c +++ b/samples/bluetooth/central_hr/src/main.c @@ -29,9 +29,6 @@ #include #include -#define SLEEPTIME 5000 -#define SLEEPTICKS (SLEEPTIME * sys_clock_ticks_per_sec / 1000) - static struct bt_conn *default_conn; static struct bt_uuid_16 uuid = BT_UUID_INIT_16(0); @@ -272,9 +269,4 @@ void main(void) } printk("Scanning successfully started\n"); - - while (1) { - task_sleep(SLEEPTICKS); - } } - diff --git a/samples/bluetooth/handsfree/src/main.c b/samples/bluetooth/handsfree/src/main.c index 042c02db04a..7845cace719 100644 --- a/samples/bluetooth/handsfree/src/main.c +++ b/samples/bluetooth/handsfree/src/main.c @@ -81,13 +81,9 @@ void main(void) int err; handsfree_enable(); + err = bt_enable(bt_ready); if (err) { printk("Bluetooth init failed (err %d)\n", err); - return; - } - - while (1) { - task_sleep(sys_clock_ticks_per_sec); } } diff --git a/samples/bluetooth/peripheral/src/main.c b/samples/bluetooth/peripheral/src/main.c index 19772def139..9ffc342d880 100644 --- a/samples/bluetooth/peripheral/src/main.c +++ b/samples/bluetooth/peripheral/src/main.c @@ -304,7 +304,7 @@ void main(void) * of starting delayed work so we do it here */ while (1) { - task_sleep(sys_clock_ticks_per_sec); + k_sleep(MSEC_PER_SEC); /* Current Time Service updates only when time is changed */ cts_notify(); diff --git a/samples/bluetooth/peripheral_csc/src/main.c b/samples/bluetooth/peripheral_csc/src/main.c index e5d79614906..431f647f8aa 100644 --- a/samples/bluetooth/peripheral_csc/src/main.c +++ b/samples/bluetooth/peripheral_csc/src/main.c @@ -423,7 +423,7 @@ void main(void) bt_conn_cb_register(&conn_callbacks); while (1) { - task_sleep(sys_clock_ticks_per_sec); + k_sleep(MSEC_PER_SEC); /* CSC simulation */ if (csc_simulate) { diff --git a/samples/bluetooth/peripheral_esp/src/main.c b/samples/bluetooth/peripheral_esp/src/main.c index 39b134b8659..f90d5285870 100644 --- a/samples/bluetooth/peripheral_esp/src/main.c +++ b/samples/bluetooth/peripheral_esp/src/main.c @@ -459,7 +459,7 @@ void main(void) bt_conn_auth_cb_register(&auth_cb_display); while (1) { - task_sleep(sys_clock_ticks_per_sec); + k_sleep(MSEC_PER_SEC); /* Temperature simulation */ if (simulate_temp) { diff --git a/samples/bluetooth/peripheral_hr/src/main.c b/samples/bluetooth/peripheral_hr/src/main.c index 9b5e6772ff0..2b43ff461e0 100644 --- a/samples/bluetooth/peripheral_hr/src/main.c +++ b/samples/bluetooth/peripheral_hr/src/main.c @@ -129,7 +129,7 @@ void main(void) * of starting delayed work so we do it here */ while (1) { - task_sleep(sys_clock_ticks_per_sec); + k_sleep(MSEC_PER_SEC); /* Heartrate measurements simulation */ hrs_notify(); diff --git a/tests/bluetooth/shell/src/main.c b/tests/bluetooth/shell/src/main.c index 8d94546bbe4..2b4b76d20b7 100644 --- a/tests/bluetooth/shell/src/main.c +++ b/tests/bluetooth/shell/src/main.c @@ -2310,7 +2310,7 @@ void main(void) shell_register_default_module(MY_SHELL_MODULE); while (1) { - task_sleep(sys_clock_ticks_per_sec); + k_sleep(MSEC_PER_SEC); /* Heartrate measurements simulation */ if (hrs_simulate) {