본문 바로가기

[ST_MICRO]/STM32F4

STM32F4 UART interrupt 테스트

STM32F4 UART interrupt 테스트



void U0_SetInt(void)

{

    /* NVIC for USART1 */

    HAL_NVIC_SetPriority(USART1_IRQn, 0, 1);

    HAL_NVIC_EnableIRQ(USART1_IRQn);

    

      /* Enable the UART Data Register not empty Interrupt */

    __HAL_UART_ENABLE_IT(&UartHandle, UART_IT_RXNE);

}




void USART1_IRQHandler(void)

{

    U0_PutByte(U0_GetByte());

}