From a4476055ecd16520382b7dac1ed7279a1c0b921c Mon Sep 17 00:00:00 2001 From: Kurt Borja Date: Tue, 20 May 2025 13:02:16 +0000 Subject: [PATCH] Controllers: AlienwareController: Fix number of zones probing --- .../AlienwareController/AlienwareController.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Controllers/AlienwareController/AlienwareController.cpp b/Controllers/AlienwareController/AlienwareController.cpp index 1f355510..c7edec2e 100644 --- a/Controllers/AlienwareController/AlienwareController.cpp +++ b/Controllers/AlienwareController/AlienwareController.cpp @@ -99,6 +99,11 @@ AlienwareController::AlienwareController(hid_device* dev_handle, const hid_devic report = Report(ALIENWARE_COMMAND_REPORT_CONFIG); alienware_platform_id platform_id = report.data[4] << 8 | report.data[5]; + /*-----------------------------------------------------*\ + | Check if the device reports the wrong number of zones | + \*-----------------------------------------------------*/ + unsigned number_of_zones = zone_quirks_table.count(platform_id) ? zone_quirks_table.at(platform_id) : report.data[6]; + /*-----------------------------------------------------*\ | Get firmware version | \*-----------------------------------------------------*/ @@ -109,11 +114,6 @@ AlienwareController::AlienwareController(hid_device* dev_handle, const hid_devic fw_string << static_cast(report.data[4]) << '.' << static_cast(report.data[5]) << '.' << static_cast(report.data[6]); version = fw_string.str(); - /*-----------------------------------------------------*\ - | Check if the device reports the wrong number of zones | - \*-----------------------------------------------------*/ - unsigned number_of_zones = zone_quirks_table.count(platform_id) ? zone_quirks_table.at(platform_id) : report.data[6]; - /*-----------------------------------------------------*\ | Initialize Alienware zones | \*-----------------------------------------------------*/