diff --git a/examples/device/usbtmc/src/usbtmc_app.c b/examples/device/usbtmc/src/usbtmc_app.c index e1ce115ad..0057a429f 100644 --- a/examples/device/usbtmc/src/usbtmc_app.c +++ b/examples/device/usbtmc/src/usbtmc_app.c @@ -92,14 +92,6 @@ static size_t buffer_tx_ix; // for transmitting using multiple transfers static uint8_t buffer[225]; // A few packets long should be enough. -static usbtmc_msg_dev_dep_msg_in_header_t rspMsg = { - .bmTransferAttributes = - { - .EOM = 1, - .UsingTermChar = 0 - } -}; - void tud_usbtmc_open_cb(uint8_t interface_id) { (void)interface_id; @@ -188,9 +180,6 @@ static unsigned int msgReqLen; bool tud_usbtmc_msgBulkIn_request_cb(usbtmc_msg_request_dev_dep_in const * request) { - rspMsg.header.MsgID = request->header.MsgID, - rspMsg.header.bTag = request->header.bTag, - rspMsg.header.bTagInverse = request->header.bTagInverse; msgReqLen = request->TransferSize; #ifdef xDEBUG diff --git a/src/class/usbtmc/usbtmc_device.c b/src/class/usbtmc/usbtmc_device.c index 64db85fcf..e96990c49 100644 --- a/src/class/usbtmc/usbtmc_device.c +++ b/src/class/usbtmc/usbtmc_device.c @@ -154,7 +154,9 @@ TU_VERIFY_STATIC(USBTMCD_BUFFER_SIZE >= 32u,"USBTMC dev buffer size too small"); static bool handle_devMsgOutStart(uint8_t rhport, void *data, size_t len); static bool handle_devMsgOut(uint8_t rhport, void *data, size_t len, size_t packetLen); +#ifndef NDEBUG static uint8_t termChar; +#endif static uint8_t termCharRequested = false; osal_mutex_def_t usbtmcLockBuffer; @@ -440,7 +442,9 @@ static bool handle_devMsgIn(void *data, size_t len) usbtmc_state.transfer_size_sent = 0u; termCharRequested = msg->bmTransferAttributes.TermCharEnabled; +#ifndef NDEBUG termChar = msg->TermChar; +#endif if(termCharRequested) TU_VERIFY(usbtmc_state.capabilities->bmDevCapabilities.canEndBulkInOnTermChar);