native: Fixed hw6 USBUSART support.

This commit is contained in:
Piotr Esden-Tempski 2022-01-09 16:12:21 -08:00
parent 06f24d3269
commit bcba3ee4a9
2 changed files with 8 additions and 7 deletions

View File

@ -254,12 +254,12 @@ int usbuart_debug_write(const char *buf, size_t len);
#define USBUSART2 USART2
#define USBUSART2_IRQ NVIC_USART2_IRQ
#define USBUSART2_ISR(x) usart2_isr(x)
#define USBUSART2_DMA_TX_CHAN DMA_CHANNEL6
#define USBUSART2_DMA_TX_IRQ NVIC_DMA1_CHANNEL6_IRQ
#define USBUSART2_DMA_TX_ISR(x) dma1_channel6_isr(x)
#define USBUSART2_DMA_RX_CHAN DMA_CHANNEL7
#define USBUSART2_DMA_RX_IRQ NVIC_DMA1_CHANNEL7_IRQ
#define USBUSART2_DMA_RX_ISR(x) dma1_channel7_isr(x)
#define USBUSART2_DMA_TX_CHAN DMA_CHANNEL7
#define USBUSART2_DMA_TX_IRQ NVIC_DMA1_CHANNEL7_IRQ
#define USBUSART2_DMA_TX_ISR(x) dma1_channel7_isr(x)
#define USBUSART2_DMA_RX_CHAN DMA_CHANNEL6
#define USBUSART2_DMA_RX_IRQ NVIC_DMA1_CHANNEL6_IRQ
#define USBUSART2_DMA_RX_ISR(x) dma1_channel6_isr(x)
#define TRACE_TIM TIM3
#define TRACE_TIM_CLK_EN() rcc_periph_clock_enable(RCC_TIM3)

View File

@ -274,7 +274,8 @@ void usbuart_usb_out_cb(usbd_device *dev, uint8_t ep)
/* Don't bother if uart is disabled.
* This will be the case on mini while we're being debugged.
*/
if(!(RCC_APB2ENR & RCC_APB2ENR_USART1EN))
if(!(RCC_APB2ENR & RCC_APB2ENR_USART1EN) &&
!(RCC_APB1ENR & RCC_APB1ENR_USART2EN))
{
usbd_ep_nak_set(dev, CDCACM_UART_ENDPOINT, 0);
return;