From d89e7e4e450aef8a8a50f237de346a8ae86c63bd Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Fri, 30 Jun 2017 15:28:18 -0700 Subject: [PATCH] samples: drivers: gpio: Make the sample work with ESP32 Signed-off-by: Leandro Pereira --- samples/drivers/gpio/src/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/samples/drivers/gpio/src/main.c b/samples/drivers/gpio/src/main.c index b95cb192f68..cb03e8523f1 100644 --- a/samples/drivers/gpio/src/main.c +++ b/samples/drivers/gpio/src/main.c @@ -108,6 +108,12 @@ * Toggling GPIO_8 * GPIO_24 triggered * " + * + * ESP32 + * ----- + * + * An LED should be connected to pin IO4, and either a jumper cable or + * button should be connected between IO2 and GND. */ #include @@ -138,6 +144,10 @@ #define GPIO_OUT_PIN 10 #define GPIO_INT_PIN 4 #define GPIO_NAME "GPIO_" +#elif defined(CONFIG_SOC_ESP32) +#define GPIO_OUT_PIN 4 +#define GPIO_INT_PIN 2 +#define GPIO_NAME "GPIO_" #endif #if defined(CONFIG_GPIO_DW_0) @@ -148,6 +158,8 @@ #define GPIO_DRV_NAME CONFIG_GPIO_QMSI_SS_0_NAME #elif defined(CONFIG_GPIO_ATMEL_SAM3) #define GPIO_DRV_NAME CONFIG_GPIO_ATMEL_SAM3_PORTB_DEV_NAME +#elif defined(CONFIG_GPIO_ESP32) +#define GPIO_DRV_NAME CONFIG_GPIO_ESP32_0_NAME #else #define GPIO_DRV_NAME "GPIO_0" #endif