remove most of the defines
This commit is contained in:
@@ -13,8 +13,8 @@ Counter::Counter(uint8_t pin) {
|
||||
pcnt_config_t config;
|
||||
config.unit = this->unit;
|
||||
config.channel = PCNT_CHANNEL_0;
|
||||
config.counter_h_lim = COUNTER_HIGH_LIMIT;
|
||||
config.counter_l_lim = COUNTER_LOW_LIMIT;
|
||||
config.counter_h_lim = Counter::highLimit;
|
||||
config.counter_l_lim = Counter::lowLimit;
|
||||
config.ctrl_gpio_num = PCNT_PIN_NOT_USED;
|
||||
config.hctrl_mode = PCNT_CHANNEL_LEVEL_ACTION_KEEP;
|
||||
config.lctrl_mode = PCNT_CHANNEL_LEVEL_ACTION_KEEP;
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
#include <Arduino.h>
|
||||
#include <driver/pcnt.h>
|
||||
|
||||
#define COUNTER_HIGH_LIMIT INT16_MAX
|
||||
#define COUNTER_LOW_LIMIT 0
|
||||
|
||||
class Counter {
|
||||
public:
|
||||
Counter(uint8_t pin);
|
||||
@@ -21,6 +18,9 @@ class Counter {
|
||||
void filterDisable();
|
||||
|
||||
private:
|
||||
static constexpr int16_t highLimit = INT16_MAX;
|
||||
static constexpr uint8_t lowLimit = 0;
|
||||
|
||||
static uint8_t amountOfCounter;
|
||||
|
||||
bool initalised = false;
|
||||
|
||||
Reference in New Issue
Block a user