Make all variables configurable.

This commit is contained in:
Balazs Kelemen
2022-01-12 09:26:42 +01:00
parent f5004a66a1
commit 3fa00f603b
11 changed files with 165 additions and 67 deletions

View File

@@ -9,10 +9,25 @@ RotaryEncoderInterruptImpl1::RotaryEncoderInterruptImpl1() :
{
}
void RotaryEncoderInterruptImpl1::init(
uint8_t pinA, uint8_t pinB, uint8_t pinPress,
char eventCw, char eventCcw, char eventPressed)
void RotaryEncoderInterruptImpl1::init()
{
if (!radioConfig.preferences.rotary1_enabled)
{
// Input device is disabled.
return;
}
uint8_t pinA = radioConfig.preferences.rotary1_pin_a;
uint8_t pinB = radioConfig.preferences.rotary1_pin_b;
uint8_t pinPress = radioConfig.preferences.rotary1_pin_press;
char eventCw =
static_cast<char>(radioConfig.preferences.rotary1_event_cw);
char eventCcw =
static_cast<char>(radioConfig.preferences.rotary1_event_ccw);
char eventPressed =
static_cast<char>(radioConfig.preferences.rotary1_event_press);
//radioConfig.preferences.ext_notification_plugin_output
RotaryEncoderInterruptBase::init(
pinA, pinB, pinPress,
eventCw, eventCcw, eventPressed,