summaryrefslogtreecommitdiff
path: root/keyboards/hub20/hub20.c
blob: f7171c521930ac1b76acb3ae0bf62ffd95377828 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
/* Copyright 2020 joshajohnson 2021 peepeetee
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "hub20.h"


#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = { {
    // Key Matrix to LED Index
    {NO_LED,NO_LED,NO_LED,NO_LED},
    { 7,      8,      9,     10},
    { 11,    12,     13,     14},
    { 15,    16,     17,     18},
    { 19,    20,     21,     22},
    { 23,    24,     25,     26}
    //todo: assign leds to keys differently for the different layouts
}, {
    // LED Index to Physical Position
    { 190, 50}, { 111, 50}, { 35, 50}, {38, 0}, {38, 35}, {186, 35}, {186, 0}, // UNDERGLOW
    //todo: underglow location needs to be recalculated. The top row is above row 4, and for now they have the same y value 0
    {  0,  0}, {75,  0}, {150,  0}, {225,  0}, // row 4
    {  0, 16}, {75, 16}, {150, 16}, {225, 16}, // row 3
    {  0, 32}, {75, 32}, {150, 32}, {225, 32}, // row 2
    {  0, 48}, {75, 48}, {150, 48}, {225, 48}, // row 1
    {  0, 64}, {75, 64}, {150, 64}, {225, 64}  // row 0

}, {
    // LED Index to Flag
    LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW,  // UNDERGLOW
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,           // row 4
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,           // row 3
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,           // row 2
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,           // row 1
    LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT            // row 0

} };
#endif



// #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER && LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO
// #error lower left enter conflicts with lower left zero
// #endif

// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER && LED_MERGE_NUMPAD_LEFT_HANDED_ZERO
// #error lower right enter conflicts with lower right zero
// #endif

//     /* LAYOUT_left_handed


//      *     ┌───┬───┐
//      *     │01 │02 │
//      * ┌───┼───┼───┼───┐
//      * │10 │11 │12 │13 │
//      * ├───┼───┼───┼───┤
//      * │   │21 │22 │23 │
//      * │20 ├───┼───┼───┤
//      * │   │31 │32 │33 │
//      * ├───┼───┼───┼───┤
//      * │   │41 │42 │43 │
//      * │40 ├───┼───┴───┤
//      * │   │51 │  52   │
//      * └───┴───┴───────┘
//      */

// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20
// #define LED_MERGE_NUMPAD_LEFT_HANDED_PLUS FALSE
// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_PLUS

// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40
// #define LED_MERGE_NUMPAD_LEFT_HANDED_ENTER FALSE
// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ENTER

// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52
// #define LED_MERGE_NUMPAD_LEFT_HANDED_ZERO FALSE
// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ZERO


//     /* LAYOUT_right_handed


//      *     ┌───┬───┐
//      *     │01 │02 │
//      * ┌───┼───┼───┼───┐
//      * │10 │11 │12 │13 │
//      * ├───┼───┼───┼───┤
//      * │20 │21 │22 │   │
//      * ├───┼───┼───┤23 │
//      * │30 │31 │32 │   │
//      * ├───┼───┼───┼───┤
//      * │40 │41 │42 │   │
//      * ├───┴───┼───┤43 │
//      * │  50   │52 │   │
//      * └───────┴───┴───┘
//      */
//         //LOCATION OF bottom row 0 NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER

// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS FALSE
// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS

// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER FALSE
// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER

// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO // key 50 (confirm with manufacturer)
// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO FALSE
// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO

// uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {
// // Keys here have 2 leds. Here we add the led that is not bound to the key
// // and the default led would be added
// // by the default code that runs after this in rgb_matrix_map_row_column_to_led

// uint8_t counter = 0;

// #if LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20, leds 7 and 11, 7 already bound

//     if (row == 2 && column == 0) {
//         led_i[counter] = 11;
//         counter ++;
//     }
// #endif
// #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40, leds 19 and 23, 23 already bound
//     if (row == 4 && column == 0) {
//         led_i[counter] = 23;
//         counter ++;
//     }
// #endif
// #if LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52, leds 25 and 26, 26 already bound
//     if (row == 5 && column == 2) {
//         led_i[counter] = 26;
//         counter ++;
//     }
// #endif

// #if LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23, led 14 and 18, 14 already bound
//     if (row == 2 && column == 3) {
//         led_i[counter] = 18;
//         counter ++;
//     }
// #endif
// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43, led 22 and 26, 22 already bound
//     if (row == 4 && column == 3) {
//         led_i[counter] = 26;
//         counter ++;
//     }
// #endif
// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO  // key 50 (confirm with manufacturer)
// // LED 23 and 24, 23(?) already bound
//     if (row == 5 && column == 0) {
//         led_i[counter] = 24;
//         counter ++;
//     }
// #endif
//     return counter;
// }