From 4a75c6aa9c4584682c6069b488b1a9fbf4fe2db4 Mon Sep 17 00:00:00 2001 From: Alex Hoffman Date: Wed, 4 Mar 2020 14:40:50 +0100 Subject: [PATCH] Removed macros --- tensorflow/lite/micro/stm32f4HAL/debug_log.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tensorflow/lite/micro/stm32f4HAL/debug_log.cc b/tensorflow/lite/micro/stm32f4HAL/debug_log.cc index 9a70998d9d5..4be3b40e782 100644 --- a/tensorflow/lite/micro/stm32f4HAL/debug_log.cc +++ b/tensorflow/lite/micro/stm32f4HAL/debug_log.cc @@ -20,18 +20,20 @@ limitations under the License. #include -#ifdef __GNUC__ -#define PUTCHAR_PROTOTYPE int __io_putchar(int ch) -#else -#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) -#endif /* __GNUC__ */ - extern UART_HandleTypeDef DEBUG_UART_HANDLE; -PUTCHAR_PROTOTYPE { +#ifdef __GNUC__ +int __io_putchar(int ch) { HAL_UART_Transmit(&DEBUG_UART_HANDLE, (uint8_t *)&ch, 1, HAL_MAX_DELAY); return ch; } +#else +int fputc(int ch, FILE *f) { + HAL_UART_Transmit(&DEBUG_UART_HANDLE, (uint8_t *)&ch, 1, HAL_MAX_DELAY); + + return ch; +} +#endif /* __GNUC__ */ extern "C" void DebugLog(const char *s) { fprintf(stderr, "%s", s); }