Code: Select all
gpio_wakeup_enable(GPIO_NUM_2, GPIO_INTR_HIGH_LEVEL);
esp_sleep_enable_gpio_wakeup();//以上为GPIO唤醒设置,电流5.16ma;以下为Timer唤醒设置,电流1.43ma;二者同时设置电流也为1.43ma。
int time_wakeup_sec = 10;
esp_sleep_enable_timer_wakeup(time_wakeup_sec * 1000000);