Skip to content

Commit 6669d6c

Browse files
committed
More ESP32 work.
1 parent 119711a commit 6669d6c

File tree

8 files changed

+16
-6
lines changed

8 files changed

+16
-6
lines changed

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const std::map<
7878
{PABB_PID_PABOTBASE_ESP32, {
7979
{ControllerType::NintendoSwitch_WirelessProController, {
8080
ControllerFeature::QueryCommandQueueSize,
81+
ControllerFeature::NintendoSwitch_ProController,
8182
}},
8283
{ControllerType::NintendoSwitch_LeftJoycon, {
8384
ControllerFeature::QueryCommandQueueSize,

SerialPrograms/Source/Controllers/SerialPABotBase/SerialPABotBase_Descriptor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ std::unique_ptr<AbstractController> SerialPABotBase_Descriptor::make_controller(
6767
) const{
6868
switch (controller_type){
6969
case ControllerType::NintendoSwitch_WiredProController:
70+
case ControllerType::NintendoSwitch_WirelessProController:
7071
return std::unique_ptr<AbstractController>(
7172
new NintendoSwitch::ProController_SerialPABotBase(
7273
logger,
74+
controller_type,
7375
static_cast<SerialPABotBase_Connection&>(connection),
7476
requirements
7577
)

SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ProController_SerialPABotBase.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ PA_FORCE_INLINE Type milliseconds_to_ticks_8ms(Type milliseconds){
3333

3434
ProController_SerialPABotBase::ProController_SerialPABotBase(
3535
Logger& logger,
36+
ControllerType controller_type,
3637
SerialPABotBase::SerialPABotBase_Connection& connection,
3738
const ControllerRequirements& requirements
3839
)
@@ -47,12 +48,12 @@ ProController_SerialPABotBase::ProController_SerialPABotBase(
4748
// Check compatibility.
4849

4950
const std::map<ControllerType, std::set<ControllerFeature>>& controllers = connection.supported_controllers();
50-
auto iter = controllers.find(ControllerType::NintendoSwitch_WiredProController);
51+
auto iter = controllers.find(controller_type);
5152

5253
std::string missing_feature;
5354
do{
5455
if (iter == controllers.end()){
55-
missing_feature = "NintendoSwitch_WiredProController";
56+
missing_feature = CONTROLLER_TYPE_STRINGS.get_string(controller_type);
5657
break;
5758
}
5859

SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ProController_SerialPABotBase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class ProController_SerialPABotBase final : public ProControllerWithScheduler{
2323
public:
2424
ProController_SerialPABotBase(
2525
Logger& logger,
26+
ControllerType controller_type,
2627
SerialPABotBase::SerialPABotBase_Connection& connection,
2728
const ControllerRequirements& requirements
2829
);

SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_SnapshotDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SnapshotDumper_Descriptor::SnapshotDumper_Descriptor()
2222
"Periodically take screenshots.",
2323
FeedbackType::NONE,
2424
AllowCommandsWhenRunning::ENABLE_COMMANDS,
25-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
25+
{ControllerFeature::NintendoSwitch_ProController}
2626
)
2727
{}
2828

SerialPrograms/Source/PokemonHome/Programs/PokemonHome_BoxSorting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ BoxSorting_Descriptor::BoxSorting_Descriptor()
6363
FeedbackType::REQUIRED,
6464
AllowCommandsWhenRunning::DISABLE_COMMANDS,
6565
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
66-
)
66+
)
6767
{}
6868
struct BoxSorting_Descriptor::Stats : public StatsTracker{
6969
Stats()

SerialPrograms/Source/PokemonLA/Programs/ShinyHunting/PokemonLA_ShinyHunt-LakeTrio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ ShinyHuntLakeTrio_Descriptor::ShinyHuntLakeTrio_Descriptor()
3636
"Shiny hunt the lake trio legendaries.",
3737
FeedbackType::REQUIRED,
3838
AllowCommandsWhenRunning::DISABLE_COMMANDS,
39-
{SerialPABotBase::OLD_NINTENDO_SWITCH_DEFAULT_REQUIREMENTS}
39+
{ControllerFeature::NintendoSwitch_ProController}
4040
)
4141
{}
4242
std::unique_ptr<StatsTracker> ShinyHuntLakeTrio_Descriptor::make_stats() const{

SerialPrograms/Source/Tests/PokemonLA_Tests.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,12 @@ int test_pokemonLA_shinySoundDetector(const std::vector<AudioSpectrum>& spectrum
493493
auto& logger = global_logger_command_line();
494494
DummyBotBase botbase(logger);
495495
SerialPABotBase::SerialPABotBase_Connection connection(logger, nullptr);
496-
ProController_SerialPABotBase controller(logger, connection, {});
496+
ProController_SerialPABotBase controller(
497+
logger,
498+
ControllerType::NintendoSwitch_WiredProController,
499+
connection,
500+
{}
501+
);
497502
DummyVideoFeed video_feed;
498503
DummyVideoOverlay video_overlay;
499504
DummyAudioFeed audio_feed;

0 commit comments

Comments
 (0)