[MERGE] Implement multiple logging backends (22159)
This commit is contained in:
parent
1648a63812
commit
cbb8b0de36
18 changed files with 111 additions and 35 deletions
8
quantum/logging/sendchar_console.c
Normal file
8
quantum/logging/sendchar_console.c
Normal file
|
@ -0,0 +1,8 @@
|
|||
// Copyright 2023 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#include "sendchar.h"
|
||||
int8_t console_write(uint8_t c);
|
||||
|
||||
int8_t sendchar(uint8_t c) {
|
||||
return console_write(c);
|
||||
}
|
19
quantum/logging/sendchar_uart.c
Normal file
19
quantum/logging/sendchar_uart.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2023 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#include "sendchar.h"
|
||||
#include "uart.h"
|
||||
|
||||
#ifndef SENDCHAR_BAUD_RATE
|
||||
# define SENDCHAR_BAUD_RATE 9600
|
||||
#endif
|
||||
|
||||
int8_t sendchar(uint8_t c) {
|
||||
static bool s_init = false;
|
||||
if (!s_init) {
|
||||
uart_init(SENDCHAR_BAUD_RATE);
|
||||
s_init = true;
|
||||
}
|
||||
|
||||
uart_write(c);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue