Skip to content

Commit 119711a

Browse files
committed
Early ESP32 preparations.
1 parent d660c7a commit 119711a

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

Common/PokemonSwSh/PokemonProgramIDs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#define PABB_PID_UNSPECIFIED 0x00
1212
#define PABB_PID_PABOTBASE_12KB 0x08
1313
#define PABB_PID_PABOTBASE_31KB 0x09
14+
#define PABB_PID_PABOTBASE_ESP32 0x10
1415

1516

1617

SerialPrograms/Source/Controllers/ControllerSession.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,9 @@ void ControllerSession::post_connection_ready(
372372
ready = m_controller && m_controller->is_ready();
373373

374374
WriteSpinLock lg1(m_message_lock);
375-
m_controller_error = m_controller->error_string();
375+
if (m_controller){
376+
m_controller_error = m_controller->error_string();
377+
}
376378
}
377379

378380
signal_controller_changed(selected_controller, available_controllers);

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ std::string program_name(uint8_t id){
2727
case PABB_PID_UNSPECIFIED: return "Microcontroller Program";
2828
case PABB_PID_PABOTBASE_12KB: return "PABotBase-AVR8-12KB";
2929
case PABB_PID_PABOTBASE_31KB: return "PABotBase-AVR8-31KB";
30+
case PABB_PID_PABOTBASE_ESP32: return "PABotBase-ESP32";
3031
default: return "Unknown ID";
3132
}
3233
}
@@ -73,9 +74,17 @@ const std::map<
7374
ControllerFeature::NintendoSwitch_ProController,
7475
ControllerFeature::NintendoSwitch_DateSkip,
7576
}},
76-
// {ControllerType::NintendoSwitch_WirelessProController, {}},
77-
// {ControllerType::NintendoSwitch_LeftJoycon, {}},
78-
// {ControllerType::NintendoSwitch_RightJoycon, {}},
77+
}},
78+
{PABB_PID_PABOTBASE_ESP32, {
79+
{ControllerType::NintendoSwitch_WirelessProController, {
80+
ControllerFeature::QueryCommandQueueSize,
81+
}},
82+
{ControllerType::NintendoSwitch_LeftJoycon, {
83+
ControllerFeature::QueryCommandQueueSize,
84+
}},
85+
{ControllerType::NintendoSwitch_RightJoycon, {
86+
ControllerFeature::QueryCommandQueueSize,
87+
}},
7988
}},
8089
}},
8190
};

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase_Connection.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,11 @@ void SerialPABotBase_Connection::thread_body(){
325325
&scope
326326
).convert<PABB_MSG_ACK_REQUEST_I32>(m_logger, response);
327327
uint32_t wallclock = response.data;
328-
str = ticks_to_time(NintendoSwitch::TICKS_PER_SECOND, wallclock);
328+
if (wallclock == 0){
329+
str = "Unknown";
330+
}else{
331+
str = ticks_to_time(NintendoSwitch::TICKS_PER_SECOND, wallclock);
332+
}
329333
}catch (InvalidConnectionStateException&){
330334
break;
331335
}catch (SerialProtocolException& e){

0 commit comments

Comments
 (0)