Wait until UART ready

This commit is contained in:
2026-06-24 13:08:43 +02:00
parent 72e8c19abf
commit 1c1001335e
+1 -2
View File
@@ -102,7 +102,7 @@ void uart_debug_print(const char *fmt, ...)
if (len > 0) if (len > 0)
{ {
while (HAL_UART_GetState(&huart1) & HAL_UART_STATE_BUSY_TX); while (huart1.gState != HAL_UART_STATE_READY);
HAL_UART_Transmit(&huart1, (uint8_t*)buf, len, 100); HAL_UART_Transmit(&huart1, (uint8_t*)buf, len, 100);
} }
} }
@@ -134,7 +134,6 @@ int main(void)
/* MCU Configuration--------------------------------------------------------*/ /* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init(); HAL_Init();
/* USER CODE BEGIN Init */ /* USER CODE BEGIN Init */