ESP IDF Robot

This commit is contained in:
2024-12-21 23:45:18 -05:00
parent 3c863b242e
commit ec7203e05c

View File

@@ -21,7 +21,7 @@
static const char *TAG = "ESP IDF Robot"; static const char *TAG = "ESP IDF Robot";
#define PUSH_BTN_GPIO 3 // GPIO of on-board push-button #define PUSH_BTN_GPIO 3 // GPIO of on-board push-button
#define GPIO_OUTPUT_PIN_SEL ((1ULL<<PUSH_BTN_GPIO)) #define GPIO_INPUT_PIN_SEL ((1ULL<<PUSH_BTN_GPIO))
#define ESP_INTR_FLAG_DEFAULT 0 #define ESP_INTR_FLAG_DEFAULT 0
static QueueHandle_t gpio_evt_queue = NULL; static QueueHandle_t gpio_evt_queue = NULL;
@@ -132,6 +132,9 @@ void app_main(void)
io_conf.pull_up_en = 1; io_conf.pull_up_en = 1;
gpio_config(&io_conf); gpio_config(&io_conf);
io_conf.intr_type = GPIO_INTR_NEGEDGE;
io_conf.pin_bit_mask = GPIO_INPUT_PIN_SEL;
configure_button(); configure_button();
while (1) { while (1) {