注释掉触发深度睡眠相关代码

This commit is contained in:
dianke3yu 2025-05-22 18:08:42 +08:00
parent d759c0ce4e
commit 0c902ceecf
2 changed files with 17 additions and 13 deletions

View File

@ -264,7 +264,9 @@ void power_off()
// extern bk_err_t video_turn_off(void); // extern bk_err_t video_turn_off(void);
// audio_turn_off(); // audio_turn_off();
// video_turn_off(); // video_turn_off();
bk_reboot_ex(RESET_SOURCE_FORCE_DEEPSLEEP);
//zhanyu
// bk_reboot_ex(RESET_SOURCE_FORCE_DEEPSLEEP);
} }
void power_on() void power_on()
@ -474,8 +476,8 @@ static void handle_system_event(key_event_t event)
bk_pm_sleep_mode_set(PM_MODE_DEEP_SLEEP); bk_pm_sleep_mode_set(PM_MODE_DEEP_SLEEP);
rtos_delay_milliseconds(10); rtos_delay_milliseconds(10);
} }
//zhanyu
static void bk_wait_power_on() /* static void bk_wait_power_on()
{ {
uint32_t press_time = 0; uint32_t press_time = 0;
GLOBAL_INT_DECLARATION(); GLOBAL_INT_DECLARATION();
@ -506,7 +508,7 @@ static void handle_system_event(key_event_t event)
bk_key_register_wakeup_source(); bk_key_register_wakeup_source();
bk_enter_deepsleep(); bk_enter_deepsleep();
} }
} }*/
#endif #endif
void user_app_main(void) void user_app_main(void)
@ -564,13 +566,14 @@ static void handle_system_event(key_event_t event)
#if (CONFIG_SYS_CPU0) #if (CONFIG_SYS_CPU0)
/*to judgement key is long press or short press; long press exit deepsleep*/ /*to judgement key is long press or short press; long press exit deepsleep*/
if (bk_misc_get_reset_reason() == RESET_SOURCE_DEEPPS_GPIO /*&& (bk_gpio_get_wakeup_gpio_id() == KEY_GPIO_12)*/) //zhanyu
{ // if (bk_misc_get_reset_reason() == RESET_SOURCE_DEEPPS_GPIO && (bk_gpio_get_wakeup_gpio_id() == KEY_GPIO_12))
// motor vibration // {
motor_open(PWM_MOTOR_CH_3); // // motor vibration
bk_wait_power_on(); // motor_open(PWM_MOTOR_CH_3);
motor_close(PWM_MOTOR_CH_3); // bk_wait_power_on();
} // motor_close(PWM_MOTOR_CH_3);
// }
bk_regist_factory_user_config((const struct factory_config_t *)&s_user_config, bk_regist_factory_user_config((const struct factory_config_t *)&s_user_config,
sizeof(s_user_config) / sizeof(s_user_config[0])); sizeof(s_user_config) / sizeof(s_user_config[0]));

View File

@ -18,8 +18,9 @@ beken2_timer_t g_countdown_timer;
void CountdownCallback() void CountdownCallback()
{ {
LOGI("Standy time is up, start enter deepsleep\r\n"); LOGI("Standy time is up, start enter deepsleep\r\n");
extern void bk_reboot_ex(uint32_t reset_reason); //zhanyu
bk_reboot_ex(RESET_SOURCE_FORCE_DEEPSLEEP); //extern void bk_reboot_ex(uint32_t reset_reason);
// bk_reboot_ex(RESET_SOURCE_FORCE_DEEPSLEEP);
} }
void start_countdown(uint32_t time_ms) void start_countdown(uint32_t time_ms)