From 7df0cad3d3e6f62fd4f726e30fac062cb278d1e0 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Sat, 28 Feb 2026 14:11:23 +0800 Subject: [PATCH] add code --- main.cpp | 7 ++----- threadfunc/thread_func.cpp | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/main.cpp b/main.cpp index 1fa9853..e8130dc 100644 --- a/main.cpp +++ b/main.cpp @@ -78,8 +78,8 @@ int main(int argc, char *argv[]) { boost::thread uartWaveReadTh(UartStartWave); uartWaveReadTh.detach(); //启动 RUN LED - boost::thread startRunLED(RunLED); - startRunLED.detach(); + // boost::thread startRunLED(RunLED); + // startRunLED.detach(); #ifdef NR5G_MODULE @@ -146,9 +146,6 @@ int main(int argc, char *argv[]) { //int fd = OpenWatchDog(); int count = 0; while (GlobalConfig::QuitFlag_G) { - gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 1); - usleep(20000); - gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 0); //WriteWatchDog(fd); sleep(20); if (GlobalConfig::threadStatus == 0) { diff --git a/threadfunc/thread_func.cpp b/threadfunc/thread_func.cpp index b00d45b..292857e 100644 --- a/threadfunc/thread_func.cpp +++ b/threadfunc/thread_func.cpp @@ -69,22 +69,22 @@ void HeartRep() { zlog_info(zct, "heart = %s,iRet = %d", strJson.c_str(), iRet); } - if (iRet != 0) { - gpio_set(GlobalConfig::GPIO_G.errorLed, 1); - sleep(1); - gpio_set(GlobalConfig::GPIO_G.errorLed, 0); - sleep(1); - gpio_set(GlobalConfig::GPIO_G.errorLed, 1); - sleep(1); - gpio_set(GlobalConfig::GPIO_G.errorLed, 0); - sleep(1); - gpio_set(GlobalConfig::GPIO_G.errorLed, 1); - sleep(1); - GlobalConfig::serverStatus = 1; - } else { - GlobalConfig::serverStatus = 0; - gpio_set(GlobalConfig::GPIO_G.errorLed, 0); - } + // if (iRet != 0) { + // gpio_set(GlobalConfig::GPIO_G.errorLed, 1); + // sleep(1); + // gpio_set(GlobalConfig::GPIO_G.errorLed, 0); + // sleep(1); + // gpio_set(GlobalConfig::GPIO_G.errorLed, 1); + // sleep(1); + // gpio_set(GlobalConfig::GPIO_G.errorLed, 0); + // sleep(1); + // gpio_set(GlobalConfig::GPIO_G.errorLed, 1); + // sleep(1); + // GlobalConfig::serverStatus = 1; + // } else { + // GlobalConfig::serverStatus = 0; + // gpio_set(GlobalConfig::GPIO_G.errorLed, 0); + // } sleep(30); count ++; }