Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/devices/logitech_gpro_x2_lightspeed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,19 @@ class LogitechGProX2Lightspeed : public HIDDevice {

Result<SidetoneResult> setSidetone(hid_device* device_handle, uint8_t level) override
{
uint8_t mapped = map<uint8_t>(level, 0, 128, 0, 100);

// INFO: The original G HUB app does some strange mapping:
// 0 - 5 -> 0x00 (off)
// 6 - 16 -> 0x01
// 17 - 27 -> 0x02
// 28 - 38 -> 0x03
// 39 - 49 -> 0x04
// 50 - 61 -> 0x05
// 62 - 72 -> 0x06
// 73 - 83 -> 0x07
// 84 - 94 -> 0x08
// 95 - 100 -> 0x09
uint8_t mapped = map<uint8_t>(level, 0, 128, 0, 9);

auto command = buildSidetoneCommand(mapped);
if (auto write_result = writeHID(device_handle, command, PACKET_SIZE); !write_result) {
Expand All @@ -120,7 +132,7 @@ class LogitechGProX2Lightspeed : public HIDDevice {
.min_level = 0,
.max_level = 128,
.device_min = 0,
.device_max = 100
.device_max = 9
};
}

Expand Down
Loading