feat: add opt-in native Nintendo rumble backend

This commit is contained in:
Joey Yakimowich-Payne 2026-09-05 23:58:50 -06:00
commit 3fc28b1fa4
44 changed files with 4834 additions and 240 deletions

View file

@ -29,3 +29,33 @@ def test_switch_haptics_native(tmp_path: Path) -> None:
cwd=root,
)
subprocess.run([str(executable)], check=True, cwd=root)
def test_switch_native_haptics_encoder(tmp_path: Path) -> None:
root = Path(__file__).resolve().parents[1]
compiler = shutil.which("c++") or shutil.which("g++")
assert compiler is not None, "a host C++ compiler is required"
firmware = root / "src" / "firmware"
executable = tmp_path / "switch_native_haptics_test"
subprocess.run(
[
compiler,
"-std=c++17",
"-Wall",
"-Wextra",
"-Werror",
"-pedantic",
f"-I{firmware}",
str(firmware / "usb" / "switch" / "switch_haptics.cpp"),
str(firmware / "usb" / "switch" / "switch_native_haptics.cpp"),
str(firmware / "core" / "controller_identity.cpp"),
str(firmware / "profile" / "controller_profile.cpp"),
str(firmware / "profile" / "controller_profile_transform.cpp"),
str(root / "tests" / "switch_native_haptics_test.cpp"),
"-o",
str(executable),
],
check=True,
cwd=root,
)
subprocess.run([str(executable)], check=True, cwd=root)