aboutsummaryrefslogtreecommitdiffstats
path: root/core/usb/usb_callbacks.c
diff options
context:
space:
mode:
authorAJM <poslathian@poslathian.(none)>2010-04-25 00:51:43 -0400
committerbnewbold <bnewbold@robocracy.org>2010-05-20 22:09:15 -0400
commit4dcbd9612275d7957484f4a87e16f0bb09484ee6 (patch)
tree92909ce42b9baeb7cbd3e8dbe8e760bfb1914787 /core/usb/usb_callbacks.c
parent6ad3acd15e9859ac9bc77c1eb04d67108dcc5a03 (diff)
downloadlibrambutan-4dcbd9612275d7957484f4a87e16f0bb09484ee6.tar.gz
librambutan-4dcbd9612275d7957484f4a87e16f0bb09484ee6.zip
FINALLY figured out the tx/rx bugs, so the whole stack is officially working. for future reference its ESSENTIAL that you set the EPNUM flag of the global device struct appropriately regardless of whether or not you enable or configure more endpoints.
Diffstat (limited to 'core/usb/usb_callbacks.c')
-rw-r--r--core/usb/usb_callbacks.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/core/usb/usb_callbacks.c b/core/usb/usb_callbacks.c
index 402e8f5..1fb73d5 100644
--- a/core/usb/usb_callbacks.c
+++ b/core/usb/usb_callbacks.c
@@ -58,7 +58,7 @@ void vcomDataRxCb(void) {
/* setEPRxCount on the previous cycle should garuntee
we havnt received more bytes than we can fit */
- uint8 newBytes = _GetEPRxCount(VCOM_RX_ENDP);
+ uint8 newBytes = GetEPRxCount(VCOM_RX_ENDP);
/* assert (newBytes <= maxNewBytes); */
if (recvBufIn + newBytes < VCOM_RX_EPSIZE) {
@@ -82,7 +82,7 @@ void vcomDataRxCb(void) {
}
void vcomManagementCb(void) {
- /* unused. This enpoint would callback if we had sent a linestate
+/* unused. This enpoint would callback if we had sent a linestate
changed notification */
}
@@ -133,11 +133,17 @@ void usbReset(void) {
SetEPRxStatus (VCOM_NOTIFICATION_ENDP, EP_RX_DIS);
/* setup data endpoint OUT (rx) */
- SetEPType (VCOM_RX_ENDP, EP_BULK);
- SetEPRxAddr (VCOM_RX_ENDP, VCOM_RX_ADDR);
- SetEPRxCount (VCOM_RX_ENDP, VCOM_RX_EPSIZE);
- SetEPTxStatus (VCOM_RX_ENDP, EP_TX_DIS);
- SetEPRxStatus (VCOM_RX_ENDP, EP_RX_VALID);
+/* SetEPType (VCOM_RX_ENDP, EP_BULK); */
+/* SetEPRxAddr (VCOM_RX_ENDP, VCOM_RX_ADDR); */
+/* SetEPRxCount (VCOM_RX_ENDP, VCOM_RX_EPSIZE); */
+/* // SetEPTxStatus (VCOM_RX_ENDP, EP_TX_DIS); */
+/* SetEPRxStatus (VCOM_RX_ENDP, EP_RX_VALID); */
+
+ SetEPType (3, EP_BULK);
+ SetEPRxAddr (3, 0x110);
+ SetEPRxCount (3,64);
+ // SetEPTxStatus (VCOM_RX_ENDP, EP_TX_DIS);
+ SetEPRxStatus (3, EP_RX_VALID);
/* setup data endpoint IN (tx) */
SetEPType (VCOM_TX_ENDP, EP_BULK);