Parcourir la source

每次rtc或者其他方式唤醒后查询hall状态,如果有hall,需要退出休眠

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui il y a 4 ans
Parent
commit
5f2c51ddbb
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. 6 0
      Application/bsp/mcu_power_sleep.c

+ 6 - 0
Application/bsp/mcu_power_sleep.c

@@ -157,6 +157,12 @@ void mcu_enter_deepsleep(void){
 		}else { //rtc second wrap
 			_sleep_second_time_now += 60 - start_time + end_time;
 		}
+		if (IS_HALL1_DETECTED()) {
+			_wakeup_source |= WAKEUP_SOURCE_HALL1;
+		}
+		if (IS_HALL2_DETECTED()) {
+			_wakeup_source |= WAKEUP_SOURCE_HALL2;
+		}
 		if (_wakeup_source & WAKEUP_SOURCE_RTC) {
 			wdog_reload();
 			shark_rtc_set_backup(0xFF2);