From a5c07c188f66c32d6376690eae4dd00fc698febb Mon Sep 17 00:00:00 2001 From: dragonmux Date: Fri, 19 Aug 2022 11:00:56 +0100 Subject: [PATCH] usb_serial: Begun refactoring debug_uart_receive_callback --- src/platforms/common/usb_serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/platforms/common/usb_serial.c b/src/platforms/common/usb_serial.c index 840dfaa..9a4a22a 100644 --- a/src/platforms/common/usb_serial.c +++ b/src/platforms/common/usb_serial.c @@ -311,13 +311,13 @@ static void debug_uart_send_callback(usbd_device *dev, uint8_t ep) #ifndef ENABLE_RTT static void debug_uart_receive_callback(usbd_device *dev, uint8_t ep) { - char *const tx_buf_ptr = aux_serial_current_transmit_buffer(); + char *const transmit_buffer = aux_serial_current_transmit_buffer(); #if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32F4) usbd_ep_nak_set(dev, ep, 1); /* Read new packet directly into TX buffer */ - const uint16_t len = usbd_ep_read_packet(dev, ep, tx_buf_ptr + buf_tx_act_sz, CDCACM_PACKET_SIZE); + const uint16_t len = usbd_ep_read_packet(dev, ep, transmit_buffer + buf_tx_act_sz, CDCACM_PACKET_SIZE); #if defined(BLACKMAGIC) /* Don't bother if uart is disabled. @@ -350,10 +350,10 @@ static void debug_uart_receive_callback(usbd_device *dev, uint8_t ep) if (TX_BUF_SIZE - buf_tx_act_sz >= CDCACM_PACKET_SIZE) usbd_ep_nak_set(dev, ep, 0); #elif defined(LM4F) - const uint16_t len = usbd_ep_read_packet(dev, ep, tx_buf_ptr, CDCACM_PACKET_SIZE); + const uint16_t len = usbd_ep_read_packet(dev, ep, transmit_buffer, CDCACM_PACKET_SIZE); for(uint16_t i = 0; i < len; i++) - uart_send_blocking(USBUART, tx_buf_ptr[i]); + uart_send_blocking(USBUART, transmit_buffer[i]); #endif } #endif