summaryrefslogtreecommitdiff
path: root/examples/device/usbtmc
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-01-30 22:05:21 +0700
committerGitHub <[email protected]>2023-01-30 22:05:21 +0700
commit7166bb364380d436644d68541f1d905cc40cf2d1 (patch)
treed07fac172e9d449fc04f36f0cc5ad4a983b71f4a /examples/device/usbtmc
parent8681dbb7a22669deaa72954bf65fec0af0e2071b (diff)
parent25603c7269172f64b1dfe55e1224964cc20529ec (diff)
Merge pull request #1876 from hathach/support-iar
Support iar build
Diffstat (limited to 'examples/device/usbtmc')
-rw-r--r--examples/device/usbtmc/src/usbtmc_app.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/device/usbtmc/src/usbtmc_app.c b/examples/device/usbtmc/src/usbtmc_app.c
index 8f87a6dca..503ee3071 100644
--- a/examples/device/usbtmc/src/usbtmc_app.c
+++ b/examples/device/usbtmc/src/usbtmc_app.c
@@ -23,7 +23,7 @@
*
*/
-#include <strings.h>
+#include <string.h>
#include <stdlib.h> /* atoi */
#include "tusb.h"
#include "bsp/board.h"
@@ -148,11 +148,12 @@ bool tud_usbtmc_msg_data_cb(void *data, size_t len, bool transfer_complete)
queryState = transfer_complete;
idnQuery = 0;
- if(transfer_complete && (len >=4) && !strncasecmp("*idn?",data,4))
+ if ( transfer_complete && (len >= 4) && (!strncmp("*idn?", data, 4) || !strncmp("*IDN?", data, 4)) )
{
idnQuery = 1;
}
- if(transfer_complete && !strncasecmp("delay ",data,5))
+
+ if ( transfer_complete && (!strncmp("delay ", data, 5) || !strncmp("DELAY ", data, 5)) )
{
queryState = 0;
int d = atoi((char*)data + 5);