Skip to content

Commit c4b96a7

Browse files
committed
Print::printf() generic
Before it was only linked to U(S)ART while Print is a Base class. Fixes stm32duino#862 Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent a6f7a98 commit c4b96a7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cores/arduino/Print.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -200,22 +200,19 @@ extern "C" {
200200
__attribute__((weak))
201201
int _write(int file, char *ptr, int len)
202202
{
203-
#if defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
204203
switch (file) {
205204
case STDOUT_FILENO:
206205
case STDERR_FILENO:
206+
#if defined(HAL_UART_MODULE_ENABLED) && !defined(HAL_UART_MODULE_ONLY)
207+
/* Used for core_debug() */
207208
uart_debug_write((uint8_t *)ptr, (uint32_t)len);
208-
break;
209+
#endif
209210
case STDIN_FILENO:
210211
break;
211212
default:
212213
((class Print *)file)->write((uint8_t *)ptr, len);
213214
break;
214215
}
215-
#else
216-
(void)file;
217-
(void)ptr;
218-
#endif
219216
return len;
220217
}
221218
}

0 commit comments

Comments
 (0)