Skip to content

Commit

Permalink
changed enumeration for joy stick button
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkcass committed Oct 30, 2018
1 parent 040e7fc commit 4487a30
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion libhardware/src/joystick3d_stick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ int Joystick::run()
if (debounce[axis] == debounce_threshold)
{
debounce[axis]++;
changed_cb(axis, current);
if (axis == num_axis)
changed_cb(JOY3D_BUTTON, current);
else
changed_cb(axis, current);
}
else
debounce[axis]++;
Expand Down
2 changes: 1 addition & 1 deletion libhardware/src/joystick3d_stick.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#define JOY3D_AXIS_Y 1
#define JOY3D_AXIS_Z 2
#define JOY3D_AXIS_W 3
#define JOY3D_BUTTON 0
#define JOY3D_BUTTON 4

#define JOY3D_RANGE 128

Expand Down

0 comments on commit 4487a30

Please sign in to comment.