Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[develop] Fix Q1 change dip switch to bool #13687

Merged
merged 1 commit into from
Jul 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions keyboards/keychron/q1/q1.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ const matrix_row_t matrix_mask[] = {
0b0111111111111111,
};

void dip_switch_update_kb(uint8_t index, bool active) {
bool dip_switch_update_kb(uint8_t index, bool active) {
if (!dip_switch_update_user(index, active)) { return false;}
if (index == 0) {
default_layer_set(1UL << (active ? 2 : 0));
default_layer_set(1UL << (active ? 2 : 0));
}
dip_switch_update_user(index, active);
return true;
}

const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
Expand All @@ -47,7 +48,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{0, A_6, C_6, B_6},
{0, A_7, C_7, B_7},
{0, A_8, C_8, B_8},
{0, A_9, C_9, B_9},
{0, A_9, C_9, B_9},
{0, A_10, C_10, B_10},
{0, A_11, C_11, B_11},
{0, A_12, C_12, B_12},
Expand All @@ -58,7 +59,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {

{0, D_1, F_1, E_1},
{0, D_2, F_2, E_2},
{0, D_3, F_3, E_3},
{0, D_3, F_3, E_3},
{0, D_4, F_4, E_4},
{0, D_5, F_5, E_5},
{0, D_6, F_6, E_6},
Expand Down Expand Up @@ -86,8 +87,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{0, G_12, I_12, H_12},
{0, G_13, I_13, H_13},
{0, G_14, I_14, H_14},
{0, G_16, I_16, H_16},
{0, G_16, I_16, H_16},

{0, J_1, L_1, K_1},
{0, J_2, L_2, K_2},
{0, J_3, L_3, K_3},
Expand Down Expand Up @@ -116,15 +117,15 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
{1, A_12, C_12, B_12},
{1, A_14, C_14, B_14},
{1, A_15, C_15, B_15},

{1, D_1, F_1, E_1},
{1, D_2, F_2, E_2},
{1, D_3, F_3, E_3},
{1, D_7, F_7, E_7},
{1, D_11, F_11, E_11},
{1, D_12, F_12, E_12},
{1, D_13, F_13, E_13},
{1, D_14, F_14, E_14},
{1, D_13, F_13, E_13},
{1, D_14, F_14, E_14},
{1, D_15, F_15, E_15},
{1, D_16, F_16, E_16}

Expand All @@ -144,15 +145,15 @@ led_config_t g_led_config = {
{0,13}, {15,13}, {30,13}, {45,13}, {60,13}, {75,13}, {90,13}, {105,13}, {120,13}, {135,13}, {150,13}, {165,13}, {180,13}, {195,13}, {224,13},
{0,26}, {15,26}, {30,26}, {45,26}, {60,26}, {75,26}, {90,26}, {105,26}, {120,26}, {135,26}, {150,26}, {165,26}, {180,26}, {195,26}, {224,26},
{0,39}, {15,39}, {30,39}, {45,39}, {60,39}, {75,39}, {90,39}, {105,39}, {120,39}, {135,39}, {150,39}, {165,39}, {195,39}, {224,39},
{0,52}, {30,52}, {45,52}, {60,52}, {75,52}, {90,52}, {105,52}, {120,52}, {135,52}, {150,52}, {165,52}, {195,52}, {210,52},
{0,52}, {30,52}, {45,52}, {60,52}, {75,52}, {90,52}, {105,52}, {120,52}, {135,52}, {150,52}, {165,52}, {195,52}, {210,52},
{0,64}, {15,64}, {30,64}, {90,64}, {150,64}, {165,64}, {180,64}, {195,64}, {210,64}, {224,64},
},
{
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4

}
Expand Down