diff options
Diffstat (limited to 'src/hid_core')
| -rw-r--r-- | src/hid_core/frontend/emulated_controller.cpp | 32 | ||||
| -rw-r--r-- | src/hid_core/frontend/emulated_controller.h | 2 | ||||
| -rw-r--r-- | src/hid_core/frontend/motion_input.h | 4 | ||||
| -rw-r--r-- | src/hid_core/hid_result.h | 2 | ||||
| -rw-r--r-- | src/hid_core/irsensor/irs_types.h | 4 | ||||
| -rw-r--r-- | src/hid_core/resources/hid_firmware_settings.cpp | 4 | ||||
| -rw-r--r-- | src/hid_core/resources/hid_firmware_settings.h | 2 | ||||
| -rw-r--r-- | src/hid_core/resources/six_axis/six_axis.cpp | 4 | ||||
| -rw-r--r-- | src/hid_core/resources/six_axis/six_axis.h | 2 |
9 files changed, 28 insertions, 28 deletions
diff --git a/src/hid_core/frontend/emulated_controller.cpp b/src/hid_core/frontend/emulated_controller.cpp index a6a96935d..2ab93402d 100644 --- a/src/hid_core/frontend/emulated_controller.cpp +++ b/src/hid_core/frontend/emulated_controller.cpp | |||
| @@ -509,11 +509,11 @@ void EmulatedController::ReloadInput() { | |||
| 509 | }); | 509 | }); |
| 510 | } | 510 | } |
| 511 | turbo_button_state = 0; | 511 | turbo_button_state = 0; |
| 512 | is_initalized = true; | 512 | is_initialized = true; |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | void EmulatedController::UnloadInput() { | 515 | void EmulatedController::UnloadInput() { |
| 516 | is_initalized = false; | 516 | is_initialized = false; |
| 517 | for (auto& button : button_devices) { | 517 | for (auto& button : button_devices) { |
| 518 | button.reset(); | 518 | button.reset(); |
| 519 | } | 519 | } |
| @@ -1209,7 +1209,7 @@ void EmulatedController::SetNfc(const Common::Input::CallbackStatus& callback) { | |||
| 1209 | } | 1209 | } |
| 1210 | 1210 | ||
| 1211 | bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue vibration) { | 1211 | bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue vibration) { |
| 1212 | if (!is_initalized) { | 1212 | if (!is_initialized) { |
| 1213 | return false; | 1213 | return false; |
| 1214 | } | 1214 | } |
| 1215 | if (device_index >= output_devices.size()) { | 1215 | if (device_index >= output_devices.size()) { |
| @@ -1247,7 +1247,7 @@ bool EmulatedController::IsVibrationEnabled(std::size_t device_index) { | |||
| 1247 | const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); | 1247 | const auto player_index = Service::HID::NpadIdTypeToIndex(npad_id_type); |
| 1248 | const auto& player = Settings::values.players.GetValue()[player_index]; | 1248 | const auto& player = Settings::values.players.GetValue()[player_index]; |
| 1249 | 1249 | ||
| 1250 | if (!is_initalized) { | 1250 | if (!is_initialized) { |
| 1251 | return false; | 1251 | return false; |
| 1252 | } | 1252 | } |
| 1253 | 1253 | ||
| @@ -1270,7 +1270,7 @@ Common::Input::DriverResult EmulatedController::SetPollingMode( | |||
| 1270 | EmulatedDeviceIndex device_index, Common::Input::PollingMode polling_mode) { | 1270 | EmulatedDeviceIndex device_index, Common::Input::PollingMode polling_mode) { |
| 1271 | LOG_INFO(Service_HID, "Set polling mode {}, device_index={}", polling_mode, device_index); | 1271 | LOG_INFO(Service_HID, "Set polling mode {}, device_index={}", polling_mode, device_index); |
| 1272 | 1272 | ||
| 1273 | if (!is_initalized) { | 1273 | if (!is_initialized) { |
| 1274 | return Common::Input::DriverResult::InvalidHandle; | 1274 | return Common::Input::DriverResult::InvalidHandle; |
| 1275 | } | 1275 | } |
| 1276 | 1276 | ||
| @@ -1319,7 +1319,7 @@ bool EmulatedController::SetCameraFormat( | |||
| 1319 | Core::IrSensor::ImageTransferProcessorFormat camera_format) { | 1319 | Core::IrSensor::ImageTransferProcessorFormat camera_format) { |
| 1320 | LOG_INFO(Service_HID, "Set camera format {}", camera_format); | 1320 | LOG_INFO(Service_HID, "Set camera format {}", camera_format); |
| 1321 | 1321 | ||
| 1322 | if (!is_initalized) { | 1322 | if (!is_initialized) { |
| 1323 | return false; | 1323 | return false; |
| 1324 | } | 1324 | } |
| 1325 | 1325 | ||
| @@ -1347,7 +1347,7 @@ void EmulatedController::SetRingParam(Common::ParamPackage param) { | |||
| 1347 | 1347 | ||
| 1348 | bool EmulatedController::HasNfc() const { | 1348 | bool EmulatedController::HasNfc() const { |
| 1349 | 1349 | ||
| 1350 | if (!is_initalized) { | 1350 | if (!is_initialized) { |
| 1351 | return false; | 1351 | return false; |
| 1352 | } | 1352 | } |
| 1353 | 1353 | ||
| @@ -1388,7 +1388,7 @@ bool EmulatedController::RemoveNfcHandle() { | |||
| 1388 | } | 1388 | } |
| 1389 | 1389 | ||
| 1390 | bool EmulatedController::StartNfcPolling() { | 1390 | bool EmulatedController::StartNfcPolling() { |
| 1391 | if (!is_initalized) { | 1391 | if (!is_initialized) { |
| 1392 | return false; | 1392 | return false; |
| 1393 | } | 1393 | } |
| 1394 | 1394 | ||
| @@ -1403,7 +1403,7 @@ bool EmulatedController::StartNfcPolling() { | |||
| 1403 | } | 1403 | } |
| 1404 | 1404 | ||
| 1405 | bool EmulatedController::StopNfcPolling() { | 1405 | bool EmulatedController::StopNfcPolling() { |
| 1406 | if (!is_initalized) { | 1406 | if (!is_initialized) { |
| 1407 | return false; | 1407 | return false; |
| 1408 | } | 1408 | } |
| 1409 | 1409 | ||
| @@ -1418,7 +1418,7 @@ bool EmulatedController::StopNfcPolling() { | |||
| 1418 | } | 1418 | } |
| 1419 | 1419 | ||
| 1420 | bool EmulatedController::ReadAmiiboData(std::vector<u8>& data) { | 1420 | bool EmulatedController::ReadAmiiboData(std::vector<u8>& data) { |
| 1421 | if (!is_initalized) { | 1421 | if (!is_initialized) { |
| 1422 | return false; | 1422 | return false; |
| 1423 | } | 1423 | } |
| 1424 | 1424 | ||
| @@ -1434,7 +1434,7 @@ bool EmulatedController::ReadAmiiboData(std::vector<u8>& data) { | |||
| 1434 | 1434 | ||
| 1435 | bool EmulatedController::ReadMifareData(const Common::Input::MifareRequest& request, | 1435 | bool EmulatedController::ReadMifareData(const Common::Input::MifareRequest& request, |
| 1436 | Common::Input::MifareRequest& out_data) { | 1436 | Common::Input::MifareRequest& out_data) { |
| 1437 | if (!is_initalized) { | 1437 | if (!is_initialized) { |
| 1438 | return false; | 1438 | return false; |
| 1439 | } | 1439 | } |
| 1440 | 1440 | ||
| @@ -1450,7 +1450,7 @@ bool EmulatedController::ReadMifareData(const Common::Input::MifareRequest& requ | |||
| 1450 | } | 1450 | } |
| 1451 | 1451 | ||
| 1452 | bool EmulatedController::WriteMifareData(const Common::Input::MifareRequest& request) { | 1452 | bool EmulatedController::WriteMifareData(const Common::Input::MifareRequest& request) { |
| 1453 | if (!is_initalized) { | 1453 | if (!is_initialized) { |
| 1454 | return false; | 1454 | return false; |
| 1455 | } | 1455 | } |
| 1456 | 1456 | ||
| @@ -1465,7 +1465,7 @@ bool EmulatedController::WriteMifareData(const Common::Input::MifareRequest& req | |||
| 1465 | } | 1465 | } |
| 1466 | 1466 | ||
| 1467 | bool EmulatedController::WriteNfc(const std::vector<u8>& data) { | 1467 | bool EmulatedController::WriteNfc(const std::vector<u8>& data) { |
| 1468 | if (!is_initalized) { | 1468 | if (!is_initialized) { |
| 1469 | return false; | 1469 | return false; |
| 1470 | } | 1470 | } |
| 1471 | 1471 | ||
| @@ -1480,7 +1480,7 @@ bool EmulatedController::WriteNfc(const std::vector<u8>& data) { | |||
| 1480 | } | 1480 | } |
| 1481 | 1481 | ||
| 1482 | void EmulatedController::SetLedPattern() { | 1482 | void EmulatedController::SetLedPattern() { |
| 1483 | if (!is_initalized) { | 1483 | if (!is_initialized) { |
| 1484 | return; | 1484 | return; |
| 1485 | } | 1485 | } |
| 1486 | 1486 | ||
| @@ -1508,8 +1508,8 @@ void EmulatedController::SetGyroscopeZeroDriftMode(GyroscopeZeroDriftMode mode) | |||
| 1508 | motion.emulated.SetGyroThreshold(motion.emulated.ThresholdLoose); | 1508 | motion.emulated.SetGyroThreshold(motion.emulated.ThresholdLoose); |
| 1509 | break; | 1509 | break; |
| 1510 | case GyroscopeZeroDriftMode::Tight: | 1510 | case GyroscopeZeroDriftMode::Tight: |
| 1511 | motion_sensitivity = motion.emulated.IsAtRestThight; | 1511 | motion_sensitivity = motion.emulated.IsAtRestTight; |
| 1512 | motion.emulated.SetGyroThreshold(motion.emulated.ThresholdThight); | 1512 | motion.emulated.SetGyroThreshold(motion.emulated.ThresholdTight); |
| 1513 | break; | 1513 | break; |
| 1514 | case GyroscopeZeroDriftMode::Standard: | 1514 | case GyroscopeZeroDriftMode::Standard: |
| 1515 | default: | 1515 | default: |
diff --git a/src/hid_core/frontend/emulated_controller.h b/src/hid_core/frontend/emulated_controller.h index 94798164d..90e536e07 100644 --- a/src/hid_core/frontend/emulated_controller.h +++ b/src/hid_core/frontend/emulated_controller.h | |||
| @@ -559,7 +559,7 @@ private: | |||
| 559 | NpadStyleTag supported_style_tag{NpadStyleSet::All}; | 559 | NpadStyleTag supported_style_tag{NpadStyleSet::All}; |
| 560 | bool is_connected{false}; | 560 | bool is_connected{false}; |
| 561 | bool is_configuring{false}; | 561 | bool is_configuring{false}; |
| 562 | bool is_initalized{false}; | 562 | bool is_initialized{false}; |
| 563 | bool system_buttons_enabled{true}; | 563 | bool system_buttons_enabled{true}; |
| 564 | f32 motion_sensitivity{Core::HID::MotionInput::IsAtRestStandard}; | 564 | f32 motion_sensitivity{Core::HID::MotionInput::IsAtRestStandard}; |
| 565 | u32 turbo_button_state{0}; | 565 | u32 turbo_button_state{0}; |
diff --git a/src/hid_core/frontend/motion_input.h b/src/hid_core/frontend/motion_input.h index 11678983d..c902a3a6e 100644 --- a/src/hid_core/frontend/motion_input.h +++ b/src/hid_core/frontend/motion_input.h | |||
| @@ -13,12 +13,12 @@ class MotionInput { | |||
| 13 | public: | 13 | public: |
| 14 | static constexpr float ThresholdLoose = 0.01f; | 14 | static constexpr float ThresholdLoose = 0.01f; |
| 15 | static constexpr float ThresholdStandard = 0.007f; | 15 | static constexpr float ThresholdStandard = 0.007f; |
| 16 | static constexpr float ThresholdThight = 0.002f; | 16 | static constexpr float ThresholdTight = 0.002f; |
| 17 | 17 | ||
| 18 | static constexpr float IsAtRestRelaxed = 0.05f; | 18 | static constexpr float IsAtRestRelaxed = 0.05f; |
| 19 | static constexpr float IsAtRestLoose = 0.02f; | 19 | static constexpr float IsAtRestLoose = 0.02f; |
| 20 | static constexpr float IsAtRestStandard = 0.01f; | 20 | static constexpr float IsAtRestStandard = 0.01f; |
| 21 | static constexpr float IsAtRestThight = 0.005f; | 21 | static constexpr float IsAtRestTight = 0.005f; |
| 22 | 22 | ||
| 23 | static constexpr float GyroMaxValue = 5.0f; | 23 | static constexpr float GyroMaxValue = 5.0f; |
| 24 | static constexpr float AccelMaxValue = 7.0f; | 24 | static constexpr float AccelMaxValue = 7.0f; |
diff --git a/src/hid_core/hid_result.h b/src/hid_core/hid_result.h index bb14aa61e..df9b28c9a 100644 --- a/src/hid_core/hid_result.h +++ b/src/hid_core/hid_result.h | |||
| @@ -15,7 +15,7 @@ constexpr Result ResultVibrationNotInitialized{ErrorModule::HID, 121}; | |||
| 15 | constexpr Result ResultVibrationInvalidStyleIndex{ErrorModule::HID, 122}; | 15 | constexpr Result ResultVibrationInvalidStyleIndex{ErrorModule::HID, 122}; |
| 16 | constexpr Result ResultVibrationInvalidNpadId{ErrorModule::HID, 123}; | 16 | constexpr Result ResultVibrationInvalidNpadId{ErrorModule::HID, 123}; |
| 17 | constexpr Result ResultVibrationDeviceIndexOutOfRange{ErrorModule::HID, 124}; | 17 | constexpr Result ResultVibrationDeviceIndexOutOfRange{ErrorModule::HID, 124}; |
| 18 | constexpr Result ResultVibrationStrenghtOutOfRange{ErrorModule::HID, 126}; | 18 | constexpr Result ResultVibrationStrengthOutOfRange{ErrorModule::HID, 126}; |
| 19 | constexpr Result ResultVibrationArraySizeMismatch{ErrorModule::HID, 131}; | 19 | constexpr Result ResultVibrationArraySizeMismatch{ErrorModule::HID, 131}; |
| 20 | 20 | ||
| 21 | constexpr Result InvalidSixAxisFusionRange{ErrorModule::HID, 423}; | 21 | constexpr Result InvalidSixAxisFusionRange{ErrorModule::HID, 423}; |
diff --git a/src/hid_core/irsensor/irs_types.h b/src/hid_core/irsensor/irs_types.h index 017f38e6c..d7354de21 100644 --- a/src/hid_core/irsensor/irs_types.h +++ b/src/hid_core/irsensor/irs_types.h | |||
| @@ -106,8 +106,8 @@ enum class HandAnalysisMode : u32 { | |||
| 106 | None, | 106 | None, |
| 107 | Silhouette, | 107 | Silhouette, |
| 108 | Image, | 108 | Image, |
| 109 | SilhoueteAndImage, | 109 | SilhouetteAndImage, |
| 110 | SilhuetteOnly, | 110 | SilhouetteOnly, |
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | // This is nn::irsensor::IrSensorFunctionLevel | 113 | // This is nn::irsensor::IrSensorFunctionLevel |
diff --git a/src/hid_core/resources/hid_firmware_settings.cpp b/src/hid_core/resources/hid_firmware_settings.cpp index e76b3a016..9fa0db17e 100644 --- a/src/hid_core/resources/hid_firmware_settings.cpp +++ b/src/hid_core/resources/hid_firmware_settings.cpp | |||
| @@ -14,7 +14,7 @@ void HidFirmwareSettings::Reload() { | |||
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | void HidFirmwareSettings::LoadSettings(bool reload_config) { | 16 | void HidFirmwareSettings::LoadSettings(bool reload_config) { |
| 17 | if (is_initalized && !reload_config) { | 17 | if (is_initialized && !reload_config) { |
| 18 | return; | 18 | return; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| @@ -33,7 +33,7 @@ void HidFirmwareSettings::LoadSettings(bool reload_config) { | |||
| 33 | is_handheld_forced = true; | 33 | is_handheld_forced = true; |
| 34 | features_per_id_disabled = {}; | 34 | features_per_id_disabled = {}; |
| 35 | is_touch_firmware_auto_update_disabled = false; | 35 | is_touch_firmware_auto_update_disabled = false; |
| 36 | is_initalized = true; | 36 | is_initialized = true; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | bool HidFirmwareSettings::IsDebugPadEnabled() { | 39 | bool HidFirmwareSettings::IsDebugPadEnabled() { |
diff --git a/src/hid_core/resources/hid_firmware_settings.h b/src/hid_core/resources/hid_firmware_settings.h index 6c10c440b..00201fd94 100644 --- a/src/hid_core/resources/hid_firmware_settings.h +++ b/src/hid_core/resources/hid_firmware_settings.h | |||
| @@ -33,7 +33,7 @@ public: | |||
| 33 | FeaturesPerId FeaturesDisabledPerId(); | 33 | FeaturesPerId FeaturesDisabledPerId(); |
| 34 | 34 | ||
| 35 | private: | 35 | private: |
| 36 | bool is_initalized{}; | 36 | bool is_initialized{}; |
| 37 | 37 | ||
| 38 | // Debug settings | 38 | // Debug settings |
| 39 | bool is_debug_pad_enabled{}; | 39 | bool is_debug_pad_enabled{}; |
diff --git a/src/hid_core/resources/six_axis/six_axis.cpp b/src/hid_core/resources/six_axis/six_axis.cpp index da12d2d5a..abb6fd152 100644 --- a/src/hid_core/resources/six_axis/six_axis.cpp +++ b/src/hid_core/resources/six_axis/six_axis.cpp | |||
| @@ -249,7 +249,7 @@ Result SixAxis::EnableSixAxisSensorUnalteredPassthrough( | |||
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | auto& sixaxis = GetSixaxisState(sixaxis_handle); | 251 | auto& sixaxis = GetSixaxisState(sixaxis_handle); |
| 252 | sixaxis.unaltered_passtrough = is_enabled; | 252 | sixaxis.unaltered_passthrough = is_enabled; |
| 253 | return ResultSuccess; | 253 | return ResultSuccess; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| @@ -262,7 +262,7 @@ Result SixAxis::IsSixAxisSensorUnalteredPassthroughEnabled( | |||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | const auto& sixaxis = GetSixaxisState(sixaxis_handle); | 264 | const auto& sixaxis = GetSixaxisState(sixaxis_handle); |
| 265 | is_enabled = sixaxis.unaltered_passtrough; | 265 | is_enabled = sixaxis.unaltered_passthrough; |
| 266 | return ResultSuccess; | 266 | return ResultSuccess; |
| 267 | } | 267 | } |
| 268 | 268 | ||
diff --git a/src/hid_core/resources/six_axis/six_axis.h b/src/hid_core/resources/six_axis/six_axis.h index 1054e1b27..b4b00a441 100644 --- a/src/hid_core/resources/six_axis/six_axis.h +++ b/src/hid_core/resources/six_axis/six_axis.h | |||
| @@ -62,7 +62,7 @@ private: | |||
| 62 | 62 | ||
| 63 | struct SixaxisParameters { | 63 | struct SixaxisParameters { |
| 64 | bool is_fusion_enabled{true}; | 64 | bool is_fusion_enabled{true}; |
| 65 | bool unaltered_passtrough{false}; | 65 | bool unaltered_passthrough{false}; |
| 66 | Core::HID::SixAxisSensorFusionParameters fusion{}; | 66 | Core::HID::SixAxisSensorFusionParameters fusion{}; |
| 67 | Core::HID::SixAxisSensorCalibrationParameter calibration{}; | 67 | Core::HID::SixAxisSensorCalibrationParameter calibration{}; |
| 68 | Core::HID::SixAxisSensorIcInformation ic_information{}; | 68 | Core::HID::SixAxisSensorIcInformation ic_information{}; |