summaryrefslogtreecommitdiffstats
path: root/src/input_common/helpers/joycon_protocol
diff options
context:
space:
mode:
authorViktor Szépe <viktor@szepe.net>2024-01-16 00:26:53 +0100
committerViktor Szépe <viktor@szepe.net>2024-01-16 00:26:53 +0100
commit2044ae6b3af6fab4d79996a661fef43f6db8d825 (patch)
tree49f827eb5f5cc0eca379bce989cbe9450e4831c9 /src/input_common/helpers/joycon_protocol
parentFix typos in src/core (#12625) (diff)
downloadyuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.tar
yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.tar.gz
yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.tar.bz2
yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.tar.lz
yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.tar.xz
yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.tar.zst
yuzu-2044ae6b3af6fab4d79996a661fef43f6db8d825.zip
Diffstat (limited to 'src/input_common/helpers/joycon_protocol')
-rw-r--r--src/input_common/helpers/joycon_protocol/irs.cpp4
-rw-r--r--src/input_common/helpers/joycon_protocol/joycon_types.h6
-rw-r--r--src/input_common/helpers/joycon_protocol/nfc.cpp8
-rw-r--r--src/input_common/helpers/joycon_protocol/rumble.cpp12
4 files changed, 15 insertions, 15 deletions
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<u8>(led_intensity >> 8)},
- {IrRegistersAddress::LedIntensitiyLSB, static_cast<u8>(led_intensity & 0xff)},
+ {IrRegistersAddress::LedIntensityLSB, static_cast<u8>(led_intensity & 0xff)},
{IrRegistersAddress::ImageFlip, static_cast<u8>(image_flip)},
{IrRegistersAddress::DenoiseSmoothing, static_cast<u8>((denoise >> 16) & 0xff)},
{IrRegistersAddress::DenoiseEdge, static_cast<u8>((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<std::pair<f32, int>, 101> high_fequency_amplitude{
+ static constexpr std::array<std::pair<f32, int>, 101> high_frequency_amplitude{
std::pair<f32, int>{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<u8>(code);
}
}
- return static_cast<u8>(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second);
+ return static_cast<u8>(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<std::pair<f32, int>, 101> high_fequency_amplitude{
+ static constexpr std::array<std::pair<f32, int>, 101> high_frequency_amplitude{
std::pair<f32, int>{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<u16>(code);
}
}
- return static_cast<u16>(high_fequency_amplitude[high_fequency_amplitude.size() - 1].second);
+ return static_cast<u16>(high_frequency_amplitude[high_frequency_amplitude.size() - 1].second);
}
} // namespace InputCommon::Joycon