Browse Source

usbuart: Moved usbuart_usb_in_cb into usb_serial.c

fix/newlib-file-io-hooks
dragonmux 2 years ago
parent
commit
1ac6de276e
No known key found for this signature in database GPG Key ID: 64861EA89B35507A
  1. 12
      src/platforms/common/usb_serial.c
  2. 2
      src/platforms/common/usbuart.h

12
src/platforms/common/usb_serial.c

@ -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 usbuart_usb_in_cb(usbd_device *dev, uint8_t ep);
#ifdef ENABLE_DEBUG
/*
* 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
* 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;
/* Calculate writing position in the FIFO */
@ -293,6 +295,14 @@ void debug_uart_run(void)
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.
*

2
src/platforms/common/usbuart.h

@ -25,10 +25,8 @@
#include "general.h"
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 debug_uart_send_rx_packet(void);
void debug_uart_run(void);
#define TX_LED_ACT (1 << 0)

Loading…
Cancel
Save