diff --git a/src/Button.cpp b/src/Button.cpp index 6e5f086..2016147 100644 --- a/src/Button.cpp +++ b/src/Button.cpp @@ -25,9 +25,9 @@ #define EXPANDER_2_ENABLE #endif #ifdef USEROTARY_ENABLE - #if (DREHENCODER_BUTTON >= 0 && DREHENCODER_BUTTON <= 39) + #if (ROTARYENCODER_BUTTON >= 0 && ROTARYENCODER_BUTTON <= 39) #define BUTTON_3_ENABLE - #elif (DREHENCODER_BUTTON >= 100 && DREHENCODER_BUTTON <= 115) + #elif (ROTARYENCODER_BUTTON >= 100 && ROTARYENCODER_BUTTON <= 115) #define EXPANDER_3_ENABLE #endif #endif @@ -103,7 +103,7 @@ void Button_Init() { pinMode(PAUSEPLAY_BUTTON, INPUT_PULLUP); #endif #ifdef BUTTON_3_ENABLE - pinMode(DREHENCODER_BUTTON, INPUT_PULLUP); + pinMode(ROTARYENCODER_BUTTON, INPUT_PULLUP); #endif #ifdef BUTTON_4_ENABLE pinMode(BUTTON_4, INPUT_PULLUP); @@ -144,7 +144,7 @@ void Button_Cyclic() { gButtons[2].currentState = Port_Read(PAUSEPLAY_BUTTON); #endif #if defined(BUTTON_3_ENABLE) || defined(EXPANDER_3_ENABLE) - gButtons[3].currentState = Port_Read(DREHENCODER_BUTTON); + gButtons[3].currentState = Port_Read(ROTARYENCODER_BUTTON); #endif #if defined(BUTTON_4_ENABLE) || defined(EXPANDER_4_ENABLE) gButtons[4].currentState = Port_Read(BUTTON_4); diff --git a/src/RotaryEncoder.cpp b/src/RotaryEncoder.cpp index 8cfaf1c..0709450 100644 --- a/src/RotaryEncoder.cpp +++ b/src/RotaryEncoder.cpp @@ -21,7 +21,7 @@ void RotaryEncoder_Init(void) { // Init rotary encoder #ifdef USEROTARY_ENABLE - encoder.attachHalfQuad(DREHENCODER_CLK, DREHENCODER_DT); + encoder.attachHalfQuad(ROTARYENCODER_CLK, ROTARYENCODER_DT); encoder.clearCount(); encoder.setCount(AudioPlayer_GetInitVolume() * 2); // Ganzes Raster ist immer +2, daher initiale Lautstärke mit 2 multiplizieren #endif diff --git a/src/settings-complete.h b/src/settings-complete.h index ca62335..71e7495 100644 --- a/src/settings-complete.h +++ b/src/settings-complete.h @@ -48,9 +48,9 @@ // Rotary encoder #ifdef USEROTARY_ENABLE - #define DREHENCODER_CLK 35 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) - #define DREHENCODER_DT 34 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! - #define DREHENCODER_BUTTON 105 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) + #define ROTARYENCODER_CLK 35 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) + #define ROTARYENCODER_DT 34 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! + #define ROTARYENCODER_BUTTON 105 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) #endif // Amp enable (optional) @@ -79,7 +79,7 @@ // Wake-up button => this also is the interrupt-pin if port-expander is enabled! // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. -#define WAKEUP_BUTTON DREHENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. +#define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. // (optional) Power-control #define POWER 13 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep diff --git a/src/settings-custom.h b/src/settings-custom.h index bb7e653..8182fa0 100644 --- a/src/settings-custom.h +++ b/src/settings-custom.h @@ -47,9 +47,9 @@ // Rotary encoder #ifdef USEROTARY_ENABLE - #define DREHENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) - #define DREHENCODER_DT 35 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! - #define DREHENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) + #define ROTARYENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) + #define ROTARYENCODER_DT 35 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! + #define ROTARYENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) #endif // Amp enable (optional) @@ -78,7 +78,7 @@ // Wake-up button => this also is the interrupt-pin if port-expander is enabled! // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. - #define WAKEUP_BUTTON DREHENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. + #define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. // (optional) Power-control #define POWER 17 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep diff --git a/src/settings-espa1s.h b/src/settings-espa1s.h index 5ad9ccf..87aac6f 100644 --- a/src/settings-espa1s.h +++ b/src/settings-espa1s.h @@ -56,9 +56,9 @@ // Rotary encoder #ifdef USEROTARY_ENABLE - #define DREHENCODER_CLK 5 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) - #define DREHENCODER_DT 18 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! - #define DREHENCODER_BUTTON 4 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) + #define ROTARYENCODER_CLK 5 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) + #define ROTARYENCODER_DT 18 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! + #define ROTARYENCODER_BUTTON 4 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) #endif // Control-buttons (set to 99 to DISABLE; 0->39 for GPIO; 100->115 for port-expander) diff --git a/src/settings-lolin32.h b/src/settings-lolin32.h index 5350c31..a0ee6b7 100644 --- a/src/settings-lolin32.h +++ b/src/settings-lolin32.h @@ -54,9 +54,9 @@ // Rotary encoder #ifdef USEROTARY_ENABLE - #define DREHENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) - #define DREHENCODER_DT 35 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! - #define DREHENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) + #define ROTARYENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) + #define ROTARYENCODER_DT 35 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! + #define ROTARYENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) #endif // Amp enable (optional) @@ -85,7 +85,7 @@ // Wake-up button => this also is the interrupt-pin if port-expander is enabled! // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. -#define WAKEUP_BUTTON DREHENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. +#define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. // (optional) Power-control #define POWER 17 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep diff --git a/src/settings-lolin_d32.h b/src/settings-lolin_d32.h index e59583c..8373aa1 100644 --- a/src/settings-lolin_d32.h +++ b/src/settings-lolin_d32.h @@ -54,9 +54,9 @@ // Rotary encoder #ifdef USEROTARY_ENABLE - #define DREHENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) - #define DREHENCODER_DT 33 // Info: Lolin D32 is using 35 for battery-voltage-monitoring! - #define DREHENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) + #define ROTARYENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) + #define ROTARYENCODER_DT 33 // Info: Lolin D32 is using 35 for battery-voltage-monitoring! + #define ROTARYENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) #endif // Amp enable (optional) @@ -85,7 +85,7 @@ // Wake-up button => this also is the interrupt-pin if port-expander is enabled! // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. - #define WAKEUP_BUTTON DREHENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. + #define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. // (optional) Power-control #define POWER 17 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep diff --git a/src/settings-lolin_d32_pro.h b/src/settings-lolin_d32_pro.h index 7057a05..18df66f 100644 --- a/src/settings-lolin_d32_pro.h +++ b/src/settings-lolin_d32_pro.h @@ -49,9 +49,9 @@ // Rotary encoder #ifdef USEROTARY_ENABLE - #define DREHENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) - #define DREHENCODER_DT 39 // 39 = 'VN'; Info: Lolin D32 pro is using 35 for battery-voltage-monitoring! - #define DREHENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) + #define ROTARYENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) + #define ROTARYENCODER_DT 39 // 39 = 'VN'; Info: Lolin D32 pro is using 35 for battery-voltage-monitoring! + #define ROTARYENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) #endif // Amp enable (optional) @@ -80,7 +80,7 @@ // Wake-up button => this also is the interrupt-pin if port-expander is enabled! // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. - #define WAKEUP_BUTTON DREHENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. + #define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. // (optional) Power-control #define POWER 5 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep diff --git a/src/settings-ttgo_t8.h b/src/settings-ttgo_t8.h index c7d76ec..b1f0d47 100644 --- a/src/settings-ttgo_t8.h +++ b/src/settings-ttgo_t8.h @@ -49,9 +49,9 @@ // Rotary encoder #ifdef USEROTARY_ENABLE - #define DREHENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) - #define DREHENCODER_DT 33 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! - #define DREHENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) + #define ROTARYENCODER_CLK 34 // If you want to reverse encoder's direction, just switch GPIOs of CLK with DT (in software or hardware) + #define ROTARYENCODER_DT 33 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! + #define ROTARYENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) #endif // Amp enable (optional) @@ -80,7 +80,7 @@ // Wake-up button => this also is the interrupt-pin if port-expander is enabled! // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. -#define WAKEUP_BUTTON DREHENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. +#define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. // (optional) Power-control #define POWER 4 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep diff --git a/src/settings.h b/src/settings.h index cd13725..f20b32f 100644 --- a/src/settings.h +++ b/src/settings.h @@ -79,7 +79,7 @@ 0: NEXT_BUTTON 1: PREVIOUS_BUTTON 2: PAUSEPLAY_BUTTON - 3: DREHENCODER_BUTTON + 3: ROTARYENCODER_BUTTON 4: BUTTON_4 5: BUTTON_5 @@ -87,7 +87,7 @@ Single-buttons [can be long or short] (examples): BUTTON_0_SHORT => Button 0 (NEXT_BUTTON) pressed shortly - BUTTON_3_SHORT => Button 3 (DREHENCODER_BUTTON) pressed shortly + BUTTON_3_SHORT => Button 3 (ROTARYENCODER_BUTTON) pressed shortly BUTTON_4_LONG => Button 4 (BUTTON_4) pressed long Multi-buttons [short only] (examples):