From 6ad3acd15e9859ac9bc77c1eb04d67108dcc5a03 Mon Sep 17 00:00:00 2001 From: AJM Date: Sat, 24 Apr 2010 22:23:50 -0400 Subject: finally got TX working without any delay, there is some weird timing involved in what happens when the line state is toggled (host port disconnected) and theres still data waiting to go out, this will hang any while(txCount != 0) calls. similarly, sending data without checking txCount != 0 will hard fault the chip. This is all handled now by usbSendBytes, which returns -1 for unconnected, and 0 for simply 'waiting to send' --- core/usb/usb_callbacks.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/usb/usb_callbacks.h') diff --git a/core/usb/usb_callbacks.h b/core/usb/usb_callbacks.h index 53857ae..b95ea15 100644 --- a/core/usb/usb_callbacks.h +++ b/core/usb/usb_callbacks.h @@ -5,6 +5,7 @@ #include "libmaple.h" #include "usb_lib.h" +#include "usb_config.h" #define SET_LINE_CODING 0x20 #define GET_LINE_CODING 0x21 @@ -30,6 +31,13 @@ typedef enum { DTR_NRTS } RESET_STATE; +extern RESET_STATE reset_state; /* tracks DTR/RTS */ +extern uint8 countTx; +extern uint8 vcomBufferRx[VCOM_RX_EPSIZE]; /* no reason this has to be VCOM_RX_EPSIZE, could be bigger */ +extern uint8 recvBufIn; /* the FIFO in index to the recvbuffer */ +extern uint8 recvBufOut; /* the FIFO out index to the recvbuffer */ +extern uint8 maxNewBytes; + void vcomDataTxCb(void); void vcomDataRxCb(void); void vcomManagementCb(void); -- cgit v1.2.3