From 85ef63db9c81fd3c497342b2949e2d0e42f9b574 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Mon, 14 Aug 2023 14:24:10 +0200 Subject: [PATCH] Renamed MD_REncoder to MD_REncoderPlus for avoiding complications with updated original MD_REncoder. --- UI.hpp | 4 ++-- .../ISSUE_TEMPLATE.md | 0 .../{MD_REncoder => MD_REncoderPlus}/LICENSE | 0 .../PULL_REQUEST.md | 0 .../{MD_REncoder => MD_REncoderPlus}/README.md | 0 .../examples/Polling/Polling.ino | 0 .../keywords.txt | 0 .../library.properties | 0 .../src/MD_REncoderPlus.cpp} | 18 +++++++++--------- .../src/MD_REncoderPlus.h} | 8 ++++---- 10 files changed, 15 insertions(+), 15 deletions(-) rename third-party/{MD_REncoder => MD_REncoderPlus}/ISSUE_TEMPLATE.md (100%) rename third-party/{MD_REncoder => MD_REncoderPlus}/LICENSE (100%) rename third-party/{MD_REncoder => MD_REncoderPlus}/PULL_REQUEST.md (100%) rename third-party/{MD_REncoder => MD_REncoderPlus}/README.md (100%) rename third-party/{MD_REncoder => MD_REncoderPlus}/examples/Polling/Polling.ino (100%) rename third-party/{MD_REncoder => MD_REncoderPlus}/keywords.txt (100%) rename third-party/{MD_REncoder => MD_REncoderPlus}/library.properties (100%) rename third-party/{MD_REncoder/src/MD_REncoder.cpp => MD_REncoderPlus/src/MD_REncoderPlus.cpp} (91%) rename third-party/{MD_REncoder/src/MD_REncoder.h => MD_REncoderPlus/src/MD_REncoderPlus.h} (97%) diff --git a/UI.hpp b/UI.hpp index e6015ab..ce368b1 100644 --- a/UI.hpp +++ b/UI.hpp @@ -26,12 +26,12 @@ #include "config.h" #include -#include #include #include #include #include #include +#include "MD_REncoderPlus.h" #include "disp_plus.h" #include "midi_devices.hpp" #include "synth_dexed.h" @@ -473,7 +473,7 @@ private: bool down; }; -MD_REncoder ENCODER[NUM_ENCODER] = { MD_REncoder(ENC_R_PIN_B, ENC_R_PIN_A), MD_REncoder(ENC_L_PIN_B, ENC_L_PIN_A) }; +MD_REncoderPlus ENCODER[NUM_ENCODER] = { MD_REncoderPlus(ENC_R_PIN_B, ENC_R_PIN_A), MD_REncoderPlus(ENC_L_PIN_B, ENC_L_PIN_A) }; EncoderDirection encoderDir[NUM_ENCODER]; long g_LCDML_CONTROL_button_press_time[NUM_ENCODER] = { 0, 0 }; diff --git a/third-party/MD_REncoder/ISSUE_TEMPLATE.md b/third-party/MD_REncoderPlus/ISSUE_TEMPLATE.md similarity index 100% rename from third-party/MD_REncoder/ISSUE_TEMPLATE.md rename to third-party/MD_REncoderPlus/ISSUE_TEMPLATE.md diff --git a/third-party/MD_REncoder/LICENSE b/third-party/MD_REncoderPlus/LICENSE similarity index 100% rename from third-party/MD_REncoder/LICENSE rename to third-party/MD_REncoderPlus/LICENSE diff --git a/third-party/MD_REncoder/PULL_REQUEST.md b/third-party/MD_REncoderPlus/PULL_REQUEST.md similarity index 100% rename from third-party/MD_REncoder/PULL_REQUEST.md rename to third-party/MD_REncoderPlus/PULL_REQUEST.md diff --git a/third-party/MD_REncoder/README.md b/third-party/MD_REncoderPlus/README.md similarity index 100% rename from third-party/MD_REncoder/README.md rename to third-party/MD_REncoderPlus/README.md diff --git a/third-party/MD_REncoder/examples/Polling/Polling.ino b/third-party/MD_REncoderPlus/examples/Polling/Polling.ino similarity index 100% rename from third-party/MD_REncoder/examples/Polling/Polling.ino rename to third-party/MD_REncoderPlus/examples/Polling/Polling.ino diff --git a/third-party/MD_REncoder/keywords.txt b/third-party/MD_REncoderPlus/keywords.txt similarity index 100% rename from third-party/MD_REncoder/keywords.txt rename to third-party/MD_REncoderPlus/keywords.txt diff --git a/third-party/MD_REncoder/library.properties b/third-party/MD_REncoderPlus/library.properties similarity index 100% rename from third-party/MD_REncoder/library.properties rename to third-party/MD_REncoderPlus/library.properties diff --git a/third-party/MD_REncoder/src/MD_REncoder.cpp b/third-party/MD_REncoderPlus/src/MD_REncoderPlus.cpp similarity index 91% rename from third-party/MD_REncoder/src/MD_REncoder.cpp rename to third-party/MD_REncoderPlus/src/MD_REncoderPlus.cpp index e4a3cca..8f45c1d 100755 --- a/third-party/MD_REncoder/src/MD_REncoder.cpp +++ b/third-party/MD_REncoderPlus/src/MD_REncoderPlus.cpp @@ -1,5 +1,5 @@ /* -MD_REncoder - Library for Rotary Encoders +MD_REncoderPlus - Library for Rotary Encoders See header file for comments @@ -25,9 +25,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA /** * \file - * \brief Implements core MD_REncoder class methods + * \brief Implements core MD_REncoderPlus class methods */ -#include +#include /* * The below state table has, for each state (row), the new state @@ -77,7 +77,7 @@ const unsigned char ttable[][4] = }; #endif -MD_REncoder::MD_REncoder(uint8_t pinA, uint8_t pinB): +MD_REncoderPlus::MD_REncoderPlus(uint8_t pinA, uint8_t pinB): _pinA (pinA), _pinB (pinB), _state(R_START) #if ENABLE_SPEED , _period(DEFAULT_PERIOD), _count(0), _spd(0), _timeLast(0) @@ -85,7 +85,7 @@ _pinA (pinA), _pinB (pinB), _state(R_START) { } -void MD_REncoder::begin(void) +void MD_REncoderPlus::begin(void) { pinMode(_pinA, (ENABLE_PULLUPS ? INPUT_PULLUP : INPUT)); pinMode(_pinB, (ENABLE_PULLUPS ? INPUT_PULLUP : INPUT)); @@ -93,7 +93,7 @@ void MD_REncoder::begin(void) last_dir=DIR_NONE; } -void MD_REncoder::update(void) +void MD_REncoderPlus::update(void) // Grab state of input pins, determine new state from the pins // and state table, and return the emit bits (ie the generated event). { @@ -125,12 +125,12 @@ void MD_REncoder::update(void) } } -int32_t MD_REncoder::read_value(void) +int32_t MD_REncoderPlus::read_value(void) { return (value); } -int8_t MD_REncoder::read(void) +int8_t MD_REncoderPlus::read(void) { switch(last_dir) { @@ -145,7 +145,7 @@ int8_t MD_REncoder::read(void) } -void MD_REncoder::write(int32_t v) +void MD_REncoderPlus::write(int32_t v) { value=v; } diff --git a/third-party/MD_REncoder/src/MD_REncoder.h b/third-party/MD_REncoderPlus/src/MD_REncoderPlus.h similarity index 97% rename from third-party/MD_REncoder/src/MD_REncoder.h rename to third-party/MD_REncoderPlus/src/MD_REncoderPlus.h index 4a2a7c0..0abe52e 100755 --- a/third-party/MD_REncoder/src/MD_REncoder.h +++ b/third-party/MD_REncoderPlus/src/MD_REncoderPlus.h @@ -94,7 +94,7 @@ direction or the other. It's also possible to use 'half-step' mode. This just emits an event at both the 0-0 and 1-1 positions. This might be useful for some encoders where you want to -detect all positions. In MD_REncoder.h set ENABLE_HALF_STEP to 1 to enable +detect all positions. In MD_REncoderPlus.h set ENABLE_HALF_STEP to 1 to enable half-step mode. If an invalid state happens (for example we go from '0-1' straight to '1-0'), the @@ -187,9 +187,9 @@ speed = ClickCount * (1000 / period) #define DIR_CCW 0x20 /** - * Core object for the MD_REncoder library + * Core object for the MD_REncoderPlus library */ -class MD_REncoder +class MD_REncoderPlus { public: /** @@ -200,7 +200,7 @@ class MD_REncoder * \param pinA the pin number for the encoder A output * \param pinB the pin number for the encoder B output */ - MD_REncoder(uint8_t pinA, uint8_t pinB); + MD_REncoderPlus(uint8_t pinA, uint8_t pinB); /** * Initialize the object.