Skip to content

Commit 8fc5fd5

Browse files
finikorgcarlescufi
authored andcommitted
logger: Simplify UART backend initialization
Move definition to sources of UART backend. Signed-off-by: Andrei Emeltchenko <[email protected]>
1 parent 94bae6a commit 8fc5fd5

File tree

3 files changed

+4
-40
lines changed

3 files changed

+4
-40
lines changed

include/logging/log_backend_uart.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

subsys/logging/log_backend_uart.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
6-
#include <logging/log_backend_uart.h>
6+
7+
#include <logging/log_backend.h>
78
#include <logging/log_core.h>
89
#include <logging/log_msg.h>
910
#include <logging/log_output.h>
@@ -66,3 +67,5 @@ const struct log_backend_api log_backend_uart_api = {
6667
.panic = panic,
6768
.init = log_backend_uart_init,
6869
};
70+
71+
LOG_BACKEND_DEFINE(log_backend_uart, log_backend_uart_api);

subsys/logging/log_core.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <logging/log_backend.h>
1010
#include <logging/log_ctrl.h>
1111
#include <logging/log_output.h>
12-
#include <logging/log_backend_uart.h>
1312
#include <misc/printk.h>
1413
#include <assert.h>
1514
#include <atomic.h>
@@ -18,13 +17,6 @@
1817
#define CONFIG_LOG_PRINTK_MAX_STRING_LENGTH 1
1918
#endif
2019

21-
#ifdef CONFIG_LOG_BACKEND_UART
22-
LOG_BACKEND_UART_DEFINE(log_backend_uart);
23-
const struct log_backend *uart_backend = &log_backend_uart;
24-
#else
25-
const struct log_backend *uart_backend;
26-
#endif
27-
2820
static struct log_list_t list;
2921
static atomic_t initialized;
3022
static bool panic_mode;

0 commit comments

Comments
 (0)