Use init() instead of constructor.

This commit is contained in:
Balazs Kelemen
2022-01-11 13:12:04 +01:00
parent fbd5b8b721
commit b832b82ec6
5 changed files with 38 additions and 16 deletions

View File

@@ -1,11 +1,19 @@
#pragma once
#include "RotaryEncoderInterruptBase.h"
/**
* @brief The idea behind this class to have static methods for the event handlers.
* Check attachInterrupt() at RotaryEncoderInteruptBase.cpp
* Technically you can have as many rotary encoders hardver attached
* to your device as you wish, but you always need to have separate event
* handlers, thus you need to have a RotaryEncoderInterrupt implementation.
*/
class RotaryEncoderInterruptImpl1 :
public RotaryEncoderInterruptBase
{
public:
RotaryEncoderInterruptImpl1(
RotaryEncoderInterruptImpl1();
void init(
uint8_t pinA, uint8_t pinB, uint8_t pinPress,
char eventCw, char eventCcw, char eventPressed);
static void handleIntA();