File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -125,9 +125,9 @@ config ENABLE_WAKEUP_KEY
125125 help
126126 Select this to enable WakeUp Key.
127127
128- config WAKEUP_KEY_HOLD_TIME
129- int "WakeUp Key Hold Time (ms)"
130- default 1000
128+ config WAKEUP_KEY_EXTRA_HOLD_TIME
129+ int "WakeUp Key Extra Hold Time (ms)"
130+ default 0
131131 depends on ENABLE_WAKEUP_KEY
132132
133133choice WAKEUP_KEY_ACTIVE_LEVEL
Original file line number Diff line number Diff line change @@ -36,19 +36,18 @@ void os_enter_sleep_mode(void)
3636void core_init (void )
3737{
3838#ifdef CONFIG_ENABLE_WAKEUP_KEY
39- portTickType xLastWakeTime = xTaskGetTickCount ();
40-
39+ ESP_LOGI (TAG , "checking wakeup cause" );
4140 if (esp_sleep_get_wakeup_cause () != ESP_SLEEP_WAKEUP_UNDEFINED ) {
42- vTaskDelayUntil ( & xLastWakeTime , CONFIG_WAKEUP_KEY_HOLD_TIME / portTICK_RATE_MS );
41+ vTaskDelay ( CONFIG_WAKEUP_KEY_EXTRA_HOLD_TIME / portTICK_RATE_MS );
4342
4443#ifdef CONFIG_WAKEUP_KEY_ACTIVE_LOW
4544 if (gpio_get_level (CONFIG_WAKEUP_KEY_PIN ) == 0 ) {
4645#else
4746 if (gpio_get_level (CONFIG_WAKEUP_KEY_PIN ) == 1 ) {
4847#endif
49- ESP_LOGI (TAG , "wakeup from sleep mode" );
48+ ESP_LOGI (TAG , "resuming from sleep mode" );
5049 } else {
51- ESP_LOGI (TAG , "wakeup aborted" );
50+ ESP_LOGI (TAG , "resume aborted" );
5251
5352 os_enter_sleep_mode ();
5453 }
You can’t perform that action at this time.
0 commit comments