aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/duck/eagle_viper/readme.md6
-rw-r--r--keyboards/duck/eagle_viper/v2/matrix.c60
-rw-r--r--keyboards/duck/eagle_viper/v2/readme.md2
3 files changed, 31 insertions, 37 deletions
diff --git a/keyboards/duck/eagle_viper/readme.md b/keyboards/duck/eagle_viper/readme.md
index 3fec11bc0..63623940b 100644
--- a/keyboards/duck/eagle_viper/readme.md
+++ b/keyboards/duck/eagle_viper/readme.md
@@ -2,10 +2,6 @@
2 2
3Non official firmware for custom Korean keyboard with 60% key layout made by Duck. 3Non official firmware for custom Korean keyboard with 60% key layout made by Duck.
4 4
5See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information.
6
7Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127) 5Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127)
8 6
9Make example for this keyboard (after setting up your build environment): 7See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
10
11 make duck/eagle_viper/v2:default
diff --git a/keyboards/duck/eagle_viper/v2/matrix.c b/keyboards/duck/eagle_viper/v2/matrix.c
index a6bc56342..b705ae49f 100644
--- a/keyboards/duck/eagle_viper/v2/matrix.c
+++ b/keyboards/duck/eagle_viper/v2/matrix.c
@@ -123,31 +123,27 @@ void matrix_print(void) {
123 } 123 }
124} 124}
125 125
126/* Row pin configuration 126/* Row pin configuration - diode connected
127 * row: 0 1 2 3 4 5 127 * row: 0 1 2 3 4
128 * pin: PB7 PD0 PD1 PD2 PD3 PD5 128 * pin: PD0 PD1 PD2 PD3 PD5
129 * 129 *
130 * Esc uses its own pin PE2 130 * Caps Lock uses its own pin PE2 on the column pin, row pin is grounded
131 */ 131 */
132static void init_rows(void) { 132static void init_rows(void) {
133 DDRD &= ~0b00101111; 133 DDRD &= ~0b00101111;
134 PORTD &= ~0b00101111; 134 PORTD &= ~0b00101111;
135 135
136 DDRB &= ~0b10000000;
137 PORTB &= ~0b10000000;
138
139 DDRE &= ~0b00000100; 136 DDRE &= ~0b00000100;
140 PORTE |= 0b00000100; 137 PORTE |= 0b00000100;
141} 138}
142 139
143static uint8_t read_rows(uint8_t col) { 140static uint8_t read_rows(uint8_t col) {
144 141
145 return (PIND&(1<<0) ? (1<<0) : 0) | 142 return (PIND&(1<<0) ? (1<<0) : 0) |
146 (PIND&(1<<1) ? (1<<1) : 0) | 143 (PIND&(1<<1) ? (1<<1) : 0) |
147 (PIND&(1<<2) ? (1<<2) : 0) | 144 (PIND&(1<<2) ? (1<<2) : 0) |
148 (PIND&(1<<3) ? (1<<3) : 0) | 145 (PIND&(1<<3) ? (1<<3) : 0) |
149 (PIND&(1<<5) ? (1<<4) : 0) | 146 (PIND&(1<<5) ? (1<<4) : 0) |
150 (PINB&(1<<7) ? (1<<5) : 0) |
151 (col==0 ? ((PINE&(1<<2) ? 0 : (1<<2))) : 0); 147 (col==0 ? ((PINE&(1<<2) ? 0 : (1<<2))) : 0);
152 148
153} 149}
@@ -158,24 +154,31 @@ uint8_t read_fwkey(void)
158} 154}
159 155
160/* Columns 0 - 15 156/* Columns 0 - 15
157 *
158 * atmega32u4 decoder pin
159 * PC6 U1 E3
160 * PB6 U2 E3
161 * PF0 U1, U2 A0
162 * PF1 U1, U2 A1
163 * PC7 U1, U2 A2
164 *
161 * These columns uses two 74HC237D 3 to 8 bit demultiplexers. 165 * These columns uses two 74HC237D 3 to 8 bit demultiplexers.
162 * col / pin: PC6 PB6 PF0 PF1 PC7 166 * col / pin: PC6 PB6 PF0 PF1 PC7 Decoder Pin
163 * 0: 1 0 0 0 0 167 * 0: 1 0 0 0 0 U1 Y0
164 * 1: 1 0 1 0 0 168 * 1: 1 0 1 0 0 U1 Y1
165 * 2: 1 0 0 1 0 169 * 2: 1 0 0 1 0 U1 Y2
166 * 3: 1 0 1 1 0 170 * 3: 1 0 1 1 0 U1 Y3
167 * 4: 1 0 0 0 1 171 * 4: 1 0 0 0 1 U1 Y4
168 * 5: 1 0 1 0 1 172 * 5: 1 0 1 0 1 U1 Y5
169 * 6: 1 0 0 1 1 173 * 6: 1 0 0 1 1 U1 Y6
170 * 7: 1 0 1 1 1 174 * 7: 1 0 1 1 1 U1 Y7
171 * 8: 0 1 0 0 0 175 * 8: 0 1 0 0 0 U2 Y0
172 * 9: 0 1 1 0 0 176 * 9: 0 1 1 0 0 U2 Y1
173 * 10: 0 1 0 1 0 177 * 10: 0 1 0 1 0 U2 Y2
174 * 11: 0 1 1 1 0 178 * 11: 0 1 1 1 0 U2 Y3
175 * 12: 0 1 0 0 1 179 * 12: 0 1 0 0 1 U2 Y4
176 * 13: 0 1 1 0 1 180 * 13: 0 1 1 0 1 U2 Y5
177 * 14: 0 1 0 1 1 181 * 14: 0 1 0 1 1 U2 Y6
178 * 15: 0 1 1 1 1
179 * 182 *
180 */ 183 */
181static void unselect_cols(void) { 184static void unselect_cols(void) {
@@ -251,10 +254,5 @@ static void select_col(uint8_t col) {
251 PORTF |= 0b00000010; 254 PORTF |= 0b00000010;
252 PORTC |= 0b10000000; 255 PORTC |= 0b10000000;
253 break; 256 break;
254 case 15:
255 PORTB |= 0b01000000;
256 PORTF |= 0b00000011;
257 PORTC |= 0b10000000;
258 break;
259 } 257 }
260} 258}
diff --git a/keyboards/duck/eagle_viper/v2/readme.md b/keyboards/duck/eagle_viper/v2/readme.md
index 31f70b93b..2dca0b5b7 100644
--- a/keyboards/duck/eagle_viper/v2/readme.md
+++ b/keyboards/duck/eagle_viper/v2/readme.md
@@ -13,7 +13,7 @@ Make example for this keyboard (after setting up your build environment):
13 13
14**Reset Key:** To put the Eagle/Viper V2 into reset, hold caps lock key (`K2A`) while plugging in. 14**Reset Key:** To put the Eagle/Viper V2 into reset, hold caps lock key (`K2A`) while plugging in.
15 15
16See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. 16See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
17 17
18## Hardware Notes 18## Hardware Notes
19 19