Jelajahi Sumber

小电流短路保护中断设置wakeup源

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui 5 tahun lalu
induk
melakukan
b10922e075
2 mengubah file dengan 2 tambahan dan 0 penghapusan
  1. 1 0
      Application/app/sox/iostate.c
  2. 1 0
      Application/bsp/mcu_power_sleep.h

+ 1 - 0
Application/app/sox/iostate.c

@@ -158,6 +158,7 @@ void small_current_short_irq_handler(void){
 		io_debug("close aux power,cause the short irq\n");
 		io_debug("close aux power,cause the short irq\n");
 		return;
 		return;
 	}
 	}
+	mcu_sleep_set_wakeup_source(WAKEUP_SOURCE_SMALL_POWER_SHORT);
 	_io_state.aux_lock_irq = 1;
 	_io_state.aux_lock_irq = 1;
 	shark_timer_post(&_small_current_irq_timer, 0);
 	shark_timer_post(&_small_current_irq_timer, 0);
 	//io_debug("aux lock irq\n");
 	//io_debug("aux lock irq\n");

+ 1 - 0
Application/bsp/mcu_power_sleep.h

@@ -8,6 +8,7 @@
 #define WAKEUP_SOURCE_IR1   0x10
 #define WAKEUP_SOURCE_IR1   0x10
 #define WAKEUP_SOURCE_IR2   0x20
 #define WAKEUP_SOURCE_IR2   0x20
 #define WAKEUP_SOURCE_KEY   0x40
 #define WAKEUP_SOURCE_KEY   0x40
+#define WAKEUP_SOURCE_SMALL_POWER_SHORT 0x80
 void mcu_enter_deepsleep(void);
 void mcu_enter_deepsleep(void);
 uint32_t mcu_get_sleeptime(void);
 uint32_t mcu_get_sleeptime(void);
 void mcu_sleep_set_wakeup_source(uint32_t source);
 void mcu_sleep_set_wakeup_source(uint32_t source);