From ad9c76e97f1e20d3a564d296d156e67a80fbd6dc Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Thu, 10 Jan 2013 22:01:21 -0800 Subject: Update to current libopencm3 usb api. --- src/platforms/stm32/gdb_if.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/platforms/stm32') diff --git a/src/platforms/stm32/gdb_if.c b/src/platforms/stm32/gdb_if.c index 30ad247..0e702a2 100644 --- a/src/platforms/stm32/gdb_if.c +++ b/src/platforms/stm32/gdb_if.c @@ -43,7 +43,8 @@ void gdb_if_putchar(unsigned char c, int flush) count_in = 0; return; } - while(usbd_ep_write_packet(CDCACM_GDB_ENDPOINT, buffer_in, count_in) <= 0); + while(usbd_ep_write_packet(usbdev, CDCACM_GDB_ENDPOINT, + buffer_in, count_in) <= 0); count_in = 0; } } @@ -56,8 +57,8 @@ unsigned char gdb_if_getchar(void) return 0x04; while(cdcacm_get_config() != 1); - count_out = usbd_ep_read_packet(CDCACM_GDB_ENDPOINT, buffer_out, - CDCACM_PACKET_SIZE); + count_out = usbd_ep_read_packet(usbdev, CDCACM_GDB_ENDPOINT, + buffer_out, CDCACM_PACKET_SIZE); out_ptr = 0; } @@ -73,12 +74,12 @@ unsigned char gdb_if_getchar_to(int timeout) if(!cdcacm_get_dtr()) return 0x04; - count_out = usbd_ep_read_packet(CDCACM_GDB_ENDPOINT, buffer_out, - CDCACM_PACKET_SIZE); + count_out = usbd_ep_read_packet(usbdev, CDCACM_GDB_ENDPOINT, + buffer_out, CDCACM_PACKET_SIZE); out_ptr = 0; } while(timeout_counter && !(out_ptr < count_out)); - if(out_ptr < count_out) + if(out_ptr < count_out) return gdb_if_getchar(); return -1; -- cgit v1.2.3