Procházet zdrojové kódy

don't really stop EXTI4_15_IRQn

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui před 5 roky
rodič
revize
0c2a35f62d
2 změnil soubory, kde provedl 3 přidání a 21 odebrání
  1. 1 1
      Application/bsp/bsp.c
  2. 2 20
      Application/bsp/gpio.c

+ 1 - 1
Application/bsp/bsp.c

@@ -12,7 +12,7 @@ const char iap_board_name[] __attribute__((at(0x08002800))) = "SP600";
 const char iap_fw_version[] __attribute__((at(0x08002A00))) = "1.0";
 const char iap_fw_name[] __attribute__((at(0x08002C00))) = "App";
 
-#define CONFIG_DEBUG 1
+#define CONFIG_DEBUG 0
 
 extern void system_clock_config(void);
 extern void SystemCoreClockUpdate(void);

+ 2 - 20
Application/bsp/gpio.c

@@ -73,29 +73,11 @@ void enable_mcu_power(void){
 }
 
 static void enable_exti4_15_irq(int enable){
-#if 0	
-	static int _exti4_15_irq_enable = 0;
-	__disable_irq();
-	if (enable) {
-		if (_exti4_15_irq_enable++ == 0){
-			nvic_irq_enable(EXTI4_15_IRQn, 4U, 0U);
-		}
-	}else {
-		if (_exti4_15_irq_enable-- == 1){
-			nvic_irq_disable(EXTI4_15_IRQn);
-		}
-		if (_exti4_15_irq_enable < 0){
-			_exti4_15_irq_enable = 0;
-		}
-	}
-	__enable_irq();
-#else
 	if (enable){
 		nvic_irq_enable(EXTI4_15_IRQn, 4U, 0U);
-	}else {
-		nvic_irq_disable(EXTI4_15_IRQn);
+	}else { //many pins share the EXTI4_15_IRQn, do'nt stop it really
+		//nvic_irq_disable(EXTI4_15_IRQn);
 	}
-#endif
 }
 
 void charger_detect_irq_enable(int enable){