From 48fee82987d85f474b36bd9470230a862f87ba95 Mon Sep 17 00:00:00 2001 From: Matthew Date: Sat, 12 Oct 2024 12:56:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=AF=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/CMakeLists.txt | 2 +- app/src/main/cpp/GPIOControl.cpp | 20 -------------------- app/src/main/cpp/GPIOControl.h | 4 ++-- app/src/main/cpp/PhoneDevice.cpp | 8 +------- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/app/src/main/cpp/CMakeLists.txt b/app/src/main/cpp/CMakeLists.txt index 5be83f4d..9cc69c5d 100644 --- a/app/src/main/cpp/CMakeLists.txt +++ b/app/src/main/cpp/CMakeLists.txt @@ -44,7 +44,7 @@ add_definitions(-DUSING_HDRPLUS) add_definitions(-DUSING_EXEC_HDRP=1) set(USING_EXEC_HDRP 1) -#add_definitions(-DUSING_N938) +add_definitions(-DUSING_N938) # include_directories(${OpenCV_DIR}/include) # add_library( lib_opencv SHARED IMPORTED ) diff --git a/app/src/main/cpp/GPIOControl.cpp b/app/src/main/cpp/GPIOControl.cpp index d4b69f39..797a7882 100644 --- a/app/src/main/cpp/GPIOControl.cpp +++ b/app/src/main/cpp/GPIOControl.cpp @@ -134,26 +134,6 @@ std::string GpioControl::getString(int cmd) #ifdef USING_N938 -bool GpioControl::SetN938Cmd(int cmd, int val) -{ - char buf[32] = { 0 }; - snprintf(buf, "out %d %d", cmd, val); - - IOT_PARAM param; - int len = MAX_STRING_LEN < strlen(buf) ? MAX_STRING_LEN : strlen(buf); - - param.cmd = cmd; - memset(param.str, 0, MAX_STRING_LEN); - memcpy(param.str, value.c_str(), len); - - int fd = open(GPIO_NODE_MP, O_RDONLY); - if( fd > 0 ) - { - ioctl(fd, IOT_PARAM_WRITE, ¶m); - close(fd); - } - return; -} bool GpioControl::OpenSensors() { diff --git a/app/src/main/cpp/GPIOControl.h b/app/src/main/cpp/GPIOControl.h index 96f73e04..c5dafd6a 100644 --- a/app/src/main/cpp/GPIOControl.h +++ b/app/src/main/cpp/GPIOControl.h @@ -116,9 +116,10 @@ #ifdef USING_N938 #define GPIO_NODE_N938 "/sys/devices/platform/1000b000.pinctrl/mt_gpio" #else -#define GPIO_NODE_MP "/dev/mtkgpioctrl" + #endif // USING_N938 +#define GPIO_NODE_MP "/dev/mtkgpioctrl" class GpioControl { @@ -253,7 +254,6 @@ public: } #ifdef USING_N938 - static bool SetN938Cmd(int cmd, int val); static bool OpenSensors(); static bool CloseSensors(); #endif diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index d75213a5..5618d660 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -2195,13 +2195,7 @@ bool CPhoneDevice::onBurstCapture(std::shared_ptr characteristi #endif XYLOG(XYLOG_SEVERITY_ERROR, "Finish HDR CH=%u IMGID=%u", (uint32_t)photoInfo.channel, (uint32_t)photoInfo.photoId); - -#ifdef NDEBUG - for (auto it = rawFilePaths.cbegin(); it != rawFilePaths.cend(); ++it) - { - std::remove((*it).c_str()); - } -#endif + { cv::Mat tempPic = convert16bit2_8bit_(rgb); rgb = tempPic;