fix sleep

This commit is contained in:
2025-03-03 01:09:21 +01:00
parent 3fc93c7441
commit 996f922e35

View File

@@ -15,6 +15,7 @@ Shutdowner& Shutdowner::get() {
static void shutdown(void* arg) {
// printf("Shutting down...\n");
ESP_ERROR_CHECK(gpio_hold_dis(PWR_KILL));
ESP_ERROR_CHECK(gpio_set_level(PWR_KILL, 0));
}
@@ -28,5 +29,6 @@ Shutdowner::Shutdowner() {
ESP_ERROR_CHECK(gpio_set_pull_mode(PWR_INT, GPIO_FLOATING));
ESP_ERROR_CHECK(gpio_set_intr_type(PWR_INT, GPIO_INTR_NEGEDGE));
ESP_ERROR_CHECK(gpio_install_isr_service(0));
ESP_ERROR_CHECK(gpio_hold_en(PWR_KILL));
gpio_isr_handler_add(PWR_INT, shutdown, nullptr);
}