Add set_GPIO, handle GPIO 36/39 bug

This commit is contained in:
philippe44
2020-02-01 01:53:50 -08:00
parent e1e3b820f3
commit dfebb8ceb6
7 changed files with 44 additions and 16 deletions

View File

@@ -31,6 +31,9 @@
#include "esp_task.h"
#include "driver/gpio.h"
#include "buttons.h"
#include "globdefs.h"
bool gpio36_39_used;
static const char * TAG = "buttons";
@@ -208,7 +211,10 @@ void button_create(void *client, int gpio, int type, bool pull, int debounce, bu
ESP_LOGW(TAG, "cannot set pull up/down for gpio %u", gpio);
}
}
// nasty ESP32 bug: fire-up constantly INT on GPIO 36/39 if ADC1, AMP, Hall which WiFi when PS is activated
if (gpio == 36 || gpio == 39) gpio36_39_used = true;
gpio_isr_handler_add(gpio, gpio_isr_handler, (void*) &buttons[n_buttons]);
gpio_intr_enable(gpio);