код:
Код: Выделить всё
int main(void)
{
/* USER CODE BEGIN 1 */
char str[9]={0};
/* USER CODE END 1 */
/* MCU Configuration----------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USART2_UART_Init();
/* USER CODE BEGIN 2 */
LCD_ini();
LCD_Clear();
sprintf(str,"Stm32F407VG");
LCD_String(str);
LCD_SetPos(10, 2);
sprintf(str,"ARM mc");
LCD_String(str);
HAL_UART_Receive_IT(&huart2, (uint8_t*) str, 8);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
if(huart2.RxXferCount==0)
{
HAL_Delay(100);
LCD_SetPos(0, 3);
str[8]=0;
LCD_String(str);
HAL_UART_Receive_IT(&huart2, (uint8_t*) str, 8);
}
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}



