fix upDown ISR (#3612)

This commit is contained in:
Manuel
2024-04-14 15:11:22 +02:00
committed by GitHub
parent 0a246bfe9b
commit ec3971bce5
2 changed files with 41 additions and 17 deletions

View File

@@ -3,7 +3,7 @@
#include "InputBroker.h"
#include "mesh/NodeDB.h"
class UpDownInterruptBase : public Observable<const InputEvent *>
class UpDownInterruptBase : public Observable<const InputEvent *>, public concurrency::OSThread
{
public:
explicit UpDownInterruptBase(const char *name);
@@ -13,6 +13,13 @@ class UpDownInterruptBase : public Observable<const InputEvent *>
void intDownHandler();
void intUpHandler();
int32_t runOnce() override;
protected:
enum UpDownInterruptBaseActionType { UPDOWN_ACTION_NONE, UPDOWN_ACTION_PRESSED, UPDOWN_ACTION_UP, UPDOWN_ACTION_DOWN };
volatile UpDownInterruptBaseActionType action = UPDOWN_ACTION_NONE;
private:
uint8_t _pinDown = 0;
uint8_t _pinUp = 0;