From 2044ae6b3af6fab4d79996a661fef43f6db8d825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 15 Jan 2024 23:26:53 +0000 Subject: Fix more typos --- src/input_common/drivers/gc_adapter.cpp | 4 ++-- src/input_common/helpers/joycon_protocol/irs.cpp | 4 ++-- src/input_common/helpers/joycon_protocol/joycon_types.h | 6 +++--- src/input_common/helpers/joycon_protocol/nfc.cpp | 8 ++++---- src/input_common/helpers/joycon_protocol/rumble.cpp | 12 ++++++------ src/input_common/helpers/udp_protocol.h | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/input_common') diff --git a/src/input_common/drivers/gc_adapter.cpp b/src/input_common/drivers/gc_adapter.cpp index 1ff296af5..f1184a5fa 100644 --- a/src/input_common/drivers/gc_adapter.cpp +++ b/src/input_common/drivers/gc_adapter.cpp @@ -451,11 +451,11 @@ ButtonMapping GCAdapter::GetButtonMappingForDevice(const Common::ParamPackage& p std::tuple{Settings::NativeButton::ZL, PadButton::TriggerL, PadAxes::TriggerLeft}, {Settings::NativeButton::ZR, PadButton::TriggerR, PadAxes::TriggerRight}, }; - for (const auto& [switch_button, gcadapter_buton, gcadapter_axis] : switch_to_gcadapter_axis) { + for (const auto& [switch_button, gcadapter_button, gcadapter_axis] : switch_to_gcadapter_axis) { Common::ParamPackage button_params{}; button_params.Set("engine", GetEngineName()); button_params.Set("port", params.Get("port", 0)); - button_params.Set("button", static_cast(gcadapter_buton)); + button_params.Set("button", static_cast(gcadapter_button)); button_params.Set("axis", static_cast(gcadapter_axis)); button_params.Set("threshold", 0.5f); button_params.Set("range", 1.9f); diff --git a/src/input_common/helpers/joycon_protocol/irs.cpp b/src/input_common/helpers/joycon_protocol/irs.cpp index 68b0589e3..5bf72114d 100644 --- a/src/input_common/helpers/joycon_protocol/irs.cpp +++ b/src/input_common/helpers/joycon_protocol/irs.cpp @@ -236,9 +236,9 @@ Common::Input::DriverResult IrsProtocol::WriteRegistersStep2() { .number_of_registers = 0x8, .registers = { - IrsRegister{IrRegistersAddress::LedIntensitiyMSB, + IrsRegister{IrRegistersAddress::LedIntensityMSB, static_cast(led_intensity >> 8)}, - {IrRegistersAddress::LedIntensitiyLSB, static_cast(led_intensity & 0xff)}, + {IrRegistersAddress::LedIntensityLSB, static_cast(led_intensity & 0xff)}, {IrRegistersAddress::ImageFlip, static_cast(image_flip)}, {IrRegistersAddress::DenoiseSmoothing, static_cast((denoise >> 16) & 0xff)}, {IrRegistersAddress::DenoiseEdge, static_cast((denoise >> 8) & 0xff)}, diff --git a/src/input_common/helpers/joycon_protocol/joycon_types.h b/src/input_common/helpers/joycon_protocol/joycon_types.h index 77a43c67a..792f124e1 100644 --- a/src/input_common/helpers/joycon_protocol/joycon_types.h +++ b/src/input_common/helpers/joycon_protocol/joycon_types.h @@ -282,7 +282,7 @@ enum class NFCCommand : u8 { CancelAll = 0x00, StartPolling = 0x01, StopPolling = 0x02, - StartWaitingRecieve = 0x04, + StartWaitingReceive = 0x04, ReadNtag = 0x06, WriteNtag = 0x08, Mifare = 0x0F, @@ -382,8 +382,8 @@ enum class IrRegistersAddress : u16 { FinalizeConfig = 0x0700, LedFilter = 0x0e00, Leds = 0x1000, - LedIntensitiyMSB = 0x1100, - LedIntensitiyLSB = 0x1200, + LedIntensityMSB = 0x1100, + LedIntensityLSB = 0x1200, ImageFlip = 0x2d00, Resolution = 0x2e00, DigitalGainLSB = 0x2e01, diff --git a/src/input_common/helpers/joycon_protocol/nfc.cpp b/src/input_common/helpers/joycon_protocol/nfc.cpp index 09953394b..db83f9ef4 100644 --- a/src/input_common/helpers/joycon_protocol/nfc.cpp +++ b/src/input_common/helpers/joycon_protocol/nfc.cpp @@ -519,13 +519,13 @@ Common::Input::DriverResult NfcProtocol::GetMifareData( } if (output.mcu_report == MCUReport::NFCState && output.mcu_data[1] == 0x10) { - constexpr std::size_t DATA_LENGHT = 0x10 + 1; + constexpr std::size_t DATA_LENGTH = 0x10 + 1; constexpr std::size_t DATA_START = 11; const u8 number_of_elements = output.mcu_data[10]; for (std::size_t i = 0; i < number_of_elements; i++) { - out_data[i].sector = output.mcu_data[DATA_START + (i * DATA_LENGHT)]; + out_data[i].sector = output.mcu_data[DATA_START + (i * DATA_LENGTH)]; memcpy(out_data[i].data.data(), - output.mcu_data.data() + DATA_START + 1 + (i * DATA_LENGHT), + output.mcu_data.data() + DATA_START + 1 + (i * DATA_LENGTH), sizeof(MifareReadData::data)); } package_index++; @@ -659,7 +659,7 @@ Common::Input::DriverResult NfcProtocol::SendStopPollingRequest(MCUCommandRespon Common::Input::DriverResult NfcProtocol::SendNextPackageRequest(MCUCommandResponse& output, u8 packet_id) { NFCRequestState request{ - .command_argument = NFCCommand::StartWaitingRecieve, + .command_argument = NFCCommand::StartWaitingReceive, .block_id = {}, .packet_id = packet_id, .packet_flag = MCUPacketFlag::LastCommandPacket, diff --git a/src/input_common/helpers/joycon_protocol/rumble.cpp b/src/input_common/helpers/joycon_protocol/rumble.cpp index 7647f505e..9fd0b8470 100644 --- a/src/input_common/helpers/joycon_protocol/rumble.cpp +++ b/src/input_common/helpers/joycon_protocol/rumble.cpp @@ -67,7 +67,7 @@ u8 RumbleProtocol::EncodeHighAmplitude(f32 amplitude) const { // More information about these values can be found here: // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md - static constexpr std::array, 101> high_fequency_amplitude{ + static constexpr std::array, 101> high_frequency_amplitude{ std::pair{0.0f, 0x0}, {0.01f, 0x2}, {0.012f, 0x4}, @@ -171,20 +171,20 @@ u8 RumbleProtocol::EncodeHighAmplitude(f32 amplitude) const { {1.003f, 0xc8}, }; - for (const auto& [amplitude_value, code] : high_fequency_amplitude) { + for (const auto& [amplitude_value, code] : high_frequency_amplitude) { if (amplitude <= amplitude_value) { return static_cast(code); } } - return static_cast(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second); + return static_cast(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second); } u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const { // More information about these values can be found here: // https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/rumble_data_table.md - static constexpr std::array, 101> high_fequency_amplitude{ + static constexpr std::array, 101> high_frequency_amplitude{ std::pair{0.0f, 0x0040}, {0.01f, 0x8040}, {0.012f, 0x0041}, @@ -288,13 +288,13 @@ u16 RumbleProtocol::EncodeLowAmplitude(f32 amplitude) const { {1.003f, 0x0072}, }; - for (const auto& [amplitude_value, code] : high_fequency_amplitude) { + for (const auto& [amplitude_value, code] : high_frequency_amplitude) { if (amplitude <= amplitude_value) { return static_cast(code); } } - return static_cast(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second); + return static_cast(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second); } } // namespace InputCommon::Joycon diff --git a/src/input_common/helpers/udp_protocol.h b/src/input_common/helpers/udp_protocol.h index d9643ffe0..dba9f87d9 100644 --- a/src/input_common/helpers/udp_protocol.h +++ b/src/input_common/helpers/udp_protocol.h @@ -78,7 +78,7 @@ namespace Request { enum RegisterFlags : u8 { AllPads, PadID, - PadMACAdddress, + PadMACAddress, }; struct Version {}; -- cgit v1.2.3