From 1bb053654533fe1f0f330888b1e61855740fd14b Mon Sep 17 00:00:00 2001 From: xinyang Date: Wed, 15 May 2019 16:56:39 +0800 Subject: [PATCH] fix bug --- main.cpp | 1 - others/include/camera/camera_define.h | 16 ++++++++-------- others/src/serial/serial.cpp | 9 ++++++--- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/main.cpp b/main.cpp index d851c79..806398e 100644 --- a/main.cpp +++ b/main.cpp @@ -141,7 +141,6 @@ void uartReceive(Serial* uart) { cnt = 0; } } - LOGM("%d", cnt); if (cnt == 12) { if (buffer[8] == 'e') { state = ENERGY_STATE; diff --git a/others/include/camera/camera_define.h b/others/include/camera/camera_define.h index e06b8b3..1f56316 100644 --- a/others/include/camera/camera_define.h +++ b/others/include/camera/camera_define.h @@ -14,21 +14,21 @@ typedef unsigned int UINT; typedef unsigned long long UINT64; typedef int BOOL; typedef unsigned char BYTE; -#define DWORD unsigned int +typedef unsigned int DWORD; typedef void* PVOID; -#define HWND typedef void* -#define LPCTSTR char* +typedef void* HWND; +typedef char* LPCTSTR; typedef unsigned short USHORT; typedef short SHORT; typedef unsigned char* LPBYTE; typedef char CHAR; -#define WORD short -#define HANDLE INT -#define VOID void +typedef short WORD; +typedef INT HANDLE; +typedef void VOID; typedef unsigned long ULONG; -#define LPVOID void** +typedef void** LPVOID; typedef unsigned char UCHAR; -#define HMODULE void* +typedef void* HMODULE; diff --git a/others/src/serial/serial.cpp b/others/src/serial/serial.cpp index d714ea6..20ffb5a 100644 --- a/others/src/serial/serial.cpp +++ b/others/src/serial/serial.cpp @@ -1,9 +1,12 @@ #include #include -#include -using namespace std; #include +#define LOG_LEVEL LOG_NONE +#include + +using namespace std; + #ifdef Windows Serial::Serial(UINT baud, char parity, UINT databits, UINT stopsbits, DWORD dwCommEvents) : @@ -171,7 +174,7 @@ bool Serial::ReadData(unsigned char *buffer, unsigned int length) { return bResult; } -#else defined(Linux) +#elif defined(Linux) #include