usbuart: Moved usbuart_usb_in_cb into usb_serial.c

This commit is contained in:
dragonmux 2022-08-19 01:51:54 +01:00 committed by Piotr Esden-Tempski
parent bbbb49c2b5
commit 67e8a5b840
2 changed files with 11 additions and 3 deletions

View File

@ -58,6 +58,8 @@ static bool gdb_uart_dtr = true;
static void usb_serial_set_state(usbd_device *dev, uint16_t iface, uint8_t ep); static void usb_serial_set_state(usbd_device *dev, uint16_t iface, uint8_t ep);
static void usbuart_usb_in_cb(usbd_device *dev, uint8_t ep);
#ifdef ENABLE_DEBUG #ifdef ENABLE_DEBUG
/* /*
* This call initialises "SemiHosting", only we then do our own SVC interrupt things to * This call initialises "SemiHosting", only we then do our own SVC interrupt things to
@ -228,7 +230,7 @@ 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 USBUSART RX, draining RX FIFO by sending
* characters to host PC via CDCACM. Allowed to write to FIFO OUT pointer. * characters to host PC via CDCACM. Allowed to write to FIFO OUT pointer.
*/ */
void debug_uart_send_rx_packet(void) static void debug_uart_send_rx_packet(void)
{ {
rx_usb_trfr_cplt = false; rx_usb_trfr_cplt = false;
/* Calculate writing position in the FIFO */ /* Calculate writing position in the FIFO */
@ -293,6 +295,14 @@ void debug_uart_run(void)
nvic_enable_irq(USB_IRQ); nvic_enable_irq(USB_IRQ);
} }
static void usbuart_usb_in_cb(usbd_device *dev, uint8_t ep)
{
(void) ep;
(void) dev;
debug_uart_send_rx_packet();
}
/* /*
* newlib defines _write as a weak link'd function for user code to override. * newlib defines _write as a weak link'd function for user code to override.
* *

View File

@ -25,10 +25,8 @@
#include "general.h" #include "general.h"
void usbuart_usb_out_cb(usbd_device *dev, uint8_t ep); void usbuart_usb_out_cb(usbd_device *dev, uint8_t ep);
void usbuart_usb_in_cb(usbd_device *dev, uint8_t ep);
void usbuart_set_led_state(uint8_t ledn, bool state); void usbuart_set_led_state(uint8_t ledn, bool state);
void debug_uart_send_rx_packet(void);
void debug_uart_run(void); void debug_uart_run(void);
#define TX_LED_ACT (1 << 0) #define TX_LED_ACT (1 << 0)