Skip to content

Commit 98efbe7

Browse files
committed
[U(S)ART] Add missing HAL_UART_MODULE_ENABLED guard
If printf() function is used and HAL_UART_MODULE_ENABLED is disabled uart_debug_write() is not defined. Instead return len. Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>
1 parent b7a4db9 commit 98efbe7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cores/arduino/syscalls_stm32.c

+5
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ int _read( UNUSED(int file), UNUSED(char *ptr), UNUSED(int len) ) {
7575

7676
__attribute__((weak))
7777
int _write( UNUSED(int file), char *ptr, int len ) {
78+
#ifdef HAL_UART_MODULE_ENABLED
7879
return uart_debug_write((uint8_t *)ptr, (uint32_t)len);
80+
#else
81+
(void)ptr;
82+
return len;
83+
#endif
7984
}
8085

8186
__attribute__((weak))

0 commit comments

Comments
 (0)