From 536d5827c0d6a68a981c94076ef5a65e4524aed5 Mon Sep 17 00:00:00 2001 From: Song Ruo Jing Date: Tue, 13 Dec 2022 15:38:38 +0800 Subject: [PATCH] gpio_filter: Fix test case fail on esp32c6 due to slow io_mux clock compare to 160MHz cpu clock. --- components/driver/test_apps/gpio/main/test_gpio_filter.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/driver/test_apps/gpio/main/test_gpio_filter.c b/components/driver/test_apps/gpio/main/test_gpio_filter.c index 345ef6600b..a385cfc807 100644 --- a/components/driver/test_apps/gpio/main/test_gpio_filter.c +++ b/components/driver/test_apps/gpio/main/test_gpio_filter.c @@ -123,6 +123,10 @@ TEST_CASE("GPIO flex glitch filter enable/disable", "[gpio_filter]") printf("generate rising edge glitch signal\r\n"); asm volatile("csrrsi zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); + asm volatile("csrrsi zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); + asm volatile("csrrsi zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); + asm volatile("csrrsi zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); + asm volatile("csrrci zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); // should timeout, because the glitch is filtered out @@ -133,6 +137,10 @@ TEST_CASE("GPIO flex glitch filter enable/disable", "[gpio_filter]") printf("generate rising edge glitch signal again\r\n"); asm volatile("csrrsi zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); + asm volatile("csrrsi zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); + asm volatile("csrrsi zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); + asm volatile("csrrsi zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); + asm volatile("csrrci zero, %0, 0x1" :: "i"(CSR_GPIO_OUT_USER)); // this time we should see the GPIO interrupt fired up