Skip to content

Commit dd55da6

Browse files
committed
bugfix(example): fixed the unexpected button event triggered when no button was pressed in the light sleep example on ESP32-C6
1 parent 4e4ee77 commit dd55da6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/esp_zigbee_sleep/light_sleep/main/esp_zb_sleepy_end_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
static const char *TAG = "ESP_ZB_SLEEP";
3939

40-
static switch_func_pair_t button_func_pair[] = {{CONFIG_GPIO_EXT1_WAKEUP_SOURCE, SWITCH_ONOFF_TOGGLE_CONTROL}};
40+
static switch_func_pair_t button_func_pair[] = {{GPIO_INPUT_IO_TOGGLE_SWITCH, SWITCH_ONOFF_TOGGLE_CONTROL}};
4141

4242
static void ieee_cb(esp_zb_zdp_status_t zdo_status, esp_zb_zdo_ieee_addr_rsp_t *resp, void *user_ctx)
4343
{
@@ -75,9 +75,9 @@ static esp_err_t deferred_driver_init(void)
7575
Since the BOOT button is connected to a pull-up resistor, the wake-up mode is configured as LOW.
7676
*/
7777
ESP_ERROR_CHECK(esp_sleep_enable_ext1_wakeup(BIT(CONFIG_GPIO_EXT1_WAKEUP_SOURCE), ESP_EXT1_WAKEUP_ANY_LOW));
78+
ESP_ERROR_CHECK(gpio_wakeup_enable(CONFIG_GPIO_EXT1_WAKEUP_SOURCE, GPIO_INTR_LOW_LEVEL));
7879

7980
#if SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
80-
rtc_gpio_init(CONFIG_GPIO_EXT1_WAKEUP_SOURCE);
8181
rtc_gpio_pulldown_dis(CONFIG_GPIO_EXT1_WAKEUP_SOURCE);
8282
rtc_gpio_pullup_en(CONFIG_GPIO_EXT1_WAKEUP_SOURCE);
8383
#else

0 commit comments

Comments
 (0)