|
|
@@ -38,17 +38,17 @@ static enum Initialize_Result InitializeResult;
|
|
|
|
|
|
|
|
|
static struct TIMER_Struct timer;
|
|
|
-
|
|
|
+static struct TIMER_Struct timer2;
|
|
|
|
|
|
// 计时相关的变量
|
|
|
|
|
|
-static uint8_t Restart_flag = 0;//5分钟内重启次数计数
|
|
|
+static uint8_t Restart_flag = 0;//4分钟内重启次数计数
|
|
|
|
|
|
-static uint8_t module_switch = 0;//4G模块开关 0正常,1是关闭标志
|
|
|
+uint8_t module_switch = 0;//4G模块开关 0正常,1是关闭标志
|
|
|
|
|
|
|
|
|
static uint32_t Power_wait_time = 10;
|
|
|
-static uint32_t Restart_time_ms = 0;//重启时间计时
|
|
|
+
|
|
|
static uint8_t set_mincfun_flag=1;//0代表正在初始化,1代表空闲
|
|
|
|
|
|
|
|
|
@@ -133,10 +133,10 @@ void Power_Handle(void)
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(Restart_time_ms>=240000)
|
|
|
+ if(time_get_delay(&timer2)>=240000)
|
|
|
{
|
|
|
Restart_flag=0;
|
|
|
- Restart_time_ms=0;
|
|
|
+ time_clear(&timer2);
|
|
|
}else
|
|
|
{
|
|
|
if(Restart_flag>=4&&module_switch==0)//4分钟内重启4次
|
|
|
@@ -164,7 +164,7 @@ void Power_Handle(void)
|
|
|
|
|
|
case STEP_SET_SLEEP: // 设置休眠模式
|
|
|
result = ec800m.set_sleep(1);
|
|
|
-// power_times++;
|
|
|
+
|
|
|
if(result == Result_Success)
|
|
|
{
|
|
|
Log_Printf_Debug("设置休眠模式成功\r\n");
|
|
|
@@ -262,11 +262,11 @@ void Power_Handle(void)
|
|
|
|
|
|
if(module_switch==0)
|
|
|
{
|
|
|
- pownext_wait_step(STEP_START, 500);
|
|
|
+ pownext_wait_step(STEP_START, 50);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- pownext_wait_step(STEP_SET_CFUN_0, 1000);
|
|
|
+ pownext_wait_step(STEP_SET_CFUN_0, 500);
|
|
|
}
|
|
|
break;
|
|
|
default:
|