aux_serial: tx_buf -> aux_serial_transmit_buffer
This commit is contained in:
parent
7feeb70430
commit
5108ecf759
|
@ -35,12 +35,11 @@
|
||||||
#include "aux_serial.h"
|
#include "aux_serial.h"
|
||||||
|
|
||||||
#if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32F4)
|
#if defined(STM32F0) || defined(STM32F1) || defined(STM32F3) || defined(STM32F4)
|
||||||
/* TX double buffer */
|
static char aux_serial_transmit_buffer[TX_BUF_SIZE * 2];
|
||||||
char buf_tx[TX_BUF_SIZE * 2];
|
|
||||||
/* Active buffer part idx */
|
/* Active buffer part idx */
|
||||||
uint8_t buf_tx_act_idx;
|
static uint8_t buf_tx_act_idx;
|
||||||
#elif defined(LM4F)
|
#elif defined(LM4F)
|
||||||
char buf_tx[FIFO_SIZE];
|
static char aux_serial_transmit_buffer[FIFO_SIZE];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void aux_serial_set_encoding(struct usb_cdc_line_coding *coding)
|
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)
|
void aux_serial_switch_transmit_buffers(void)
|
||||||
{
|
{
|
||||||
/* Select buffer for transmission */
|
/* 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 */
|
/* Configure DMA */
|
||||||
dma_set_memory_address(USBUSART_DMA_BUS, USBUSART_DMA_TX_CHAN, (uintptr_t)tx_buf_ptr);
|
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)
|
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)
|
#elif defined(LM4F)
|
||||||
|
|
||||||
char *aux_serial_current_transmit_buffer(void)
|
char *aux_serial_current_transmit_buffer(void)
|
||||||
{
|
{
|
||||||
return buf_tx;
|
return aux_serial_transmit_buffer;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue