Skip to content

Commit bdeb49c

Browse files
committed
Update to latest firmware.
1 parent 804625a commit bdeb49c

28 files changed

+341
-234
lines changed

Common/Controllers/NintendoSwitch2_WiredController_State.c renamed to Common/ControllerStates/NintendoSwitch2_WiredController_State.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "NintendoSwitch2_WiredController_State.h"
99

1010

11-
const pa_NintendoSwitch2_WiredController_State pa_NintendoSwitch2_WiredController_State_NEUTRAL_STATE = {
11+
const pabb_NintendoSwitch2_WiredController_State pabb_NintendoSwitch2_WiredController_State_NEUTRAL_STATE = {
1212
.buttons0 = 0,
1313
.buttons1 = 0,
1414
.dpad_byte = 8,
@@ -18,9 +18,9 @@ const pa_NintendoSwitch2_WiredController_State pa_NintendoSwitch2_WiredControlle
1818
.right_joystick_y = 128,
1919
};
2020

21-
bool pa_NintendoSwitch2_WiredController_State_equals(
22-
const pa_NintendoSwitch2_WiredController_State* state0,
23-
const pa_NintendoSwitch2_WiredController_State* state1
21+
bool pabb_NintendoSwitch2_WiredController_State_equals(
22+
const pabb_NintendoSwitch2_WiredController_State* state0,
23+
const pabb_NintendoSwitch2_WiredController_State* state1
2424
){
25-
return memcmp(state0, state1, sizeof(pa_NintendoSwitch2_WiredController_State)) == 0;
25+
return memcmp(state0, state1, sizeof(pabb_NintendoSwitch2_WiredController_State)) == 0;
2626
}

Common/Controllers/NintendoSwitch2_WiredController_State.h renamed to Common/ControllerStates/NintendoSwitch2_WiredController_State.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ typedef struct{
2424
uint8_t left_joystick_y;
2525
uint8_t right_joystick_x;
2626
uint8_t right_joystick_y;
27-
} pa_NintendoSwitch2_WiredController_State;
27+
} pabb_NintendoSwitch2_WiredController_State;
2828

29-
extern const pa_NintendoSwitch2_WiredController_State pa_NintendoSwitch2_WiredController_State_NEUTRAL_STATE;
29+
extern const pabb_NintendoSwitch2_WiredController_State pabb_NintendoSwitch2_WiredController_State_NEUTRAL_STATE;
3030

31-
bool pa_NintendoSwitch2_WiredController_State_equals(
32-
const pa_NintendoSwitch2_WiredController_State* state0,
33-
const pa_NintendoSwitch2_WiredController_State* state1
31+
bool pabb_NintendoSwitch2_WiredController_State_equals(
32+
const pabb_NintendoSwitch2_WiredController_State* state0,
33+
const pabb_NintendoSwitch2_WiredController_State* state1
3434
);
3535

3636

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* Nintendo Switch - Wireless Controller State
2+
*
3+
* From: https://github.com/PokemonAutomation/
4+
*
5+
*/
6+
7+
8+
#include <string.h>
9+
#include "NintendoSwitch_WirelessController_State.h"
10+
11+
12+
const pabb_NintendoSwitch_WirelessController_State0x30 pabb_NintendoSwitch_WirelessController_State0x30_NEUTRAL_STATE = {
13+
.buttons = {
14+
.button3 = 0,
15+
.button4 = 0,
16+
.button5 = 0,
17+
.left_joystick = {0x00, 0x08, 0x80},
18+
.right_joystick = {0x00, 0x08, 0x80},
19+
.vibrator = 0x80,
20+
},
21+
.gyro = {},
22+
};
23+
24+
bool pabb_NintendoSwitch_WirelessController_State0x30_equals(
25+
const pabb_NintendoSwitch_WirelessController_State0x30* state0,
26+
const pabb_NintendoSwitch_WirelessController_State0x30* state1
27+
){
28+
return memcmp(state0, state1, sizeof(pabb_NintendoSwitch_WirelessController_State0x30)) == 0;
29+
}
30+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* Nintendo Switch - Wireless Controller State
2+
*
3+
* From: https://github.com/PokemonAutomation/
4+
*
5+
*/
6+
7+
#ifndef PokemonAutomation_NintendoSwitch_WirelessController_State_H
8+
#define PokemonAutomation_NintendoSwitch_WirelessController_State_H
9+
10+
#include <stdbool.h>
11+
#include <stdint.h>
12+
13+
#ifdef __cplusplus
14+
extern "C" {
15+
#endif
16+
17+
18+
19+
20+
typedef struct{
21+
uint8_t button3;
22+
uint8_t button4;
23+
uint8_t button5;
24+
uint8_t left_joystick[3];
25+
uint8_t right_joystick[3];
26+
uint8_t vibrator;
27+
} pabb_NintendoSwitch_WirelessController_State0x30_Buttons;
28+
29+
typedef struct{
30+
int16_t accel_x;
31+
int16_t accel_y;
32+
int16_t accel_z;
33+
int16_t rotation_x;
34+
int16_t rotation_y;
35+
int16_t rotation_z;
36+
} pabb_NintendoSwitch_WirelessController_State0x30_Gyro;
37+
38+
typedef struct{
39+
pabb_NintendoSwitch_WirelessController_State0x30_Gyro time0;
40+
pabb_NintendoSwitch_WirelessController_State0x30_Gyro time1;
41+
pabb_NintendoSwitch_WirelessController_State0x30_Gyro time2;
42+
} pabb_NintendoSwitch_WirelessController_State0x30_GyroX3;
43+
44+
typedef struct{
45+
pabb_NintendoSwitch_WirelessController_State0x30_Buttons buttons;
46+
pabb_NintendoSwitch_WirelessController_State0x30_GyroX3 gyro;
47+
} pabb_NintendoSwitch_WirelessController_State0x30;
48+
49+
50+
51+
52+
extern const pabb_NintendoSwitch_WirelessController_State0x30 pabb_NintendoSwitch_WirelessController_State0x30_NEUTRAL_STATE;
53+
54+
bool pabb_NintendoSwitch_WirelessController_State0x30_equals(
55+
const pabb_NintendoSwitch_WirelessController_State0x30* state0,
56+
const pabb_NintendoSwitch_WirelessController_State0x30* state1
57+
);
58+
59+
60+
61+
#ifdef __cplusplus
62+
}
63+
#endif
64+
#endif

Common/Controllers/NintendoSwitch_WirelessController_State.c

Lines changed: 0 additions & 30 deletions
This file was deleted.

Common/Controllers/NintendoSwitch_WirelessController_State.h

Lines changed: 0 additions & 64 deletions
This file was deleted.

Common/SerialPABotBase/SerialPABotBase_Messages_ESP32.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef PokemonAutomation_SerialPABotBase_Messages_ESP32_H
88
#define PokemonAutomation_SerialPABotBase_Messages_ESP32_H
99

10-
#include "../Controllers/NintendoSwitch_WirelessController_State.h"
10+
#include "../ControllerStates/NintendoSwitch_WirelessController_State.h"
1111
#include "SerialPABotBase_Protocol.h"
1212

1313
#if _WIN32
@@ -59,15 +59,15 @@ typedef struct{
5959
typedef struct{
6060
seqnum_t seqnum;
6161
uint16_t milliseconds;
62-
pa_NintendoSwitch_WirelessController_State0x30_Buttons buttons;
62+
pabb_NintendoSwitch_WirelessController_State0x30_Buttons buttons;
6363
} PABB_PACK pabb_Message_ESP32_CommandButtonState;
6464

6565

6666
#define PABB_MSG_ESP32_CONTROLLER_STATE_FULL 0xa1
6767
typedef struct{
6868
seqnum_t seqnum;
6969
uint16_t milliseconds;
70-
pa_NintendoSwitch_WirelessController_State0x30 state;
70+
pabb_NintendoSwitch_WirelessController_State0x30 state;
7171
} PABB_PACK pabb_Message_ESP32_CommandFullState;
7272

7373

Common/SerialPABotBase/SerialPABotBase_Messages_NS2_WiredController.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifndef PokemonAutomation_SerialPABotBase_Messages_NS2_WiredController_H
88
#define PokemonAutomation_SerialPABotBase_Messages_NS2_WiredController_H
99

10-
#include "../Controllers/NintendoSwitch2_WiredController_State.h"
10+
#include "../ControllerStates/NintendoSwitch2_WiredController_State.h"
1111
#include "SerialPABotBase_Protocol.h"
1212

1313
#if _WIN32
@@ -30,7 +30,7 @@ namespace SerialPABotBase{
3030
typedef struct{
3131
seqnum_t seqnum;
3232
uint16_t milliseconds;
33-
pa_NintendoSwitch2_WiredController_State report;
33+
pabb_NintendoSwitch2_WiredController_State report;
3434
} PABB_PACK pabb_Message_Report_NS2_WiredController;
3535

3636

0 commit comments

Comments
 (0)