aboutsummaryrefslogtreecommitdiff
path: root/src/stm32/gdb_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm32/gdb_if.c')
-rw-r--r--src/stm32/gdb_if.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/stm32/gdb_if.c b/src/stm32/gdb_if.c
index 59e9c2b..aa43293 100644
--- a/src/stm32/gdb_if.c
+++ b/src/stm32/gdb_if.c
@@ -27,18 +27,16 @@
#include "gdb_if.h"
-#define VIRTUAL_COM_PORT_DATA_SIZE 64
-
static uint32_t count_out;
static uint32_t count_in;
static uint32_t out_ptr;
-static uint8_t buffer_out[VIRTUAL_COM_PORT_DATA_SIZE];
-static uint8_t buffer_in[VIRTUAL_COM_PORT_DATA_SIZE];
+static uint8_t buffer_out[CDCACM_PACKET_SIZE];
+static uint8_t buffer_in[CDCACM_PACKET_SIZE];
void gdb_if_putchar(unsigned char c, int flush)
{
buffer_in[count_in++] = c;
- if(flush || (count_in == VIRTUAL_COM_PORT_DATA_SIZE)) {
+ if(flush || (count_in == CDCACM_PACKET_SIZE)) {
/* Refuse to send if USB isn't configured, and
* don't bother if nobody's listening */
if((cdcacm_get_config() != 1) || !cdcacm_get_dtr()) {
@@ -59,7 +57,7 @@ unsigned char gdb_if_getchar(void)
while(cdcacm_get_config() != 1);
count_out = usbd_ep_read_packet(1, buffer_out,
- VIRTUAL_COM_PORT_DATA_SIZE);
+ CDCACM_PACKET_SIZE);
out_ptr = 0;
}
@@ -76,7 +74,7 @@ unsigned char gdb_if_getchar_to(int timeout)
return 0x04;
count_out = usbd_ep_read_packet(1, buffer_out,
- VIRTUAL_COM_PORT_DATA_SIZE);
+ CDCACM_PACKET_SIZE);
out_ptr = 0;
} while(timeout_counter && !(out_ptr < count_out));