summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Conrad <[email protected]>2019-09-18 19:30:44 -0400
committerNathan Conrad <[email protected]>2019-09-18 19:30:44 -0400
commit99d03fcaee64104df96e332a2347aa7ecc1b6172 (patch)
tree5e81d5cfe1639912c47a95511fa1bf3960264f46
parenteea71a8b3b080299ad95ac79a7d45b2dc0d5b6f6 (diff)
small fixes
-rw-r--r--examples/device/usbtmc/src/usbtmc_app.c10
-rw-r--r--src/class/usbtmc/usbtmc_device.c13
2 files changed, 14 insertions, 9 deletions
diff --git a/examples/device/usbtmc/src/usbtmc_app.c b/examples/device/usbtmc/src/usbtmc_app.c
index 03800ab17..7132f5143 100644
--- a/examples/device/usbtmc/src/usbtmc_app.c
+++ b/examples/device/usbtmc/src/usbtmc_app.c
@@ -86,7 +86,7 @@ bool usbtmcd_app_msgBulkOut_start(uint8_t rhport, usbtmc_msg_request_dev_dep_out
{
(void)rhport;
(void)msgHeader;
- uart_tx_str_sync("MSG_OUT_DATA: start\r\n");
+ //uart_tx_str_sync("MSG_OUT_DATA: start\r\n");
return true;
}
bool usbtmcd_app_msg_trigger(uint8_t rhport, usbtmc_msg_generic_t* msg) {
@@ -100,12 +100,12 @@ bool usbtmcd_app_msg_data(uint8_t rhport, void *data, size_t len, bool transfer_
(void)rhport;
// If transfer isn't finished, we just ignore it (for now)
- uart_tx_str_sync("MSG_OUT_DATA: <<<");
+ /*uart_tx_str_sync("MSG_OUT_DATA: <<<");
uart_tx_sync(data,len);
uart_tx_str_sync(">>>\r\n");
if(transfer_complete)
uart_tx_str_sync("MSG_OUT_DATA: Complete\r\n");
-
+*/
if(transfer_complete && (len >=4) && !strncasecmp("*idn?",data,4)) {
queryState = 1;
}
@@ -132,7 +132,7 @@ bool usbtmcd_app_msgBulkIn_request(uint8_t rhport, usbtmc_msg_request_dev_dep_in
rspMsg.header.bTagInverse = request->header.bTagInverse;
msgReqLen = request->TransferSize;
- uart_tx_str_sync("MSG_IN_DATA: Requested!\r\n");
+ //uart_tx_str_sync("MSG_IN_DATA: Requested!\r\n");
TU_ASSERT(bulkInStarted == 0);
bulkInStarted = 1;
@@ -169,7 +169,7 @@ void usbtmc_app_task_iter(void) {
if(bulkInStarted) {
queryState = 0;
bulkInStarted = 0;
- uart_tx_str_sync("usbtmc_app_task_iter: sending rsp!\r\n");
+ //uart_tx_str_sync("usbtmc_app_task_iter: sending rsp!\r\n");
usbtmcd_transmit_dev_msg_data(rhport, idn, tu_min32(sizeof(idn)-1,msgReqLen),false);
// MAV is cleared in the transfer complete callback.
}
diff --git a/src/class/usbtmc/usbtmc_device.c b/src/class/usbtmc/usbtmc_device.c
index c71d4d963..0f14fdfb4 100644
--- a/src/class/usbtmc/usbtmc_device.c
+++ b/src/class/usbtmc/usbtmc_device.c
@@ -31,8 +31,6 @@
* This file is part of the TinyUSB stack.
*/
-#include "tusb_option.h"
-
// Synchronization is needed in some spots.
// These functions should NOT be called from interrupts.
@@ -71,6 +69,9 @@
// Abort bulk in/out
// No CLEAR_FEATURE/HALT no EP (yet)
+
+#include "tusb_option.h"
+
#if (TUSB_OPT_DEVICE_ENABLED && CFG_TUD_USBTMC)
#include <string.h>
@@ -78,8 +79,12 @@
#include "usbtmc_device.h"
#include "device/dcd.h"
#include "device/usbd.h"
+
+#ifdef xDEBUG
#include "uart_util.h"
static char logMsg[150];
+#endif
+
// FIXME: I shouldn't need to include _pvt headers.
#include "device/usbd_pvt.h"
@@ -447,7 +452,7 @@ bool usbtmcd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t result, uint
break;
case USBTMC_MSGID_DEV_DEP_MSG_IN:
- uart_tx_sync("Handling msg in req\r\n", 21);
+ TRACE("Handling msg in req\r\n");
TU_VERIFY(handle_devMsgIn(rhport, msg, xferred_bytes));
break;
@@ -643,7 +648,7 @@ bool usbtmcd_control_request(uint8_t rhport, tusb_control_request_t const * requ
TU_VERIFY(request->bmRequestType == 0xA2); // in,class,EP
TU_VERIFY(request->wLength == sizeof(rsp));
TU_VERIFY(request->wIndex == usbtmc_state.ep_bulk_out);
- TU_VERIFY(usbtmcd_app_check_abort_bulk_out(rhport, &(rsp.USBTMC_status)));
+ TU_VERIFY(usbtmcd_app_check_abort_bulk_out(rhport, &rsp));
TU_VERIFY(usbd_edpt_xfer(rhport, 0u, (void*)&rsp,sizeof(rsp)));
return true;
}