Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
QMK Bot 2022-09-07 21:05:23 +00:00
commit fd8875f82c
4 changed files with 5 additions and 66 deletions

View File

@ -70,12 +70,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
# if defined(KEYBOARD_keebio_iris_rev7)
[_MAIN] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLU, KC_VOLD), ENCODER_CCW_CW(KC_PGDN, KC_PGUP) },
[_FN1] = { ENCODER_CCW_CW(KC_MNXT, KC_MPRV), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_MNXT, KC_MPRV), ENCODER_CCW_CW(KC_HOME, KC_END) },
[_FN1] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_MPRV, KC_MNXT), ENCODER_CCW_CW(KC_HOME, KC_END) },
[_FN2] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) },
[_FN3] = { ENCODER_CCW_CW(RGB_SPD, RGB_SPI), ENCODER_CCW_CW(KC_UP, KC_DOWN), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_UP, KC_DOWN) },
# else
[_MAIN] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLU, KC_VOLD) },
[_FN1] = { ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_MNXT, KC_MPRV) },
[_MAIN] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_FN1] = { ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_MPRV, KC_MNXT) },
[_FN2] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) },
[_FN3] = { ENCODER_CCW_CW(RGB_SPD, RGB_SPI), ENCODER_CCW_CW(RGB_VAD, RGB_VAI) },
# endif

View File

@ -111,7 +111,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define ENABLE_RGB_MATRIX_MULTISPLASH
# define ENABLE_RGB_MATRIX_SOLID_SPLASH
# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 160
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120
# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
# define DRIVER_LED_TOTAL RGBLED_NUM
# define RGB_MATRIX_SPLIT { 34, 34 }
@ -119,9 +119,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define RGB_MATRIX_KEYPRESSES
//# endif
#endif
#define VIA_QMK_RGBLIGHT_ENABLE
// Enable the workaround for the speed parameter mismatch between RGBLIGHT and
// RGB Matrix, so that the speed slider in VIA behaves in a more useful way.
#define VIA_CUSTOM_LIGHTING_ENABLE

View File

@ -63,61 +63,6 @@ led_config_t g_led_config = { {
} };
# if defined(VIA_ENABLE) && defined(VIA_CUSTOM_LIGHTING_ENABLE)
// VIA supports only 4 discrete values for effect speed; map these to some
// useful speed values for RGB Matrix.
enum speed_values {
RGBLIGHT_SPEED_0 = UINT8_MAX / 16, // not 0 to avoid really slow effects
RGBLIGHT_SPEED_1 = UINT8_MAX / 4,
RGBLIGHT_SPEED_2 = UINT8_MAX / 2, // matches the default value
RGBLIGHT_SPEED_3 = UINT8_MAX / 4 * 3, // UINT8_MAX is really fast
};
static uint8_t speed_from_rgblight(uint8_t rgblight_speed) {
switch (rgblight_speed) {
case 0:
return RGBLIGHT_SPEED_0;
case 1:
return RGBLIGHT_SPEED_1;
case 2:
default:
return RGBLIGHT_SPEED_2;
case 3:
return RGBLIGHT_SPEED_3;
}
}
static uint8_t speed_to_rgblight(uint8_t rgb_matrix_speed) {
if (rgb_matrix_speed < ((RGBLIGHT_SPEED_0 + RGBLIGHT_SPEED_1) / 2)) {
return 0;
} else if (rgb_matrix_speed < ((RGBLIGHT_SPEED_1 + RGBLIGHT_SPEED_2) / 2)) {
return 1;
} else if (rgb_matrix_speed < ((RGBLIGHT_SPEED_2 + RGBLIGHT_SPEED_3) / 2)) {
return 2;
} else {
return 3;
}
}
void raw_hid_receive_kb(uint8_t *data, uint8_t length) {
switch (data[0]) {
case id_lighting_get_value:
if (data[1] == id_qmk_rgblight_effect_speed) {
data[2] = speed_to_rgblight(rgb_matrix_get_speed());
}
break;
case id_lighting_set_value:
if (data[1] == id_qmk_rgblight_effect_speed) {
rgb_matrix_set_speed_noeeprom(speed_from_rgblight(data[2]));
}
break;
}
}
# endif // defined(VIA_ENABLE) && defined(VIA_CUSTOM_LIGHTING_ENABLE)
#endif
#ifdef ENCODER_ENABLE

View File

@ -111,7 +111,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define ENABLE_RGB_MATRIX_MULTISPLASH
//# define ENABLE_RGB_MATRIX_SOLID_SPLASH
//# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 160
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120
# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
# define DRIVER_LED_TOTAL RGBLED_NUM
# define RGB_MATRIX_SPLIT { 34, 34 }