Bluetooth: samples: Fix use of deprecated sleep API

Use new sleep API or remove sleeps where not needed.

Change-Id: I88c0973e57eb4970b68b3f4fa428683191b1a7f0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This commit is contained in:
Szymon Janc 2016-11-10 16:10:48 +01:00 committed by Johan Hedberg
parent 0a38788c92
commit 051f97bd7a
7 changed files with 6 additions and 18 deletions

View File

@ -29,9 +29,6 @@
#include <bluetooth/gatt.h>
#include <misc/byteorder.h>
#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);
}
}

View File

@ -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);
}
}

View File

@ -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();

View File

@ -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) {

View File

@ -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) {

View File

@ -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();

View File

@ -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) {