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