Skip to content

Commit 9389c74

Browse files
committed
samples: ble_services: update to enable scheduler
Let the sample enable the scheduler. Signed-off-by: Emanuele Di Santo <[email protected]>
1 parent 7e64376 commit 9389c74

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

samples/ble_services/prj.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ CONFIG_BLE_CONN_PARAMS=y
1818
CONFIG_NRF_SDH_BLE_GATT_MAX_MTU_SIZE=100
1919
CONFIG_BLE_CONN_PARAMS_DATA_LENGTH=100
2020

21+
CONFIG_EVENT_SCHEDULER=y
22+
2123
# Battery service
2224
CONFIG_BLE_BAS=y
2325
# Device information service

samples/ble_services/src/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <nrf_sdh.h>
88
#include <nrf_sdh_ble.h>
99
#include <nrf_sdh_soc.h>
10+
#include <event_scheduler.h>
1011
#include <ble_adv.h>
1112
#include <ble_gap.h>
1213
#include <bluetooth/services/ble_bas.h>
@@ -78,10 +79,10 @@ static void ble_bas_evt_handler(struct ble_bas *bas, const struct ble_bas_evt *e
7879
{
7980
switch (evt->evt_type) {
8081
case BLE_BAS_EVT_NOTIFICATION_ENABLED:
81-
printk("Battery level notifications enabled");
82+
printk("Battery level notifications enabled\n");
8283
break;
8384
case BLE_BAS_EVT_NOTIFICATION_DISABLED:
84-
printk("Battery level notifications disabled");
85+
printk("Battery level notifications disabled\n");
8586
break;
8687
}
8788
}
@@ -164,6 +165,7 @@ int main(void)
164165
sd_app_evt_wait();
165166
k_busy_wait(1 * USEC_PER_SEC);
166167
ble_bas_battery_level_update(&ble_bas, conn_handle, battery_level++ % 100);
168+
event_scheduler_process();
167169
}
168170

169171
err = nrf_sdh_disable_request();

0 commit comments

Comments
 (0)