You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bounds check — if (port >= SER_PORT_NUM) return; in putchar_p(). Straightforward safety guard, no issues.
Variable rename — replaces the uart_print_port local variable with extern uint32_t lt_uart_port.
Problem with the rename
lt_uart_port is referenced as extern but is not defined anywhere in the LN882H family. On ambz2 it is defined in that family's own printf.c (uint8_t lt_uart_port = 2;), but no equivalent definition exists for LN882H. As-is this would produce a linker error.
PR #373 (now merged) restructured the LN882H logger setup around uart_print_port:
printf.c owns the definition: uint8_t uart_print_port = LT_UART_DEFAULT_LOGGER;
lt_init.c holds extern uint8_t uart_print_port; and sets it to UART1 in lt_init_log()
If this PR merges, uart_print_port disappears from printf.c while lt_init.c still references it — compile/link failure.
What a correct fix would look like
To align LN882H with the ambz2 pattern, lt_uart_port needs to be defined (not just declared) in LN882H, and lt_init.c updated to set lt_uart_port instead of uart_print_port. The bounds check can land independently and cleanly without any of this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same problem as on ambz2 - the printfs must always write to whichever uart is set as logger, not to the default one.