Hi,
I have used an interrupt to read a character via UART. I'm using STM32 CubeMx to generate initialization code for UART and the interrupt. For example this would be my ISR:
extern uint8_t buffRX[10];
void USART3_IRQHandler(void)
{
HAL_UART_IRQHandler(&huart3);
HAL_UART_Receive_IT(&huart3, buffRX, 10);
}
The routines used by the tasks are:
bool uart_getchar_available (char * c) - this routine returns a boolean value determining if a buffer character could be read, in which case the value is found in parameter c. If there is no character in the buffer, the routine returns immediately and the result of the call is false.
How could I implement char uart_getchar (void) and bool uart_getchar_available (char * c) in my tasks? The tasks are defined with normal priority. Can I use HAL_UART_RxCpltCallback to check if a caracter has been obtained?
I have used an interrupt to read a character via UART. I'm using STM32 CubeMx to generate initialization code for UART and the interrupt. For example this would be my ISR:
extern uint8_t buffRX[10];
void USART3_IRQHandler(void)
{
HAL_UART_IRQHandler(&huart3);
HAL_UART_Receive_IT(&huart3, buffRX, 10);
}
The routines used by the tasks are:
bool uart_getchar_available (char * c) - this routine returns a boolean value determining if a buffer character could be read, in which case the value is found in parameter c. If there is no character in the buffer, the routine returns immediately and the result of the call is false.
How could I implement char uart_getchar (void) and bool uart_getchar_available (char * c) in my tasks? The tasks are defined with normal priority. Can I use HAL_UART_RxCpltCallback to check if a caracter has been obtained?
Last edited: