mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
hidpp20: move up hidpp20_internal_profile
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
This commit is contained in:
@@ -1051,6 +1051,30 @@ int hidpp20_adjustable_dpi_set_sensor_dpi(struct hidpp20_device *device,
|
||||
#define HIDPP20_ONBOARD_PROFILES_PROFILE_TYPE_G900 0x03
|
||||
#define HIDPP20_ONBOARD_PROFILES_MACRO_TYPE_G402 0x01
|
||||
|
||||
union hidpp20_internal_profile {
|
||||
uint8_t data[HIDPP20_PROFILE_SIZE];
|
||||
struct {
|
||||
uint8_t report_rate;
|
||||
uint8_t default_dpi;
|
||||
uint8_t switched_dpi;
|
||||
uint16_t dpi[5];
|
||||
struct hidpp20_color profile_color;
|
||||
uint8_t power_mode;
|
||||
uint8_t angle_snapping;
|
||||
uint8_t reserved[14];
|
||||
union hidpp20_button_binding buttons[16];
|
||||
union hidpp20_button_binding alternate_buttons[16];
|
||||
union {
|
||||
char txt[16 * 3];
|
||||
uint8_t raw[16 * 3];
|
||||
} name;
|
||||
struct hidpp20_internal_led leds[2]; /* G303, g502, g900 only */
|
||||
uint8_t free[24];
|
||||
uint16_t crc;
|
||||
} __attribute__((packed)) profile;
|
||||
};
|
||||
_Static_assert(sizeof(union hidpp20_internal_profile) == HIDPP20_PROFILE_SIZE, "Invalid size");
|
||||
|
||||
int
|
||||
hidpp20_onboard_profiles_get_profiles_desc(struct hidpp20_device *device,
|
||||
struct hidpp20_onboard_profiles_info *info)
|
||||
@@ -1804,30 +1828,6 @@ hidpp20_onboard_profiles_set_enable_profile(struct hidpp20_device *device,
|
||||
return rc;
|
||||
}
|
||||
|
||||
union hidpp20_internal_profile {
|
||||
uint8_t data[HIDPP20_PROFILE_SIZE];
|
||||
struct {
|
||||
uint8_t report_rate;
|
||||
uint8_t default_dpi;
|
||||
uint8_t switched_dpi;
|
||||
uint16_t dpi[5];
|
||||
struct hidpp20_color profile_color;
|
||||
uint8_t power_mode;
|
||||
uint8_t angle_snapping;
|
||||
uint8_t reserved[14];
|
||||
union hidpp20_button_binding buttons[16];
|
||||
union hidpp20_button_binding alternate_buttons[16];
|
||||
union {
|
||||
char txt[16 * 3];
|
||||
uint8_t raw[16 * 3];
|
||||
} name;
|
||||
struct hidpp20_internal_led leds[2]; /* G303, g502, g900 only */
|
||||
uint8_t free[24];
|
||||
uint16_t crc;
|
||||
} __attribute__((packed)) profile;
|
||||
};
|
||||
_Static_assert(sizeof(union hidpp20_internal_profile) == HIDPP20_PROFILE_SIZE, "Invalid size");
|
||||
|
||||
static void
|
||||
hidpp20_buttons_to_cpu(struct hidpp20_device *device,
|
||||
struct hidpp20_profiles *profiles,
|
||||
|
||||
Reference in New Issue
Block a user