Bladeren bron

代码优化

YunZhiNeng 1 jaar geleden
bovenliggende
commit
fbe5af6ab4

+ 4 - 2
Drivers/Business/PumpBusiness.c

@@ -23,6 +23,7 @@ static struct TIMER_Struct timer;
 
 uint8_t send_data_switch = 1; // 发送数据的开关,0表示发送数据
 uint8_t networkTest_Flag=0;//开机判断是否有信号,0是未知默认状态,1是失败状态,2是成功状态。
+uint8_t module_switch = 0;//4G模块开关 0正常,1是关闭标志
 static uint8_t test_switch=0; //0代表正常流程,1代表测试流程
 struct Pump_Params pump_params; // 泵参数
 
@@ -164,13 +165,14 @@ void PumpBusines_Handle(void)
 // 循环执行
 void pump_business_loop_execution()
 {
+		// 初始化
+	Initialize_Handle();
 	// 没注册,直接返回
 	if(regist_get_result() == Regist_Result_Failure)
 	{
 		return;
 	}
-	// 初始化
-	Initialize_Handle();
+
 	// 业务处理
 	PumpBusines_Handle();
 	// 未及时处理的AT指令

+ 1 - 0
Drivers/Business/PumpBusiness.h

@@ -7,4 +7,5 @@
 void pump_business_loop_execution(void);
  void Pump_Params_Refresh(void);
  extern uint8_t networkTest_Flag;
+  extern uint8_t module_switch;
 #endif

+ 1 - 1
Drivers/Modules/bc260y/BC260Y_UDP_Client5.c

@@ -249,7 +249,7 @@ static uint8_t auth_times = 0; // 
 static uint16_t socket_err = 0;
 static uint8_t auth_or_data = 0;
 static enum Initialize_Result InitializeResult;
-static enum Regist_Result regist_result;
+
 static uint8_t resend_counter = 0;//nbʧ°ÜÖØ·¢±êÖ¾
 static uint8_t cfun_mode = 0;
 void UDP_Client_Handle(void)

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

@@ -45,7 +45,7 @@ static struct TIMER_Struct timer2;
 
 static uint8_t Restart_flag = 0;//4分钟内重启次数计数
 
-uint8_t module_switch = 0;//4G模块开关 0正常,1是关闭标志
+
 
 
 static uint32_t Power_wait_time = 10;

+ 7 - 5
Hardware/GPIOA.c

@@ -15,11 +15,13 @@ void GPIOA_Init(void)
 	 #endif
 
 	#if  BC260Y
-//	GPIO_InitStructure.GPIO_Mode	= GPIO_Mode_Out_PP;
-//	GPIO_InitStructure.GPIO_Pin 	= WAKE_GPIO_Pin;
-//	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_50MHz;	
-//	GPIO_Init(WAKE_GPIO, &GPIO_InitStructure);
-//	GPIO_SetBits(WAKE_GPIO, WAKE_GPIO_Pin); // nbÀ­µÍ
+	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
+	GPIO_InitTypeDef GPIO_InitStructure;
+	GPIO_InitStructure.GPIO_Pin 	= GPIO_Pin_7;
+	GPIO_InitStructure.GPIO_Mode	= GPIO_Mode_Out_PP;
+	GPIO_InitStructure.GPIO_Speed 	= GPIO_Speed_50MHz;	
+	GPIO_Init(GPIOA, &GPIO_InitStructure);
+	GPIO_ResetBits(GPIOA, GPIO_Pin_7); // nbÀ­µÍ
 	
   #endif
 }