mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			STM32WB: Fix serial IRQ handling
Check that the RX or TX interrupt is enabled before calling a registered handler with RxIrq or TxIrq arg.pull/10774/head
							parent
							
								
									53222fa448
								
							
						
					
					
						commit
						14b83e7fdf
					
				| 
						 | 
				
			
			@ -55,12 +55,12 @@ static void uart_irq(UARTName uart_name)
 | 
			
		|||
        UART_HandleTypeDef *huart = &uart_handlers[id];
 | 
			
		||||
        if (serial_irq_ids[id] != 0) {
 | 
			
		||||
            if (__HAL_UART_GET_FLAG(huart, UART_FLAG_TXE) != RESET) {
 | 
			
		||||
                if (__HAL_UART_GET_IT(huart, UART_IT_TXE) != RESET) {
 | 
			
		||||
                if (__HAL_UART_GET_IT(huart, UART_IT_TXE) != RESET && __HAL_UART_GET_IT_SOURCE(huart, UART_IT_TXE)) {
 | 
			
		||||
                    irq_handler(serial_irq_ids[id], TxIrq);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
            if (__HAL_UART_GET_FLAG(huart, UART_FLAG_RXNE) != RESET) {
 | 
			
		||||
                if (__HAL_UART_GET_IT(huart, UART_IT_RXNE) != RESET) {
 | 
			
		||||
                if (__HAL_UART_GET_IT(huart, UART_IT_RXNE) != RESET && __HAL_UART_GET_IT_SOURCE(huart, UART_IT_RXNE)) {
 | 
			
		||||
                    irq_handler(serial_irq_ids[id], RxIrq);
 | 
			
		||||
                    /* Flag has been cleared when reading the content */
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue