This commit is contained in:
2021-03-09 18:08:39 +01:00
parent 4431d7b951
commit c27cd94e7e
2 changed files with 11 additions and 2 deletions

View File

@ -3,7 +3,9 @@
#include "gpio.h"
#include <driver/gpio.h>
#include <esp_log.h>
static const char *TAG = "gpio";
void gpioInit() {
@ -11,10 +13,15 @@ void gpioInit() {
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.pin_bit_mask = (1ULL << GPIO_FORCE_PROV);
io_conf.mode = GPIO_MODE_INPUT;
io_conf.pull_up_en = 1;
io_conf.pull_up_en = 0;
io_conf.pull_down_en = 1;
gpio_config(&io_conf);
ESP_LOGI(TAG, "gpios configured");
}
bool isGpioForceProv() {
return 0 == gpio_get_level(GPIO_FORCE_PROV);
int r = gpio_get_level(GPIO_FORCE_PROV);
ESP_LOGI(TAG, "forceProv pin is %d", r);
return (r != 0);
}