usb_serial: Renamed rx_usb_trfr_cplt -> aux_serial_receive_complete

This commit is contained in:
dragonmux 2022-08-20 16:31:37 +01:00 committed by Piotr Esden-Tempski
parent fa966924e4
commit c2d2263395
3 changed files with 7 additions and 7 deletions

View File

@ -231,12 +231,12 @@ static uint32_t copy_from_fifo(char *dst, const char *src, uint32_t start, uint3
} }
/* /*
* Runs deferred processing for USBUSART RX, draining RX FIFO by sending * Runs deferred processing for AUX serial RX, draining RX FIFO by sending
* characters to host PC via CDCACM. Allowed to write to FIFO OUT pointer. * characters to host PC via the debug serial interface. Allowed to write to FIFO OUT pointer.
*/ */
static void debug_uart_send_rx_packet(void) static void debug_uart_send_rx_packet(void)
{ {
rx_usb_trfr_cplt = false; aux_serial_receive_complete = false;
/* Calculate writing position in the FIFO */ /* Calculate writing position in the FIFO */
const uint32_t buf_rx_in = (RX_FIFO_SIZE - dma_get_number_of_data(USBUSART_DMA_BUS, USBUSART_DMA_RX_CHAN)) % RX_FIFO_SIZE; const uint32_t buf_rx_in = (RX_FIFO_SIZE - dma_get_number_of_data(USBUSART_DMA_BUS, USBUSART_DMA_RX_CHAN)) % RX_FIFO_SIZE;
@ -254,7 +254,7 @@ static void debug_uart_send_rx_packet(void)
buf_rx_out = buf_rx_in; buf_rx_out = buf_rx_in;
/* Turn off LED */ /* Turn off LED */
usbuart_set_led_state(RX_LED_ACT, false); usbuart_set_led_state(RX_LED_ACT, false);
rx_usb_trfr_cplt = true; aux_serial_receive_complete = true;
} }
else else
{ {
@ -293,7 +293,7 @@ void debug_uart_run(void)
usbuart_set_led_state(RX_LED_ACT, true); usbuart_set_led_state(RX_LED_ACT, true);
/* Try to send a packet if usb is idle */ /* Try to send a packet if usb is idle */
if (rx_usb_trfr_cplt) if (aux_serial_receive_complete)
debug_uart_send_rx_packet(); debug_uart_send_rx_packet();
nvic_enable_irq(USB_IRQ); nvic_enable_irq(USB_IRQ);

View File

@ -46,7 +46,7 @@ extern char buf_rx[RX_FIFO_SIZE + sizeof(uint64_t)];
/* RX Fifo out pointer, writes assumed to be atomic */ /* RX Fifo out pointer, writes assumed to be atomic */
extern uint8_t buf_rx_out; extern uint8_t buf_rx_out;
/* RX usb transfer complete */ /* RX usb transfer complete */
extern bool rx_usb_trfr_cplt; extern bool aux_serial_receive_complete;
#ifdef ENABLE_DEBUG #ifdef ENABLE_DEBUG
/* Debug Fifo buffer with space for copy fn overrun */ /* Debug Fifo buffer with space for copy fn overrun */

View File

@ -43,7 +43,7 @@ char buf_rx[RX_FIFO_SIZE + sizeof(uint64_t)];
/* RX Fifo out pointer, writes assumed to be atomic */ /* RX Fifo out pointer, writes assumed to be atomic */
uint8_t buf_rx_out; uint8_t buf_rx_out;
/* RX usb transfer complete */ /* RX usb transfer complete */
bool rx_usb_trfr_cplt = true; bool aux_serial_receive_complete = true;
#ifdef ENABLE_DEBUG #ifdef ENABLE_DEBUG
/* Debug Fifo buffer with space for copy fn overrun */ /* Debug Fifo buffer with space for copy fn overrun */