diff options
| author | Yan-Fa Li <yanfali@gmail.com> | 2019-08-24 13:10:36 -0700 |
|---|---|---|
| committer | noroadsleft <18669334+noroadsleft@users.noreply.github.com> | 2019-08-24 13:10:36 -0700 |
| commit | 43b03099702265ef514cb84236d9031e04047837 (patch) | |
| tree | fb27708b8dc312bebc2980c97165a245b8d2308d /keyboards/bpiphany | |
| parent | caab1d0303141c11e565c3dd18e97790d5cb7dab (diff) | |
| download | qmk_firmware-43b03099702265ef514cb84236d9031e04047837.tar.gz qmk_firmware-43b03099702265ef514cb84236d9031e04047837.zip | |
Add 2015 revision of Pegasus Hoof to QMK (#6595)
* Add 2015 revision of pegasus hoof to QMK
* Add different version strings
* Fix ansi tkl layout
- temporary JIS mapping, I can't test this as I don't have the hardware
* Reverse engineer JIS layout macro for 2015 Pegasus Hoof
* Linting on 2013.h
* Add more resources to readme
* Update keyboards/bpiphany/pegasushoof/2013/config.h
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/bpiphany/pegasushoof/2015/config.h
Co-Authored-By: Drashna Jaelre <drashna@live.com>
* Update keyboards/bpiphany/pegasushoof/readme.md
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
* Update keyboards/bpiphany/pegasushoof/readme.md
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
* Try to use core debouncing code
* return changed
* Use helpers
Diffstat (limited to 'keyboards/bpiphany')
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2013/2013.c (renamed from keyboards/bpiphany/pegasushoof/pegasushoof.c) | 2 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2013/2013.h (renamed from keyboards/bpiphany/pegasushoof/pegasushoof.h) | 35 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2013/config.h | 37 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2013/matrix.c (renamed from keyboards/bpiphany/pegasushoof/matrix.c) | 0 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2013/rules.mk | 2 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/2015.c | 58 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/2015.h | 82 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/config.h | 38 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/matrix.c | 146 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/2015/rules.mk | 2 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/config.h | 25 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/readme.md | 10 | ||||
| -rw-r--r-- | keyboards/bpiphany/pegasushoof/rules.mk | 3 |
13 files changed, 394 insertions, 46 deletions
diff --git a/keyboards/bpiphany/pegasushoof/pegasushoof.c b/keyboards/bpiphany/pegasushoof/2013/2013.c index cde814812..7a489b22a 100644 --- a/keyboards/bpiphany/pegasushoof/pegasushoof.c +++ b/keyboards/bpiphany/pegasushoof/2013/2013.c | |||
| @@ -15,7 +15,7 @@ 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/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #include "pegasushoof.h" | 18 | #include "2013.h" |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | extern inline void ph_caps_led_on(void); | 21 | extern inline void ph_caps_led_on(void); |
diff --git a/keyboards/bpiphany/pegasushoof/pegasushoof.h b/keyboards/bpiphany/pegasushoof/2013/2013.h index b91235aad..b3e911ab4 100644 --- a/keyboards/bpiphany/pegasushoof/pegasushoof.h +++ b/keyboards/bpiphany/pegasushoof/2013/2013.h | |||
| @@ -15,8 +15,7 @@ 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/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #ifndef PEGASUSHOOF_H | 18 | #pragma once |
| 19 | #define PEGASUSHOOF_H | ||
| 20 | 19 | ||
| 21 | #include "matrix.h" | 20 | #include "matrix.h" |
| 22 | #include "quantum.h" | 21 | #include "quantum.h" |
| @@ -56,21 +55,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 56 | ) | 55 | ) |
| 57 | 56 | ||
| 58 | #define LAYOUT_tkl_jis( \ | 57 | #define LAYOUT_tkl_jis( \ |
| 59 | KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ | 58 | KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ |
| 60 | KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO7, KO2, KR4, KC4, KE4, \ | 59 | KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO7, KO2, KR4, KC4, KE4, \ |
| 61 | KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KQ4, KC5, KE5, \ | 60 | KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KQ4, KC5, KE5, \ |
| 62 | KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO3, KO1, \ | 61 | KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO3, KO1, \ |
| 63 | KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KL0, KB3, KC6, \ | 62 | KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KL0, KB3, KC6, \ |
| 64 | KP4, KD2, KN6, KG0, KQ6, KH0, KI0, KN0, KM0, KP1, KC0, KQ0, KR0 \ | 63 | KP4, KD2, KN6, KG0, KQ6, KH0, KI0, KN0, KM0, KP1, KC0, KQ0, KR0 \ |
| 65 | ) { /* 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 */ \ | 64 | ) { /* 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 */ \ |
| 66 | /* 0 */ { KC_NO, KC_NO, KC0, KC_NO, KC_NO, KF0, KG0, KH0, KI0, KJ0, KK0, KL0, KM0, KN0, KO0, KC_NO, KQ0, KR0 }, \ | 65 | /* 0 */ { KC_NO, KC_NO, KC0, KC_NO, KC_NO, KF0, KG0, KH0, KI0, KJ0, KK0, KL0, KM0, KN0, KO0, KC_NO, KQ0, KR0 }, \ |
| 67 | /* 1 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KG1, KH1, KI1, KJ1, KK1, KL1, KM1, KC_NO, KO1, KP1, KC_NO, KC_NO }, \ | 66 | /* 1 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KG1, KH1, KI1, KJ1, KK1, KL1, KM1, KC_NO, KO1, KP1, KC_NO, KC_NO }, \ |
| 68 | /* 2 */ { KC_NO, KB2, KC_NO, KD2, KC_NO, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KM2, KC_NO, KO2, KC_NO, KC_NO, KC_NO }, \ | 67 | /* 2 */ { KC_NO, KB2, KC_NO, KD2, KC_NO, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KM2, KC_NO, KO2, KC_NO, KC_NO, KC_NO }, \ |
| 69 | /* 3 */ { KC_NO, KB3, KC_NO, KC_NO, KC_NO, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KC_NO, KO3, KC_NO, KC_NO, KC_NO }, \ | 68 | /* 3 */ { KC_NO, KB3, KC_NO, KC_NO, KC_NO, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KC_NO, KO3, KC_NO, KC_NO, KC_NO }, \ |
| 70 | /* 4 */ { KC_NO, KC_NO, KC4, KC_NO, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KM4, KC_NO, KO4, KP4, KQ4, KR4 }, \ | 69 | /* 4 */ { KC_NO, KC_NO, KC4, KC_NO, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KM4, KC_NO, KO4, KP4, KQ4, KR4 }, \ |
| 71 | /* 5 */ { KC_NO, KC_NO, KC5, KC_NO, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KM5, KN5, KO5, KP5, KC_NO, KC_NO }, \ | 70 | /* 5 */ { KC_NO, KC_NO, KC5, KC_NO, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KM5, KN5, KO5, KP5, KC_NO, KC_NO }, \ |
| 72 | /* 6 */ { KC_NO, KC_NO, KC6, KC_NO, KC_NO, KF6, KG6, KC_NO, KI6, KJ6, KK6, KL6, KC_NO, KN6, KO6, KC_NO, KQ6, KC_NO }, \ | 71 | /* 6 */ { KC_NO, KC_NO, KC6, KC_NO, KC_NO, KF6, KG6, KC_NO, KI6, KJ6, KK6, KL6, KC_NO, KN6, KO6, KC_NO, KQ6, KC_NO }, \ |
| 73 | /* 7 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KF7, KG7, KH7, KI7, KJ7, KK7, KL7, KK7, KL7, KO7, KP7, KC_NO, KC_NO } \ | 72 | /* 7 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KF7, KG7, KH7, KI7, KJ7, KK7, KL7, KK7, KL7, KO7, KP7, KC_NO, KC_NO } \ |
| 74 | } | 73 | } |
| 75 | 74 | ||
| 76 | inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } | 75 | inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } |
| @@ -79,5 +78,3 @@ inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); } | |||
| 79 | inline void ph_sclk_led_on(void) { DDRC |= (1<<5); PORTC &= ~(1<<5); } | 78 | inline void ph_sclk_led_on(void) { DDRC |= (1<<5); PORTC &= ~(1<<5); } |
| 80 | inline void ph_sclk_led_off(void) { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } | 79 | inline void ph_sclk_led_off(void) { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } |
| 81 | 80 | ||
| 82 | |||
| 83 | #endif | ||
diff --git a/keyboards/bpiphany/pegasushoof/2013/config.h b/keyboards/bpiphany/pegasushoof/2013/config.h new file mode 100644 index 000000000..d2f81fedc --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2013/config.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2016 Daniel Svensson <dsvensson@gmail.com> | ||
| 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 2013 | ||
| 27 | #define DESCRIPTION QMK firmware for Majestouch TKL | ||
| 28 | |||
| 29 | /* key matrix size */ | ||
| 30 | #define MATRIX_ROWS 8 | ||
| 31 | #define MATRIX_COLS 18 | ||
| 32 | |||
| 33 | /* COL2ROW or ROW2COL */ | ||
| 34 | #define DIODE_DIRECTION COL2ROW | ||
| 35 | |||
| 36 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 37 | #define DEBOUNCE 5 | ||
diff --git a/keyboards/bpiphany/pegasushoof/matrix.c b/keyboards/bpiphany/pegasushoof/2013/matrix.c index a670d5382..a670d5382 100644 --- a/keyboards/bpiphany/pegasushoof/matrix.c +++ b/keyboards/bpiphany/pegasushoof/2013/matrix.c | |||
diff --git a/keyboards/bpiphany/pegasushoof/2013/rules.mk b/keyboards/bpiphany/pegasushoof/2013/rules.mk new file mode 100644 index 000000000..3215e3588 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2013/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | CUSTOM_MATRIX = yes | ||
| 2 | SRC = matrix.c | ||
diff --git a/keyboards/bpiphany/pegasushoof/2015/2015.c b/keyboards/bpiphany/pegasushoof/2015/2015.c new file mode 100644 index 000000000..62841e7af --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/2015.c | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2016 Daniel Svensson <dsvensson@gmail.com> | ||
| 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); | ||
| 26 | |||
| 27 | __attribute__ ((weak)) | ||
| 28 | void matrix_init_user(void) { | ||
| 29 | }; | ||
| 30 | |||
| 31 | __attribute__ ((weak)) | ||
| 32 | void matrix_scan_user(void) { | ||
| 33 | } | ||
| 34 | |||
| 35 | __attribute__ ((weak)) | ||
| 36 | bool process_action_user(keyrecord_t *record) { | ||
| 37 | return true; | ||
| 38 | } | ||
| 39 | |||
| 40 | __attribute__ ((weak)) | ||
| 41 | void led_set_user(uint8_t usb_led) { | ||
| 42 | } | ||
| 43 | |||
| 44 | void matrix_init_kb(void) { | ||
| 45 | matrix_init_user(); | ||
| 46 | } | ||
| 47 | |||
| 48 | void matrix_scan_kb(void) { | ||
| 49 | matrix_scan_user(); | ||
| 50 | } | ||
| 51 | |||
| 52 | bool process_action_kb(keyrecord_t *record) { | ||
| 53 | return process_action_user(record); | ||
| 54 | } | ||
| 55 | |||
| 56 | void led_set_kb(uint8_t usb_led) { | ||
| 57 | led_set_user(usb_led); | ||
| 58 | } | ||
diff --git a/keyboards/bpiphany/pegasushoof/2015/2015.h b/keyboards/bpiphany/pegasushoof/2015/2015.h new file mode 100644 index 000000000..18bfc46b8 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/2015.h | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2016 Daniel Svensson <dsvensson@gmail.com> | ||
| 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 | ) LAYOUT( \ | ||
| 51 | KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ | ||
| 52 | KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ | ||
| 53 | KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ | ||
| 54 | KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ | ||
| 55 | KN2,KC_NO,KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ | ||
| 56 | KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ | ||
| 57 | ) | ||
| 58 | |||
| 59 | #define LAYOUT_tkl_jis( \ | ||
| 60 | KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ | ||
| 61 | KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB5, KB2, KL4, KO4, KQ4, \ | ||
| 62 | KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KK4, KO7, KQ7, \ | ||
| 63 | KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB3, KB1, \ | ||
| 64 | KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KE0, KN3, KO6, \ | ||
| 65 | KA4, KP2, KC6, KJ0, KK6, KI0, KH0, KC0, KD0, KA1, KO0, KK0, KL0 \ | ||
| 66 | ) { /* 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 */ \ | ||
| 67 | /* 0 */ { ___ , KB0 , KC0 , KD0 , KE0 , KF0 , KG0 , KH0 , KI0 , KJ0 , KK0 , KL0 , ___ , ___ , KO0 , ___ , ___ , KR0 }, \ | ||
| 68 | /* 1 */ { KA1 , KB1 , ___ , KD1 , KE1 , KF1 , KG1 , KH1 , KI1 , KJ1 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , }, \ | ||
| 69 | /* 2 */ { ___ , KB2 , ___ , KD2 , KE2 , KF2 , KG2 , KH2 , KI2 , KJ2 , ___ , ___ , ___ , KN2 , ___ , KP2 , ___ , KR2 }, \ | ||
| 70 | /* 3 */ { ___ , KB3 , ___ , KD3 , KE3 , KF3 , KG3 , KH3 , KI3 , KJ3 , ___ , ___ , ___ , KN3 , ___ , ___ , ___ , KR3 }, \ | ||
| 71 | /* 4 */ { KA4 , KB4 , ___ , KD4 , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , ___ , ___ , KO4 , ___ , KQ4 , KR4 }, \ | ||
| 72 | /* 5 */ { KA5 , KB5 , KC5 , KD5 , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , ___ , ___ , ___ , ___ , ___ , ___ , ___ , KR5 }, \ | ||
| 73 | /* 6 */ { ___ , KB6 , KC6 , ___ , KE6 , KF6 , KG6 , KH6 , ___ , KJ6 , KK6 , ___ , ___ , ___ , KO6 , ___ , ___ , KR6 }, \ | ||
| 74 | /* 7 */ { KA7 , KB7 , KC7 , KD7 , KE7 , KF7 , KG7 , KH7 , KI7 , KJ7 , ___ , ___ , ___ , ___ , KO7 , ___ , KQ7 , KR7 } \ | ||
| 75 | } | ||
| 76 | |||
| 77 | inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } | ||
| 78 | inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); } | ||
| 79 | |||
| 80 | inline void ph_sclk_led_on(void) { DDRC |= (1<<5); PORTC &= ~(1<<5); } | ||
| 81 | inline void ph_sclk_led_off(void) { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } | ||
| 82 | |||
diff --git a/keyboards/bpiphany/pegasushoof/2015/config.h b/keyboards/bpiphany/pegasushoof/2015/config.h new file mode 100644 index 000000000..6edfa5993 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/config.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2016 Daniel Svensson <dsvensson@gmail.com> | ||
| 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 | #define DESCRIPTION QMK firmware for Majestouch TKL | ||
| 28 | |||
| 29 | /* key matrix size */ | ||
| 30 | #define MATRIX_ROWS 8 | ||
| 31 | #define MATRIX_COLS 18 | ||
| 32 | |||
| 33 | /* COL2ROW or ROW2COL */ | ||
| 34 | #define DIODE_DIRECTION COL2ROW | ||
| 35 | |||
| 36 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 37 | #define DEBOUNCE 5 | ||
| 38 | |||
diff --git a/keyboards/bpiphany/pegasushoof/2015/matrix.c b/keyboards/bpiphany/pegasushoof/2015/matrix.c new file mode 100644 index 000000000..db0399354 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/2015/matrix.c | |||
| @@ -0,0 +1,146 @@ | |||
| 1 | /* | ||
| 2 | Copyright 2014 Ralf Schmitt <ralf@bunkertor.net> | ||
| 3 | Copyright 2016 Daniel Svensson <dsvensson@gmail.com> | ||
| 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 | inline uint8_t matrix_rows(void) | ||
| 37 | { | ||
| 38 | return MATRIX_ROWS; | ||
| 39 | } | ||
| 40 | |||
| 41 | inline uint8_t matrix_cols(void) | ||
| 42 | { | ||
| 43 | return MATRIX_COLS; | ||
| 44 | } | ||
| 45 | |||
| 46 | void matrix_init(void) | ||
| 47 | { | ||
| 48 | /* Column output pins */ | ||
| 49 | DDRD |= 0b01111011; | ||
| 50 | /* Row input pins */ | ||
| 51 | DDRC &= ~0b10000000; | ||
| 52 | DDRB &= ~0b01111111; | ||
| 53 | PORTC |= 0b10000000; | ||
| 54 | PORTB |= 0b01111111; | ||
| 55 | |||
| 56 | for (uint8_t i=0; i < matrix_rows(); i++) { | ||
| 57 | matrix[i] = 0; | ||
| 58 | matrix_debouncing[i] = 0; | ||
| 59 | } | ||
| 60 | |||
| 61 | matrix_init_quantum(); | ||
| 62 | } | ||
| 63 | |||
| 64 | uint8_t matrix_scan(void) | ||
| 65 | { | ||
| 66 | bool changed = false; | ||
| 67 | for (uint8_t col = 0; col < MATRIX_COLS; col++) { | ||
| 68 | select_row(col); | ||
| 69 | wait_us(30); | ||
| 70 | matrix_row_t rows = read_cols(); | ||
| 71 | for (uint8_t row = 0; row < matrix_rows(); row++) { | ||
| 72 | bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1<<col); | ||
| 73 | bool curr_bit = rows & (1<<row); | ||
| 74 | if ((changed |= prev_bit != curr_bit)) { | ||
| 75 | matrix_debouncing[row] ^= (matrix_row_t) 1 << col; | ||
| 76 | } | ||
| 77 | } | ||
| 78 | } | ||
| 79 | |||
| 80 | debounce(matrix_debouncing, matrix, matrix_rows(), changed); | ||
| 81 | matrix_scan_quantum(); | ||
| 82 | |||
| 83 | return (uint8_t)changed; | ||
| 84 | } | ||
| 85 | |||
| 86 | inline | ||
| 87 | matrix_row_t matrix_get_row(uint8_t row) | ||
| 88 | { | ||
| 89 | return matrix[row]; | ||
| 90 | } | ||
| 91 | |||
| 92 | void matrix_print(void) | ||
| 93 | { | ||
| 94 | print("\nr/c 0123456789ABCDEF\n"); | ||
| 95 | for (uint8_t row = 0; row < matrix_rows(); row++) { | ||
| 96 | phex(row); print(": "); | ||
| 97 | pbin_reverse16(matrix_get_row(row)); | ||
| 98 | print("\n"); | ||
| 99 | } | ||
| 100 | } | ||
| 101 | |||
| 102 | uint8_t matrix_key_count(void) | ||
| 103 | { | ||
| 104 | uint8_t count = 0; | ||
| 105 | for (uint8_t i = 0; i < matrix_rows(); i++) { | ||
| 106 | count += bitpop16(matrix_get_row(i)); | ||
| 107 | } | ||
| 108 | return count; | ||
| 109 | } | ||
| 110 | |||
| 111 | static matrix_row_t read_cols(void) | ||
| 112 | { | ||
| 113 | return | ||
| 114 | (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<0)) | | ||
| 115 | (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<1)) | | ||
| 116 | (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | | ||
| 117 | (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<3)) | | ||
| 118 | (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | | ||
| 119 | (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<5)) | | ||
| 120 | (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<6)) | | ||
| 121 | (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<7)); | ||
| 122 | } | ||
| 123 | |||
| 124 | static void select_row(uint8_t col) | ||
| 125 | { | ||
| 126 | switch (col) { | ||
| 127 | case 0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break; | ||
| 128 | case 1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break; | ||
| 129 | case 2: PORTD = (PORTD & ~0b01111011) | 0b01100000; break; | ||
| 130 | case 3: PORTD = (PORTD & ~0b01111011) | 0b01111001; break; | ||
| 131 | case 4: PORTD = (PORTD & ~0b01111011) | 0b01100010; break; | ||
| 132 | case 5: PORTD = (PORTD & ~0b01111011) | 0b01101010; break; | ||
| 133 | case 6: PORTD = (PORTD & ~0b01111011) | 0b01110001; break; | ||
| 134 | case 7: PORTD = (PORTD & ~0b01111011) | 0b01101001; break; | ||
| 135 | case 8: PORTD = (PORTD & ~0b01111011) | 0b01100001; break; | ||
| 136 | case 9: PORTD = (PORTD & ~0b01111011) | 0b01111000; break; | ||
| 137 | case 10: PORTD = (PORTD & ~0b01111011) | 0b00100011; break; | ||
| 138 | case 11: PORTD = (PORTD & ~0b01111011) | 0b00101011; break; | ||
| 139 | case 12: PORTD = (PORTD & ~0b01111011) | 0b00110011; break; | ||
| 140 | case 13: PORTD = (PORTD & ~0b01111011) | 0b01110000; break; | ||
| 141 | case 14: PORTD = (PORTD & ~0b01111011) | 0b00010011; break; | ||
| 142 | case 15: PORTD = (PORTD & ~0b01111011) | 0b01101000; break; | ||
| 143 | case 16: PORTD = (PORTD & ~0b01111011) | 0b00001011; break; | ||
| 144 | case 17: PORTD = (PORTD & ~0b01111011) | 0b00111011; break; | ||
| 145 | } | ||
| 146 | } | ||
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 | ||
diff --git a/keyboards/bpiphany/pegasushoof/config.h b/keyboards/bpiphany/pegasushoof/config.h index cd89b7582..6868dc135 100644 --- a/keyboards/bpiphany/pegasushoof/config.h +++ b/keyboards/bpiphany/pegasushoof/config.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | Copyright 2016 Daniel Svensson <dsvensson@gmail.com> | 2 | Copyright 2017 Danny Nguyen <danny@hexwire.com> |
| 3 | 3 | ||
| 4 | This program is free software: you can redistribute it and/or modify | 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 | 5 | it under the terms of the GNU General Public License as published by |
| @@ -15,27 +15,6 @@ 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/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | */ | 16 | */ |
| 17 | 17 | ||
| 18 | #ifndef CONFIG_H | 18 | #pragma once |
| 19 | #define CONFIG_H | ||
| 20 | 19 | ||
| 21 | #include "config_common.h" | 20 | #include "config_common.h" |
| 22 | |||
| 23 | /* USB Device descriptor parameter */ | ||
| 24 | #define VENDOR_ID 0xFEED | ||
| 25 | #define PRODUCT_ID 0x6050 | ||
| 26 | #define DEVICE_VER 0x0104 | ||
| 27 | #define MANUFACTURER Filco | ||
| 28 | #define PRODUCT Majestouch TKL \\w The Pegasus Hoof | ||
| 29 | #define DESCRIPTION QMK firmware for Majestouch TKL | ||
| 30 | |||
| 31 | /* key matrix size */ | ||
| 32 | #define MATRIX_ROWS 8 | ||
| 33 | #define MATRIX_COLS 18 | ||
| 34 | |||
| 35 | /* COL2ROW or ROW2COL */ | ||
| 36 | #define DIODE_DIRECTION COL2ROW | ||
| 37 | |||
| 38 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 39 | #define DEBOUNCE 5 | ||
| 40 | |||
| 41 | #endif | ||
diff --git a/keyboards/bpiphany/pegasushoof/readme.md b/keyboards/bpiphany/pegasushoof/readme.md index 10ec79300..ab49db03c 100644 --- a/keyboards/bpiphany/pegasushoof/readme.md +++ b/keyboards/bpiphany/pegasushoof/readme.md | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | A replacement controller that turns your Filco Majestouch 87/88 mechanical keyboard into a fully programmable keyboard. | 3 | A replacement controller that turns your Filco Majestouch 87/88 mechanical keyboard into a fully programmable keyboard. |
| 4 | 4 | ||
| 5 | Keyboard Maintainer: QMK Community | 5 | Keyboard Maintainer: QMK Community |
| 6 | Hardware Supported: Pegasus Hoof | 6 | Hardware Supported: Pegasus Hoof, revisions [20131001](2013/) and [20150108](2015/) |
| 7 | Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/filco-pegasus-hoof-controller/) | 7 | Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/filco-pegasus-hoof-controller/) |
| 8 | 8 | ||
| 9 | Make example for this keyboard (after setting up your build environment): | 9 | Make example for this keyboard (after setting up your build environment): |
| @@ -11,3 +11,11 @@ Make example for this keyboard (after setting up your build environment): | |||
| 11 | make bpiphany/pegasus_hoof:default | 11 | make bpiphany/pegasus_hoof:default |
| 12 | 12 | ||
| 13 | See 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). | 13 | See 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). |
| 14 | |||
| 15 | ### Additional Resources | ||
| 16 | |||
| 17 | With many thanks to Bathroom Epiphanies for all the kind advice and help. | ||
| 18 | |||
| 19 | * [Schematic](https://deskthority.net/wiki/Costar_replacement_controllers#Schematic) | ||
| 20 | * [bpiphany TMK source](https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard) | ||
| 21 | * [bpiphany QMK source](https://github.com/BathroomEpiphanies/epiphanies_qmk_keyboard) | ||
diff --git a/keyboards/bpiphany/pegasushoof/rules.mk b/keyboards/bpiphany/pegasushoof/rules.mk index 00e4bb0ea..e81ee886e 100644 --- a/keyboards/bpiphany/pegasushoof/rules.mk +++ b/keyboards/bpiphany/pegasushoof/rules.mk | |||
| @@ -64,5 +64,4 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. | |||
| 64 | 64 | ||
| 65 | LAYOUTS = tkl_ansi | 65 | LAYOUTS = tkl_ansi |
| 66 | 66 | ||
| 67 | CUSTOM_MATRIX = yes | 67 | DEFAULT_FOLDER=bpiphany/pegasushoof/2013 |
| 68 | SRC = matrix.c | ||
