From dfe02441bb96c17357a0471b8dde74b51d3081d3 Mon Sep 17 00:00:00 2001
From: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
Date: Thu, 21 Mar 2019 06:06:27 -0700
Subject: handwired/magicforce61 Refactor (#5459)
* handwired/magicforce61: refactor
Renamed layout macro KEYMAP to LAYOUT.
Keymap now uses #include QMK_KEYBOARD_H.
Refactored the default keymap to use non-auto-prepended keycodes per QMK standard.
Deleted deprecated action_get_macro block (was unused).
* handwired/magicforce61: Configurator support
* handwired/magicforce61: readme cleanup
Restructured the readme to be more similar to current QMK template.
* handwired/magicforce61: replace missing image in readme
Replaced the missing wiring image (error 404) with a table.
* handwired/magicforce61: rename readme to lowercase
* Convert config.h to #pragma once include guard
---
keyboards/handwired/magicforce61/README.md | 24 ------
keyboards/handwired/magicforce61/config.h | 7 +-
keyboards/handwired/magicforce61/info.json | 74 ++++++++++++++++++
.../magicforce61/keymaps/default/keymap.c | 91 +++++++++-------------
keyboards/handwired/magicforce61/magicforce61.h | 17 ++--
keyboards/handwired/magicforce61/readme.md | 31 ++++++++
6 files changed, 152 insertions(+), 92 deletions(-)
delete mode 100644 keyboards/handwired/magicforce61/README.md
create mode 100644 keyboards/handwired/magicforce61/info.json
create mode 100644 keyboards/handwired/magicforce61/readme.md
(limited to 'keyboards/handwired')
diff --git a/keyboards/handwired/magicforce61/README.md b/keyboards/handwired/magicforce61/README.md
deleted file mode 100644
index cc86732627..0000000000
--- a/keyboards/handwired/magicforce61/README.md
+++ /dev/null
@@ -1,24 +0,0 @@
-Magicforce "61" Handwired
-=======================
-
-Basically I cut 7 keys off the magicforce68 and handwired everything to a
-teensy++ 2.0 to make it a ~60% board.
-
-## Wiring Layout
-
-![Wiring Layout](https://imgur.com/gallery/RxYyA)
-
-## Pinout
-
-The following pins are used:
-
- ```
- #define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 }
- #define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 }
- ```
-
-## Compiling and loading the firmware
-
-To build the firmware, run `make handwired/magicforce61`.
-
-Flash the firmware using the teensy loader or avrdude.
diff --git a/keyboards/handwired/magicforce61/config.h b/keyboards/handwired/magicforce61/config.h
index c6c689ab6c..3dc74f83e7 100644
--- a/keyboards/handwired/magicforce61/config.h
+++ b/keyboards/handwired/magicforce61/config.h
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-#ifndef CONFIG_H
-#define CONFIG_H
+#pragma once
#include "config_common.h"
@@ -43,7 +42,7 @@ along with this program. If not, see .
*
*/
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 }
-#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 }
+#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
@@ -152,5 +151,3 @@ along with this program. If not, see .
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
-
-#endif
diff --git a/keyboards/handwired/magicforce61/info.json b/keyboards/handwired/magicforce61/info.json
new file mode 100644
index 0000000000..22ffccd3ce
--- /dev/null
+++ b/keyboards/handwired/magicforce61/info.json
@@ -0,0 +1,74 @@
+{
+ "keyboard_name": "Magicforce \"61\"",
+ "url": "",
+ "maintainer": "qmk",
+ "width": 15,
+ "height": 5,
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ {"label":"`", "x":0, "y":0},
+ {"label":"1", "x":1, "y":0},
+ {"label":"2", "x":2, "y":0},
+ {"label":"3", "x":3, "y":0},
+ {"label":"4", "x":4, "y":0},
+ {"label":"5", "x":5, "y":0},
+ {"label":"6", "x":6, "y":0},
+ {"label":"7", "x":7, "y":0},
+ {"label":"8", "x":8, "y":0},
+ {"label":"9", "x":9, "y":0},
+ {"label":"0", "x":10, "y":0},
+ {"label":"-", "x":11, "y":0},
+ {"label":"=", "x":12, "y":0},
+ {"label":"Backspace", "x":13, "y":0, "w":2},
+ {"label":"Tab", "x":0, "y":1, "w":1.5},
+ {"label":"Q", "x":1.5, "y":1},
+ {"label":"W", "x":2.5, "y":1},
+ {"label":"E", "x":3.5, "y":1},
+ {"label":"R", "x":4.5, "y":1},
+ {"label":"T", "x":5.5, "y":1},
+ {"label":"Y", "x":6.5, "y":1},
+ {"label":"U", "x":7.5, "y":1},
+ {"label":"I", "x":8.5, "y":1},
+ {"label":"O", "x":9.5, "y":1},
+ {"label":"P", "x":10.5, "y":1},
+ {"label":"[", "x":11.5, "y":1},
+ {"label":"]", "x":12.5, "y":1},
+ {"label":"\\", "x":13.5, "y":1, "w":1.5},
+ {"label":"Caps Lock", "x":0, "y":2, "w":1.75},
+ {"label":"A", "x":1.75, "y":2},
+ {"label":"S", "x":2.75, "y":2},
+ {"label":"D", "x":3.75, "y":2},
+ {"label":"F", "x":4.75, "y":2},
+ {"label":"G", "x":5.75, "y":2},
+ {"label":"H", "x":6.75, "y":2},
+ {"label":"J", "x":7.75, "y":2},
+ {"label":"K", "x":8.75, "y":2},
+ {"label":"L", "x":9.75, "y":2},
+ {"label":";", "x":10.75, "y":2},
+ {"label":"'", "x":11.75, "y":2},
+ {"label":"Enter", "x":12.75, "y":2, "w":2.25},
+ {"label":"Shift", "x":0, "y":3, "w":2.25},
+ {"label":"Z", "x":2.25, "y":3},
+ {"label":"X", "x":3.25, "y":3},
+ {"label":"C", "x":4.25, "y":3},
+ {"label":"V", "x":5.25, "y":3},
+ {"label":"B", "x":6.25, "y":3},
+ {"label":"N", "x":7.25, "y":3},
+ {"label":"M", "x":8.25, "y":3},
+ {"label":",", "x":9.25, "y":3},
+ {"label":".", "x":10.25, "y":3},
+ {"label":"/", "x":11.25, "y":3},
+ {"label":"Shift", "x":12.25, "y":3, "w":2.75},
+ {"label":"Ctrl", "x":0, "y":4, "w":1.25},
+ {"label":"GUI", "x":1.25, "y":4, "w":1.25},
+ {"label":"Alt", "x":2.5, "y":4, "w":1.25},
+ {"label":"Space", "x":3.75, "y":4, "w":6.25},
+ {"label":"Alt", "x":10, "y":4, "w":1.25},
+ {"label":"GUI", "x":11.25, "y":4, "w":1.25},
+ {"label":"Menu", "x":12.5, "y":4, "w":1.25},
+ {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}
+ ]
+ }
+ }
+}
diff --git a/keyboards/handwired/magicforce61/keymaps/default/keymap.c b/keyboards/handwired/magicforce61/keymaps/default/keymap.c
index 9183ba72a2..12252c978a 100644
--- a/keyboards/handwired/magicforce61/keymaps/default/keymap.c
+++ b/keyboards/handwired/magicforce61/keymaps/default/keymap.c
@@ -3,67 +3,52 @@
#define _QWERTY 0
#define _FN1 1
#define _FN2 2
-#define KC_ KC_TRNS
+
#define KC_X0 LT(_FN2, KC_GRV)
#define KC_X1 MO(_FN1)
-#define KC_NAV_ESC LT(_FN1, KC_ESC)
+#define NAV_ESC LT(_FN1, KC_ESC)
#define KC_GUI MAGIC_UNNO_GUI
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- [_QWERTY] = KEYMAP(
- /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */
- GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC ,
- /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| */
- TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS ,
- /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| */
- NAV_ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER ,
- /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| */
- LSPO , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSPC ,
- /*|---------`----`----`----`----`----`----`----`----`----`----`-------------. */
- LCTL , RGUI ,LALT , SPACE , X1 ,RALT ,RCTL , X1
- /*`-----+-----+-----+------------------------------+------+-----+-----' ANY */
+ [_QWERTY] = LAYOUT(
+ /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
+ /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \
+ /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */
+ NAV_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
+ /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */
+ KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \
+ /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */
+ KC_LCTL, KC_RGUI, KC_LALT, KC_SPC, KC_X1, KC_RALT, KC_RCTL, KC_X1 \
+ /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */
),
- [_FN1] = KEYMAP(
- /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */
- GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC ,
- /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| */
- , , UP , , , , , ,INS ,PSCR, , , , ,
- /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| */
- ,LEFT,DOWN,RGHT, , , , PGDN , PGUP , , , , ,
- /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| */
- , , , , , ,VOLD,VOLU,MUTE, , , ,
- /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-. */
- , , , , , , , MPLY
- /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' ANY */
+ [_FN1] = LAYOUT(
+ /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */
+ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, \
+ /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */
+ _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_INS, KC_PSCR, _______, _______, _______, _______, \
+ /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */
+ _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_PGDN, KC_PGUP, _______, _______, _______, _______, \
+ /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */
+ _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, \
+ /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */
+ _______, _______, _______, _______, _______, _______, _______, KC_MPLY \
+ /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */
),
- [_FN2] = KEYMAP(
- /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. */
- GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC ,
- /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| */
- , , , , , , , 7 , 8 , 9 , , , , ,
- /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| */
- , , , , , , , 4 , 5 , 6 , , , ,
- /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| */
- , , , , , , 0 , 1 , 2 , 3 , , ,
- /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-. */
- , , , , , , ,
- /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' ANY */
+ [_FN2] = LAYOUT(
+ /*,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. */
+ KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, \
+ /*|esc-----`-1------`-2------`-3------`-4------`-5------`-6------`-7------`-8------`-9------`-0------`mnus----`plus----`--bksp--| */
+ _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, \
+ /*|tab-----`-q------`-w------`-e------`-r------`-t------`-y------`-u------`-i------`-o------`-p------`-{------`-}------`--|-----| */
+ _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, \
+ /*|caps----`-a------`-s------`-d------`-f------`-g------`-h------`-j------`-k------`-l------`-;------`-'------`-----------enter-| */
+ _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, _______, _______, \
+ /*|shift---`-z------`-x------`-c------`-v------`-b------`-n------`-m------`-,------`-.------`-/------`--------------------shift-| */
+ _______, _______, _______, _______, _______, _______, _______, _______ \
+ /*`ctrl----`-gui----`-alt----`------------------space---------------------------------------`-fn-----`-alt----`ctrl----' ANY */
)
};
-
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
-{
- // MACRODOWN only works in this function
- switch(id) {
- case 0:
- if (record->event.pressed) {
- register_code(KC_RSFT);
- } else {
- unregister_code(KC_RSFT);
- }
- break;
- }
- return MACRO_NONE;
-};
diff --git a/keyboards/handwired/magicforce61/magicforce61.h b/keyboards/handwired/magicforce61/magicforce61.h
index 784f2b2c80..37a32ed783 100644
--- a/keyboards/handwired/magicforce61/magicforce61.h
+++ b/keyboards/handwired/magicforce61/magicforce61.h
@@ -1,20 +1,17 @@
-#ifndef MAGICFORCE61_H
-#define MAGICFORCE61_H
+#pragma once
#include "quantum.h"
-#define KEYMAP( \
+#define LAYOUT( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \
K40, K41, K42, K45, K49, K4A, K4C, K4D \
) { \
- { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D }, \
- { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D }, \
- { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO, KC_##K2D }, \
- { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_NO, KC_NO, KC_##K3D }, \
- { KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_NO, KC_##K45, KC_NO, KC_NO, KC_NO, KC_##K49, KC_##K4A, KC_NO, KC_##K4C, KC_##K4D }, \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \
+ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \
+ { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, KC_NO, K4C, K4D }, \
}
-
-#endif
diff --git a/keyboards/handwired/magicforce61/readme.md b/keyboards/handwired/magicforce61/readme.md
new file mode 100644
index 0000000000..081992aa84
--- /dev/null
+++ b/keyboards/handwired/magicforce61/readme.md
@@ -0,0 +1,31 @@
+# Magicforce "61" Handwired
+
+Basically I cut 7 keys off the magicforce68 and handwired everything to a teensy++ 2.0 to make it a ~60% board.
+
+Keyboard Maintainer: [The QMK Community](https://github.com/qmk)
+Hardware Supported: magicforce61, teensy++ 2.0
+
+Make example for this keyboard (after setting up your build environment):
+
+ make handwired/magicforce61:default
+
+Flash the firmware using the teensy loader or avrdude.
+
+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).
+
+## Wiring Layout / Pinout
+
+| | B5 | B4 | B3 | B2 | B1 | B0 | E7 | E6 | F0 | F1 | F2 | F3 | F4 | F5 |
+| -----: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: | :--: |
+| **D0** | Esc | 1! | 2@ | 3# | 4$ | 5% | 6^ | 7& | 8* | 9( | 0) | -_ | =+ | Bspc |
+| **D1** | Tab | Q | W | E | R | T | Y | U | I | O | P | [{ | ]} | \\\| |
+| **D2** | Caps | A | S | D | F | G | H | J | K | L | ;: | '" | | Ent |
+| **D3** | LSft | Z | X | C | V | B | N | M | , | . | / | | | RSft |
+| **D4** | LCtl | LGUI | LAlt | | | Spc | | | | RAlt | RGUI | | App | RCtl |
+
+The following pins are used:
+
+```
+#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4 }
+#define MATRIX_COL_PINS { B5, B4, B3, B2, B1, B0, E7, E6, F0, F1, F2, F3, F4, F5 }
+```
--
cgit v1.2.3