This commit is contained in:
2021-03-09 19:21:19 +01:00
parent 7fa6fe176c
commit cfcd4ba0bd
8 changed files with 96 additions and 50 deletions

View File

@ -1,6 +1,7 @@
#include <stdbool.h>
#include "gpio.h"
#include "counter.h"
#include <driver/gpio.h>
#include <esp_log.h>
@ -17,6 +18,15 @@ void gpioInit() {
io_conf.pull_down_en = 1;
gpio_config(&io_conf);
io_conf.intr_type = GPIO_INTR_POSEDGE;
io_conf.pin_bit_mask = (1ULL << GPIO_ZERO_CROSSING);
io_conf.mode = GPIO_MODE_INPUT;
io_conf.pull_up_en = 0;
io_conf.pull_down_en = 0;
gpio_config(&i_conf);
gpio_isr_handler_add(GPIO_ZERO_CROSSING, counterZeroCrossingISR, NULL);
ESP_LOGI(TAG, "gpios configured");
}