diff options
Diffstat (limited to 'keyboards/bpiphany/pegasushoof/2015')
-rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/2015.c | 25 | ||||
-rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/2015.h | 102 | ||||
-rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/config.h | 37 | ||||
-rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/matrix.c | 158 | ||||
-rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/rules.mk | 2 |
5 files changed, 324 insertions, 0 deletions
diff --git a/keyboards/bpiphany/pegasushoof/2015/2015.c b/keyboards/bpiphany/pegasushoof/2015/2015.c new file mode 100644 index 000000000..401dc2633 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/2015.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | Copyright 2016 Daniel Svensson <[email protected]> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #include "2015.h" | ||
19 | |||
20 | |||
21 | extern inline void ph_caps_led_on(void); | ||
22 | extern inline void ph_caps_led_off(void); | ||
23 | |||
24 | extern inline void ph_sclk_led_on(void); | ||
25 | extern inline void ph_sclk_led_off(void); | ||
diff --git a/keyboards/bpiphany/pegasushoof/2015/2015.h b/keyboards/bpiphany/pegasushoof/2015/2015.h new file mode 100644 index 000000000..418772aa2 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/2015.h | |||
@@ -0,0 +1,102 @@ | |||
1 | /* | ||
2 | Copyright 2016 Daniel Svensson <[email protected]> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | #include "matrix.h" | ||
21 | #include "quantum.h" | ||
22 | |||
23 | #define ___ XXXXXXX | ||
24 | |||
25 | #define LAYOUT( \ | ||
26 | KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ | ||
27 | KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ | ||
28 | KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ | ||
29 | KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ | ||
30 | KN2, KI6, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ | ||
31 | KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ | ||
32 | ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ | ||
33 | /* 0 */ { ___ , KB0 , KC0 , KD0 , ___ , KF0 , KG0 , ___ , ___ , ___ , KK0 , KL0 , ___ , ___ , KO0 , ___ , ___ , KR0 }, \ | ||
34 | /* 1 */ { KA1 , KB1 , ___ , KD1 , KE1 , KF1 , KG1 , KH1 , KI1 , KJ1 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ }, \ | ||
35 | /* 2 */ { ___ , KB2 , ___ , KD2 , KE2 , KF2 , KG2 , KH2 , KI2 , KJ2 , ___ , ___ , ___ , KN2 , ___ , KP2 , ___ , KR2 }, \ | ||
36 | /* 3 */ { ___ , KB3 , ___ , KD3 , KE3 , KF3 , KG3 , KH3 , KI3 , KJ3 , ___ , ___ , KM3 , KN3 , ___ , ___ , ___ , KR3 }, \ | ||
37 | /* 4 */ { KA4 , KB4 , ___ , KD4 , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , ___ , ___ , KO4 , ___ , KQ4 , KR4 }, \ | ||
38 | /* 5 */ { KA5 , ___ , KC5 , KD5 , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , KR5 }, \ | ||
39 | /* 6 */ { ___ , KB6 , KC6 , ___ , KE6 , KF6 , KG6 , KH6 , KI6 , KJ6 , KK6 , ___ , ___ , ___ , KO6 , ___ , ___ , KR6 }, \ | ||
40 | /* 7 */ { KA7 , KB7 , KC7 , KD7 , KE7 , KF7 , KG7 , KH7 , KI7 , KJ7 , ___ , ___ , ___ , ___ , KO7 , ___ , KQ7 , KR7 } \ | ||
41 | } | ||
42 | |||
43 | #define LAYOUT_tkl_ansi( \ | ||
44 | KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ | ||
45 | KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ | ||
46 | KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ | ||
47 | KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ | ||
48 | KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ | ||
49 | KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ | ||
50 | ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ | ||
51 | /* 0 */ { ___ , KB0 , KC0 , KD0 , ___ , KF0 , KG0 , ___ , ___ , ___ , KK0 , KL0 , ___ , ___ , KO0 , ___ , ___ , KR0 }, \ | ||
52 | /* 1 */ { KA1 , KB1 , ___ , KD1 , KE1 , KF1 , KG1 , KH1 , KI1 , KJ1 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ }, \ | ||
53 | /* 2 */ { ___ , KB2 , ___ , KD2 , KE2 , KF2 , KG2 , KH2 , KI2 , KJ2 , ___ , ___ , ___ , KN2 , ___ , KP2 , ___ , KR2 }, \ | ||
54 | /* 3 */ { ___ , KB3 , ___ , KD3 , KE3 , KF3 , KG3 , KH3 , KI3 , KJ3 , ___ , ___ , KM3 , KN3 , ___ , ___ , ___ , KR3 }, \ | ||
55 | /* 4 */ { KA4 , KB4 , ___ , KD4 , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , ___ , ___ , KO4 , ___ , KQ4 , KR4 }, \ | ||
56 | /* 5 */ { KA5 , ___ , KC5 , KD5 , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , KR5 }, \ | ||
57 | /* 6 */ { ___ , KB6 , KC6 , ___ , KE6 , KF6 , KG6 , KH6 , ___ , KJ6 , KK6 , ___ , ___ , ___ , KO6 , ___ , ___ , KR6 }, \ | ||
58 | /* 7 */ { KA7 , KB7 , KC7 , KD7 , KE7 , KF7 , KG7 , KH7 , KI7 , KJ7 , ___ , ___ , ___ , ___ , KO7 , ___ , KQ7 , KR7 } \ | ||
59 | } | ||
60 | |||
61 | #define LAYOUT_tkl_iso( \ | ||
62 | KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ | ||
63 | KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ | ||
64 | KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KK4, KO7, KQ7, \ | ||
65 | KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB3, KB1, \ | ||
66 | KN2, KI6, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ | ||
67 | KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ | ||
68 | ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ | ||
69 | /* 0 */ { ___ , KB0 , KC0 , KD0 , ___ , KF0 , KG0 , ___ , ___ , ___ , KK0 , KL0 , ___ , ___ , KO0 , ___ , ___ , KR0 }, \ | ||
70 | /* 1 */ { KA1 , KB1 , ___ , KD1 , KE1 , KF1 , KG1 , KH1 , KI1 , KJ1 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , ___ }, \ | ||
71 | /* 2 */ { ___ , KB2 , ___ , KD2 , KE2 , KF2 , KG2 , KH2 , KI2 , KJ2 , ___ , ___ , ___ , KN2 , ___ , KP2 , ___ , KR2 }, \ | ||
72 | /* 3 */ { ___ , KB3 , ___ , KD3 , KE3 , KF3 , KG3 , KH3 , KI3 , KJ3 , ___ , ___ , KM3 , KN3 , ___ , ___ , ___ , KR3 }, \ | ||
73 | /* 4 */ { KA4 , KB4 , ___ , KD4 , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , ___ , ___ , KO4 , ___ , KQ4 , KR4 }, \ | ||
74 | /* 5 */ { KA5 , ___ , KC5 , KD5 , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , KR5 }, \ | ||
75 | /* 6 */ { ___ , KB6 , KC6 , ___ , KE6 , KF6 , KG6 , KH6 , KI6 , KJ6 , KK6 , ___ , ___ , ___ , KO6 , ___ , ___ , KR6 }, \ | ||
76 | /* 7 */ { KA7 , KB7 , KC7 , KD7 , KE7 , KF7 , KG7 , KH7 , KI7 , KJ7 , ___ , ___ , ___ , ___ , KO7 , ___ , KQ7 , KR7 } \ | ||
77 | } | ||
78 | |||
79 | #define LAYOUT_tkl_jis( \ | ||
80 | KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ | ||
81 | KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB5, KB2, KL4, KO4, KQ4, \ | ||
82 | KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KK4, KO7, KQ7, \ | ||
83 | KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB3, KB1, \ | ||
84 | KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KE0, KN3, KO6, \ | ||
85 | KA4, KP2, KC6, KJ0, KK6, KI0, KH0, KC0, KD0, KA1, KO0, KK0, KL0 \ | ||
86 | ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ | ||
87 | /* 0 */ { ___ , KB0 , KC0 , KD0 , KE0 , KF0 , KG0 , KH0 , KI0 , KJ0 , KK0 , KL0 , ___ , ___ , KO0 , ___ , ___ , KR0 }, \ | ||
88 | /* 1 */ { KA1 , KB1 , ___ , KD1 , KE1 , KF1 , KG1 , KH1 , KI1 , KJ1 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , }, \ | ||
89 | /* 2 */ { ___ , KB2 , ___ , KD2 , KE2 , KF2 , KG2 , KH2 , KI2 , KJ2 , ___ , ___ , ___ , KN2 , ___ , KP2 , ___ , KR2 }, \ | ||
90 | /* 3 */ { ___ , KB3 , ___ , KD3 , KE3 , KF3 , KG3 , KH3 , KI3 , KJ3 , ___ , ___ , ___ , KN3 , ___ , ___ , ___ , KR3 }, \ | ||
91 | /* 4 */ { KA4 , KB4 , ___ , KD4 , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , ___ , ___ , KO4 , ___ , KQ4 , KR4 }, \ | ||
92 | /* 5 */ { KA5 , KB5 , KC5 , KD5 , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , KR5 }, \ | ||
93 | /* 6 */ { ___ , KB6 , KC6 , ___ , KE6 , KF6 , KG6 , KH6 , ___ , KJ6 , KK6 , ___ , ___ , ___ , KO6 , ___ , ___ , KR6 }, \ | ||
94 | /* 7 */ { KA7 , KB7 , KC7 , KD7 , KE7 , KF7 , KG7 , KH7 , KI7 , KJ7 , ___ , ___ , ___ , ___ , KO7 , ___ , KQ7 , KR7 } \ | ||
95 | } | ||
96 | |||
97 | inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } | ||
98 | inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); } | ||
99 | |||
100 | inline void ph_sclk_led_on(void) { DDRC |= (1<<5); PORTC &= ~(1<<5); } | ||
101 | inline void ph_sclk_led_off(void) { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } | ||
102 | |||
diff --git a/keyboards/bpiphany/pegasushoof/2015/config.h b/keyboards/bpiphany/pegasushoof/2015/config.h new file mode 100644 index 000000000..479175c47 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/config.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | Copyright 2016 Daniel Svensson <[email protected]> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | |||
21 | /* USB Device descriptor parameter */ | ||
22 | #define VENDOR_ID 0xFEED | ||
23 | #define PRODUCT_ID 0x6050 | ||
24 | #define DEVICE_VER 0x0104 | ||
25 | #define MANUFACTURER Filco | ||
26 | #define PRODUCT Majestouch TKL \\w The Pegasus Hoof 2015 | ||
27 | |||
28 | /* key matrix size */ | ||
29 | #define MATRIX_ROWS 8 | ||
30 | #define MATRIX_COLS 18 | ||
31 | |||
32 | /* COL2ROW or ROW2COL */ | ||
33 | #define DIODE_DIRECTION COL2ROW | ||
34 | |||
35 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
36 | #define DEBOUNCE 5 | ||
37 | |||
diff --git a/keyboards/bpiphany/pegasushoof/2015/matrix.c b/keyboards/bpiphany/pegasushoof/2015/matrix.c new file mode 100644 index 000000000..b05869fed --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/matrix.c | |||
@@ -0,0 +1,158 @@ | |||
1 | /* | ||
2 | Copyright 2014 Ralf Schmitt <[email protected]> | ||
3 | Copyright 2016 Daniel Svensson <[email protected]> | ||
4 | |||
5 | This program is free software: you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation, either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #include <stdint.h> | ||
20 | #include <stdbool.h> | ||
21 | #include <avr/io.h> | ||
22 | #include <util/delay.h> | ||
23 | #include "wait.h" | ||
24 | #include "print.h" | ||
25 | #include "debug.h" | ||
26 | #include "util.h" | ||
27 | #include "matrix.h" | ||
28 | #include "debounce.h" | ||
29 | |||
30 | static matrix_row_t matrix[MATRIX_ROWS]; | ||
31 | static matrix_row_t matrix_debouncing[MATRIX_ROWS]; | ||
32 | |||
33 | static matrix_row_t read_cols(void); | ||
34 | static void select_row(uint8_t col); | ||
35 | |||
36 | // user-defined overridable functions | ||
37 | |||
38 | __attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } | ||
39 | |||
40 | __attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } | ||
41 | |||
42 | __attribute__((weak)) void matrix_init_user(void) {} | ||
43 | |||
44 | __attribute__((weak)) void matrix_scan_user(void) {} | ||
45 | |||
46 | // helper functions | ||
47 | |||
48 | inline uint8_t matrix_rows(void) | ||
49 | { | ||
50 | return MATRIX_ROWS; | ||
51 | } | ||
52 | |||
53 | inline uint8_t matrix_cols(void) | ||
54 | { | ||
55 | return MATRIX_COLS; | ||
56 | } | ||
57 | |||
58 | void matrix_init(void) | ||
59 | { | ||
60 | /* Column output pins */ | ||
61 | DDRD |= 0b01111011; | ||
62 | /* Row input pins */ | ||
63 | DDRC &= ~0b10000000; | ||
64 | DDRB &= ~0b01111111; | ||
65 | PORTC |= 0b10000000; | ||
66 | PORTB |= 0b01111111; | ||
67 | |||
68 | for (uint8_t i=0; i < matrix_rows(); i++) { | ||
69 | matrix[i] = 0; | ||
70 | matrix_debouncing[i] = 0; | ||
71 | } | ||
72 | |||
73 | matrix_init_quantum(); | ||
74 | } | ||
75 | |||
76 | uint8_t matrix_scan(void) | ||
77 | { | ||
78 | bool changed = false; | ||
79 | for (uint8_t col = 0; col < MATRIX_COLS; col++) { | ||
80 | select_row(col); | ||
81 | wait_us(30); | ||
82 | matrix_row_t rows = read_cols(); | ||
83 | for (uint8_t row = 0; row < matrix_rows(); row++) { | ||
84 | bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<<col); | ||
85 | bool curr_bit = rows & (1<<row); | ||
86 | if ((changed |= prev_bit != curr_bit)) { | ||
87 | matrix_debouncing[row] ^= (matrix_row_t) 1 << col; | ||
88 | } | ||
89 | } | ||
90 | } | ||
91 | |||
92 | debounce(matrix_debouncing, matrix, matrix_rows(), changed); | ||
93 | matrix_scan_quantum(); | ||
94 | |||
95 | return (uint8_t)changed; | ||
96 | } | ||
97 | |||
98 | inline | ||
99 | matrix_row_t matrix_get_row(uint8_t row) | ||
100 | { | ||
101 | return matrix[row]; | ||
102 | } | ||
103 | |||
104 | void matrix_print(void) | ||
105 | { | ||
106 | print("\nr/c 0123456789ABCDEF\n"); | ||
107 | for (uint8_t row = 0; row < matrix_rows(); row++) { | ||
108 | print_hex8(row); print(": "); | ||
109 | print_bin_reverse16(matrix_get_row(row)); | ||
110 | print("\n"); | ||
111 | } | ||
112 | } | ||
113 | |||
114 | uint8_t matrix_key_count(void) | ||
115 | { | ||
116 | uint8_t count = 0; | ||
117 | for (uint8_t i = 0; i < matrix_rows(); i++) { | ||
118 | count += bitpop16(matrix_get_row(i)); | ||
119 | } | ||
120 | return count; | ||
121 | } | ||
122 | |||
123 | static matrix_row_t read_cols(void) | ||
124 | { | ||
125 | return | ||
126 | (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<0)) | | ||
127 | (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<1)) | | ||
128 | (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | | ||
129 | (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<3)) | | ||
130 | (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | | ||
131 | (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<5)) | | ||
132 | (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<6)) | | ||
133 | (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<7)); | ||
134 | } | ||
135 | |||
136 | static void select_row(uint8_t col) | ||
137 | { | ||
138 | switch (col) { | ||
139 | case 0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break; | ||
140 | case 1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break; | ||
141 | case 2: PORTD = (PORTD & ~0b01111011) | 0b01100000; break; | ||
142 | case 3: PORTD = (PORTD & ~0b01111011) | 0b01111001; break; | ||
143 | case 4: PORTD = (PORTD & ~0b01111011) | 0b01100010; break; | ||
144 | case 5: PORTD = (PORTD & ~0b01111011) | 0b01101010; break; | ||
145 | case 6: PORTD = (PORTD & ~0b01111011) | 0b01110001; break; | ||
146 | case 7: PORTD = (PORTD & ~0b01111011) | 0b01101001; break; | ||
147 | case 8: PORTD = (PORTD & ~0b01111011) | 0b01100001; break; | ||
148 | case 9: PORTD = (PORTD & ~0b01111011) | 0b01111000; break; | ||
149 | case 10: PORTD = (PORTD & ~0b01111011) | 0b00100011; break; | ||
150 | case 11: PORTD = (PORTD & ~0b01111011) | 0b00101011; break; | ||
151 | case 12: PORTD = (PORTD & ~0b01111011) | 0b00110011; break; | ||
152 | case 13: PORTD = (PORTD & ~0b01111011) | 0b01110000; break; | ||
153 | case 14: PORTD = (PORTD & ~0b01111011) | 0b00010011; break; | ||
154 | case 15: PORTD = (PORTD & ~0b01111011) | 0b01101000; break; | ||
155 | case 16: PORTD = (PORTD & ~0b01111011) | 0b00001011; break; | ||
156 | case 17: PORTD = (PORTD & ~0b01111011) | 0b00111011; break; | ||
157 | } | ||
158 | } | ||
diff --git a/keyboards/bpiphany/pegasushoof/2015/rules.mk b/keyboards/bpiphany/pegasushoof/2015/rules.mk new file mode 100644 index 000000000..3215e3588 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/rules.mk | |||
@@ -0,0 +1,2 @@ | |||
1 | CUSTOM_MATRIX = yes | ||
2 | SRC = matrix.c | ||