Parcourir la source

增加GPIOA 7配置

YunZhiNeng il y a 1 an
Parent
commit
6d656034e1
2 fichiers modifiés avec 12 ajouts et 10 suppressions
  1. 1 3
      Drivers/Business/PumpBusiness.c
  2. 11 7
      Hardware/GPIOA.c

+ 1 - 3
Drivers/Business/PumpBusiness.c

@@ -21,7 +21,7 @@ uint8_t Business_time_flag = 0;
 uint32_t Business_timer_ms = 0;
 uint32_t Business_wait_time = 1200; // 秒
 uint8_t resend_counter = 0;//nb失败重发标志
-uint8_t send_data_switch = 0; // 发送数据的开关,0表示发送数据
+uint8_t send_data_switch = 1; // 发送数据的开关,0表示发送数据
 static struct Pump_Params pump_params; // 泵参数
 uint8_t test_switch=1; //0代表正常流程,1代表测试流程
 static uint16_t Data_Number = 0; // 数据编号
@@ -176,8 +176,6 @@ void PumpBusines_Handle(void)
 void pump_business_loop_execution()
 {
 	#if  _4GFLAG
-	
-
 	Power_Handle();
 	#endif
 	if(flashdata.read_flag==0)return;//注册失败或flash存储失败

+ 11 - 7
Hardware/GPIOA.c

@@ -4,21 +4,25 @@
 void GPIOA_Init(void)
 {
 	RCC_APB2PeriphClockCmd(WAKE_GPIO_RCC, ENABLE);
-	
+	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
 	GPIO_InitTypeDef GPIO_InitStructure;
+	#if  _4GFLAG
+	
 	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); // 4g拉高
+	 #endif
 //	//GPIO_SetBits(WAKE_GPIO, WAKE_GPIO_Pin); // 4g拉高
 	#if  NBFLAG
-	GPIO_ResetBits(WAKE_GPIO, WAKE_GPIO_Pin); // nb拉低
+	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
-	#if  _4GFLAG
-	GPIO_SetBits(WAKE_GPIO, WAKE_GPIO_Pin); // 4g拉高
-   #endif
-//	GPIO_ResetBits(WAKE_GPIO, WAKE_GPIO_Pin); // nb拉低
 }