|
|
@@ -284,24 +284,6 @@ void setSystemTime(struct tm *timeinfo) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 函数定义:判断数组中是否有大于 100 的元素
|
|
|
-int hasElementGreaterThan400(uint16_t arr[], int size) {
|
|
|
- for (int i = 0; i < size; i++) {
|
|
|
- if (arr[i] < LAMP_CURRENT) {
|
|
|
- return 1; // 找到大于 100 的元素,返回 1
|
|
|
- }
|
|
|
- }
|
|
|
- return 0; // 遍历完数组,没有找到大于 100 的元素,返回 0
|
|
|
-}
|
|
|
-
|
|
|
-int hasElementGreater_lessThan400(uint16_t arr[], int size) {
|
|
|
- for (int i = 0; i < size; i++) {
|
|
|
- if (arr[i] > LAMP_CURRENT) {
|
|
|
- return 1; // 找到大于 100 的元素,返回 1
|
|
|
- }
|
|
|
- }
|
|
|
- return 0; // 遍历完数组,没有找到大于 100 的元素,返回 0
|
|
|
-}
|
|
|
|
|
|
/*入口函数-指令发送*/
|
|
|
static void dtu_thread_entry_send(void *parameter)
|
|
|
@@ -340,15 +322,15 @@ static void dtu_thread_entry_send(void *parameter)
|
|
|
{
|
|
|
HMI_WRITE("sleep=%d",1);
|
|
|
}
|
|
|
- if(device_status.sleep_mode == 1) {
|
|
|
- LOG_I("启动联网模块剩余:%d -120",device_status.num_updata);
|
|
|
- if(device_status.num_updata==120&&device_status.work_status==0)
|
|
|
- {
|
|
|
- device_status.dattim = 120; //省电,设置上传间隔为2H
|
|
|
- ctr_router(ON);
|
|
|
- ctr_RTU_DTU(ON);
|
|
|
- }
|
|
|
- }
|
|
|
+// if(device_status.sleep_mode == 1) {
|
|
|
+// LOG_I("启动联网模块剩余:%d -120",device_status.num_updata);
|
|
|
+// if(device_status.num_updata==120&&device_status.work_status==0)
|
|
|
+// {
|
|
|
+// device_status.dattim = 120; //省电,设置上传间隔为2H
|
|
|
+// ctr_router(ON);
|
|
|
+// ctr_RTU_DTU(ON);
|
|
|
+// }
|
|
|
+// }
|
|
|
}
|
|
|
else {
|
|
|
char *readinfo = makeJson_ReadInfo();
|
|
|
@@ -371,12 +353,12 @@ static void dtu_thread_entry_send(void *parameter)
|
|
|
}
|
|
|
else {
|
|
|
wait_i ++;
|
|
|
- if(device_status.sleep_mode == 1){
|
|
|
- if(wait_i==3500){
|
|
|
- ctr_router(ON);
|
|
|
- ctr_RTU_DTU(ON);
|
|
|
- }
|
|
|
- }
|
|
|
+// if(device_status.sleep_mode == 1){
|
|
|
+// if(wait_i==3500){
|
|
|
+// ctr_router(ON);
|
|
|
+// ctr_RTU_DTU(ON);
|
|
|
+// }
|
|
|
+// }
|
|
|
LOG_I("wait connect internet......%d",wait_i);
|
|
|
}
|
|
|
rt_thread_mdelay(1000);
|