@@ -51,34 +51,27 @@ static uart_irq_handler irq_handler;
51
51
* INTERRUPTS HANDLING
52
52
******************************************************************************/
53
53
54
- static uint32_t uart_irq (int id )
54
+ static void uart_irq (int id )
55
55
{
56
56
UART_HandleTypeDef * huart = & uart_handlers [id ];
57
- uint32_t status = 0 ;
58
-
59
57
if (serial_irq_ids [id ] != 0 ) {
60
58
if (__HAL_UART_GET_FLAG (huart , UART_FLAG_TXE ) != RESET ) {
61
59
if (__HAL_UART_GET_IT (huart , UART_IT_TXE ) != RESET ) {
62
60
irq_handler (serial_irq_ids [id ], TxIrq );
63
- status = 1 ;
64
61
}
65
62
}
66
63
if (__HAL_UART_GET_FLAG (huart , UART_FLAG_RXNE ) != RESET ) {
67
64
if (__HAL_UART_GET_IT (huart , UART_IT_RXNE ) != RESET ) {
68
65
irq_handler (serial_irq_ids [id ], RxIrq );
69
- /* Flag has been cleared when reading the content */
70
- status = 1 ;
66
+ /* Flag has been cleared when reading the content */
71
67
}
72
68
}
73
69
if (__HAL_UART_GET_FLAG (huart , UART_FLAG_ORE ) != RESET ) {
74
70
if (__HAL_UART_GET_IT (huart , UART_IT_ORE ) != RESET ) {
75
71
__HAL_UART_CLEAR_FLAG (huart , UART_CLEAR_OREF );
76
- status = 1 ;
77
72
}
78
73
}
79
74
}
80
-
81
- return status ;
82
75
}
83
76
84
77
static void uart1_irq (void )
@@ -128,9 +121,12 @@ static void uart3_8_irq(void)
128
121
}
129
122
#endif
130
123
#else // TARGET_STM32F070RB, TARGET_STM32F072RB
131
- if (uart_irq (2 ) == 0 ) { // Check if it's USART3
132
- uart_irq (3 ); // Otherwise it's USART4
133
- }
124
+ #if defined(USART3_BASE )
125
+ uart_irq (2 );
126
+ #endif
127
+ #if defined(USART4_BASE )
128
+ uart_irq (3 );
129
+ #endif
134
130
#endif
135
131
}
136
132
0 commit comments