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) {
|
||||
Button button = _buttons[index];
|
||||
bool changed = button.debouncer.update();
|
||||
bool changed = button.bouncer.update();
|
||||
|
||||
switch (button.type) {
|
||||
case BUTTON_LATCHED:
|
||||
if (button.debouncer.rose()) PressButton(index);
|
||||
else if (button.debouncer.fell()) ReleaseButton(index);
|
||||
if (button.bouncer.rose()) PressButton(index);
|
||||
else if (button.bouncer.fell()) ReleaseButton(index);
|
||||
break;
|
||||
case BUTTON_PULSED:
|
||||
if button.debouncer.rose() PressButton(index);
|
||||
if (button.bouncer.rose()) PressButton(index);
|
||||
break;
|
||||
case BUTTON_PULSED_DOUBLE_ACTION:
|
||||
if (changed) PressButton(index);
|
||||
|
|
|
@ -28,7 +28,7 @@ struct JoyReport {
|
|||
|
||||
struct Button {
|
||||
ButtonType type;
|
||||
Bounce bouncher;
|
||||
Bounce bouncer;
|
||||
};
|
||||
|
||||
bool operator ==(JoyReport a, JoyReport b);
|
||||
|
|
Loading…
Reference in New Issue
Block a user