diff --git a/Libraries/BSP_LL/Src/py32f0xx_bsp_printf.c b/Libraries/BSP_LL/Src/py32f0xx_bsp_printf.c index 778ab02..7d818db 100644 --- a/Libraries/BSP_LL/Src/py32f0xx_bsp_printf.c +++ b/Libraries/BSP_LL/Src/py32f0xx_bsp_printf.c @@ -38,6 +38,12 @@ void BSP_USART_Config(uint32_t baudRate) LL_GPIO_SetPinSpeed(DEBUG_USART_RX_GPIO_PORT, DEBUG_USART_RX_PIN, LL_GPIO_SPEED_FREQ_VERY_HIGH); LL_GPIO_SetPinPull(DEBUG_USART_RX_GPIO_PORT, DEBUG_USART_RX_PIN, LL_GPIO_PULL_UP); LL_GPIO_SetAFPin_0_7(DEBUG_USART_RX_GPIO_PORT, DEBUG_USART_RX_PIN, DEBUG_USART_RX_AF); + +#if defined (__GNUC__) && !defined (__clang__) + // To avoid io buffer + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stdin, NULL, _IONBF, 0); +#endif }