From 94f225f57bda5b7bd2d7e2cc58f2e38181b43da6 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 27 Jul 2024 09:25:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=90=8D=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/SensorsProtocol.cpp | 2 +- app/src/main/cpp/SensorsProtocol.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/SensorsProtocol.cpp b/app/src/main/cpp/SensorsProtocol.cpp index 4802f3de..72eb9e52 100644 --- a/app/src/main/cpp/SensorsProtocol.cpp +++ b/app/src/main/cpp/SensorsProtocol.cpp @@ -1077,7 +1077,7 @@ void Gm_InitSerialComm(SENSOR_PARAM *sensorParam, char *filedir) if(NULL == filedir) return; memset(srdt.filedir, 0, sizeof(srdt.filedir)); - memmove(srdt.filedir, filedir, min(sizeof(srdt.filedir), strlen(filedir))); + memmove(srdt.filedir, filedir, MIN(sizeof(srdt.filedir), strlen(filedir))); FindDevUseSerialCommNo(); #if 0 //Collect_sensor_data(); diff --git a/app/src/main/cpp/SensorsProtocol.h b/app/src/main/cpp/SensorsProtocol.h index 3b40e8bb..525bac7e 100644 --- a/app/src/main/cpp/SensorsProtocol.h +++ b/app/src/main/cpp/SensorsProtocol.h @@ -34,7 +34,7 @@ typedef long long LONG; #define LOWORD(l) ((WORD)(l)) #define HIWORD(l) ((WORD)((DWORD)(l) >> 16)) -#define min(a, b) ((a) < (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX_STRING_LEN 32 #define IOT_PARAM_WRITE 0xAE #define IOT_PARAM_READ 0xAF