Bläddra i källkod

修改初始化

YunZhiNeng 1 år sedan
förälder
incheckning
09a3803cad
3 ändrade filer med 13 tillägg och 13 borttagningar
  1. 2 2
      Drivers/Business/PumpBusiness.c
  2. 2 2
      Drivers/CONFIG.h
  3. 9 9
      Drivers/Modules/ec800m/Ec800m_Initialize.c

+ 2 - 2
Drivers/Business/PumpBusiness.c

@@ -23,7 +23,7 @@ static struct TIMER_Struct timer;
 
 uint8_t send_data_switch = 0; // 发送数据的开关,0表示发送数据
 uint8_t networkTest_Flag=0;//开机判断是否有信号,0是未知默认状态,1是失败状态,2是成功状态。
-uint8_t test_switch=0; //0代表正常流程,1代表测试流程
+static uint8_t test_switch=0; //0代表正常流程,1代表测试流程
 struct Pump_Params pump_params; // 泵参数
 
 static uint16_t Data_Number = 0; // 数据编号
@@ -123,7 +123,7 @@ void PumpBusines_Handle(void)
 	// 发送
 	if(UDP_Client_Status() == Client_Status_None)
 	{
-		if(test_switch==1&&Data_Number>=100)
+		if(test_switch==1&&Data_Number>=100)//测试模式只发100条数据
 		{
 			send_data_switch=0;
 			return ;

+ 2 - 2
Drivers/CONFIG.h

@@ -7,8 +7,8 @@
 
 
 
-//#define EC800M 1 //4G开关,不能数字开头
-#define BC260Y 1  // NB
+#define EC800M 1 //4G开关,不能数字开头
+//#define BC260Y 1  // NB
 
 
 

+ 9 - 9
Drivers/Modules/ec800m/Ec800m_Initialize.c

@@ -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: