mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
small fixes
This commit is contained in:
parent
eea71a8b3b
commit
99d03fcaee
@ -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.
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user