counter
This commit is contained in:
@ -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");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user