1
0
forked from drath/libratbag

Merge pull request #21 from phomes/master

Read colors from profiles in hidpp10
This commit is contained in:
Peter Hutterer
2015-09-18 01:16:40 +10:00
2 changed files with 11 additions and 2 deletions

View File

@@ -389,7 +389,10 @@ union _hidpp10_button_binding {
_Static_assert(sizeof(union _hidpp10_button_binding) == 3, "Invalid size");
struct _hidpp10_profile {
uint8_t unknown[4];
uint8_t red;
uint8_t green;
uint8_t blue;
uint8_t unknown;
struct _hidpp10_dpi_mode dpi_modes[PROFILE_NUM_DPI_MODES];
uint8_t angle_correction;
uint8_t default_dpi_mode;
@@ -440,7 +443,7 @@ hidpp10_get_profile(struct hidpp10_device *dev, int8_t number, struct hidpp10_pr
struct hidpp10_profile profile;
/* FIXME: profile offset appears to be 3, 1 and 2 are garbage */
number += 3;
number += 2;
log_raw(dev->ratbag_device->ratbag, "Fetching profile %d\n", number);
@@ -450,6 +453,9 @@ hidpp10_get_profile(struct hidpp10_device *dev, int8_t number, struct hidpp10_pr
return res;
}
profile.red = p->red;
profile.green = p->green;
profile.blue = p->blue;
profile.angle_correction = p->angle_correction;
profile.default_dpi_mode = p->default_dpi_mode;
profile.refresh_rate = p->usb_refresh_rate ? 1000/p->usb_refresh_rate : 0;

View File

@@ -132,6 +132,9 @@ struct hidpp10_profile {
} dpi_modes[5];
size_t num_dpi_modes;
uint8_t red;
uint8_t green;
uint8_t blue;
bool angle_correction;
uint8_t default_dpi_mode;
uint16_t refresh_rate;