Add analog_only option, though this is a stub for now.

This commit is contained in:
2021-11-13 05:56:21 +00:00
parent e09c21edf1
commit e8a1235a95
4 changed files with 20 additions and 15 deletions

View File

@ -40,23 +40,23 @@ void Joystick::Init() {
delay(100);
}
void Joystick::AddButton(uint8_t pin, ButtonType type, bool pullup, Mux* mux) {
void Joystick::AddButton(uint8_t pin, ButtonType type, bool pullup, Mux* mux, bool analog_only) {
Button *button;
switch (type) {
case BUTTON_PASSTHRU:
button = new PassthruButton(pin, _virtual_buttons, pullup, mux);
button = new PassthruButton(pin, _virtual_buttons, pullup, mux, analog_only);
_virtual_buttons++;
break;
case BUTTON_PULSED:
button = new PulsedButton(pin, _virtual_buttons, false, false, pullup, mux);
button = new PulsedButton(pin, _virtual_buttons, false, false, pullup, mux, analog_only);
_virtual_buttons++;
break;
case BUTTON_PULSED_DOUBLE_ACTION:
button = new PulsedButton(pin, _virtual_buttons, true, false, pullup, mux);
button = new PulsedButton(pin, _virtual_buttons, true, false, pullup, mux, analog_only);
_virtual_buttons++;
break;
case BUTTON_PULSED_DOUBLE_ACTION_SPLIT:
button = new PulsedButton(pin, _virtual_buttons, true, true, pullup, mux);
button = new PulsedButton(pin, _virtual_buttons, true, true, pullup, mux, analog_only);
_virtual_buttons += 2;
break;
default: