Fix a bunch of embarrassing typos and syntax errors. That'll teach me to commit code I haven't compiled...
This commit is contained in:
parent
f0cfcdc90d
commit
40f6c99922
|
@ -150,15 +150,15 @@ void Joystick::Write() {
|
||||||
|
|
||||||
void Joystick::_UpdateButton(uint8_t index) {
|
void Joystick::_UpdateButton(uint8_t index) {
|
||||||
Button button = _buttons[index];
|
Button button = _buttons[index];
|
||||||
bool changed = button.debouncer.update();
|
bool changed = button.bouncer.update();
|
||||||
|
|
||||||
switch (button.type) {
|
switch (button.type) {
|
||||||
case BUTTON_LATCHED:
|
case BUTTON_LATCHED:
|
||||||
if (button.debouncer.rose()) PressButton(index);
|
if (button.bouncer.rose()) PressButton(index);
|
||||||
else if (button.debouncer.fell()) ReleaseButton(index);
|
else if (button.bouncer.fell()) ReleaseButton(index);
|
||||||
break;
|
break;
|
||||||
case BUTTON_PULSED:
|
case BUTTON_PULSED:
|
||||||
if button.debouncer.rose() PressButton(index);
|
if (button.bouncer.rose()) PressButton(index);
|
||||||
break;
|
break;
|
||||||
case BUTTON_PULSED_DOUBLE_ACTION:
|
case BUTTON_PULSED_DOUBLE_ACTION:
|
||||||
if (changed) PressButton(index);
|
if (changed) PressButton(index);
|
||||||
|
|
|
@ -28,7 +28,7 @@ struct JoyReport {
|
||||||
|
|
||||||
struct Button {
|
struct Button {
|
||||||
ButtonType type;
|
ButtonType type;
|
||||||
Bounce bouncher;
|
Bounce bouncer;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool operator ==(JoyReport a, JoyReport b);
|
bool operator ==(JoyReport a, JoyReport b);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user