From 5108ecf759924bffd153bfc50c1b01a00b0f13a0 Mon Sep 17 00:00:00 2001 From: dragonmux Date: Fri, 19 Aug 2022 10:41:28 +0100 Subject: [PATCH] aux_serial: tx_buf -> aux_serial_transmit_buffer --- src/platforms/common/aux_serial.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/platforms/common/aux_serial.c b/src/platforms/common/aux_serial.c index 32fe56a..21a8915 100644 --- a/src/platforms/common/aux_serial.c +++ b/src/platforms/common/aux_serial.c @@ -35,12 +35,11 @@ #include "aux_serial.h" #if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32F4) -/* TX double buffer */ -char buf_tx[TX_BUF_SIZE * 2]; +static char aux_serial_transmit_buffer[TX_BUF_SIZE * 2]; /* Active buffer part idx */ -uint8_t buf_tx_act_idx; +static uint8_t buf_tx_act_idx; #elif defined(LM4F) -char buf_tx[FIFO_SIZE]; +static char aux_serial_transmit_buffer[FIFO_SIZE]; #endif void aux_serial_set_encoding(struct usb_cdc_line_coding *coding) @@ -91,7 +90,7 @@ void aux_serial_set_encoding(struct usb_cdc_line_coding *coding) void aux_serial_switch_transmit_buffers(void) { /* Select buffer for transmission */ - char *const tx_buf_ptr = &buf_tx[buf_tx_act_idx * TX_BUF_SIZE]; + char *const tx_buf_ptr = &aux_serial_transmit_buffer[buf_tx_act_idx * TX_BUF_SIZE]; /* Configure DMA */ dma_set_memory_address(USBUSART_DMA_BUS, USBUSART_DMA_TX_CHAN, (uintptr_t)tx_buf_ptr); @@ -105,12 +104,12 @@ void aux_serial_switch_transmit_buffers(void) char *aux_serial_current_transmit_buffer(void) { - return buf_tx + (buf_tx_act_idx * TX_BUF_SIZE); + return aux_serial_transmit_buffer + (buf_tx_act_idx * TX_BUF_SIZE); } #elif defined(LM4F) char *aux_serial_current_transmit_buffer(void) { - return buf_tx; + return aux_serial_transmit_buffer; } #endif