Skip to content

Commit

Permalink
Fixed PS3 controller not working.
Browse files Browse the repository at this point in the history
  • Loading branch information
o0Zz committed Dec 25, 2024
1 parent 87fc23b commit 0b4783d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/ControllerLib/Controllers/Dualshock3Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct Dualshock3ButtonData
uint16_t accelerometer_y;
uint16_t accelerometer_z;
uint16_t gyroscope;
};
} _PACKED;

enum Dualshock3LEDValue : uint8_t
{
Expand Down
2 changes: 1 addition & 1 deletion source/ControllerLib/Controllers/Xbox360Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct Xbox360ButtonData
int16_t Y;
int16_t Z;
int16_t Rz;
};
} _PACKED;

enum Xbox360InputPacketType : uint8_t
{
Expand Down
4 changes: 2 additions & 2 deletions source/ControllerLib/Controllers/XboxController.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct XboxButtonData
int16_t stick_left_y;
int16_t stick_right_x;
int16_t stick_right_y;
};
} _PACKED;

struct XboxRumbleData
{
Expand All @@ -48,7 +48,7 @@ struct XboxRumbleData
uint8_t big;
uint8_t dummy2;
uint8_t little;
};
} _PACKED;

class XboxController : public BaseController
{
Expand Down
2 changes: 1 addition & 1 deletion source/ControllerLib/Controllers/XboxOneController.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct XboxOneButtonData
int16_t stick_left_y;
int16_t stick_right_x;
int16_t stick_right_y;
};
} _PACKED;

class XboxOneController : public BaseController
{
Expand Down
8 changes: 8 additions & 0 deletions source/ControllerLib/IUSBDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#include <cstdio>
#include <vector>

#ifndef _PACKED
#if WIN32
#define _PACKED
#else
#define _PACKED __attribute__((packed))
#endif
#endif

class IUSBDevice
{
protected:
Expand Down

0 comments on commit 0b4783d

Please sign in to comment.