1
0
Fork 0

VIA compile fixes (#13054)

This commit is contained in:
Xelus22 2021-06-01 14:56:23 +10:00 committed by GitHub
parent 6bafefa886
commit 5a06813b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 106 additions and 68 deletions

View file

@ -1,2 +1,4 @@
RGB_MATRIX_ENABLE = yes # Enable RGB matrix RGB_MATRIX_ENABLE = yes # Enable RGB matrix
RGB_MATRIX_DRIVER = WS2812 # Set Driver to WS2812 RGB_MATRIX_DRIVER = WS2812 # Set Driver to WS2812
LTO_ENABLE = yes

View file

@ -1,2 +1,4 @@
RGB_MATRIX_ENABLE = yes # Enable RGB matrix RGB_MATRIX_ENABLE = yes # Enable RGB matrix
RGB_MATRIX_DRIVER = WS2812 # Set Driver to WS2812 RGB_MATRIX_DRIVER = WS2812 # Set Driver to WS2812
LTO_ENABLE = yes

View file

@ -44,8 +44,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
}; };
void rgb_matrix_indicators_user(void) { void rgb_matrix_indicators_user(void) {
if (!g_suspend_state && layer_state_is(1)) { if (layer_state_is(1)) {
rgb_matrix_set_color(77,0xFF, 0x80, 0x00); rgb_matrix_set_color(77,0xFF, 0x80, 0x00);
} }
if (host_keyboard_led_state().caps_lock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,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT, KC_P0 ,KC_P0 ,KC_PDOT,KC_PENT),
[1] = LAYOUT_RH_ANY( [1] = LAYOUT_rh_any(
RESET ,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RESET ,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,
_______,_______,_______,_______,RESET ,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, _______,_______,_______,_______,RESET ,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,
@ -36,7 +36,7 @@ RESET ,_______,_______,_______,_______,_______,_______, _______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,
_______,_______, _______,_______,_______, _______, _______, _______,_______,_______,_______,_______, _______,_______,_______,_______), _______,_______, _______,_______,_______, _______, _______, _______,_______,_______,_______,_______, _______,_______,_______,_______),
[2] = LAYOUT_RH_ANY( [2] = LAYOUT_rh_any(
_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,
_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,

View file

@ -56,3 +56,34 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS KC_TRNS, KC_TRNS
), ),
}; };
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (get_highest_layer(layer_state) == 0) {
uint16_t mapped_code = 0;
if (clockwise) {
mapped_code = handle_encoder_cw();
} else {
mapped_code = handle_encoder_ccw();
}
if (mapped_code != 0) {
tap_code16(mapped_code);
}
} else {
if (clockwise) {
if (oled_mode == OLED_MODE_CALC) {
handle_encoder_cw();
} else if (oled_mode == OLED_MODE_DEFAULT) {
change_encoder_mode(false);
}
} else {
if (oled_mode == OLED_MODE_CALC) {
handle_encoder_ccw();
} else if (oled_mode == OLED_MODE_DEFAULT) {
change_encoder_mode(true);
}
}
}
}
return true;
}

View file

@ -51,3 +51,34 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS KC_TRNS, KC_TRNS
), ),
}; };
bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (get_highest_layer(layer_state) == 0) {
uint16_t mapped_code = 0;
if (clockwise) {
mapped_code = handle_encoder_cw();
} else {
mapped_code = handle_encoder_ccw();
}
if (mapped_code != 0) {
tap_code16(mapped_code);
}
} else {
if (clockwise) {
if (oled_mode == OLED_MODE_CALC) {
handle_encoder_cw();
} else if (oled_mode == OLED_MODE_DEFAULT) {
change_encoder_mode(false);
}
} else {
if (oled_mode == OLED_MODE_CALC) {
handle_encoder_ccw();
} else if (oled_mode == OLED_MODE_DEFAULT) {
change_encoder_mode(true);
}
}
}
}
return true;
}

View file

@ -73,36 +73,7 @@ bool led_update_kb(led_t led_state) {
return true; return true;
} }
__attribute__ ((weak)) void encoder_update_user(uint8_t index, bool clockwise) { bool encoder_update_kb(uint8_t index, bool clockwise) {
if (index == 0) { if (!encoder_update_user(index, clockwise)) { return false; }
if (get_highest_layer(layer_state) == 0) { return true;
uint16_t mapped_code = 0;
if (clockwise) {
mapped_code = handle_encoder_cw();
} else {
mapped_code = handle_encoder_ccw();
}
if (mapped_code != 0) {
tap_code16(mapped_code);
}
} else {
if (clockwise) {
if (oled_mode == OLED_MODE_CALC) {
handle_encoder_cw();
} else if (oled_mode == OLED_MODE_DEFAULT) {
change_encoder_mode(false);
}
} else {
if (oled_mode == OLED_MODE_CALC) {
handle_encoder_ccw();
} else if (oled_mode == OLED_MODE_DEFAULT) {
change_encoder_mode(true);
}
}
}
}
}
void encoder_update_kb(uint8_t index, bool clockwise) {
encoder_update_user(index, clockwise);
} }