Rename RotaryEncoderImpl to TLoraPagerRotaryEncoder

This commit is contained in:
WillyJL 2025-09-20 18:53:30 +02:00
parent bfb03b422a
commit a76cc88dc2
No known key found for this signature in database
3 changed files with 15 additions and 15 deletions

View File

@ -1,19 +1,19 @@
#ifdef T_LORA_PAGER #ifdef T_LORA_PAGER
#include "RotaryEncoderImpl.h" #include "TLoraPagerRotaryEncoder.h"
#include "InputBroker.h" #include "InputBroker.h"
#include "RotaryEncoder.h" #include "RotaryEncoder.h"
#define ORIGIN_NAME "RotaryEncoder" #define ORIGIN_NAME "RotaryEncoder"
RotaryEncoderImpl *rotaryEncoderImpl; TLoraPagerRotaryEncoder *tLoraPagerRotaryEncoder;
RotaryEncoderImpl::RotaryEncoderImpl() TLoraPagerRotaryEncoder::TLoraPagerRotaryEncoder()
{ {
rotary = nullptr; rotary = nullptr;
} }
bool RotaryEncoderImpl::init() bool TLoraPagerRotaryEncoder::init()
{ {
if (!moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.inputbroker_pin_a == 0 || if (!moduleConfig.canned_message.updown1_enabled || moduleConfig.canned_message.inputbroker_pin_a == 0 ||
moduleConfig.canned_message.inputbroker_pin_b == 0) { moduleConfig.canned_message.inputbroker_pin_b == 0) {
@ -41,7 +41,7 @@ bool RotaryEncoderImpl::init()
return true; return true;
} }
void RotaryEncoderImpl::pollOnce() void TLoraPagerRotaryEncoder::pollOnce()
{ {
InputEvent e{ORIGIN_NAME, INPUT_BROKER_NONE, 0, 0, 0}; InputEvent e{ORIGIN_NAME, INPUT_BROKER_NONE, 0, 0, 0};
@ -71,6 +71,6 @@ void RotaryEncoderImpl::pollOnce()
} }
} }
RotaryEncoderImpl *RotaryEncoderImpl::interruptInstance; TLoraPagerRotaryEncoder *TLoraPagerRotaryEncoder::interruptInstance;
#endif #endif

View File

@ -10,15 +10,15 @@
class RotaryEncoder; class RotaryEncoder;
class RotaryEncoderImpl : public InputPollable class TLoraPagerRotaryEncoder : public InputPollable
{ {
public: public:
RotaryEncoderImpl(); TLoraPagerRotaryEncoder();
bool init(void); bool init(void);
virtual void pollOnce() override; virtual void pollOnce() override;
protected: protected:
static RotaryEncoderImpl *interruptInstance; static TLoraPagerRotaryEncoder *interruptInstance;
input_broker_event eventCw = INPUT_BROKER_NONE; input_broker_event eventCw = INPUT_BROKER_NONE;
input_broker_event eventCcw = INPUT_BROKER_NONE; input_broker_event eventCcw = INPUT_BROKER_NONE;
@ -27,6 +27,6 @@ class RotaryEncoderImpl : public InputPollable
RotaryEncoder *rotary; RotaryEncoder *rotary;
}; };
extern RotaryEncoderImpl *rotaryEncoderImpl; extern TLoraPagerRotaryEncoder *tLoraPagerRotaryEncoder;
#endif #endif

View File

@ -4,7 +4,7 @@
#include "input/ExpressLRSFiveWay.h" #include "input/ExpressLRSFiveWay.h"
#include "input/InputBroker.h" #include "input/InputBroker.h"
#ifdef T_LORA_PAGER #ifdef T_LORA_PAGER
#include "input/RotaryEncoderImpl.h" #include "input/TLoraPagerRotaryEncoder.h"
#endif #endif
#include "input/RotaryEncoderInterruptImpl1.h" #include "input/RotaryEncoderInterruptImpl1.h"
#include "input/SerialKeyboardImpl.h" #include "input/SerialKeyboardImpl.h"
@ -185,10 +185,10 @@ void setupModules()
} }
#ifdef T_LORA_PAGER #ifdef T_LORA_PAGER
// use a special FSM based rotary encoder version for T-LoRa Pager // use a special FSM based rotary encoder version for T-LoRa Pager
rotaryEncoderImpl = new RotaryEncoderImpl(); tLoraPagerRotaryEncoder = new TLoraPagerRotaryEncoder();
if (!rotaryEncoderImpl->init()) { if (!tLoraPagerRotaryEncoder->init()) {
delete rotaryEncoderImpl; delete tLoraPagerRotaryEncoder;
rotaryEncoderImpl = nullptr; tLoraPagerRotaryEncoder = nullptr;
} }
#else #else
upDownInterruptImpl1 = new UpDownInterruptImpl1(); upDownInterruptImpl1 = new UpDownInterruptImpl1();