mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
hidpp20: do not overwrite macros when writing a profile
Same commit for hidpp20: Previously, we would put a random address in the macro value, meaning we lose the content of the macros. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
This commit is contained in:
@@ -1503,7 +1503,11 @@ hidpp20_buttons_to_cpu(struct hidpp20_device *device,
|
||||
b->macro.page,
|
||||
b->macro.offset,
|
||||
&profile->macros[i]);
|
||||
|
||||
/* the actual page is stored in the 'zero' field */
|
||||
button->macro.page = i;
|
||||
button->macro.offset = b->macro.offset;
|
||||
button->macro.zero = b->macro.page;
|
||||
break;
|
||||
case HIDPP20_BUTTON_DISABLED:
|
||||
break;
|
||||
@@ -1550,6 +1554,12 @@ hidpp20_buttons_from_cpu(struct hidpp20_profile *profile,
|
||||
break;
|
||||
case HIDPP20_BUTTON_DISABLED:
|
||||
break;
|
||||
case HIDPP20_BUTTON_MACRO:
|
||||
/* the actual page is stored in the 'zero' field */
|
||||
button->macro.page = b->macro.zero;
|
||||
button->macro.offset = b->macro.offset;
|
||||
button->macro.zero = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user