Skip to content

Commit c0a1d43

Browse files
committed
More PABB2.
1 parent beed5d4 commit c0a1d43

7 files changed

Lines changed: 17 additions & 10 deletions

File tree

Common/PABotBase2/ReliableConnectionLayer/PABotBase2FW_ReliableStreamConnection.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ bool ReliableStreamConnectionFW::run_events(){
104104
return iterate_retransmits();
105105
}
106106

107+
m_packets_received++;
108+
107109
// Check the packet status.
108110
switch (packet->magic_number){
109111
case PABB2_PacketParser_RESULT_VALID:

Common/PABotBase2/ReliableConnectionLayer/PABotBase2FW_ReliableStreamConnection.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class ReliableStreamConnectionFW final : public ReliableStreamConnectionPolling{
3838
public:
3939
ReliableStreamConnectionFW(UnreliableStreamConnectionPolling& unreliable_connection);
4040

41+
size_t packets_received() const{
42+
return m_packets_received;
43+
}
4144
bool has_unacked_sends() const{
4245
return m_reliable_sender.slots_used() != 0;
4346
}
@@ -97,6 +100,8 @@ class ReliableStreamConnectionFW final : public ReliableStreamConnectionPolling{
97100
PacketParser m_parser;
98101
StreamCoalescer m_stream_coalescer;
99102

103+
size_t m_packets_received = 0;
104+
100105
WallClock m_last_retransmit;
101106

102107
bool m_reset_flag = false;

Common/SerialPABotBase/SerialPABotBase_Protocol_IDs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ typedef uint8_t pabb_ProgramID;
3636
#define PABB_PID_PABOTBASE_Pico1W_UART 0x21
3737
#define PABB_PID_PABOTBASE_Pico2W_USB 0x22
3838
#define PABB_PID_PABOTBASE_Pico2W_UART 0x23
39+
#define PABB_PID_PABOTBASE_Pico1 0x24
40+
#define PABB_PID_PABOTBASE_Pico2 0x25
3941

4042

4143
//

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ const std::map<uint32_t, std::map<pabb_ProgramID, uint8_t>>& SUPPORTED_VERSIONS(
5656

5757
const std::map<pabb_ProgramID, uint32_t>& SUPPORTED_DEVICES2(){
5858
static const std::map<pabb_ProgramID, uint32_t> database{
59-
{PABB_PID_UNSPECIFIED, 2026041100},
60-
{PABB_PID_PABOTBASE_ESP32, 2026041100},
61-
{PABB_PID_PABOTBASE_ESP32S3, 2026041100},
59+
{PABB_PID_UNSPECIFIED, 2026041100},
60+
{PABB_PID_PABOTBASE_ESP32, 2026041100},
61+
{PABB_PID_PABOTBASE_ESP32S3, 2026041100},
62+
{PABB_PID_PABOTBASE_Pico1, 2026041100},
63+
{PABB_PID_PABOTBASE_Pico2, 2026041100},
6264
};
6365
return database;
6466
}

SerialPrograms/Source/NintendoSwitch/Controllers/PABotBase2/NintendoSwitch_PABotBase2_Joycon.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ class PABotBase2_JoyCon :
7070

7171
public:
7272
virtual bool cancel_all_commands(WallDuration timeout) override{
73-
PABotBase2_Controller::cancel_all_commands(timeout);
74-
return true;
73+
return PABotBase2_Controller::cancel_all_commands(timeout);
7574
}
7675
virtual void replace_on_next_command() override{
7776
PABotBase2_Controller::replace_on_next_command();

SerialPrograms/Source/NintendoSwitch/Controllers/PABotBase2/NintendoSwitch_PABotBase2_ProController.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ class PABotBase2_ProController final :
6767

6868
public:
6969
virtual bool cancel_all_commands(WallDuration timeout) override{
70-
PABotBase2_Controller::cancel_all_commands(timeout);
71-
return true;
70+
return PABotBase2_Controller::cancel_all_commands(timeout);
7271
}
7372
virtual void replace_on_next_command() override{
7473
PABotBase2_Controller::replace_on_next_command();

SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ void CommandRow::set_focus(bool focused){
211211
if (controller != nullptr && allow_controller_input()){
212212
try{
213213
controller->cancel_all_commands();
214-
}catch (InvalidConnectionStateException&){
215-
}catch (OperationCancelledException&){
216-
}
214+
}catch (...){}
217215
}
218216
}
219217
if (m_last_known_focus == focused){

0 commit comments

Comments
 (0)