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

[console] Fix complition error when CONSOLE_OUTPUT_TO_PLATFORM_PUTC=0 #397

Merged
merged 1 commit into from
Dec 16, 2023
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: 1 addition & 1 deletion lib/io/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ static uint8_t console_cbuf_buf[CONSOLE_BUF_LEN];
/* print lock must be held when invoking out, outs, outc */
static void out_count(const char *str, size_t len) {
print_callback_t *cb;
size_t i;

/* print to any registered loggers */
if (!list_is_empty(&print_callbacks)) {
Expand All @@ -60,6 +59,7 @@ static void out_count(const char *str, size_t len) {
}

#if CONSOLE_OUTPUT_TO_PLATFORM_PUTC
size_t i;
/* write out the serial port */
for (i = 0; i < len; i++) {
platform_dputc(str[i]);
Expand Down
5 changes: 5 additions & 0 deletions lib/io/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ LOCAL_DIR := $(GET_LOCAL_DIR)

MODULE := $(LOCAL_DIR)

CONSOLE_OUTPUT_TO_PLATFORM_PUTC ?= 1

MODULE_DEPS := \
lib/cbuf

MODULE_DEFINES += \
CONSOLE_OUTPUT_TO_PLATFORM_PUTC=$(CONSOLE_OUTPUT_TO_PLATFORM_PUTC)

MODULE_SRCS += \
$(LOCAL_DIR)/console.c \
$(LOCAL_DIR)/io.c \
Expand Down