Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bluetooth: Enforce cooperative priorities in Bluetooth threads #502

Merged
merged 1 commit into from
Jun 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/drivers/bluetooth/hci_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ struct bt_hci_driver {
* Send an HCI command or ACL data to the controller. The exact
* type of the data can be checked with the help of bt_buf_get_type().
*
* @note This function must only be called from a cooperative thread.
*
* @param buf Buffer containing data to be sent to the controller.
*
* @return 0 on success or negative error number on failure.
Expand Down
1 change: 1 addition & 0 deletions subsys/bluetooth/common/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ccflags-y += -I$(srctree)/subsys/bluetooth

obj-y += dummy.o
obj-$(CONFIG_BLUETOOTH_DEBUG) += log.o
obj-$(CONFIG_BLUETOOTH_RPA) += rpa.o
19 changes: 19 additions & 0 deletions subsys/bluetooth/common/dummy.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @file dummy.c
* Static compilation checks.
*/

/*
* Copyright (c) 2017 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr.h>

/* The Bluetooth subsystem requires the system workqueue to execute at a
* cooperative priority to function correctly. If this build assert triggers
* verify your configuration to ensure that cooperative threads are enabled
* and that the system workqueue priority is negative (cooperative).
*/
BUILD_ASSERT(CONFIG_SYSTEM_WORKQUEUE_PRIORITY < 0);