Skip to content

Commit

Permalink
[console] Fix complition error when CONSOLE_OUTPUT_TO_PLATFORM_PUTC=0
Browse files Browse the repository at this point in the history
Need to move `size_t i` into the correct location. Also, set the
CONSOLE_OUTPUT_TO_PLATFORM_PUTC define in the module makefile.

Change-Id: I732ebbcc43219806d5dfd3b9bdd28bf1811248dc
  • Loading branch information
schultetwin1 authored and travisg committed Dec 16, 2023
1 parent 6a33334 commit 6b16ef0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 6b16ef0

Please sign in to comment.