Skip to content

Commit caff3b5

Browse files
author
Ben Avison
committed
Remove unused static data
This affects struct rspMsg in usbtmc_app.c (unconditionally) and uint8_t termChar in usbtmc_device.c (when NDEBUG is defined). IAR generates warning Pe550 'variable was set but never used'.
1 parent 6a2d01b commit caff3b5

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

examples/device/usbtmc/src/usbtmc_app.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,6 @@ static size_t buffer_tx_ix; // for transmitting using multiple transfers
9292
static uint8_t buffer[225]; // A few packets long should be enough.
9393

9494

95-
static usbtmc_msg_dev_dep_msg_in_header_t rspMsg = {
96-
.bmTransferAttributes =
97-
{
98-
.EOM = 1,
99-
.UsingTermChar = 0
100-
}
101-
};
102-
10395
void tud_usbtmc_open_cb(uint8_t interface_id)
10496
{
10597
(void)interface_id;
@@ -188,9 +180,6 @@ static unsigned int msgReqLen;
188180

189181
bool tud_usbtmc_msgBulkIn_request_cb(usbtmc_msg_request_dev_dep_in const * request)
190182
{
191-
rspMsg.header.MsgID = request->header.MsgID,
192-
rspMsg.header.bTag = request->header.bTag,
193-
rspMsg.header.bTagInverse = request->header.bTagInverse;
194183
msgReqLen = request->TransferSize;
195184

196185
#ifdef xDEBUG

src/class/usbtmc/usbtmc_device.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ TU_VERIFY_STATIC(USBTMCD_BUFFER_SIZE >= 32u,"USBTMC dev buffer size too small");
154154
static bool handle_devMsgOutStart(uint8_t rhport, void *data, size_t len);
155155
static bool handle_devMsgOut(uint8_t rhport, void *data, size_t len, size_t packetLen);
156156

157+
#ifndef NDEBUG
157158
static uint8_t termChar;
159+
#endif
158160
static uint8_t termCharRequested = false;
159161

160162
osal_mutex_def_t usbtmcLockBuffer;
@@ -440,7 +442,9 @@ static bool handle_devMsgIn(void *data, size_t len)
440442
usbtmc_state.transfer_size_sent = 0u;
441443

442444
termCharRequested = msg->bmTransferAttributes.TermCharEnabled;
445+
#ifndef NDEBUG
443446
termChar = msg->TermChar;
447+
#endif
444448

445449
if(termCharRequested)
446450
TU_VERIFY(usbtmc_state.capabilities->bmDevCapabilities.canEndBulkInOnTermChar);

0 commit comments

Comments
 (0)