add code
This commit is contained in:
parent
4d4c31944f
commit
7df0cad3d3
7
main.cpp
7
main.cpp
@ -78,8 +78,8 @@ int main(int argc, char *argv[]) {
|
|||||||
boost::thread uartWaveReadTh(UartStartWave);
|
boost::thread uartWaveReadTh(UartStartWave);
|
||||||
uartWaveReadTh.detach();
|
uartWaveReadTh.detach();
|
||||||
//启动 RUN LED
|
//启动 RUN LED
|
||||||
boost::thread startRunLED(RunLED);
|
// boost::thread startRunLED(RunLED);
|
||||||
startRunLED.detach();
|
// startRunLED.detach();
|
||||||
|
|
||||||
|
|
||||||
#ifdef NR5G_MODULE
|
#ifdef NR5G_MODULE
|
||||||
@ -146,9 +146,6 @@ int main(int argc, char *argv[]) {
|
|||||||
//int fd = OpenWatchDog();
|
//int fd = OpenWatchDog();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while (GlobalConfig::QuitFlag_G) {
|
while (GlobalConfig::QuitFlag_G) {
|
||||||
gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 1);
|
|
||||||
usleep(20000);
|
|
||||||
gpio_set(GlobalConfig::GPIO_G.hardWatchDog, 0);
|
|
||||||
//WriteWatchDog(fd);
|
//WriteWatchDog(fd);
|
||||||
sleep(20);
|
sleep(20);
|
||||||
if (GlobalConfig::threadStatus == 0) {
|
if (GlobalConfig::threadStatus == 0) {
|
||||||
|
|||||||
@ -69,22 +69,22 @@ void HeartRep() {
|
|||||||
zlog_info(zct, "heart = %s,iRet = %d", strJson.c_str(), iRet);
|
zlog_info(zct, "heart = %s,iRet = %d", strJson.c_str(), iRet);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iRet != 0) {
|
// if (iRet != 0) {
|
||||||
gpio_set(GlobalConfig::GPIO_G.errorLed, 1);
|
// gpio_set(GlobalConfig::GPIO_G.errorLed, 1);
|
||||||
sleep(1);
|
// sleep(1);
|
||||||
gpio_set(GlobalConfig::GPIO_G.errorLed, 0);
|
// gpio_set(GlobalConfig::GPIO_G.errorLed, 0);
|
||||||
sleep(1);
|
// sleep(1);
|
||||||
gpio_set(GlobalConfig::GPIO_G.errorLed, 1);
|
// gpio_set(GlobalConfig::GPIO_G.errorLed, 1);
|
||||||
sleep(1);
|
// sleep(1);
|
||||||
gpio_set(GlobalConfig::GPIO_G.errorLed, 0);
|
// gpio_set(GlobalConfig::GPIO_G.errorLed, 0);
|
||||||
sleep(1);
|
// sleep(1);
|
||||||
gpio_set(GlobalConfig::GPIO_G.errorLed, 1);
|
// gpio_set(GlobalConfig::GPIO_G.errorLed, 1);
|
||||||
sleep(1);
|
// sleep(1);
|
||||||
GlobalConfig::serverStatus = 1;
|
// GlobalConfig::serverStatus = 1;
|
||||||
} else {
|
// } else {
|
||||||
GlobalConfig::serverStatus = 0;
|
// GlobalConfig::serverStatus = 0;
|
||||||
gpio_set(GlobalConfig::GPIO_G.errorLed, 0);
|
// gpio_set(GlobalConfig::GPIO_G.errorLed, 0);
|
||||||
}
|
// }
|
||||||
sleep(30);
|
sleep(30);
|
||||||
count ++;
|
count ++;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user