Skip to content

Commit 881ce19

Browse files
committed
Missed some files.
1 parent c74d357 commit 881ce19

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

Common/SerialPABotBase/SerialPABotBase_Messages_ESP32.h

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
#if _WIN32
1313
#pragma pack(push, 1)
1414
#define PABB_PACK
15-
#else
15+
#elif __GNUC__
1616
#define PABB_PACK __attribute__((packed))
17+
#else
18+
#define PABB_PACK
1719
#endif
1820

1921

@@ -28,7 +30,7 @@ typedef struct{
2830
uint8_t buttons[3];
2931
uint8_t left_grip[3];
3032
uint8_t right_grip[3];
31-
} PABB_ESP32_NintendoSwitch_ControllerColors;
33+
} PABB_NintendoSwitch_ControllerColors;
3234

3335
typedef struct{
3436
uint8_t button3;
@@ -37,11 +39,22 @@ typedef struct{
3739
uint8_t left_joystick[3];
3840
uint8_t right_joystick[3];
3941
uint8_t vibrator;
40-
} PABB_ESP32_NintendoSwitch_ButtonState;
42+
} PABB_NintendoSwitch_ButtonState;
43+
44+
typedef struct{
45+
uint16_t accel_x;
46+
uint16_t accel_y;
47+
uint16_t accel_z;
48+
uint16_t rotation_x;
49+
uint16_t rotation_y;
50+
uint16_t rotation_z;
51+
} PABB_NintendoSwitch_GyroState;
4152

4253
typedef struct{
43-
uint8_t data[36];
44-
} PABB_ESP32_NintendoSwitch_GyroState;
54+
PABB_NintendoSwitch_GyroState time0;
55+
PABB_NintendoSwitch_GyroState time1;
56+
PABB_NintendoSwitch_GyroState time2;
57+
} PABB_NintendoSwitch_GyroStateX3;
4558

4659

4760

@@ -77,16 +90,16 @@ typedef struct{
7790
typedef struct{
7891
seqnum_t seqnum;
7992
uint16_t milliseconds;
80-
PABB_ESP32_NintendoSwitch_ButtonState buttons;
93+
PABB_NintendoSwitch_ButtonState buttons;
8194
} PABB_PACK pabb_Message_ESP32_CommandButtonState;
8295

8396

8497
#define PABB_MSG_ESP32_CONTROLLER_STATE_FULL 0xa1
8598
typedef struct{
8699
seqnum_t seqnum;
87100
uint16_t milliseconds;
88-
PABB_ESP32_NintendoSwitch_ButtonState buttons;
89-
PABB_ESP32_NintendoSwitch_GyroState gyro;
101+
PABB_NintendoSwitch_ButtonState buttons;
102+
PABB_NintendoSwitch_GyroStateX3 gyro;
90103
} PABB_PACK pabb_Message_ESP32_CommandFullState;
91104

92105

Common/SerialPABotBase/SerialPABotBase_Messages_NS_Generic.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@
1212
#if _WIN32
1313
#pragma pack(push, 1)
1414
#define PABB_PACK
15-
#else
15+
#elif __GNUC__
1616
#define PABB_PACK __attribute__((packed))
17+
#else
18+
#define PABB_PACK
1719
#endif
1820

1921

0 commit comments

Comments
 (0)