2016-04-20 17:54:07 +03:00
|
|
|
/** @file
|
|
|
|
* @brief Custom logging over UART
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Intel Corporation
|
|
|
|
*
|
2017-01-18 17:01:01 -08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-04-20 17:54:07 +03:00
|
|
|
*/
|
|
|
|
|
Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t. This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.
We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.
We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.
Jira: ZEP-2051
Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-19 10:32:08 -05:00
|
|
|
#include <zephyr/types.h>
|
2016-04-20 17:54:07 +03:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2016-10-21 12:04:56 +02:00
|
|
|
#include <zephyr.h>
|
2016-04-20 17:54:07 +03:00
|
|
|
#include <device.h>
|
|
|
|
#include <init.h>
|
|
|
|
#include <drivers/console/uart_pipe.h>
|
2019-06-26 10:33:41 -04:00
|
|
|
#include <sys/byteorder.h>
|
2019-06-25 15:54:01 -04:00
|
|
|
#include <drivers/uart.h>
|
2016-04-20 17:54:07 +03:00
|
|
|
|
2018-10-18 19:32:41 +03:00
|
|
|
#include <logging/log_backend.h>
|
|
|
|
#include <logging/log_output.h>
|
|
|
|
#include <logging/log_ctrl.h>
|
|
|
|
#include <logging/log.h>
|
|
|
|
|
2016-04-20 17:54:07 +03:00
|
|
|
#include <bluetooth/buf.h>
|
|
|
|
|
|
|
|
#include "monitor.h"
|
|
|
|
|
2021-04-17 13:33:20 +02:00
|
|
|
#ifdef CONFIG_BT_DEBUG_MONITOR_RTT
|
|
|
|
#include <SEGGER_RTT.h>
|
|
|
|
|
|
|
|
#define RTT_BUFFER_NAME CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER_NAME
|
|
|
|
#define RTT_BUF_SIZE CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER_SIZE
|
|
|
|
static uint8_t rtt_buf[RTT_BUF_SIZE];
|
|
|
|
#elif CONFIG_BT_DEBUG_MONITOR_UART
|
|
|
|
static const struct device *monitor_dev;
|
|
|
|
#endif
|
|
|
|
|
2016-04-26 10:20:13 +03:00
|
|
|
/* This is the same default priority as for other console handlers,
|
|
|
|
* except that we're not exporting it as a Kconfig variable until a
|
|
|
|
* clear need arises.
|
|
|
|
*/
|
|
|
|
#define MONITOR_INIT_PRIORITY 60
|
|
|
|
|
2018-10-18 19:32:41 +03:00
|
|
|
/* These defines follow the values used by syslog(2) */
|
|
|
|
#define BT_LOG_ERR 3
|
|
|
|
#define BT_LOG_WARN 4
|
|
|
|
#define BT_LOG_INFO 6
|
|
|
|
#define BT_LOG_DBG 7
|
|
|
|
|
|
|
|
/* TS resolution is 1/10th of a millisecond */
|
|
|
|
#define MONITOR_TS_FREQ 10000
|
|
|
|
|
|
|
|
/* Maximum (string) length of a log message */
|
|
|
|
#define MONITOR_MSG_MAX 128
|
|
|
|
|
2017-03-28 12:59:22 +03:00
|
|
|
enum {
|
|
|
|
BT_LOG_BUSY,
|
2017-06-30 14:44:21 +03:00
|
|
|
BT_CONSOLE_BUSY,
|
2017-03-28 12:59:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
static atomic_t flags;
|
|
|
|
|
2017-03-28 13:58:05 +03:00
|
|
|
static struct {
|
|
|
|
atomic_t cmd;
|
|
|
|
atomic_t evt;
|
|
|
|
atomic_t acl_tx;
|
|
|
|
atomic_t acl_rx;
|
2017-08-09 09:21:11 +03:00
|
|
|
#if defined(CONFIG_BT_BREDR)
|
2017-03-28 13:58:05 +03:00
|
|
|
atomic_t sco_tx;
|
|
|
|
atomic_t sco_rx;
|
|
|
|
#endif
|
|
|
|
atomic_t other;
|
|
|
|
} drops;
|
|
|
|
|
2016-04-20 17:54:07 +03:00
|
|
|
static void monitor_send(const void *data, size_t len)
|
|
|
|
{
|
2021-04-17 13:33:20 +02:00
|
|
|
#ifdef CONFIG_BT_DEBUG_MONITOR_RTT
|
|
|
|
SEGGER_RTT_Write(CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER, data, len);
|
|
|
|
#elif CONFIG_BT_DEBUG_MONITOR_UART
|
2020-05-27 11:26:57 -05:00
|
|
|
const uint8_t *buf = data;
|
2016-04-20 17:54:07 +03:00
|
|
|
|
|
|
|
while (len--) {
|
|
|
|
uart_poll_out(monitor_dev, *buf++);
|
|
|
|
}
|
2021-04-17 13:33:20 +02:00
|
|
|
#endif
|
2016-04-20 17:54:07 +03:00
|
|
|
}
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
static void encode_drops(struct bt_monitor_hdr *hdr, uint8_t type,
|
2017-03-28 13:58:05 +03:00
|
|
|
atomic_t *val)
|
|
|
|
{
|
|
|
|
atomic_val_t count;
|
|
|
|
|
|
|
|
count = atomic_set(val, 0);
|
|
|
|
if (count) {
|
|
|
|
hdr->ext[hdr->hdr_len++] = type;
|
2019-02-11 17:14:19 +00:00
|
|
|
hdr->ext[hdr->hdr_len++] = MIN(count, 255);
|
2017-03-28 13:58:05 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
static uint32_t monitor_ts_get(void)
|
2018-10-18 19:32:41 +03:00
|
|
|
{
|
|
|
|
return (k_cycle_get_32() /
|
|
|
|
(sys_clock_hw_cycles_per_sec() / MONITOR_TS_FREQ));
|
|
|
|
}
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
static inline void encode_hdr(struct bt_monitor_hdr *hdr, uint32_t timestamp,
|
|
|
|
uint16_t opcode, uint16_t len)
|
2016-04-20 17:54:07 +03:00
|
|
|
{
|
2017-03-28 13:58:05 +03:00
|
|
|
struct bt_monitor_ts32 *ts;
|
2016-05-04 21:19:49 +03:00
|
|
|
|
2016-04-27 14:42:57 +03:00
|
|
|
hdr->opcode = sys_cpu_to_le16(opcode);
|
2018-11-29 11:23:03 -08:00
|
|
|
hdr->flags = 0U;
|
2016-05-04 21:19:49 +03:00
|
|
|
|
2017-03-28 13:58:05 +03:00
|
|
|
ts = (void *)hdr->ext;
|
|
|
|
ts->type = BT_MONITOR_TS32;
|
2018-10-18 19:32:41 +03:00
|
|
|
ts->ts32 = timestamp;
|
2017-03-28 13:58:05 +03:00
|
|
|
hdr->hdr_len = sizeof(*ts);
|
|
|
|
|
|
|
|
encode_drops(hdr, BT_MONITOR_COMMAND_DROPS, &drops.cmd);
|
|
|
|
encode_drops(hdr, BT_MONITOR_EVENT_DROPS, &drops.evt);
|
|
|
|
encode_drops(hdr, BT_MONITOR_ACL_TX_DROPS, &drops.acl_tx);
|
|
|
|
encode_drops(hdr, BT_MONITOR_ACL_RX_DROPS, &drops.acl_rx);
|
2017-08-09 09:21:11 +03:00
|
|
|
#if defined(CONFIG_BT_BREDR)
|
2017-03-28 13:58:05 +03:00
|
|
|
encode_drops(hdr, BT_MONITOR_SCO_TX_DROPS, &drops.sco_tx);
|
|
|
|
encode_drops(hdr, BT_MONITOR_SCO_RX_DROPS, &drops.sco_rx);
|
|
|
|
#endif
|
|
|
|
encode_drops(hdr, BT_MONITOR_OTHER_DROPS, &drops.other);
|
|
|
|
|
|
|
|
hdr->data_len = sys_cpu_to_le16(4 + hdr->hdr_len + len);
|
2016-04-20 17:54:07 +03:00
|
|
|
}
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
static void drop_add(uint16_t opcode)
|
2017-03-28 13:58:05 +03:00
|
|
|
{
|
|
|
|
switch (opcode) {
|
|
|
|
case BT_MONITOR_COMMAND_PKT:
|
|
|
|
atomic_inc(&drops.cmd);
|
|
|
|
break;
|
|
|
|
case BT_MONITOR_EVENT_PKT:
|
|
|
|
atomic_inc(&drops.evt);
|
|
|
|
break;
|
|
|
|
case BT_MONITOR_ACL_TX_PKT:
|
|
|
|
atomic_inc(&drops.acl_tx);
|
|
|
|
break;
|
|
|
|
case BT_MONITOR_ACL_RX_PKT:
|
|
|
|
atomic_inc(&drops.acl_rx);
|
|
|
|
break;
|
2017-08-09 09:21:11 +03:00
|
|
|
#if defined(CONFIG_BT_BREDR)
|
2017-03-28 13:58:05 +03:00
|
|
|
case BT_MONITOR_SCO_TX_PKT:
|
|
|
|
atomic_inc(&drops.sco_tx);
|
|
|
|
break;
|
|
|
|
case BT_MONITOR_SCO_RX_PKT:
|
|
|
|
atomic_inc(&drops.sco_rx);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
default:
|
|
|
|
atomic_inc(&drops.other);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
void bt_monitor_send(uint16_t opcode, const void *data, size_t len)
|
2016-04-20 17:54:07 +03:00
|
|
|
{
|
2016-04-27 14:42:57 +03:00
|
|
|
struct bt_monitor_hdr hdr;
|
2016-04-20 17:54:07 +03:00
|
|
|
|
2017-03-28 12:59:22 +03:00
|
|
|
if (atomic_test_and_set_bit(&flags, BT_LOG_BUSY)) {
|
2017-03-28 13:58:05 +03:00
|
|
|
drop_add(opcode);
|
2017-03-28 12:59:22 +03:00
|
|
|
return;
|
|
|
|
}
|
2016-04-20 17:54:07 +03:00
|
|
|
|
2018-10-18 19:32:41 +03:00
|
|
|
encode_hdr(&hdr, monitor_ts_get(), opcode, len);
|
2017-03-28 13:58:05 +03:00
|
|
|
|
|
|
|
monitor_send(&hdr, BT_MONITOR_BASE_HDR_LEN + hdr.hdr_len);
|
2016-04-20 17:54:07 +03:00
|
|
|
monitor_send(data, len);
|
|
|
|
|
2017-03-28 12:59:22 +03:00
|
|
|
atomic_clear_bit(&flags, BT_LOG_BUSY);
|
2016-04-20 17:54:07 +03:00
|
|
|
}
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
void bt_monitor_new_index(uint8_t type, uint8_t bus, bt_addr_t *addr,
|
2016-04-20 17:54:07 +03:00
|
|
|
const char *name)
|
|
|
|
{
|
|
|
|
struct bt_monitor_new_index pkt;
|
|
|
|
|
|
|
|
pkt.type = type;
|
|
|
|
pkt.bus = bus;
|
|
|
|
memcpy(pkt.bdaddr, addr, 6);
|
|
|
|
strncpy(pkt.name, name, sizeof(pkt.name) - 1);
|
|
|
|
pkt.name[sizeof(pkt.name) - 1] = '\0';
|
|
|
|
|
|
|
|
bt_monitor_send(BT_MONITOR_NEW_INDEX, &pkt, sizeof(pkt));
|
|
|
|
}
|
|
|
|
|
2021-04-17 13:33:20 +02:00
|
|
|
#ifdef CONFIG_BT_DEBUG_MONITOR_RTT
|
|
|
|
static int bt_monitor_init(const struct device *d)
|
|
|
|
{
|
|
|
|
ARG_UNUSED(d);
|
|
|
|
|
|
|
|
SEGGER_RTT_ConfigUpBuffer(CONFIG_BT_DEBUG_MONITOR_RTT_BUFFER,
|
|
|
|
RTT_BUFFER_NAME, rtt_buf, RTT_BUF_SIZE,
|
|
|
|
SEGGER_RTT_MODE_NO_BLOCK_SKIP);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#elif CONFIG_BT_DEBUG_MONITOR_UART
|
|
|
|
|
2018-10-18 19:32:41 +03:00
|
|
|
#if !defined(CONFIG_UART_CONSOLE) && !defined(CONFIG_LOG_PRINTK)
|
2016-04-20 17:54:07 +03:00
|
|
|
static int monitor_console_out(int c)
|
|
|
|
{
|
2018-10-18 19:32:41 +03:00
|
|
|
static char buf[MONITOR_MSG_MAX];
|
2016-04-20 17:54:07 +03:00
|
|
|
static size_t len;
|
|
|
|
|
2017-06-30 14:44:21 +03:00
|
|
|
if (atomic_test_and_set_bit(&flags, BT_CONSOLE_BUSY)) {
|
|
|
|
return c;
|
|
|
|
}
|
2016-04-20 17:54:07 +03:00
|
|
|
|
|
|
|
if (c != '\n' && len < sizeof(buf) - 1) {
|
|
|
|
buf[len++] = c;
|
2017-06-30 14:44:21 +03:00
|
|
|
atomic_clear_bit(&flags, BT_CONSOLE_BUSY);
|
2016-04-20 17:54:07 +03:00
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
buf[len++] = '\0';
|
|
|
|
|
|
|
|
bt_monitor_send(BT_MONITOR_SYSTEM_NOTE, buf, len);
|
|
|
|
len = 0;
|
|
|
|
|
2017-06-30 14:44:21 +03:00
|
|
|
atomic_clear_bit(&flags, BT_CONSOLE_BUSY);
|
2016-04-20 17:54:07 +03:00
|
|
|
|
|
|
|
return c;
|
|
|
|
}
|
|
|
|
|
|
|
|
extern void __printk_hook_install(int (*fn)(int));
|
|
|
|
extern void __stdout_hook_install(int (*fn)(int));
|
|
|
|
#endif /* !CONFIG_UART_CONSOLE */
|
|
|
|
|
2017-08-09 09:21:11 +03:00
|
|
|
#if defined(CONFIG_HAS_DTS) && !defined(CONFIG_BT_MONITOR_ON_DEV_NAME)
|
2021-07-29 23:25:17 +02:00
|
|
|
#define CONFIG_BT_MONITOR_ON_DEV_NAME DT_LABEL(DT_CHOSEN(zephyr_console))
|
2017-07-25 09:22:26 -05:00
|
|
|
#endif
|
|
|
|
|
2019-09-22 19:46:23 -07:00
|
|
|
#ifndef CONFIG_LOG_MINIMAL
|
2018-10-18 19:32:41 +03:00
|
|
|
struct monitor_log_ctx {
|
|
|
|
size_t total_len;
|
|
|
|
char msg[MONITOR_MSG_MAX];
|
|
|
|
};
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
static int monitor_log_out(uint8_t *data, size_t length, void *user_data)
|
2018-10-18 19:32:41 +03:00
|
|
|
{
|
|
|
|
struct monitor_log_ctx *ctx = user_data;
|
|
|
|
size_t i;
|
|
|
|
|
|
|
|
for (i = 0; i < length && ctx->total_len < sizeof(ctx->msg); i++) {
|
|
|
|
/* With CONFIG_LOG_PRINTK the line terminator will come as
|
|
|
|
* as part of messages.
|
|
|
|
*/
|
|
|
|
if (IS_ENABLED(CONFIG_LOG_PRINTK) &&
|
|
|
|
(data[i] == '\r' || data[i] == '\n')) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ctx->msg[ctx->total_len++] = data[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return length;
|
|
|
|
}
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
static uint8_t buf;
|
2018-10-18 19:32:41 +03:00
|
|
|
|
|
|
|
LOG_OUTPUT_DEFINE(monitor_log_output, monitor_log_out, &buf, 1);
|
|
|
|
|
2020-05-27 11:26:57 -05:00
|
|
|
static inline uint8_t monitor_priority_get(uint8_t log_level)
|
2018-10-18 19:32:41 +03:00
|
|
|
{
|
2020-05-27 11:26:57 -05:00
|
|
|
static const uint8_t prios[] = {
|
2018-10-18 19:32:41 +03:00
|
|
|
[LOG_LEVEL_NONE] = 0,
|
|
|
|
[LOG_LEVEL_ERR] = BT_LOG_ERR,
|
|
|
|
[LOG_LEVEL_WRN] = BT_LOG_WARN,
|
|
|
|
[LOG_LEVEL_INF] = BT_LOG_INFO,
|
|
|
|
[LOG_LEVEL_DBG] = BT_LOG_DBG,
|
|
|
|
};
|
|
|
|
|
|
|
|
if (log_level < ARRAY_SIZE(prios)) {
|
|
|
|
return prios[log_level];
|
|
|
|
}
|
|
|
|
|
|
|
|
return BT_LOG_DBG;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void monitor_log_put(const struct log_backend *const backend,
|
|
|
|
struct log_msg *msg)
|
|
|
|
{
|
|
|
|
struct bt_monitor_user_logging log;
|
|
|
|
struct monitor_log_ctx ctx;
|
|
|
|
struct bt_monitor_hdr hdr;
|
|
|
|
const char id[] = "bt";
|
|
|
|
|
|
|
|
log_msg_get(msg);
|
|
|
|
|
|
|
|
log_output_ctx_set(&monitor_log_output, &ctx);
|
|
|
|
|
|
|
|
ctx.total_len = 0;
|
|
|
|
log_output_msg_process(&monitor_log_output, msg,
|
|
|
|
LOG_OUTPUT_FLAG_CRLF_NONE);
|
|
|
|
|
|
|
|
if (atomic_test_and_set_bit(&flags, BT_LOG_BUSY)) {
|
|
|
|
drop_add(BT_MONITOR_USER_LOGGING);
|
|
|
|
log_msg_put(msg);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
encode_hdr(&hdr, msg->hdr.timestamp, BT_MONITOR_USER_LOGGING,
|
|
|
|
sizeof(log) + sizeof(id) + ctx.total_len + 1);
|
|
|
|
|
|
|
|
log.priority = monitor_priority_get(msg->hdr.ids.level);
|
|
|
|
log.ident_len = sizeof(id);
|
|
|
|
|
|
|
|
log_msg_put(msg);
|
|
|
|
|
|
|
|
monitor_send(&hdr, BT_MONITOR_BASE_HDR_LEN + hdr.hdr_len);
|
|
|
|
monitor_send(&log, sizeof(log));
|
|
|
|
monitor_send(id, sizeof(id));
|
|
|
|
monitor_send(ctx.msg, ctx.total_len);
|
|
|
|
|
|
|
|
/* Terminate the string with null */
|
|
|
|
uart_poll_out(monitor_dev, '\0');
|
|
|
|
|
|
|
|
atomic_clear_bit(&flags, BT_LOG_BUSY);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void monitor_log_panic(const struct log_backend *const backend)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-01-29 17:25:55 +01:00
|
|
|
static void monitor_log_init(const struct log_backend *const backend)
|
2018-10-18 19:32:41 +03:00
|
|
|
{
|
|
|
|
log_set_timestamp_func(monitor_ts_get, MONITOR_TS_FREQ);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct log_backend_api monitor_log_api = {
|
|
|
|
.put = monitor_log_put,
|
|
|
|
.panic = monitor_log_panic,
|
|
|
|
.init = monitor_log_init,
|
|
|
|
};
|
|
|
|
|
|
|
|
LOG_BACKEND_DEFINE(bt_monitor, monitor_log_api, true);
|
2019-09-22 19:46:23 -07:00
|
|
|
#endif /* CONFIG_LOG_MINIMAL */
|
2018-10-18 19:32:41 +03:00
|
|
|
|
2020-04-30 20:33:38 +02:00
|
|
|
static int bt_monitor_init(const struct device *d)
|
2016-04-20 17:54:07 +03:00
|
|
|
{
|
|
|
|
ARG_UNUSED(d);
|
|
|
|
|
2017-08-09 09:21:11 +03:00
|
|
|
monitor_dev = device_get_binding(CONFIG_BT_MONITOR_ON_DEV_NAME);
|
2016-04-20 17:54:07 +03:00
|
|
|
|
2019-11-27 17:31:57 +01:00
|
|
|
__ASSERT_NO_MSG(monitor_dev);
|
|
|
|
|
2016-08-16 15:55:00 +03:00
|
|
|
#if defined(CONFIG_UART_INTERRUPT_DRIVEN)
|
2016-04-20 17:54:07 +03:00
|
|
|
uart_irq_rx_disable(monitor_dev);
|
|
|
|
uart_irq_tx_disable(monitor_dev);
|
2016-08-16 15:55:00 +03:00
|
|
|
#endif
|
2016-04-20 17:54:07 +03:00
|
|
|
|
2018-10-18 19:32:41 +03:00
|
|
|
#if !defined(CONFIG_UART_CONSOLE) && !defined(CONFIG_LOG_PRINTK)
|
2016-04-20 17:54:07 +03:00
|
|
|
__printk_hook_install(monitor_console_out);
|
|
|
|
__stdout_hook_install(monitor_console_out);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2021-04-17 13:33:20 +02:00
|
|
|
#endif /* CONFIG_BT_DEBUG_MONITOR_UART */
|
2016-04-20 17:54:07 +03:00
|
|
|
|
Bluetooth: Fix use of deprecated PRIMARY init level
Fix following warning:
CC subsys/bluetooth/host/monitor.o
In file included from zephyr/include/drivers/loapic.h:58:0,
from zephyr/include/drivers/ioapic.h:22,
from zephyr/include/drivers/sysapic.h:20,
from zephyr/include/arch/x86/irq_controller.h:33,
from zephyr/include/arch/x86/arch.h:28,
from zephyr/include/arch/cpu.h:23,
from zephyr/include/kernel.h:2458,
from zephyr/include/zephyr.h:20,
from zephyr/subsys/bluetooth/host/monitor.c:24:
zephyr/subsys/bluetooth/host/monitor.c: In function
'_deprecation_check_sys_init_bt_monitor_init0':
zephyr/include/device.h:130:16: warning: '_INIT_LEVEL_PRIMARY' is
deprecated [-Wdeprecated-declarations]
static struct device_config _CONCAT(__config_, dev_name) __used \
^
zephyr/include/device.h:245:2: note: in expansion of macro
'DEVICE_AND_API_INIT'
DEVICE_AND_API_INIT(dev_name, drv_name, init_fn, data, cfg_info, \
^
zephyr/include/init.h:69:2: note: in expansion of macro 'DEVICE_INIT'
DEVICE_INIT(_SYS_NAME(init_fn), "", init_fn, NULL, NULL, level, prio)
^
zephyr/subsys/bluetooth/host/monitor.c:193:1: note: in expansion of
macro 'SYS_INIT'
SYS_INIT(bt_monitor_init, PRIMARY, MONITOR_INIT_PRIORITY);
^
zephyr/include/device.h:48:31: note: declared here
static __deprecated const int _INIT_LEVEL_PRIMARY = 1;
Change-Id: Ie903e3a075f6614b26018be5769be3651f0963be
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-14 12:38:28 +01:00
|
|
|
SYS_INIT(bt_monitor_init, PRE_KERNEL_1, MONITOR_INIT_PRIORITY);
|