1
0
Fork 0

VIA V3 - The Custom UI Update (#18222)

This commit is contained in:
Wilba 2022-11-10 07:46:44 +11:00 committed by GitHub
parent 575b0e33fa
commit bc6f8dc8b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
68 changed files with 751 additions and 886 deletions

View file

@ -132,36 +132,45 @@ void suspend_wakeup_init_kb(void)
// Moving this to the bottom of this source file is a workaround
// for an intermittent compiler error for Atmel compiler.
#ifdef VIA_ENABLE
void raw_hid_receive_kb(uint8_t *data, uint8_t length) {
uint8_t *command_id = &(data[0]);
uint8_t *command_data = &(data[1]);
switch ( *command_id )
{
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
uint8_t *command_id = &(data[0]);
uint8_t *channel_id = &(data[1]);
uint8_t *value_id_and_data = &(data[2]);
#if RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED
case id_lighting_set_value:
if ( *channel_id == id_custom_channel ) {
switch ( *command_id )
{
backlight_config_set_value(command_data);
break;
}
case id_lighting_get_value:
{
backlight_config_get_value(command_data);
break;
}
case id_lighting_save:
{
backlight_config_save();
break;
}
#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED
default:
{
// Unhandled message.
*command_id = id_unhandled;
*command_data = *command_data; // force use of variable
break;
case id_custom_set_value:
{
backlight_config_set_value(value_id_and_data);
break;
}
case id_custom_get_value:
{
backlight_config_get_value(value_id_and_data);
break;
}
case id_custom_save:
{
backlight_config_save();
break;
}
default:
{
// Unhandled message.
*command_id = id_unhandled;
break;
}
}
return;
}
#else
*command_id = id_unhandled;
*channel_id = *channel_id; // force use of variable
*value_id_and_data = *value_id_and_data; // force use of variable
#endif // RGB_BACKLIGHT_ENABLED || MONO_BACKLIGHT_ENABLED
// DO NOT call raw_hid_send(data,length) here, let caller do this
}
#endif // VIA_ENABLE