Skip to content

Commit a22150c

Browse files
committed
redundant
1 parent 444dd31 commit a22150c

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

cores/arduino/stm32/uart.c

+3-12
Original file line numberDiff line numberDiff line change
@@ -615,25 +615,16 @@ size_t uart_debug_write(uint8_t *data, uint32_t size)
615615
index = serial_debug.index;
616616
}
617617

618-
IRQn_Type irq;
619-
620-
if (DEBUG_UART == USART1)
621-
irq = USART1_IRQn;
622-
else if (DEBUG_UART == USART2)
623-
irq = USART2_IRQn;
624-
else if (DEBUG_UART == USART3)
625-
irq = USART3_IRQn;
626-
627-
HAL_NVIC_DisableIRQ(irq);
618+
HAL_NVIC_DisableIRQ(serial_debug.irq);
628619

629620
while (HAL_UART_Transmit(uart_handlers[index], data, size, TX_TIMEOUT) != HAL_OK) {
630621
if ((HAL_GetTick() - tickstart) >= TX_TIMEOUT) {
631-
HAL_NVIC_EnableIRQ(irq);
622+
HAL_NVIC_EnableIRQ(serial_debug.irq);
632623
return 0;
633624
}
634625
}
635626

636-
HAL_NVIC_EnableIRQ(irq);
627+
HAL_NVIC_EnableIRQ(serial_debug.irq);
637628
return size;
638629
}
639630

0 commit comments

Comments
 (0)