mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
asus: fix single profile devices
This commit is contained in:
@@ -5,7 +5,7 @@ DeviceType=mouse
|
||||
Driver=asus
|
||||
|
||||
[Driver/asus]
|
||||
Profiles=0
|
||||
Profiles=1
|
||||
Buttons=6
|
||||
Leds=1
|
||||
Dpis=2
|
||||
|
||||
@@ -326,15 +326,18 @@ asus_driver_load_profiles(struct ratbag_device *device)
|
||||
int rc;
|
||||
struct asus_profile_data profile_data;
|
||||
struct ratbag_profile *profile;
|
||||
unsigned int current_profile_id;
|
||||
unsigned int current_profile_id = 0;
|
||||
|
||||
/* get current profile id */
|
||||
rc = asus_get_profile_data(device, &profile_data);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
current_profile_id = profile_data.profile_id;
|
||||
log_debug(device->ratbag, "Initial profile is %d\n", current_profile_id);
|
||||
if (device->num_profiles > 1) {
|
||||
current_profile_id = profile_data.profile_id;
|
||||
log_debug(device->ratbag, "Initial profile is %d\n", current_profile_id);
|
||||
}
|
||||
|
||||
log_debug(
|
||||
device->ratbag, "Primary version %02X.%02X.%02X\n",
|
||||
profile_data.version_primary_major,
|
||||
@@ -381,15 +384,17 @@ asus_driver_save_profiles(struct ratbag_device *device)
|
||||
int rc;
|
||||
struct asus_profile_data profile_data;
|
||||
struct ratbag_profile *profile;
|
||||
unsigned int current_profile_id;
|
||||
unsigned int current_profile_id = 0;
|
||||
|
||||
/* get current profile id */
|
||||
rc = asus_get_profile_data(device, &profile_data);
|
||||
if (rc)
|
||||
return rc;
|
||||
if (device->num_profiles > 1) {
|
||||
rc = asus_get_profile_data(device, &profile_data);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
current_profile_id = profile_data.profile_id;
|
||||
log_debug(device->ratbag, "Initial profile is %d\n", current_profile_id);
|
||||
current_profile_id = profile_data.profile_id;
|
||||
log_debug(device->ratbag, "Initial profile is %d\n", current_profile_id);
|
||||
}
|
||||
|
||||
ratbag_device_for_each_profile(device, profile) {
|
||||
if (!profile->dirty)
|
||||
|
||||
Reference in New Issue
Block a user