summaryrefslogtreecommitdiff
path: root/samples/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2016-12-15 09:56:11 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2016-12-16 10:27:48 +0200
commit1c9da665c3340b3f3ddd65a8518852ac54f84cc5 (patch)
tree78b70b722d34e070c6b7ca98da2a9a476dfe1479 /samples/bluetooth
parent83874836ac43fee008a610c08fc76adfaec5c7a7 (diff)
Bluetooth: Remove unnecessary runtime kernel object initialization
There are static initializer macros available for most kernel objects which we should use whenever possible. Change-Id: I496f4d05d26801eddd21fae53bdd4fcdc3246fe3 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'samples/bluetooth')
-rw-r--r--samples/bluetooth/hci_uart/src/main.c8
-rw-r--r--samples/bluetooth/hci_usb/src/main.c4
2 files changed, 3 insertions, 9 deletions
diff --git a/samples/bluetooth/hci_uart/src/main.c b/samples/bluetooth/hci_uart/src/main.c
index 0cefe50ad..6db2da9f9 100644
--- a/samples/bluetooth/hci_uart/src/main.c
+++ b/samples/bluetooth/hci_uart/src/main.c
@@ -64,7 +64,7 @@ NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BLUETOOTH_HCI_CMD_COUNT, CMD_BUF_SIZE,
NET_BUF_POOL_DEFINE(acl_tx_pool, TX_BUF_COUNT, BT_BUF_ACL_SIZE,
BT_BUF_USER_DATA_MIN, NULL);
-static struct k_fifo tx_queue;
+static K_FIFO_DEFINE(tx_queue);
#define H4_CMD 0x01
#define H4_ACL 0x02
@@ -353,15 +353,11 @@ DEVICE_INIT(hci_uart, "hci_uart", &hci_uart_init, NULL, NULL,
void main(void)
{
/* incoming events and data from the controller */
- static struct k_fifo rx_queue;
+ static K_FIFO_DEFINE(rx_queue);
int err;
SYS_LOG_DBG("Start");
- /* Initialize the FIFOs */
- k_fifo_init(&tx_queue);
- k_fifo_init(&rx_queue);
-
/* Enable the raw interface, this will in turn open the HCI driver */
bt_enable_raw(&rx_queue);
/* Spawn the TX thread and start feeding commands and data to the
diff --git a/samples/bluetooth/hci_usb/src/main.c b/samples/bluetooth/hci_usb/src/main.c
index 9135a6123..b2b37c4bb 100644
--- a/samples/bluetooth/hci_usb/src/main.c
+++ b/samples/bluetooth/hci_usb/src/main.c
@@ -81,7 +81,7 @@ static struct device *btusb_dev;
#define DEV_DATA(dev) \
((struct btusb_dev_data_t * const)(dev)->driver_data)
-static struct k_fifo rx_queue;
+static K_FIFO_DEFINE(rx_queue);
/* HCI command buffers */
#define CMD_BUF_SIZE (CONFIG_BLUETOOTH_HCI_SEND_RESERVE + \
@@ -691,8 +691,6 @@ void main(void)
{
SYS_LOG_DBG("Start");
- k_fifo_init(&rx_queue);
-
bt_enable_raw(&rx_queue);
while (1) {