From 5ab0eeb513f50a14e51467bf76a19997b75d65fb Mon Sep 17 00:00:00 2001
From: James Young <18669334+noroadsleft@users.noreply.github.com>
Date: Sat, 8 Feb 2020 10:25:50 -0800
Subject: [PATCH 001/108] [Keyboard] Boardwalk Refactor (#8122)
* refactor keymaps
Create one keymap for each layout macro.
* remove config.h for default keymap
There's nothing in it.
* update readme
- use the new list format
- use a smaller version of the keyboard photo (does the readme really need a 14MP image on it?)
---
keyboards/boardwalk/keymaps/default/config.h | 16 --
keyboards/boardwalk/keymaps/default/keymap.c | 182 +++++-------------
.../keymaps/default_2u_arrow/keymap.c | 68 +++++++
.../keymaps/default_2u_arrow/readme.md | 1 +
.../keymaps/default_625u_arrow/keymap.c | 68 +++++++
.../keymaps/default_625u_arrow/readme.md | 1 +
.../keymaps/default_ortho_7u/keymap.c | 68 +++++++
.../keymaps/default_ortho_7u/readme.md | 1 +
.../keymaps/default_ortho_hhkb/keymap.c | 68 +++++++
.../keymaps/default_ortho_hhkb/readme.md | 1 +
keyboards/boardwalk/readme.md | 8 +-
11 files changed, 324 insertions(+), 158 deletions(-)
delete mode 100644 keyboards/boardwalk/keymaps/default/config.h
create mode 100644 keyboards/boardwalk/keymaps/default_2u_arrow/keymap.c
create mode 100644 keyboards/boardwalk/keymaps/default_2u_arrow/readme.md
create mode 100644 keyboards/boardwalk/keymaps/default_625u_arrow/keymap.c
create mode 100644 keyboards/boardwalk/keymaps/default_625u_arrow/readme.md
create mode 100644 keyboards/boardwalk/keymaps/default_ortho_7u/keymap.c
create mode 100644 keyboards/boardwalk/keymaps/default_ortho_7u/readme.md
create mode 100644 keyboards/boardwalk/keymaps/default_ortho_hhkb/keymap.c
create mode 100644 keyboards/boardwalk/keymaps/default_ortho_hhkb/readme.md
diff --git a/keyboards/boardwalk/keymaps/default/config.h b/keyboards/boardwalk/keymaps/default/config.h
deleted file mode 100644
index a2530241f477..000000000000
--- a/keyboards/boardwalk/keymaps/default/config.h
+++ /dev/null
@@ -1,16 +0,0 @@
-/*
- * 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 .
- */
-
-#pragma once
diff --git a/keyboards/boardwalk/keymaps/default/keymap.c b/keyboards/boardwalk/keymaps/default/keymap.c
index fddb3da8251f..6ee85e49991a 100644
--- a/keyboards/boardwalk/keymaps/default/keymap.c
+++ b/keyboards/boardwalk/keymaps/default/keymap.c
@@ -16,147 +16,53 @@
#include QMK_KEYBOARD_H
// Layer shorthand
-enum layer {
- _1U,
- _FN,
- _HHKB,
- _7U,
- _2UARROW,
- _625UARROW,
+enum layer_names {
+ _BASE,
+ _FN,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-/* 1uGrid
- * .-----------------------------------------------------------------------------------------------------------------------------.
- * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
- * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
- * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
- * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
- * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
- * | LCTRL | LGUI | FN | LALT | SPACE | SPACE | SPACE | SPACE | SPACE | SPACE | RIGHT | DOWN | UP | RIGHT |
- * '-----------------------------------------------------------------------------------------------------------------------------'
- */
-
- [_1U] = LAYOUT_ortho_5x14(
- KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
- KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \
- KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
- KC_LCTL, KC_LGUI, MO(1), KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL \
- ),
-
- /* HHKB
- * .-----------------------------------------------------------------------------------------------------------------------------.
- * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
- * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
- * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
- * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
- * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
- * | | LCTRL | FN | LALT | LGUI | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | |
- * '-----------------------------------------------------------------------------------------------------------------------------'
- */
-
- [_HHKB] = LAYOUT_ortho_hhkb(
- KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \
- KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
- KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
- KC_LCTL, MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
- ),
-
- /* 7u HHKB
- * .-----------------------------------------------------------------------------------------------------------------------------.
- * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
- * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
- * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
- * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
- * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
- * | | LCTRL | LALT | SPACE | RALT | FN | |
- * '-----------------------------------------------------------------------------------------------------------------------------'
- */
-
- [_7U] = LAYOUT_ortho_7u(
- KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \
- KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
- KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
- KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(1) \
- ),
-
- /* 2x2u Space with Arrows
- * .-----------------------------------------------------------------------------------------------------------------------------.
- * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
- * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
- * | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
- * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN |
- * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
- * | LCTRL | LGUI | FN | LALT | SPACE | SPACE | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT |
- * '-----------------------------------------------------------------------------------------------------------------------------'
- */
-
- [_2UARROW] = LAYOUT_2u_arrow(
- KC_ESC, 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, \
- 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_QUOT, \
- KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSLS, KC_ENT, KC_PGUP, \
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
- KC_LCTL, KC_LGUI, MO(1), KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
- ),
-
- /* 6.25u Space with Arrows
- * .-----------------------------------------------------------------------------------------------------------------------------.
- * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
- * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
- * | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
- * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN |
- * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
- * | LCTRL | LGUI | LALT | SPACE | FN | RCTRL | LEFT | DOWN | RIGHT |
- * '-----------------------------------------------------------------------------------------------------------------------------'
- */
-
- [_625UARROW] = LAYOUT_625u_arrow(
- KC_ESC, 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, \
- 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_QUOT, \
- KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_BSLS, KC_ENT, KC_PGUP, \
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
- KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
- ),
-
-/* FUNCTION
- * .-----------------------------------------------------------------------------------------------------------------------------.
- * | | | | | | | | | | | | | | |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
- * | | | | | | | | | | | | | | |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
- * | | | | | | | | | | | | | | |
- * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
- * | | | | | | | | | | | | | | |
- * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
- * | | | | | | | | | | | | | | |
- * '-----------------------------------------------------------------------------------------------------------------------------'
- */
-
+ /* Base Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | LCTRL | LGUI | FN | LALT | SPACE | SPACE | SPACE | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | RCTRL |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [_BASE] = LAYOUT_ortho_5x14(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_LCTL, KC_LGUI, MO(_FN), KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL
+ ),
+
+ /* Function Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | | | MENU | | | | | | | | | | PRT SC | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | | | | | | | | | | | | | | RESET |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | | | | | | | | | | | | | | |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [_FN] = LAYOUT_ortho_5x14(
+ 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_DEL,
+ _______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ )
- [_FN] = LAYOUT_ortho_5x14(
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
- )
};
diff --git a/keyboards/boardwalk/keymaps/default_2u_arrow/keymap.c b/keyboards/boardwalk/keymaps/default_2u_arrow/keymap.c
new file mode 100644
index 000000000000..96b87d1cd4fb
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/default_2u_arrow/keymap.c
@@ -0,0 +1,68 @@
+/*
+ * 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 .
+ */
+
+#include QMK_KEYBOARD_H
+
+// Layer shorthand
+enum layer {
+ _BASE,
+ _FN,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Base Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | LCTRL | LGUI | FN | LALT | SPACE | SPACE | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [_BASE] = LAYOUT_2u_arrow(
+ KC_ESC, 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,
+ 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,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
+ KC_LCTL, KC_LGUI, MO(_FN), KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
+ ),
+
+ /* Function Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | | | MENU | | | | | | | | PRT SC | | | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | | | | | | | | | | | | | | HOME |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | | | | | | | | MUTE | VOL DN | VOL UP | | | | END |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | | | | | | | | | RESET | | | |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [_FN] = LAYOUT_2u_arrow(
+ 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_DEL,
+ _______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME,
+ _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_END,
+ _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______
+ )
+
+};
diff --git a/keyboards/boardwalk/keymaps/default_2u_arrow/readme.md b/keyboards/boardwalk/keymaps/default_2u_arrow/readme.md
new file mode 100644
index 000000000000..2774d6e2bbf7
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/default_2u_arrow/readme.md
@@ -0,0 +1 @@
+# The default_2u_arrow keymap for Boardwalk
diff --git a/keyboards/boardwalk/keymaps/default_625u_arrow/keymap.c b/keyboards/boardwalk/keymaps/default_625u_arrow/keymap.c
new file mode 100644
index 000000000000..a609859bb3fb
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/default_625u_arrow/keymap.c
@@ -0,0 +1,68 @@
+/*
+ * 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 .
+ */
+
+#include QMK_KEYBOARD_H
+
+// Layer shorthand
+enum layer {
+ _BASE,
+ _FN,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Base Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | CAP LK | A | S | D | F | G | H | J | K | L | ; | " | ENTER | PG UP |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | UP | PG DN |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | LCTRL | LGUI | LALT | SPACE | FN | RCTRL | LEFT | DOWN | RIGHT |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [_BASE] = LAYOUT_625u_arrow(
+ KC_ESC, 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,
+ 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,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
+ ),
+
+ /* Function Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | | | MENU | | | | | | | | PRT SC | | | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | | | | | | | | | | | | | | HOME |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | | | | | | | | MUTE | VOL DN | VOL UP | | | | END |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | | | | | | RESET | | | |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [_FN] = LAYOUT_625u_arrow(
+ 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_DEL,
+ _______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME,
+ _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_END,
+ _______, _______, _______, _______, _______, RESET, _______, _______, _______
+ )
+
+};
diff --git a/keyboards/boardwalk/keymaps/default_625u_arrow/readme.md b/keyboards/boardwalk/keymaps/default_625u_arrow/readme.md
new file mode 100644
index 000000000000..25eca02be6b7
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/default_625u_arrow/readme.md
@@ -0,0 +1 @@
+# The default_625u_arrow keymap for Boardwalk
diff --git a/keyboards/boardwalk/keymaps/default_ortho_7u/keymap.c b/keyboards/boardwalk/keymaps/default_ortho_7u/keymap.c
new file mode 100644
index 000000000000..8d61b54a3183
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/default_ortho_7u/keymap.c
@@ -0,0 +1,68 @@
+/*
+ * 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 .
+ */
+
+#include QMK_KEYBOARD_H
+
+// Layer shorthand
+enum layer {
+ _BASE,
+ _FN,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Base Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
+ * '--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------'
+ * | LCTRL | LALT | SPACE | RALT | FN |
+ * '-----------------------------------------------------------------------------------------------------------'
+ */
+ [_BASE] = LAYOUT_ortho_7u(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_LCTL, KC_LALT, KC_SPC, KC_RALT, MO(_FN)
+ ),
+
+ /* Function Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | | | MENU | | | | | | | | | | PRT SC | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | | | | | | | | | | | | | | RESET |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | |
+ * '--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------'
+ * | | | | | |
+ * '-----------------------------------------------------------------------------------------------------------'
+ */
+ [_FN] = LAYOUT_ortho_7u(
+ 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_DEL,
+ _______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______,
+ _______, _______, _______, _______, _______
+ )
+
+};
diff --git a/keyboards/boardwalk/keymaps/default_ortho_7u/readme.md b/keyboards/boardwalk/keymaps/default_ortho_7u/readme.md
new file mode 100644
index 000000000000..57fa07eab607
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/default_ortho_7u/readme.md
@@ -0,0 +1 @@
+# The default_ortho_7u keymap for Boardwalk
diff --git a/keyboards/boardwalk/keymaps/default_ortho_hhkb/keymap.c b/keyboards/boardwalk/keymaps/default_ortho_hhkb/keymap.c
new file mode 100644
index 000000000000..d9819d9ccfca
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/default_ortho_hhkb/keymap.c
@@ -0,0 +1,68 @@
+/*
+ * 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 .
+ */
+
+#include QMK_KEYBOARD_H
+
+// Layer shorthand
+enum layer {
+ _BASE,
+ _FN,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Base Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
+ * '--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------'
+ * | LCTRL | FN | LALT | LGUI | SPACE | SPACE | LEFT | DOWN | UP | RIGHT |
+ * '-----------------------------------------------------------------------------------------------------------'
+ */
+ [_BASE] = LAYOUT_ortho_hhkb(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_LCTL, MO(_FN), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
+ ),
+
+ /* Function Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | | | MENU | | | | | | | | | | PRT SC | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | | | | | | | | | | | | | | RESET |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | |
+ * '--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------'
+ * | | | | | | | | | | |
+ * '-----------------------------------------------------------------------------------------------------------'
+ */
+ [_FN] = LAYOUT_ortho_hhkb(
+ 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_DEL,
+ _______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ )
+
+};
diff --git a/keyboards/boardwalk/keymaps/default_ortho_hhkb/readme.md b/keyboards/boardwalk/keymaps/default_ortho_hhkb/readme.md
new file mode 100644
index 000000000000..b11c8c4009b3
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/default_ortho_hhkb/readme.md
@@ -0,0 +1 @@
+# The default_ortho_hhkb keymap for Boardwalk
diff --git a/keyboards/boardwalk/readme.md b/keyboards/boardwalk/readme.md
index 932e7e9d6c42..e66c0a07f4b9 100644
--- a/keyboards/boardwalk/readme.md
+++ b/keyboards/boardwalk/readme.md
@@ -1,13 +1,13 @@
# Boardwalk
-![Boardwalk](https://i.imgur.com/CQj3b9E.jpg)
+![Boardwalk](https://i.imgur.com/CQj3b9El.jpg)
The Boardwalk is a 60% ortholinear keyboard, designed around Ergodox keycap sets and to fit into many standard 60% cases. The project was inspired by OLKB’s Atomic keyboard, which used larger 2u mods, but u/shensmobile
decided to switch to 1.5u keys so that Ergodox sets would provide excellent compatibility. The rest of the board can be covered using standard key sizes from 60% sets.
-Keyboard Maintainer: QMK Community
-Hardware Supported: Boardwalk Ortholinear PCB
-Hardware Availability: [panc.co](https://www.panc.co/boardwalk-group-buy.html)
+* Keyboard Maintainer: QMK Community
+* Hardware Supported: Boardwalk Ortholinear PCB
+* Hardware Availability: [panc.co](https://www.panc.co/boardwalk-group-buy.html)
Make example for this keyboard (after setting up your build environment):
From 174a15d07d7321e762e51584e985bb73fe01e99b Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Thu, 6 Feb 2020 11:30:45 +1100
Subject: [PATCH 002/108] Remove PJRC USB stack
---
doxygen-todo | 1 -
tmk_core/common/command.c | 24 -
tmk_core/protocol/bluefruit.mk | 18 +-
tmk_core/protocol/bluefruit/main.c | 47 --
tmk_core/protocol/pjrc.mk | 35 -
tmk_core/protocol/pjrc/MEMO.txt | 25 -
tmk_core/protocol/pjrc/main.c | 72 --
tmk_core/protocol/pjrc/pjrc.c | 58 --
tmk_core/protocol/pjrc/pjrc.h | 25 -
tmk_core/protocol/pjrc/usb.c | 970 --------------------------
tmk_core/protocol/pjrc/usb.h | 131 ----
tmk_core/protocol/pjrc/usb_debug.c | 98 ---
tmk_core/protocol/pjrc/usb_debug.h | 39 --
tmk_core/protocol/pjrc/usb_extra.c | 62 --
tmk_core/protocol/pjrc/usb_extra.h | 44 --
tmk_core/protocol/pjrc/usb_keyboard.c | 114 ---
tmk_core/protocol/pjrc/usb_keyboard.h | 38 -
tmk_core/protocol/pjrc/usb_mouse.c | 83 ---
tmk_core/protocol/pjrc/usb_mouse.h | 47 --
tmk_core/readme.md | 9 +-
20 files changed, 5 insertions(+), 1935 deletions(-)
delete mode 100644 tmk_core/protocol/pjrc.mk
delete mode 100644 tmk_core/protocol/pjrc/MEMO.txt
delete mode 100644 tmk_core/protocol/pjrc/main.c
delete mode 100644 tmk_core/protocol/pjrc/pjrc.c
delete mode 100644 tmk_core/protocol/pjrc/pjrc.h
delete mode 100644 tmk_core/protocol/pjrc/usb.c
delete mode 100644 tmk_core/protocol/pjrc/usb.h
delete mode 100644 tmk_core/protocol/pjrc/usb_debug.c
delete mode 100644 tmk_core/protocol/pjrc/usb_debug.h
delete mode 100644 tmk_core/protocol/pjrc/usb_extra.c
delete mode 100644 tmk_core/protocol/pjrc/usb_extra.h
delete mode 100644 tmk_core/protocol/pjrc/usb_keyboard.c
delete mode 100644 tmk_core/protocol/pjrc/usb_keyboard.h
delete mode 100644 tmk_core/protocol/pjrc/usb_mouse.c
delete mode 100644 tmk_core/protocol/pjrc/usb_mouse.h
diff --git a/doxygen-todo b/doxygen-todo
index 0f3010ffafcc..6483b47c6174 100644
--- a/doxygen-todo
+++ b/doxygen-todo
@@ -6,7 +6,6 @@ tmk_core/protocol/lufa
tmk_core/protocol/midi
tmk_core/protocol/midi/bytequeue
tmk_core/protocol/midi/Config
-tmk_core/protocol/pjrc
tmk_core/protocol/usb_hid
tmk_core/protocol/vusb
tmk_core/tool
diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c
index 0d6661d6035d..900de5410311 100644
--- a/tmk_core/common/command.c
+++ b/tmk_core/common/command.c
@@ -43,13 +43,6 @@ along with this program. If not, see .
# include "mousekey.h"
#endif
-#ifdef PROTOCOL_PJRC
-# include "usb_keyboard.h"
-# ifdef EXTRAKEY_ENABLE
-# include "usb_extra.h"
-# endif
-#endif
-
#ifdef PROTOCOL_VUSB
# include "usbdrv.h"
#endif
@@ -165,9 +158,6 @@ static void print_version(void) {
/* build options */
print("OPTIONS:"
-#ifdef PROTOCOL_PJRC
- " PJRC"
-#endif
#ifdef PROTOCOL_LUFA
" LUFA"
#endif
@@ -217,20 +207,6 @@ static void print_status(void) {
print_val_hex8(keymap_config.nkro);
#endif
print_val_hex32(timer_read32());
-
-#ifdef PROTOCOL_PJRC
- print_val_hex8(UDCON);
- print_val_hex8(UDIEN);
- print_val_hex8(UDINT);
- print_val_hex8(usb_keyboard_leds);
- print_val_hex8(usb_keyboard_idle_count);
-#endif
-
-#ifdef PROTOCOL_PJRC
-# if USB_COUNT_SOF
- print_val_hex8(usbSofCount);
-# endif
-#endif
return;
}
diff --git a/tmk_core/protocol/bluefruit.mk b/tmk_core/protocol/bluefruit.mk
index e1c5fff77ffa..13a0693c5725 100644
--- a/tmk_core/protocol/bluefruit.mk
+++ b/tmk_core/protocol/bluefruit.mk
@@ -1,27 +1,11 @@
BLUEFRUIT_DIR = protocol/bluefruit
-PJRC_DIR = protocol/pjrc
SRC += $(BLUEFRUIT_DIR)/main.c \
$(BLUEFRUIT_DIR)/bluefruit.c \
- serial_uart.c \
- $(PJRC_DIR)/pjrc.c \
- $(PJRC_DIR)/usb_keyboard.c \
- $(PJRC_DIR)/usb_debug.c \
- $(PJRC_DIR)/usb.c
-
-# Option modules
-ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
- SRC += $(PJRC_DIR)/usb_mouse.c
-endif
-
-ifdef EXTRAKEY_ENABLE
- SRC += $(PJRC_DIR)/usb_extra.c
-endif
+ serial_uart.c
# Search Path
VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)
#VPATH += $(TMK_DIR)/$(BLUEFRUIT_DIR)/usb_debug_only
-VPATH += $(TMK_DIR)/$(PJRC_DIR)
OPT_DEFS += -DPROTOCOL_BLUEFRUIT
-OPT_DEFS += -DPROTOCOL_PJRC
diff --git a/tmk_core/protocol/bluefruit/main.c b/tmk_core/protocol/bluefruit/main.c
index 3adcab4f426d..aca46206d5af 100644
--- a/tmk_core/protocol/bluefruit/main.c
+++ b/tmk_core/protocol/bluefruit/main.c
@@ -24,7 +24,6 @@ along with this program. If not, see .
#include
#include "../serial.h"
#include "keyboard.h"
-#include "usb.h"
#include "host.h"
#include "timer.h"
#include "print.h"
@@ -32,14 +31,9 @@ along with this program. If not, see .
#include "sendchar.h"
#include "suspend.h"
#include "bluefruit.h"
-#include "pjrc.h"
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
-#define HOST_DRIVER_NOT_SET 0
-#define BLUEFRUIT_HOST_DRIVER 1
-#define PJRC_HOST_DRIVER 2
-
int main(void) {
CPU_PRESCALE(0);
@@ -51,27 +45,11 @@ int main(void) {
print_set_sendchar(sendchar);
- // usb_init();
- // _delay_ms(2000);
- // while (!usb_configured()) /* wait */
-
keyboard_setup();
dprintf("Initializing keyboard...\n");
keyboard_init();
- // This implementation is pretty simplistic... if the USB connection
- // is not configured, choose the Bluefruit, otherwise use USB
- // Definitely would prefer to have this driven by an input pin and make
- // it switch dynamically - BCG
- // if (!usb_configured()) {
-
- // // Send power to Bluefruit... Adafruit says it takes 27 mA, I think
- // // the pins should provide 40 mA, but just in case I switch the
- // // Bluefruit using a transistor - BCG
- // DDRB = _BV(PB6);
- // PORTB |= _BV(PB6);
-
dprintf("Setting host driver to bluefruit...\n");
host_set_driver(bluefruit_driver());
@@ -106,29 +84,4 @@ int main(void) {
while (1) {
keyboard_task();
}
-
- // } else {
-
- // // I'm not smart enough to get this done with LUFA - BCG
- // dprintf("Setting host driver to PJRC...\n");
- // host_set_driver(pjrc_driver());
- // #ifdef SLEEP_LED_ENABLE
- // sleep_led_init();
- // #endif
- // // wait an extra second for the PC's operating system
- // // to load drivers and do whatever it does to actually
- // // be ready for input
- // _delay_ms(1000);
- // PORTB = ~_BV(PB0);
- // dprintf("Starting main loop");
- // while (1) {
- // while (suspend) {
- // suspend_power_down();
- // if (remote_wakeup && suspend_wakeup_condition()) {
- // usb_remote_wakeup();
- // }
- // }
- // keyboard_task();
- // }
- // }
}
diff --git a/tmk_core/protocol/pjrc.mk b/tmk_core/protocol/pjrc.mk
deleted file mode 100644
index 7c0c1fa851b8..000000000000
--- a/tmk_core/protocol/pjrc.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-PJRC_DIR = protocol/pjrc
-
-SRC += $(PJRC_DIR)/main.c \
- $(PJRC_DIR)/pjrc.c \
- $(PJRC_DIR)/usb_keyboard.c \
- $(PJRC_DIR)/usb_debug.c \
- $(PJRC_DIR)/usb.c
-
-# Option modules
-ifdef MOUSEKEY_ENABLE
- SRC += $(PJRC_DIR)/usb_mouse.c
-endif
-
-ifdef ADB_MOUSE_ENABLE
- SRC += $(PJRC_DIR)/usb_mouse.c
-endif
-
-ifdef PS2_MOUSE_ENABLE
- SRC += $(PJRC_DIR)/usb_mouse.c
-endif
-
-ifdef EXTRAKEY_ENABLE
- SRC += $(PJRC_DIR)/usb_extra.c
-endif
-
-
-ifdef POINTING_DEVICE_ENABLE
- SRC += $(PJRC_DIR)/usb_mouse.c
-endif
-
-# Search Path
-VPATH += $(TMK_DIR)/$(PJRC_DIR)
-
-# This indicates using LUFA stack
-OPT_DEFS += -DPROTOCOL_PJRC
diff --git a/tmk_core/protocol/pjrc/MEMO.txt b/tmk_core/protocol/pjrc/MEMO.txt
deleted file mode 100644
index b0f0598313db..000000000000
--- a/tmk_core/protocol/pjrc/MEMO.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-Endpoint configuration
-----------------------
-0 Control endpoint
-1 keyboard
-2 mouse
-3 debug
-4 extra key(consumer/system)
-5 nkro keyboard(supported only on ATmega32U4/16U4 and AT90USB64/128)
-
-
-ATmega32U4/16U4, AT90USB64/128
-• Endpoint 0:programmable size FIFO up to 64 bytes, default control endpoint
-• Endpoints 1 programmable size FIFO up to 256 bytes in ping-pong mode.
-• Endpoints 2 to 6: programmable size FIFO up to 64 bytes in ping-pong mode.
-
-AT90USB82/162, ATmega8U2/16U2/32U2
-• Endpoint 0:programmable size FIFO up to 64 bytes, default control endpoint
-• Endpoints 1 and 2: programmable size FIFO up to 64 bytes.
-• Endpoints 3 and 4: programmable size FIFO up to 64 bytes with ping-pong mode.
-
-ping-pong mode means double buffer feature.
-
-
-NOTE: ATmega8U2/16U2/32U2 is not supported with PJRC stack at this time.
-TODO: Macro definition for ATmega8U2/16U2/32U2 in usb.h
diff --git a/tmk_core/protocol/pjrc/main.c b/tmk_core/protocol/pjrc/main.c
deleted file mode 100644
index d16051c5f816..000000000000
--- a/tmk_core/protocol/pjrc/main.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Keyboard example with debug channel, for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2008 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include "keyboard.h"
-#include "usb.h"
-#include "matrix.h"
-#include "print.h"
-#include "debug.h"
-#include "sendchar.h"
-#include "util.h"
-#include "suspend.h"
-#include "host.h"
-#include "pjrc.h"
-
-#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
-
-int main(void) {
- // set for 16 MHz clock
- CPU_PRESCALE(0);
-
- keyboard_setup();
-
- // Initialize the USB, and then wait for the host to set configuration.
- // If the Teensy is powered without a PC connected to the USB port,
- // this will wait forever.
- usb_init();
- while (!usb_configured()) /* wait */
- ;
-
- print_set_sendchar(sendchar);
-
- keyboard_init();
- host_set_driver(pjrc_driver());
-#ifdef SLEEP_LED_ENABLE
- sleep_led_init();
-#endif
- while (1) {
- while (suspend) {
- suspend_power_down();
- if (remote_wakeup && suspend_wakeup_condition()) {
- usb_remote_wakeup();
- }
- }
-
- keyboard_task();
- }
-}
diff --git a/tmk_core/protocol/pjrc/pjrc.c b/tmk_core/protocol/pjrc/pjrc.c
deleted file mode 100644
index 60932f59e8a9..000000000000
--- a/tmk_core/protocol/pjrc/pjrc.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
-Copyright 2011 Jun Wako
-
-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 .
-*/
-
-#include
-#include "usb_keyboard.h"
-#include "usb_mouse.h"
-#include "usb_extra.h"
-#include "host_driver.h"
-#include "pjrc.h"
-
-/*------------------------------------------------------------------*
- * Host driver
- *------------------------------------------------------------------*/
-static uint8_t keyboard_leds(void);
-static void send_keyboard(report_keyboard_t *report);
-static void send_mouse(report_mouse_t *report);
-static void send_system(uint16_t data);
-static void send_consumer(uint16_t data);
-
-static host_driver_t driver = {keyboard_leds, send_keyboard, send_mouse, send_system, send_consumer};
-
-host_driver_t *pjrc_driver(void) { return &driver; }
-
-static uint8_t keyboard_leds(void) { return usb_keyboard_leds; }
-
-static void send_keyboard(report_keyboard_t *report) { usb_keyboard_send_report(report); }
-
-static void send_mouse(report_mouse_t *report) {
-#ifdef MOUSE_ENABLE
- usb_mouse_send(report->x, report->y, report->v, report->h, report->buttons);
-#endif
-}
-
-static void send_system(uint16_t data) {
-#ifdef EXTRAKEY_ENABLE
- usb_extra_system_send(data);
-#endif
-}
-
-static void send_consumer(uint16_t data) {
-#ifdef EXTRAKEY_ENABLE
- usb_extra_consumer_send(data);
-#endif
-}
diff --git a/tmk_core/protocol/pjrc/pjrc.h b/tmk_core/protocol/pjrc/pjrc.h
deleted file mode 100644
index 08a1ede18662..000000000000
--- a/tmk_core/protocol/pjrc/pjrc.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright 2011 Jun Wako
-
-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 .
-*/
-
-#ifndef PJRC_H
-#define PJRC_H
-
-#include "host_driver.h"
-
-host_driver_t *pjrc_driver(void);
-
-#endif
diff --git a/tmk_core/protocol/pjrc/usb.c b/tmk_core/protocol/pjrc/usb.c
deleted file mode 100644
index 22fbcfdcd478..000000000000
--- a/tmk_core/protocol/pjrc/usb.c
+++ /dev/null
@@ -1,970 +0,0 @@
-/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include "usb.h"
-#include "usb_keyboard.h"
-#include "usb_mouse.h"
-#include "usb_debug.h"
-#include "usb_extra.h"
-#include "led.h"
-#include "print.h"
-#include "util.h"
-#ifdef SLEEP_LED_ENABLE
-# include "sleep_led.h"
-#endif
-#include "suspend.h"
-#include "action.h"
-#include "action_util.h"
-
-#ifdef NKRO_ENABLE
-# include "keycode_config.h"
-
-extern keymap_config_t keymap_config;
-#endif
-
-/**************************************************************************
- *
- * Configurable Options
- *
- **************************************************************************/
-
-// You can change these to give your code its own name.
-#ifndef MANUFACTURER
-# define STR_MANUFACTURER L"t.m.k."
-#else
-# define STR_MANUFACTURER LSTR(MANUFACTURER)
-#endif
-#ifndef PRODUCT
-# define STR_PRODUCT L"t.m.k. keyboard"
-#else
-# define STR_PRODUCT LSTR(PRODUCT)
-#endif
-
-// Mac OS-X and Linux automatically load the correct drivers. On
-// Windows, even though the driver is supplied by Microsoft, an
-// INF file is needed to load the driver. These numbers need to
-// match the INF file.
-#ifndef VENDOR_ID
-# define VENDOR_ID 0xFEED
-#endif
-
-#ifndef PRODUCT_ID
-# define PRODUCT_ID 0xBABE
-#endif
-
-#ifndef DEVICE_VER
-# define DEVICE_VER 0x0100
-#endif
-
-// USB devices are supposed to implment a halt feature, which is
-// rarely (if ever) used. If you comment this line out, the halt
-// code will be removed, saving 102 bytes of space (gcc 4.3.0).
-// This is not strictly USB compliant, but works with all major
-// operating systems.
-#define SUPPORT_ENDPOINT_HALT
-
-/**************************************************************************
- *
- * Endpoint Buffer Configuration
- *
- **************************************************************************/
-
-#define ENDPOINT0_SIZE 32
-
-bool remote_wakeup = false;
-bool suspend = false;
-
-// 0:control endpoint is enabled automatically by controller.
-static const uint8_t PROGMEM endpoint_config_table[] = {
- // enable, UECFG0X(type, direction), UECFG1X(size, bank, allocation)
- 1, EP_TYPE_INTERRUPT_IN, EP_SIZE(KBD_SIZE) | KBD_BUFFER, // 1
-#ifdef MOUSE_ENABLE
- 1, EP_TYPE_INTERRUPT_IN, EP_SIZE(MOUSE_SIZE) | MOUSE_BUFFER, // 2
-#else
- 0, // 2
-#endif
-#ifdef CONSOLE_ENABLE
- 1, EP_TYPE_INTERRUPT_IN, EP_SIZE(DEBUG_TX_SIZE) | DEBUG_TX_BUFFER, // 3
-#else
- 0,
-#endif
-#ifdef EXTRAKEY_ENABLE
- 1, EP_TYPE_INTERRUPT_IN, EP_SIZE(EXTRA_SIZE) | EXTRA_BUFFER, // 4
-#else
- 0, // 4
-#endif
-#ifdef NKRO_ENABLE
- 1, EP_TYPE_INTERRUPT_IN, EP_SIZE(KBD2_SIZE) | KBD2_BUFFER, // 5
-#else
- 0, // 5
-#endif
- 0, // 6
-};
-
-/**************************************************************************
- *
- * Descriptor Data
- *
- **************************************************************************/
-
-// Descriptors are the data that your computer reads when it auto-detects
-// this USB device (called "enumeration" in USB lingo). The most commonly
-// changed items are editable at the top of this file. Changing things
-// in here should only be done by those who've read chapter 9 of the USB
-// spec and relevant portions of any USB class specifications!
-
-static const uint8_t PROGMEM device_descriptor[] = {
- 18, // bLength
- 1, // bDescriptorType
- 0x00,
- 0x02, // bcdUSB
- 0, // bDeviceClass
- 0, // bDeviceSubClass
- 0, // bDeviceProtocol
- ENDPOINT0_SIZE, // bMaxPacketSize0
- LSB(VENDOR_ID),
- MSB(VENDOR_ID), // idVendor
- LSB(PRODUCT_ID),
- MSB(PRODUCT_ID), // idProduct
- LSB(DEVICE_VER),
- MSB(DEVICE_VER), // bcdDevice
- 1, // iManufacturer
- 2, // iProduct
- 0, // iSerialNumber
- 1 // bNumConfigurations
-};
-
-// Keyboard Protocol 1, HID 1.11 spec, Appendix B, page 59-60
-static const uint8_t PROGMEM keyboard_hid_report_desc[] = {
- 0x05, 0x01, // Usage Page (Generic Desktop),
- 0x09, 0x06, // Usage (Keyboard),
- 0xA1, 0x01, // Collection (Application),
- 0x75, 0x01, // Report Size (1),
- 0x95, 0x08, // Report Count (8),
- 0x05, 0x07, // Usage Page (Key Codes),
- 0x19, 0xE0, // Usage Minimum (224),
- 0x29, 0xE7, // Usage Maximum (231),
- 0x15, 0x00, // Logical Minimum (0),
- 0x25, 0x01, // Logical Maximum (1),
- 0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte
- 0x95, 0x01, // Report Count (1),
- 0x75, 0x08, // Report Size (8),
- 0x81, 0x03, // Input (Constant), ;Reserved byte
- 0x95, 0x05, // Report Count (5),
- 0x75, 0x01, // Report Size (1),
- 0x05, 0x08, // Usage Page (LEDs),
- 0x19, 0x01, // Usage Minimum (1),
- 0x29, 0x05, // Usage Maximum (5),
- 0x91, 0x02, // Output (Data, Variable, Absolute), ;LED report
- 0x95, 0x01, // Report Count (1),
- 0x75, 0x03, // Report Size (3),
- 0x91, 0x03, // Output (Constant), ;LED report padding
- 0x95, KBD_REPORT_KEYS, // Report Count (),
- 0x75, 0x08, // Report Size (8),
- 0x15, 0x00, // Logical Minimum (0),
- 0x25, 0xFF, // Logical Maximum(255),
- 0x05, 0x07, // Usage Page (Key Codes),
- 0x19, 0x00, // Usage Minimum (0),
- 0x29, 0xFF, // Usage Maximum (255),
- 0x81, 0x00, // Input (Data, Array),
- 0xc0 // End Collection
-};
-#ifdef NKRO_ENABLE
-static const uint8_t PROGMEM keyboard2_hid_report_desc[] = {
- 0x05, 0x01, // Usage Page (Generic Desktop),
- 0x09, 0x06, // Usage (Keyboard),
- 0xA1, 0x01, // Collection (Application),
- // bitmap of modifiers
- 0x75, 0x01, // Report Size (1),
- 0x95, 0x08, // Report Count (8),
- 0x05, 0x07, // Usage Page (Key Codes),
- 0x19, 0xE0, // Usage Minimum (224),
- 0x29, 0xE7, // Usage Maximum (231),
- 0x15, 0x00, // Logical Minimum (0),
- 0x25, 0x01, // Logical Maximum (1),
- 0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte
- // LED output report
- 0x95, 0x05, // Report Count (5),
- 0x75, 0x01, // Report Size (1),
- 0x05, 0x08, // Usage Page (LEDs),
- 0x19, 0x01, // Usage Minimum (1),
- 0x29, 0x05, // Usage Maximum (5),
- 0x91, 0x02, // Output (Data, Variable, Absolute),
- 0x95, 0x01, // Report Count (1),
- 0x75, 0x03, // Report Size (3),
- 0x91, 0x03, // Output (Constant),
- // bitmap of keys
- 0x95, KBD2_REPORT_KEYS * 8, // Report Count (),
- 0x75, 0x01, // Report Size (1),
- 0x15, 0x00, // Logical Minimum (0),
- 0x25, 0x01, // Logical Maximum(1),
- 0x05, 0x07, // Usage Page (Key Codes),
- 0x19, 0x00, // Usage Minimum (0),
- 0x29, KBD2_REPORT_KEYS * 8 - 1, // Usage Maximum (),
- 0x81, 0x02, // Input (Data, Variable, Absolute),
- 0xc0 // End Collection
-};
-#endif
-
-#ifdef MOUSE_ENABLE
-// Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension
-// http://www.microchip.com/forums/tm.aspx?high=&m=391435&mpage=1#391521
-// http://www.keil.com/forum/15671/
-// http://www.microsoft.com/whdc/device/input/wheel.mspx
-static const uint8_t PROGMEM mouse_hid_report_desc[] = {
- /* mouse */
- 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
- 0x09, 0x02, // USAGE (Mouse)
- 0xa1, 0x01, // COLLECTION (Application)
- // 0x85, REPORT_ID_MOUSE, // REPORT_ID (1)
- 0x09, 0x01, // USAGE (Pointer)
- 0xa1, 0x00, // COLLECTION (Physical)
- // ---------------------------- Buttons
- 0x05, 0x09, // USAGE_PAGE (Button)
- 0x19, 0x01, // USAGE_MINIMUM (Button 1)
- 0x29, 0x05, // USAGE_MAXIMUM (Button 5)
- 0x15, 0x00, // LOGICAL_MINIMUM (0)
- 0x25, 0x01, // LOGICAL_MAXIMUM (1)
- 0x75, 0x01, // REPORT_SIZE (1)
- 0x95, 0x05, // REPORT_COUNT (5)
- 0x81, 0x02, // INPUT (Data,Var,Abs)
- 0x75, 0x03, // REPORT_SIZE (3)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x03, // INPUT (Cnst,Var,Abs)
- // ---------------------------- X,Y position
- 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
- 0x09, 0x30, // USAGE (X)
- 0x09, 0x31, // USAGE (Y)
- 0x15, 0x81, // LOGICAL_MINIMUM (-127)
- 0x25, 0x7f, // LOGICAL_MAXIMUM (127)
- 0x75, 0x08, // REPORT_SIZE (8)
- 0x95, 0x02, // REPORT_COUNT (2)
- 0x81, 0x06, // INPUT (Data,Var,Rel)
- // ---------------------------- Vertical wheel
- 0x09, 0x38, // USAGE (Wheel)
- 0x15, 0x81, // LOGICAL_MINIMUM (-127)
- 0x25, 0x7f, // LOGICAL_MAXIMUM (127)
- 0x35, 0x00, // PHYSICAL_MINIMUM (0) - reset physical
- 0x45, 0x00, // PHYSICAL_MAXIMUM (0)
- 0x75, 0x08, // REPORT_SIZE (8)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x06, // INPUT (Data,Var,Rel)
- // ---------------------------- Horizontal wheel
- 0x05, 0x0c, // USAGE_PAGE (Consumer Devices)
- 0x0a, 0x38, 0x02, // USAGE (AC Pan)
- 0x15, 0x81, // LOGICAL_MINIMUM (-127)
- 0x25, 0x7f, // LOGICAL_MAXIMUM (127)
- 0x75, 0x08, // REPORT_SIZE (8)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x06, // INPUT (Data,Var,Rel)
- 0xc0, // END_COLLECTION
- 0xc0, // END_COLLECTION
-};
-#endif
-
-static const uint8_t PROGMEM debug_hid_report_desc[] = {
- 0x06, 0x31, 0xFF, // Usage Page 0xFF31 (vendor defined)
- 0x09, 0x74, // Usage 0x74
- 0xA1, 0x53, // Collection 0x53
- 0x75, 0x08, // report size = 8 bits
- 0x15, 0x00, // logical minimum = 0
- 0x26, 0xFF, 0x00, // logical maximum = 255
- 0x95, DEBUG_TX_SIZE, // report count
- 0x09, 0x75, // usage
- 0x81, 0x02, // Input (array)
- 0xC0 // end collection
-};
-
-#ifdef EXTRAKEY_ENABLE
-// audio controls & system controls
-// http://www.microsoft.com/whdc/archive/w2kbd.mspx
-static const uint8_t PROGMEM extra_hid_report_desc[] = {
- /* system control */
- 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
- 0x09, 0x80, // USAGE (System Control)
- 0xa1, 0x01, // COLLECTION (Application)
- 0x85, REPORT_ID_SYSTEM, // REPORT_ID (2)
- 0x15, 0x01, // LOGICAL_MINIMUM (0x1)
- 0x25, 0xb7, // LOGICAL_MAXIMUM (0xb7)
- 0x19, 0x01, // USAGE_MINIMUM (0x1)
- 0x29, 0xb7, // USAGE_MAXIMUM (0xb7)
- 0x75, 0x10, // REPORT_SIZE (16)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x00, // INPUT (Data,Array,Abs)
- 0xc0, // END_COLLECTION
- /* consumer */
- 0x05, 0x0c, // USAGE_PAGE (Consumer Devices)
- 0x09, 0x01, // USAGE (Consumer Control)
- 0xa1, 0x01, // COLLECTION (Application)
- 0x85, REPORT_ID_CONSUMER, // REPORT_ID (3)
- 0x15, 0x01, // LOGICAL_MINIMUM (0x1)
- 0x26, 0x9c, 0x02, // LOGICAL_MAXIMUM (0x29c)
- 0x19, 0x01, // USAGE_MINIMUM (0x1)
- 0x2a, 0x9c, 0x02, // USAGE_MAXIMUM (0x29c)
- 0x75, 0x10, // REPORT_SIZE (16)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x00, // INPUT (Data,Array,Abs)
- 0xc0, // END_COLLECTION
-};
-#endif
-
-#define KBD_HID_DESC_NUM 0
-#define KBD_HID_DESC_OFFSET (9 + (9 + 9 + 7) * KBD_HID_DESC_NUM + 9)
-
-#ifdef MOUSE_ENABLE
-# define MOUSE_HID_DESC_NUM (KBD_HID_DESC_NUM + 1)
-# define MOUSE_HID_DESC_OFFSET (9 + (9 + 9 + 7) * MOUSE_HID_DESC_NUM + 9)
-#else
-# define MOUSE_HID_DESC_NUM (KBD_HID_DESC_NUM + 0)
-#endif
-
-#ifdef CONSOLE_ENABLE
-# define DEBUG_HID_DESC_NUM (MOUSE_HID_DESC_NUM + 1)
-# define DEBUG_HID_DESC_OFFSET (9 + (9 + 9 + 7) * DEBUG_HID_DESC_NUM + 9)
-#else
-# define DEBUG_HID_DESC_NUM (MOUSE_HID_DESC_NUM + 0)
-#endif
-
-#ifdef EXTRAKEY_ENABLE
-# define EXTRA_HID_DESC_NUM (DEBUG_HID_DESC_NUM + 1)
-# define EXTRA_HID_DESC_OFFSET (9 + (9 + 9 + 7) * EXTRA_HID_DESC_NUM + 9)
-#else
-# define EXTRA_HID_DESC_NUM (DEBUG_HID_DESC_NUM + 0)
-#endif
-
-#ifdef NKRO_ENABLE
-# define KBD2_HID_DESC_NUM (EXTRA_HID_DESC_NUM + 1)
-# define KBD2_HID_DESC_OFFSET (9 + (9 + 9 + 7) * EXTRA_HID_DESC_NUM + 9)
-#else
-# define KBD2_HID_DESC_NUM (EXTRA_HID_DESC_NUM + 0)
-#endif
-
-#define NUM_INTERFACES (KBD2_HID_DESC_NUM + 1)
-#define CONFIG1_DESC_SIZE (9 + (9 + 9 + 7) * NUM_INTERFACES)
-static const uint8_t PROGMEM config1_descriptor[CONFIG1_DESC_SIZE] = {
- // configuration descriptor, USB spec 9.6.3, page 264-266, Table 9-10
- 9, // bLength;
- 2, // bDescriptorType;
- LSB(CONFIG1_DESC_SIZE), // wTotalLength
- MSB(CONFIG1_DESC_SIZE),
- NUM_INTERFACES, // bNumInterfaces
- 1, // bConfigurationValue
- 0, // iConfiguration
- 0xA0, // bmAttributes
- 50, // bMaxPower
-
- // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
- 9, // bLength
- 4, // bDescriptorType
- KBD_INTERFACE, // bInterfaceNumber
- 0, // bAlternateSetting
- 1, // bNumEndpoints
- 0x03, // bInterfaceClass (0x03 = HID)
- 0x01, // bInterfaceSubClass (0x01 = Boot)
- 0x01, // bInterfaceProtocol (0x01 = Keyboard)
- 0, // iInterface
- // HID descriptor, HID 1.11 spec, section 6.2.1
- 9, // bLength
- 0x21, // bDescriptorType
- 0x11, 0x01, // bcdHID
- 0, // bCountryCode
- 1, // bNumDescriptors
- 0x22, // bDescriptorType
- sizeof(keyboard_hid_report_desc), // wDescriptorLength
- 0,
- // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
- 7, // bLength
- 5, // bDescriptorType
- KBD_ENDPOINT | 0x80, // bEndpointAddress
- 0x03, // bmAttributes (0x03=intr)
- KBD_SIZE, 0, // wMaxPacketSize
- 10, // bInterval
-
-#ifdef MOUSE_ENABLE
- // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
- 9, // bLength
- 4, // bDescriptorType
- MOUSE_INTERFACE, // bInterfaceNumber
- 0, // bAlternateSetting
- 1, // bNumEndpoints
- 0x03, // bInterfaceClass (0x03 = HID)
- // ThinkPad T23 BIOS doesn't work with boot mouse.
- 0x00, // bInterfaceSubClass (0x01 = Boot)
- 0x00, // bInterfaceProtocol (0x02 = Mouse)
- /*
- 0x01, // bInterfaceSubClass (0x01 = Boot)
- 0x02, // bInterfaceProtocol (0x02 = Mouse)
- */
- 0, // iInterface
- // HID descriptor, HID 1.11 spec, section 6.2.1
- 9, // bLength
- 0x21, // bDescriptorType
- 0x11, 0x01, // bcdHID
- 0, // bCountryCode
- 1, // bNumDescriptors
- 0x22, // bDescriptorType
- sizeof(mouse_hid_report_desc), // wDescriptorLength
- 0,
- // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
- 7, // bLength
- 5, // bDescriptorType
- MOUSE_ENDPOINT | 0x80, // bEndpointAddress
- 0x03, // bmAttributes (0x03=intr)
- MOUSE_SIZE, 0, // wMaxPacketSize
- 1, // bInterval
-#endif
-
-#ifdef CONSOLE_ENABLE
- // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
- 9, // bLength
- 4, // bDescriptorType
- DEBUG_INTERFACE, // bInterfaceNumber
- 0, // bAlternateSetting
- 1, // bNumEndpoints
- 0x03, // bInterfaceClass (0x03 = HID)
- 0x00, // bInterfaceSubClass
- 0x00, // bInterfaceProtocol
- 0, // iInterface
- // HID descriptor, HID 1.11 spec, section 6.2.1
- 9, // bLength
- 0x21, // bDescriptorType
- 0x11, 0x01, // bcdHID
- 0, // bCountryCode
- 1, // bNumDescriptors
- 0x22, // bDescriptorType
- sizeof(debug_hid_report_desc), // wDescriptorLength
- 0,
- // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
- 7, // bLength
- 5, // bDescriptorType
- DEBUG_TX_ENDPOINT | 0x80, // bEndpointAddress
- 0x03, // bmAttributes (0x03=intr)
- DEBUG_TX_SIZE, 0, // wMaxPacketSize
- 1, // bInterval
-#endif
-
-#ifdef EXTRAKEY_ENABLE
- // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
- 9, // bLength
- 4, // bDescriptorType
- EXTRA_INTERFACE, // bInterfaceNumber
- 0, // bAlternateSetting
- 1, // bNumEndpoints
- 0x03, // bInterfaceClass (0x03 = HID)
- 0x00, // bInterfaceSubClass
- 0x00, // bInterfaceProtocol
- 0, // iInterface
- // HID descriptor, HID 1.11 spec, section 6.2.1
- 9, // bLength
- 0x21, // bDescriptorType
- 0x11, 0x01, // bcdHID
- 0, // bCountryCode
- 1, // bNumDescriptors
- 0x22, // bDescriptorType
- sizeof(extra_hid_report_desc), // wDescriptorLength
- 0,
- // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
- 7, // bLength
- 5, // bDescriptorType
- EXTRA_ENDPOINT | 0x80, // bEndpointAddress
- 0x03, // bmAttributes (0x03=intr)
- EXTRA_SIZE, 0, // wMaxPacketSize
- 10, // bInterval
-#endif
-
-#ifdef NKRO_ENABLE
- // interface descriptor, USB spec 9.6.5, page 267-269, Table 9-12
- 9, // bLength
- 4, // bDescriptorType
- KBD2_INTERFACE, // bInterfaceNumber
- 0, // bAlternateSetting
- 1, // bNumEndpoints
- 0x03, // bInterfaceClass (0x03 = HID)
- 0x00, // bInterfaceSubClass (0x01 = Boot)
- 0x00, // bInterfaceProtocol (0x01 = Keyboard)
- 0, // iInterface
- // HID descriptor, HID 1.11 spec, section 6.2.1
- 9, // bLength
- 0x21, // bDescriptorType
- 0x11, 0x01, // bcdHID
- 0, // bCountryCode
- 1, // bNumDescriptors
- 0x22, // bDescriptorType
- sizeof(keyboard2_hid_report_desc), // wDescriptorLength
- 0,
- // endpoint descriptor, USB spec 9.6.6, page 269-271, Table 9-13
- 7, // bLength
- 5, // bDescriptorType
- KBD2_ENDPOINT | 0x80, // bEndpointAddress
- 0x03, // bmAttributes (0x03=intr)
- KBD2_SIZE, 0, // wMaxPacketSize
- 1, // bInterval
-#endif
-};
-
-// If you're desperate for a little extra code memory, these strings
-// can be completely removed if iManufacturer, iProduct, iSerialNumber
-// in the device desciptor are changed to zeros.
-struct usb_string_descriptor_struct {
- uint8_t bLength;
- uint8_t bDescriptorType;
- int16_t wString[];
-};
-static const struct usb_string_descriptor_struct PROGMEM string0 = {4, 3, {0x0409}};
-static const struct usb_string_descriptor_struct PROGMEM string1 = {sizeof(STR_MANUFACTURER), 3, STR_MANUFACTURER};
-static const struct usb_string_descriptor_struct PROGMEM string2 = {sizeof(STR_PRODUCT), 3, STR_PRODUCT};
-
-// This table defines which descriptor data is sent for each specific
-// request from the host (in wValue and wIndex).
-static const struct descriptor_list_struct {
- uint16_t wValue; // descriptor type
- uint16_t wIndex;
- const uint8_t *addr;
- uint8_t length;
-} PROGMEM descriptor_list[] = {
- // DEVICE descriptor
- {0x0100, 0x0000, device_descriptor, sizeof(device_descriptor)},
- // CONFIGURATION descriptor
- {0x0200, 0x0000, config1_descriptor, sizeof(config1_descriptor)},
- // HID/REPORT descriptors
- {0x2100, KBD_INTERFACE, config1_descriptor + KBD_HID_DESC_OFFSET, 9},
- {0x2200, KBD_INTERFACE, keyboard_hid_report_desc, sizeof(keyboard_hid_report_desc)},
-#ifdef MOUSE_ENABLE
- {0x2100, MOUSE_INTERFACE, config1_descriptor + MOUSE_HID_DESC_OFFSET, 9},
- {0x2200, MOUSE_INTERFACE, mouse_hid_report_desc, sizeof(mouse_hid_report_desc)},
-#endif
-#ifdef CONSOLE_ENABLE
- {0x2100, DEBUG_INTERFACE, config1_descriptor + DEBUG_HID_DESC_OFFSET, 9},
- {0x2200, DEBUG_INTERFACE, debug_hid_report_desc, sizeof(debug_hid_report_desc)},
-#endif
-#ifdef EXTRAKEY_ENABLE
- {0x2100, EXTRA_INTERFACE, config1_descriptor + EXTRA_HID_DESC_OFFSET, 9},
- {0x2200, EXTRA_INTERFACE, extra_hid_report_desc, sizeof(extra_hid_report_desc)},
-#endif
-#ifdef NKRO_ENABLE
- {0x2100, KBD2_INTERFACE, config1_descriptor + KBD2_HID_DESC_OFFSET, 9},
- {0x2200, KBD2_INTERFACE, keyboard2_hid_report_desc, sizeof(keyboard2_hid_report_desc)},
-#endif
- // STRING descriptors
- {0x0300, 0x0000, (const uint8_t *)&string0, 4},
- {0x0301, 0x0409, (const uint8_t *)&string1, sizeof(STR_MANUFACTURER)},
- {0x0302, 0x0409, (const uint8_t *)&string2, sizeof(STR_PRODUCT)}};
-#define NUM_DESC_LIST (sizeof(descriptor_list) / sizeof(struct descriptor_list_struct))
-
-/**************************************************************************
- *
- * Variables - these are the only non-stack RAM usage
- *
- **************************************************************************/
-
-// zero when we are not configured, non-zero when enumerated
-static volatile uint8_t usb_configuration = 0;
-
-/**************************************************************************
- *
- * Public Functions - these are the API intended for the user
- *
- **************************************************************************/
-
-// initialize USB
-void usb_init(void) {
- HW_CONFIG();
- USB_FREEZE(); // enable USB
- PLL_CONFIG(); // config PLL
- while (!(PLLCSR & (1 << PLOCK)))
- ; // wait for PLL lock
- USB_CONFIG(); // start USB clock
- UDCON = 0; // enable attach resistor
- usb_configuration = 0;
- suspend = false;
- UDIEN = (1 << EORSTE) | (1 << SOFE) | (1 << SUSPE) | (1 << WAKEUPE);
- sei();
-}
-
-// return 0 if the USB is not configured, or the configuration
-// number selected by the HOST
-uint8_t usb_configured(void) { return usb_configuration && !suspend; }
-
-void usb_remote_wakeup(void) {
- UDCON |= (1 << RMWKUP);
- while (UDCON & (1 << RMWKUP))
- ;
-}
-
-/**************************************************************************
- *
- * Private Functions - not intended for general user consumption....
- *
- **************************************************************************/
-
-// USB Device Interrupt - handle all device-level events
-// the transmit buffer flushing is triggered by the start of frame
-//
-ISR(USB_GEN_vect) {
- uint8_t intbits, t;
- static uint8_t div4 = 0;
-
- intbits = UDINT;
- UDINT = 0;
- if ((intbits & (1 << SUSPI)) && (UDIEN & (1 << SUSPE)) && usb_configuration) {
-#ifdef SLEEP_LED_ENABLE
- sleep_led_enable();
-#endif
- UDIEN &= ~(1 << SUSPE);
- UDIEN |= (1 << WAKEUPE);
- suspend = true;
- }
- if ((intbits & (1 << WAKEUPI)) && (UDIEN & (1 << WAKEUPE)) && usb_configuration) {
- suspend_wakeup_init();
-#ifdef SLEEP_LED_ENABLE
- sleep_led_disable();
- // NOTE: converters may not accept this
- led_set(host_keyboard_leds());
-#endif
-
- UDIEN |= (1 << SUSPE);
- UDIEN &= ~(1 << WAKEUPE);
- suspend = false;
- }
- if (intbits & (1 << EORSTI)) {
- UENUM = 0;
- UECONX = 1;
- UECFG0X = EP_TYPE_CONTROL;
- UECFG1X = EP_SIZE(ENDPOINT0_SIZE) | EP_SINGLE_BUFFER;
- UEIENX = (1 << RXSTPE);
- usb_configuration = 0;
- }
- if ((intbits & (1 << SOFI)) && usb_configuration) {
- t = debug_flush_timer;
- if (t) {
- debug_flush_timer = --t;
- if (!t) {
- UENUM = DEBUG_TX_ENDPOINT;
- while ((UEINTX & (1 << RWAL))) {
- UEDATX = 0;
- }
- UEINTX = 0x3A;
- }
- }
- /* TODO: should keep IDLE rate on each keyboard interface */
-#ifdef NKRO_ENABLE
- if (!keymap_config.nkro && keyboard_idle && (++div4 & 3) == 0) {
-#else
- if (keyboard_idle && (++div4 & 3) == 0) {
-#endif
- UENUM = KBD_ENDPOINT;
- if (UEINTX & (1 << RWAL)) {
- usb_keyboard_idle_count++;
- if (usb_keyboard_idle_count == keyboard_idle) {
- usb_keyboard_idle_count = 0;
- /* TODO: fix keyboard_report inconsistency */
- /* To avoid Mac SET_IDLE behaviour.
- UEDATX = keyboard_report_prev->mods;
- UEDATX = 0;
- uint8_t keys = keyboard_protocol ? KBD_REPORT_KEYS : 6;
- for (uint8_t i=0; ikeys[i];
- }
- UEINTX = 0x3A;
- */
- }
- }
- }
- }
-}
-
-// Misc functions to wait for ready and send/receive packets
-static inline void usb_wait_in_ready(void) {
- while (!(UEINTX & (1 << TXINI)))
- ;
-}
-static inline void usb_send_in(void) { UEINTX = ~(1 << TXINI); }
-static inline void usb_wait_receive_out(void) {
- while (!(UEINTX & (1 << RXOUTI)))
- ;
-}
-static inline void usb_ack_out(void) { UEINTX = ~(1 << RXOUTI); }
-
-// USB Endpoint Interrupt - endpoint 0 is handled here. The
-// other endpoints are manipulated by the user-callable
-// functions, and the start-of-frame interrupt.
-//
-ISR(USB_COM_vect) {
- uint8_t intbits;
- const uint8_t *list;
- const uint8_t *cfg;
- uint8_t i, n, len, en;
- uint8_t bmRequestType;
- uint8_t bRequest;
- uint16_t wValue;
- uint16_t wIndex;
- uint16_t wLength;
- uint16_t desc_val;
- const uint8_t *desc_addr;
- uint8_t desc_length;
-
- UENUM = 0;
- intbits = UEINTX;
- if (intbits & (1 << RXSTPI)) {
- bmRequestType = UEDATX;
- bRequest = UEDATX;
- wValue = UEDATX;
- wValue |= (UEDATX << 8);
- wIndex = UEDATX;
- wIndex |= (UEDATX << 8);
- wLength = UEDATX;
- wLength |= (UEDATX << 8);
- UEINTX = ~((1 << RXSTPI) | (1 << RXOUTI) | (1 << TXINI));
- if (bRequest == GET_DESCRIPTOR) {
- list = (const uint8_t *)descriptor_list;
- for (i = 0;; i++) {
- if (i >= NUM_DESC_LIST) {
- UECONX = (1 << STALLRQ) | (1 << EPEN); // stall
- return;
- }
- desc_val = pgm_read_word(list);
- if (desc_val != wValue) {
- list += sizeof(struct descriptor_list_struct);
- continue;
- }
- list += 2;
- desc_val = pgm_read_word(list);
- if (desc_val != wIndex) {
- list += sizeof(struct descriptor_list_struct) - 2;
- continue;
- }
- list += 2;
- desc_addr = (const uint8_t *)pgm_read_word(list);
- list += 2;
- desc_length = pgm_read_byte(list);
- break;
- }
- len = (wLength < 256) ? wLength : 255;
- if (len > desc_length) len = desc_length;
- do {
- // wait for host ready for IN packet
- do {
- i = UEINTX;
- } while (!(i & ((1 << TXINI) | (1 << RXOUTI))));
- if (i & (1 << RXOUTI)) return; // abort
- // send IN packet
- n = len < ENDPOINT0_SIZE ? len : ENDPOINT0_SIZE;
- for (i = n; i; i--) {
- UEDATX = pgm_read_byte(desc_addr++);
- }
- len -= n;
- usb_send_in();
- } while (len || n == ENDPOINT0_SIZE);
- return;
- }
- if (bRequest == SET_ADDRESS) {
- usb_send_in();
- usb_wait_in_ready();
- UDADDR = wValue | (1 << ADDEN);
- return;
- }
- if (bRequest == SET_CONFIGURATION && bmRequestType == 0) {
- usb_configuration = wValue;
- usb_send_in();
- cfg = endpoint_config_table;
- for (i = 1; i <= MAX_ENDPOINT; i++) {
- UENUM = i;
- en = pgm_read_byte(cfg++);
- if (en) {
- UECONX = (1 << EPEN);
- UECFG0X = pgm_read_byte(cfg++);
- UECFG1X = pgm_read_byte(cfg++);
- } else {
- UECONX = 0;
- }
- }
- UERST = UERST_MASK;
- UERST = 0;
- return;
- }
- if (bRequest == GET_CONFIGURATION && bmRequestType == 0x80) {
- usb_wait_in_ready();
- UEDATX = usb_configuration;
- usb_send_in();
- return;
- }
-
- if (bRequest == GET_STATUS) {
- usb_wait_in_ready();
- i = 0;
-#ifdef SUPPORT_ENDPOINT_HALT
- if (bmRequestType == 0x82) {
- UENUM = wIndex;
- if (UECONX & (1 << STALLRQ)) i = 1;
- UENUM = 0;
- }
-#endif
- UEDATX = i;
- UEDATX = 0;
- usb_send_in();
- return;
- }
- if (bRequest == CLEAR_FEATURE || bRequest == SET_FEATURE) {
-#ifdef SUPPORT_ENDPOINT_HALT
- if (bmRequestType == 0x02 && wValue == ENDPOINT_HALT) {
- i = wIndex & 0x7F;
- if (i >= 1 && i <= MAX_ENDPOINT) {
- usb_send_in();
- UENUM = i;
- if (bRequest == SET_FEATURE) {
- UECONX = (1 << STALLRQ) | (1 << EPEN);
- } else {
- UECONX = (1 << STALLRQC) | (1 << RSTDT) | (1 << EPEN);
- UERST = (1 << i);
- UERST = 0;
- }
- return;
- }
- }
-#endif
- if (bmRequestType == 0x00 && wValue == DEVICE_REMOTE_WAKEUP) {
- if (bRequest == SET_FEATURE) {
- remote_wakeup = true;
- } else {
- remote_wakeup = false;
- }
- usb_send_in();
- return;
- }
- }
- if (wIndex == KBD_INTERFACE) {
- if (bmRequestType == 0xA1) {
- if (bRequest == HID_GET_REPORT) {
- usb_wait_in_ready();
- UEDATX = keyboard_report->mods;
- UEDATX = 0;
- for (i = 0; i < 6; i++) {
- UEDATX = keyboard_report->keys[i];
- }
- usb_send_in();
- return;
- }
- if (bRequest == HID_GET_IDLE) {
- usb_wait_in_ready();
- UEDATX = keyboard_idle;
- usb_send_in();
- return;
- }
- if (bRequest == HID_GET_PROTOCOL) {
- usb_wait_in_ready();
- UEDATX = keyboard_protocol;
- usb_send_in();
- return;
- }
- }
- if (bmRequestType == 0x21) {
- if (bRequest == HID_SET_REPORT) {
- usb_wait_receive_out();
- usb_keyboard_leds = UEDATX;
- usb_ack_out();
- usb_send_in();
- return;
- }
- if (bRequest == HID_SET_IDLE) {
- keyboard_idle = (wValue >> 8);
- usb_keyboard_idle_count = 0;
- // usb_wait_in_ready();
- usb_send_in();
- return;
- }
- if (bRequest == HID_SET_PROTOCOL) {
- keyboard_protocol = wValue;
-#ifdef NKRO_ENABLE
- keymap_config.nkro = !!keyboard_protocol;
-#endif
- clear_keyboard();
- // usb_wait_in_ready();
- usb_send_in();
- return;
- }
- }
- }
-#ifdef MOUSE_ENABLE
- if (wIndex == MOUSE_INTERFACE) {
- if (bmRequestType == 0xA1) {
- if (bRequest == HID_GET_REPORT) {
- if (wValue == HID_REPORT_INPUT) {
- usb_wait_in_ready();
- UEDATX = 0;
- UEDATX = 0;
- UEDATX = 0;
- UEDATX = 0;
- usb_send_in();
- return;
- }
- if (wValue == HID_REPORT_FEATURE) {
- usb_wait_in_ready();
- UEDATX = 0x05;
- usb_send_in();
- return;
- }
- }
- if (bRequest == HID_GET_PROTOCOL) {
- usb_wait_in_ready();
- UEDATX = usb_mouse_protocol;
- usb_send_in();
- return;
- }
- }
- if (bmRequestType == 0x21) {
- if (bRequest == HID_SET_PROTOCOL) {
- usb_mouse_protocol = wValue;
- usb_send_in();
- return;
- }
- }
- }
-#endif
- if (wIndex == DEBUG_INTERFACE) {
- if (bRequest == HID_GET_REPORT && bmRequestType == 0xA1) {
- len = wLength;
- do {
- // wait for host ready for IN packet
- do {
- i = UEINTX;
- } while (!(i & ((1 << TXINI) | (1 << RXOUTI))));
- if (i & (1 << RXOUTI)) return; // abort
- // send IN packet
- n = len < ENDPOINT0_SIZE ? len : ENDPOINT0_SIZE;
- for (i = n; i; i--) {
- UEDATX = 0;
- }
- len -= n;
- usb_send_in();
- } while (len || n == ENDPOINT0_SIZE);
- return;
- }
- }
- }
- UECONX = (1 << STALLRQ) | (1 << EPEN); // stall
-}
diff --git a/tmk_core/protocol/pjrc/usb.h b/tmk_core/protocol/pjrc/usb.h
deleted file mode 100644
index 50654dccf7f5..000000000000
--- a/tmk_core/protocol/pjrc/usb.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef USB_H
-#define USB_H 1
-
-#include
-#include
-#include
-
-extern bool remote_wakeup;
-extern bool suspend;
-
-void usb_init(void); // initialize everything
-uint8_t usb_configured(void); // is the USB port configured
-void usb_remote_wakeup(void);
-
-#define EP_TYPE_CONTROL 0x00
-#define EP_TYPE_BULK_IN 0x81
-#define EP_TYPE_BULK_OUT 0x80
-#define EP_TYPE_INTERRUPT_IN 0xC1
-#define EP_TYPE_INTERRUPT_OUT 0xC0
-#define EP_TYPE_ISOCHRONOUS_IN 0x41
-#define EP_TYPE_ISOCHRONOUS_OUT 0x40
-
-#define EP_SINGLE_BUFFER 0x02
-#define EP_DOUBLE_BUFFER 0x06
-
-#define EP_SIZE(s) ((s) == 64 ? 0x30 : ((s) == 32 ? 0x20 : ((s) == 16 ? 0x10 : 0x00)))
-
-#if defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__)
-# define MAX_ENDPOINT 4
-# define UERST_MASK 0x1E
-#else
-# define MAX_ENDPOINT 6
-# define UERST_MASK 0x7E
-#endif
-
-#define LSB(n) (n & 255)
-#define MSB(n) ((n >> 8) & 255)
-
-#if defined(__AVR_AT90USB162__)
-# define HW_CONFIG()
-# define PLL_CONFIG() (PLLCSR = ((1 << PLLE) | (1 << PLLP0)))
-# define USB_CONFIG() (USBCON = (1 << USBE))
-# define USB_FREEZE() (USBCON = ((1 << USBE) | (1 << FRZCLK)))
-#elif defined(__AVR_ATmega32U4__)
-# define HW_CONFIG() (UHWCON = 0x01)
-# define PLL_CONFIG() (PLLCSR = 0x12)
-# define USB_CONFIG() (USBCON = ((1 << USBE) | (1 << OTGPADE)))
-# define USB_FREEZE() (USBCON = ((1 << USBE) | (1 << FRZCLK)))
-#elif defined(__AVR_AT90USB646__)
-# define HW_CONFIG() (UHWCON = 0x81)
-# define PLL_CONFIG() (PLLCSR = 0x1A)
-# define USB_CONFIG() (USBCON = ((1 << USBE) | (1 << OTGPADE)))
-# define USB_FREEZE() (USBCON = ((1 << USBE) | (1 << FRZCLK)))
-#elif defined(__AVR_AT90USB1286__)
-# define HW_CONFIG() (UHWCON = 0x81)
-# define PLL_CONFIG() (PLLCSR = 0x16)
-# define USB_CONFIG() (USBCON = ((1 << USBE) | (1 << OTGPADE)))
-# define USB_FREEZE() (USBCON = ((1 << USBE) | (1 << FRZCLK)))
-#endif
-
-// standard control endpoint request types
-#define GET_STATUS 0
-#define CLEAR_FEATURE 1
-#define SET_FEATURE 3
-#define SET_ADDRESS 5
-#define GET_DESCRIPTOR 6
-#define GET_CONFIGURATION 8
-#define SET_CONFIGURATION 9
-#define GET_INTERFACE 10
-#define SET_INTERFACE 11
-// HID (human interface device)
-#define HID_GET_REPORT 1
-#define HID_GET_IDLE 2
-#define HID_GET_PROTOCOL 3
-#define HID_SET_REPORT 9
-#define HID_SET_IDLE 10
-#define HID_SET_PROTOCOL 11
-#define HID_REPORT_INPUT 1
-#define HID_REPORT_OUTPUT 2
-#define HID_REPORT_FEATURE 3
-// CDC (communication class device)
-#define CDC_SET_LINE_CODING 0x20
-#define CDC_GET_LINE_CODING 0x21
-#define CDC_SET_CONTROL_LINE_STATE 0x22
-// HID feature selectors
-#define DEVICE_REMOTE_WAKEUP 1
-#define ENDPOINT_HALT 0
-#define TEST_MODE 2
-
-/*------------------------------------------------------------------*
- * Keyboard descriptor setting
- *------------------------------------------------------------------*/
-#define KBD_INTERFACE 0
-#define KBD_ENDPOINT 1
-#define KBD_SIZE 8
-#define KBD_BUFFER EP_SINGLE_BUFFER
-#define KBD_REPORT_KEYS (KBD_SIZE - 2)
-
-// secondary keyboard
-#ifdef NKRO_ENABLE
-# define KBD2_INTERFACE 4
-# define KBD2_ENDPOINT 5
-# define KBD2_SIZE 16
-# define KBD2_BUFFER EP_DOUBLE_BUFFER
-# define KBD2_REPORT_KEYS (KBD2_SIZE - 1)
-#endif
-
-#endif
diff --git a/tmk_core/protocol/pjrc/usb_debug.c b/tmk_core/protocol/pjrc/usb_debug.c
deleted file mode 100644
index 7e78d96c3503..000000000000
--- a/tmk_core/protocol/pjrc/usb_debug.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include
-#include "sendchar.h"
-#include "usb_debug.h"
-
-// the time remaining before we transmit any partially full
-// packet, or send a zero length packet.
-volatile uint8_t debug_flush_timer = 0;
-
-int8_t sendchar(uint8_t c) {
- static uint8_t previous_timeout = 0;
- uint8_t timeout, intr_state;
-
- // if we're not online (enumerated and configured), error
- if (!usb_configured()) return -1;
- // interrupts are disabled so these functions can be
- // used from the main program or interrupt context,
- // even both in the same program!
- intr_state = SREG;
- cli();
- UENUM = DEBUG_TX_ENDPOINT;
- // if we gave up due to timeout before, don't wait again
- if (previous_timeout) {
- if (!(UEINTX & (1 << RWAL))) {
- SREG = intr_state;
- return -1;
- }
- previous_timeout = 0;
- }
- // wait for the FIFO to be ready to accept data
- timeout = UDFNUML + 4;
- while (1) {
- // are we ready to transmit?
- if (UEINTX & (1 << RWAL)) break;
- SREG = intr_state;
- // have we waited too long?
- if (UDFNUML == timeout) {
- previous_timeout = 1;
- return -1;
- }
- // has the USB gone offline?
- if (!usb_configured()) return -1;
- // get ready to try checking again
- intr_state = SREG;
- cli();
- UENUM = DEBUG_TX_ENDPOINT;
- }
- // actually write the byte into the FIFO
- UEDATX = c;
- // if this completed a packet, transmit it now!
- if (!(UEINTX & (1 << RWAL))) {
- UEINTX = 0x3A;
- debug_flush_timer = 0;
- } else {
- debug_flush_timer = 2;
- }
- SREG = intr_state;
- return 0;
-}
-
-// immediately transmit any buffered output.
-void usb_debug_flush_output(void) {
- uint8_t intr_state;
-
- intr_state = SREG;
- cli();
- if (debug_flush_timer) {
- UENUM = DEBUG_TX_ENDPOINT;
- while ((UEINTX & (1 << RWAL))) {
- UEDATX = 0;
- }
- UEINTX = 0x3A;
- debug_flush_timer = 0;
- }
- SREG = intr_state;
-}
diff --git a/tmk_core/protocol/pjrc/usb_debug.h b/tmk_core/protocol/pjrc/usb_debug.h
deleted file mode 100644
index efe075fa97d0..000000000000
--- a/tmk_core/protocol/pjrc/usb_debug.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef USB_DEBUG_H
-#define USB_DEBUG_H 1
-
-#include
-#include "usb.h"
-
-#define DEBUG_INTERFACE 2
-#define DEBUG_TX_ENDPOINT 3
-#define DEBUG_TX_SIZE 32
-#define DEBUG_TX_BUFFER EP_DOUBLE_BUFFER
-
-extern volatile uint8_t debug_flush_timer;
-
-void usb_debug_flush_output(void); // immediately transmit any buffered output
-
-#endif
diff --git a/tmk_core/protocol/pjrc/usb_extra.c b/tmk_core/protocol/pjrc/usb_extra.c
deleted file mode 100644
index 1745e651c7ef..000000000000
--- a/tmk_core/protocol/pjrc/usb_extra.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include
-#include
-#include "host.h"
-#include "usb_extra.h"
-
-int8_t usb_extra_send(uint8_t report_id, uint16_t data) {
- uint8_t intr_state, timeout;
-
- if (!usb_configured()) return -1;
- intr_state = SREG;
- cli();
- UENUM = EXTRA_ENDPOINT;
- timeout = UDFNUML + 50;
- while (1) {
- // are we ready to transmit?
- if (UEINTX & (1 << RWAL)) break;
- SREG = intr_state;
- // has the USB gone offline?
- if (!usb_configured()) return -1;
- // have we waited too long?
- if (UDFNUML == timeout) return -1;
- // get ready to try checking again
- intr_state = SREG;
- cli();
- UENUM = EXTRA_ENDPOINT;
- }
-
- UEDATX = report_id;
- UEDATX = data & 0xFF;
- UEDATX = (data >> 8) & 0xFF;
-
- UEINTX = 0x3A;
- SREG = intr_state;
- return 0;
-}
-
-int8_t usb_extra_consumer_send(uint16_t bits) { return usb_extra_send(REPORT_ID_CONSUMER, bits); }
-
-int8_t usb_extra_system_send(uint16_t bits) { return usb_extra_send(REPORT_ID_SYSTEM, bits); }
diff --git a/tmk_core/protocol/pjrc/usb_extra.h b/tmk_core/protocol/pjrc/usb_extra.h
deleted file mode 100644
index 674d582ac2c8..000000000000
--- a/tmk_core/protocol/pjrc/usb_extra.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef USB_EXTRA_H
-#define USB_EXTRA_H 1
-/*
- * Enhanced keyboard features for Windows:
- * Audio control and System control
- *
- * http://www.microsoft.com/whdc/archive/w2kbd.mspx
- */
-
-#include
-#include "usb.h"
-
-#define EXTRA_INTERFACE 3
-#define EXTRA_ENDPOINT 4
-#define EXTRA_SIZE 8
-#define EXTRA_BUFFER EP_DOUBLE_BUFFER
-
-int8_t usb_extra_consumer_send(uint16_t bits);
-int8_t usb_extra_system_send(uint16_t bits);
-
-#endif
diff --git a/tmk_core/protocol/pjrc/usb_keyboard.c b/tmk_core/protocol/pjrc/usb_keyboard.c
deleted file mode 100644
index 31856d0fda14..000000000000
--- a/tmk_core/protocol/pjrc/usb_keyboard.c
+++ /dev/null
@@ -1,114 +0,0 @@
-/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include
-#include
-#include "keycode.h"
-#include "usb_keyboard.h"
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "host.h"
-
-#ifdef NKRO_ENABLE
-# include "keycode_config.h"
-
-extern keymap_config_t keymap_config;
-#endif
-
-// protocol setting from the host. We use exactly the same report
-// either way, so this variable only stores the setting since we
-// are required to be able to report which setting is in use.
-uint8_t keyboard_protocol = 1;
-
-// the idle configuration, how often we send the report to the
-// host (ms * 4) even when it hasn't changed
-// Windows and Linux set 0 while OS X sets 6(24ms) by SET_IDLE request.
-uint8_t keyboard_idle = 125;
-
-// count until idle timeout
-uint8_t usb_keyboard_idle_count = 0;
-
-// 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana
-volatile uint8_t usb_keyboard_leds = 0;
-
-static inline int8_t send_report(report_keyboard_t *report, uint8_t endpoint, uint8_t keys_start, uint8_t keys_end);
-
-int8_t usb_keyboard_send_report(report_keyboard_t *report) {
- int8_t result = 0;
-
-#ifdef NKRO_ENABLE
- if (keymap_config.nkro)
- result = send_report(report, KBD2_ENDPOINT, 0, KBD2_SIZE);
- else
-#endif
- {
- result = send_report(report, KBD_ENDPOINT, 0, KBD_SIZE);
- }
-
- if (result) return result;
- usb_keyboard_idle_count = 0;
- usb_keyboard_print_report(report);
- return 0;
-}
-
-void usb_keyboard_print_report(report_keyboard_t *report) {
- if (!debug_keyboard) return;
- print("keys: ");
- for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
- phex(report->keys[i]);
- print(" ");
- }
- print(" mods: ");
- phex(report->mods);
- print("\n");
-}
-
-static inline int8_t send_report(report_keyboard_t *report, uint8_t endpoint, uint8_t keys_start, uint8_t keys_end) {
- uint8_t intr_state, timeout;
-
- if (!usb_configured()) return -1;
- intr_state = SREG;
- cli();
- UENUM = endpoint;
- timeout = UDFNUML + 50;
- while (1) {
- // are we ready to transmit?
- if (UEINTX & (1 << RWAL)) break;
- SREG = intr_state;
- // has the USB gone offline?
- if (!usb_configured()) return -1;
- // have we waited too long?
- if (UDFNUML == timeout) return -1;
- // get ready to try checking again
- intr_state = SREG;
- cli();
- UENUM = endpoint;
- }
- for (uint8_t i = keys_start; i < keys_end; i++) {
- UEDATX = report->raw[i];
- }
- UEINTX = 0x3A;
- SREG = intr_state;
- return 0;
-}
diff --git a/tmk_core/protocol/pjrc/usb_keyboard.h b/tmk_core/protocol/pjrc/usb_keyboard.h
deleted file mode 100644
index 919685fde4b8..000000000000
--- a/tmk_core/protocol/pjrc/usb_keyboard.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* USB Keyboard Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_keyboard.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef USB_KEYBOARD_H
-#define USB_KEYBOARD_H 1
-
-#include
-#include
-#include "usb.h"
-#include "host.h"
-
-extern uint8_t usb_keyboard_idle_count;
-extern volatile uint8_t usb_keyboard_leds;
-
-int8_t usb_keyboard_send_report(report_keyboard_t *report);
-void usb_keyboard_print_report(report_keyboard_t *report);
-
-#endif
diff --git a/tmk_core/protocol/pjrc/usb_mouse.c b/tmk_core/protocol/pjrc/usb_mouse.c
deleted file mode 100644
index 9e3639571c13..000000000000
--- a/tmk_core/protocol/pjrc/usb_mouse.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* USB Mouse Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_mouse.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#include
-#include
-#include "usb_mouse.h"
-#include "print.h"
-#include "debug.h"
-
-uint8_t usb_mouse_protocol = 1;
-
-int8_t usb_mouse_send(int8_t x, int8_t y, int8_t wheel_v, int8_t wheel_h, uint8_t buttons) {
- uint8_t intr_state, timeout;
-
- if (!usb_configured()) return -1;
- if (x == -128) x = -127;
- if (y == -128) y = -127;
- if (wheel_v == -128) wheel_v = -127;
- if (wheel_h == -128) wheel_h = -127;
- intr_state = SREG;
- cli();
- UENUM = MOUSE_ENDPOINT;
- timeout = UDFNUML + 50;
- while (1) {
- // are we ready to transmit?
- if (UEINTX & (1 << RWAL)) break;
- SREG = intr_state;
- // has the USB gone offline?
- if (!usb_configured()) return -1;
- // have we waited too long?
- if (UDFNUML == timeout) return -1;
- // get ready to try checking again
- intr_state = SREG;
- cli();
- UENUM = MOUSE_ENDPOINT;
- }
- UEDATX = buttons;
- UEDATX = x;
- UEDATX = y;
- if (usb_mouse_protocol) {
- UEDATX = wheel_v;
- UEDATX = wheel_h;
- }
-
- UEINTX = 0x3A;
- SREG = intr_state;
- return 0;
-}
-
-void usb_mouse_print(int8_t x, int8_t y, int8_t wheel_v, int8_t wheel_h, uint8_t buttons) {
- if (!debug_mouse) return;
- print("usb_mouse[btn|x y v h]: ");
- phex(buttons);
- print("|");
- phex(x);
- print(" ");
- phex(y);
- print(" ");
- phex(wheel_v);
- print(" ");
- phex(wheel_h);
- print("\n");
-}
diff --git a/tmk_core/protocol/pjrc/usb_mouse.h b/tmk_core/protocol/pjrc/usb_mouse.h
deleted file mode 100644
index ba7df230de70..000000000000
--- a/tmk_core/protocol/pjrc/usb_mouse.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* USB Mouse Plus Debug Channel Example for Teensy USB Development Board
- * http://www.pjrc.com/teensy/usb_mouse.html
- * Copyright (c) 2009 PJRC.COM, LLC
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-#ifndef USB_MOUSE_H
-#define USB_MOUSE_H 1
-
-#include
-#include
-#include "usb.h"
-
-#define MOUSE_INTERFACE 1
-#define MOUSE_ENDPOINT 2
-#define MOUSE_SIZE 8
-#define MOUSE_BUFFER EP_SINGLE_BUFFER
-
-#define MOUSE_BTN1 (1 << 0)
-#define MOUSE_BTN2 (1 << 1)
-#define MOUSE_BTN3 (1 << 2)
-#define MOUSE_BTN4 (1 << 3)
-#define MOUSE_BTN5 (1 << 4)
-
-extern uint8_t usb_mouse_protocol;
-
-int8_t usb_mouse_send(int8_t x, int8_t y, int8_t wheel_v, int8_t wheel_h, uint8_t buttons);
-void usb_mouse_print(int8_t x, int8_t y, int8_t wheel_v, int8_t wheel_h, uint8_t buttons);
-
-#endif
diff --git a/tmk_core/readme.md b/tmk_core/readme.md
index a3783fe37b8a..71b8d2e9fc48 100644
--- a/tmk_core/readme.md
+++ b/tmk_core/readme.md
@@ -48,7 +48,7 @@ Complete firmwares for various keyboards and protocol converters.
License
-------
**GPLv2** or later. Some protocol files are under **Modified BSD License**.
-LUFA, PJRC and V-USB stack have their own license respectively.
+ChibiOS, LUFA and V-USB stack have their own license respectively.
@@ -85,9 +85,9 @@ Architecture
/ /| Keys/Mouse | Protocol |d| | Action | | | Protocol |
/__________/ |<-----------| LUFA |r| | Layer, Tap | | | Matrix |
|.--------.| | LED | V-USB |i| |-------------| | | PS/2,IBM | __________________
- || || |----------->| PJRC |v| | Keymap | | | ADB,M0110| Keys / /_/_/_/_/_/_/_/ /|
- || Host || | Console | iWRAP(BT)|e| | Mousekey | | | SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
- ||________||/.<-----------| UART |r| | Report | | | X68K/PC98| Control / /_/_/_/_/_/_/_/ / /
+ || || |----------->| iWRAP(BT)|v| | Keymap | | | ADB,M0110| Keys / /_/_/_/_/_/_/_/ /|
+ || Host || | Console | UART |e| | Mousekey | | | SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
+ ||________||/.<-----------| |r| | Report | | | X68K/PC98| Control / /_/_/_/_/_/_/_/ / /
`_========_'/| |---------------------------------------------|-------->/___ /_______/ ___/ /
|_o______o_|/ | Sendchar, Print, Debug, Command, ... | |_________________|/
+---------------------------------------------+ Keyboard
@@ -133,7 +133,6 @@ Files and Directories
### Keyboard Protocols
* lufa/ - LUFA USB stack
-* pjrc/ - PJRC USB stack
* vusb/ - Objective Development V-USB
* iwrap/ - Bluetooth HID for Bluegiga iWRAP
* ps2.c - PS/2 protocol
From b6e23f974bf92a2e2342ede43e98ecfd24a84f51 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Sat, 8 Feb 2020 23:58:28 +0100
Subject: [PATCH 003/108] Update the flash cli command to use the user config
(#8125)
---
lib/python/qmk/cli/flash.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/python/qmk/cli/flash.py b/lib/python/qmk/cli/flash.py
index e897174a2025..cc1e6235afa5 100644
--- a/lib/python/qmk/cli/flash.py
+++ b/lib/python/qmk/cli/flash.py
@@ -52,7 +52,7 @@ def flash(cli):
print_bootloader_help()
return False
- elif cli.args.keymap and not cli.args.keyboard:
+ elif cli.config.flash.keymap and not cli.config.flash.keyboard:
# If only a keymap was given but no keyboard, suggest listing keyboards
cli.echo('usage: qmk flash [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]')
cli.log.error('run \'qmk list_keyboards\' to find out the supported keyboards')
@@ -70,7 +70,7 @@ def flash(cli):
cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap'])
- elif cli.args.keyboard and cli.args.keymap:
+ elif cli.config.flash.keyboard and cli.config.flash.keymap:
# Generate the make command for a specific keyboard/keymap.
command = create_make_command(cli.config.flash.keyboard, cli.config.flash.keymap, cli.args.bootloader)
From 2fe288d01d1f15cd2bcfcf6f4282f728da6ea7be Mon Sep 17 00:00:00 2001
From: nopunin10did
Date: Sat, 8 Feb 2020 22:54:10 -0500
Subject: [PATCH 004/108] [Keymap] Adding ergodash/rev1:nopunin10did (#8098)
* Adding ergodash/rev1:nopunin10did
* Update keyboards/ergodash/rev1/keymaps/nopunin10did/keymap.c
* Update keyboards/ergodash/rev1/keymaps/nopunin10did/keymap.c
* Update keyboards/ergodash/rev1/keymaps/nopunin10did/readme.md
---
.../rev1/keymaps/nopunin10did/config.h | 36 +++++++++++++++++++
.../rev1/keymaps/nopunin10did/keymap.c | 18 ++++++++++
.../rev1/keymaps/nopunin10did/layers.json | 1 +
.../rev1/keymaps/nopunin10did/readme.md | 13 +++++++
.../rev1/keymaps/nopunin10did/rules.mk | 3 ++
5 files changed, 71 insertions(+)
create mode 100644 keyboards/ergodash/rev1/keymaps/nopunin10did/config.h
create mode 100644 keyboards/ergodash/rev1/keymaps/nopunin10did/keymap.c
create mode 100644 keyboards/ergodash/rev1/keymaps/nopunin10did/layers.json
create mode 100644 keyboards/ergodash/rev1/keymaps/nopunin10did/readme.md
create mode 100644 keyboards/ergodash/rev1/keymaps/nopunin10did/rules.mk
diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/config.h b/keyboards/ergodash/rev1/keymaps/nopunin10did/config.h
new file mode 100644
index 000000000000..b5c45669d4b5
--- /dev/null
+++ b/keyboards/ergodash/rev1/keymaps/nopunin10did/config.h
@@ -0,0 +1,36 @@
+/*
+This is the c configuration file for the keymap
+
+Copyright 2012 Jun Wako
+Copyright 2015 Jack Humbert
+
+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 .
+*/
+
+#pragma once
+
+
+/* Use I2C or Serial, not both */
+
+#define USE_SERIAL
+// #define USE_I2C
+
+/* Select hand configuration */
+
+#define MASTER_LEFT
+// #define MASTER_RIGHT
+// #define EE_HANDS
+
+#undef TAPPING_TERM
+#define TAPPING_TERM 300
\ No newline at end of file
diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/keymap.c b/keyboards/ergodash/rev1/keymaps/nopunin10did/keymap.c
new file mode 100644
index 000000000000..61cac97b0d77
--- /dev/null
+++ b/keyboards/ergodash/rev1/keymaps/nopunin10did/keymap.c
@@ -0,0 +1,18 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_3key_2us(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_PGUP, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT,
+ LCA_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_PGDN, KC_RBRC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_GRV, KC_SPC, LT(1,KC_DEL), KC_HOME, KC_END, KC_BSLS, KC_LEFT, KC_RGHT, KC_DOWN, KC_UP
+ ),
+ [1] = LAYOUT_3key_2us(
+ KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F12, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LSFT(KC_HOME), LSFT(KC_END), KC_TRNS, LALT(LSFT(KC_LEFT)), LALT(LSFT(KC_RIGHT)), LALT(LSFT(KC_DOWN)), LALT(LSFT(KC_UP))
+ )
+};
diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/layers.json b/keyboards/ergodash/rev1/keymaps/nopunin10did/layers.json
new file mode 100644
index 000000000000..d6f647622b9d
--- /dev/null
+++ b/keyboards/ergodash/rev1/keymaps/nopunin10did/layers.json
@@ -0,0 +1 @@
+[["KC_ESC", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_EQL", "KC_7", "KC_8", "KC_9", "KC_0", "KC_MINS", "KC_BSPC", "KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_PGUP", "KC_LBRC", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_ENT", "LCA_T(KC_CAPS)", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_PGDN", "KC_RBRC", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", "KC_LSFT", "KC_Z", "KC_X", "KC_C", "KC_V", "KC_B", "KC_N", "KC_M", "KC_COMM", "KC_DOT", "KC_SLSH", "KC_RSFT", "KC_LCTL", "KC_LGUI", "KC_LALT", "MO(1)", "KC_GRV", "KC_SPC", "LT(1,KC_DEL)", "KC_HOME", "KC_END", "KC_BSLS", "KC_LEFT", "KC_RGHT", "KC_DOWN", "KC_UP"], ["KC_TRNS", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F12", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_PSCR", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "KC_TRNS", "LSFT(KC_HOME)", "LSFT(KC_END)", "KC_TRNS", "LALT(LSFT(KC_LEFT))", "LALT(LSFT(KC_RIGHT))", "LALT(LSFT(KC_DOWN))", "LALT(LSFT(KC_UP))"]]
\ No newline at end of file
diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/readme.md b/keyboards/ergodash/rev1/keymaps/nopunin10did/readme.md
new file mode 100644
index 000000000000..f3ba6752ad1e
--- /dev/null
+++ b/keyboards/ergodash/rev1/keymaps/nopunin10did/readme.md
@@ -0,0 +1,13 @@
+# Generated Keymap Layout
+
+This layout was generated by the QMK API. You can find the JSON data used to
+generate this keymap in the file layers.json.
+
+To make use of this file you will need follow the following steps:
+
+* Download or Clone QMK Firmware:
+* Extract QMK Firmware to a location on your hard drive
+* Copy this folder into `keyboards/ergodash/rev1/keymaps/`
+* You are now ready to compile or use your keymap with the source
+
+More information can be found in the QMK docs:
diff --git a/keyboards/ergodash/rev1/keymaps/nopunin10did/rules.mk b/keyboards/ergodash/rev1/keymaps/nopunin10did/rules.mk
new file mode 100644
index 000000000000..bb9e33b08297
--- /dev/null
+++ b/keyboards/ergodash/rev1/keymaps/nopunin10did/rules.mk
@@ -0,0 +1,3 @@
+BACKLIGHT_ENABLE = no
+RGBLIGHT_ENABLE = no
+AUDIO_ENABLE = no
From 6052aa499e6fa6f2601d71b18301a76218944463 Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Mon, 10 Feb 2020 04:19:08 +1100
Subject: [PATCH 005/108] Use FIRMWARE_FORMAT for "Checking file size" message
(#8121)
---
message.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/message.mk b/message.mk
index 831e30ef82ad..c8da7df0bb40 100644
--- a/message.mk
+++ b/message.mk
@@ -78,7 +78,7 @@ define GENERATE_MSG_AVAILABLE_KEYMAPS
endef
MSG_AVAILABLE_KEYMAPS = $(eval $(call GENERATE_MSG_AVAILABLE_KEYMAPS))$(MSG_AVAILABLE_KEYMAPS_ACTUAL)
-MSG_CHECK_FILESIZE = Checking file size of $(TARGET).hex
+MSG_CHECK_FILESIZE = Checking file size of $(TARGET).$(FIRMWARE_FORMAT)
MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) bytes over)\n
MSG_FILE_TOO_SMALL = The firmware is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n
MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(PERCENT_SIZE)%%, $(FREE_SIZE) bytes free)\n
From c3200aa8fcf86122736846017ca7b125ac225842 Mon Sep 17 00:00:00 2001
From: Ted Lin <49993528+tedlinsonos@users.noreply.github.com>
Date: Sun, 9 Feb 2020 23:50:45 -0500
Subject: [PATCH 006/108] Compile error if ONESHOT_TIMEOUT defined but oneshot
disabled (#8100)
* Compile error if ONESHOT_TIMEOUT defined but oneshot disabled
When ONESHOT_TIMEOUT and NO_ACTION_ONESHOT are both defined, this code
fails to compile.
Wrap the one usage of ONESHOT_TIMEOUT that is inconsistent with the
rest so all usages are properly wrapped by a check of NO_ACTION_ONESHOT.
* Run file through clang-format
Co-authored-by: Ted M Lin
---
tmk_core/common/action.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index 5dadba4fb7f3..d572b7056449 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -90,13 +90,15 @@ void action_exec(keyevent_t event) {
keyrecord_t record = {.event = event};
-#if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
+#ifndef NO_ACTION_ONESHOT
+# if (defined(ONESHOT_TIMEOUT) && (ONESHOT_TIMEOUT > 0))
if (has_oneshot_layer_timed_out()) {
clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
}
if (has_oneshot_mods_timed_out()) {
clear_oneshot_mods();
}
+# endif
#endif
#ifndef NO_ACTION_TAPPING
From 35c4dbe688f2db07426990c5980e9c70b4ff5667 Mon Sep 17 00:00:00 2001
From: madhogs <59648482+madhogs@users.noreply.github.com>
Date: Mon, 10 Feb 2020 07:53:12 +0000
Subject: [PATCH 007/108] New iso layout and keymap for dz60 with 4th row all
1u (#7830)
* Added new iso layout and keymap for dz60 with all 4th row keys 1u in size
---
keyboards/dz60/dz60.h | 27 +++++++++++++++
keyboards/dz60/info.json | 6 +++-
.../dz60/keymaps/iso_4th_row_all_1u/keymap.c | 29 ++++++++++++++++
.../dz60/keymaps/iso_4th_row_all_1u/readme.md | 34 +++++++++++++++++++
4 files changed, 95 insertions(+), 1 deletion(-)
create mode 100644 keyboards/dz60/keymaps/iso_4th_row_all_1u/keymap.c
create mode 100644 keyboards/dz60/keymaps/iso_4th_row_all_1u/readme.md
diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h
index 1d0c921935d8..c5c1c84958ca 100644
--- a/keyboards/dz60/dz60.h
+++ b/keyboards/dz60/dz60.h
@@ -628,4 +628,31 @@
{ k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, KC_NO }, \
{ k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, k4c, k4d, k4e } \
}
+
+/* LAYOUT_60_iso_4th_row_all_1u
+ * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
+ * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │
+ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
+ * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │
+ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │
+ * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │
+ * ├───┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┤
+ * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3c │3d │3e │
+ * ├───┴┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴───┼───┼───┼───┼───┼───┤
+ * │40 │41 │43 │46 │4a │4b │4c │4d │4e │
+ * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘
+*/
+#define LAYOUT_60_iso_4th_row_all_1u( \
+ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \
+ k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
+ k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \
+ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \
+ k40, k41, k43, k46, k4a, k4b, k4c, k4d, k4e \
+) { \
+ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \
+ { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \
+ { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \
+ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e }, \
+ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d, k4e } \
+}
#endif
diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json
index 49efeba06680..2d0220352896 100644
--- a/keyboards/dz60/info.json
+++ b/keyboards/dz60/info.json
@@ -92,6 +92,10 @@
"LAYOUT_60_abnt2": {
"key_count": 63,
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"\u00a8", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "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":"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":"\u00c7", "x":10.75, "y":2}, {"label":"^", "x":11.75, "y":2}, {"label":"}", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"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":"?", "x":12.25, "y":3}, {"label":"Shift", "x":13.25, "y":3, "w":1.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "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}]
- }
+ },
+ "LAYOUT_60_iso_4th_row_all_1u": {
+ "key_count": 65,
+ "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "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":"CapsLock", "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":"|", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Fn", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}]
+ }
}
}
diff --git a/keyboards/dz60/keymaps/iso_4th_row_all_1u/keymap.c b/keyboards/dz60/keymaps/iso_4th_row_all_1u/keymap.c
new file mode 100644
index 000000000000..e1552eccc44d
--- /dev/null
+++ b/keyboards/dz60/keymaps/iso_4th_row_all_1u/keymap.c
@@ -0,0 +1,29 @@
+#include QMK_KEYBOARD_H
+
+// LAYERS
+#define _QWERTY 0 // QWERTY layer
+#define _QW _QWERTY
+
+#define _FUNCTION 1 // Function layer
+#define _FN _FUNCTION
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [_QWERTY] = LAYOUT_60_iso_4th_row_all_1u(
+ // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+ KC_GESC, 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,
+ 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,
+ MO(_FN), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
+ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_INS, KC_UP, KC_DEL,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_CAPS, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT
+ ),
+
+ [_FUNCTION] = LAYOUT_60_iso_4th_row_all_1u(
+ // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+ 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_DEL,
+ _______, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, XXXXXXX, XXXXXXX,
+ _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
+ _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, XXXXXXX, KC_PGUP, XXXXXXX,
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_HOME, KC_PGDN, KC_END
+ ),
+};
diff --git a/keyboards/dz60/keymaps/iso_4th_row_all_1u/readme.md b/keyboards/dz60/keymaps/iso_4th_row_all_1u/readme.md
new file mode 100644
index 000000000000..6182800543b9
--- /dev/null
+++ b/keyboards/dz60/keymaps/iso_4th_row_all_1u/readme.md
@@ -0,0 +1,34 @@
+DZ60 iso layout with 4th row (Z row) having all 1u size keys.
+
+### _QWERTY:
+Base iso qwerty layer with arrow keys
+```
+,-----------------------------------------------------------------------------------------.
+| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
+|-----------------------------------------------------------------------------------------+
+| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | |
+|---------------------------------------------------------------------------------- Enter +
+| Fn | A | S | D | F | G | H | J | K | L | ; | ' | # | |
+|-----------------------------------------------------------------------------------------+
+|Shift| \ | Z | X | C | V | B | N | M | , | . | / | Ins | Up | Del |
+|-----------------------------------------------------------------------------------------+
+| Ctrl | Os | Alt | Space |Caps | Fn |Left |Down |Right|
+`-----------------------------------------------------------------------------------------'
+```
+
+### _FUNCTION
+Layer with function keys, media keys and rgb keys
+```
+FN Layer
+,-----------------------------------------------------------------------------------------.
+| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
+|-----------------------------------------------------------------------------------------+
+| | | Up | | | | | | | |PSRC | | | |
+|---------------------------------------------------------------------------------- +
+| |Left |Down |Right| | | | | | | | | | |
+|-----------------------------------------------------------------------------------------+
+| | | | | | |MPrev|MNext|Mute |VolUp|VolDn|MPlay| |PgUp | |
+|-----------------------------------------------------------------------------------------+
+| | | | | | |Home |PGDn | End |
+`-----------------------------------------------------------------------------------------'
+```
\ No newline at end of file
From 8f333138f5cc76ecc7538100ce93af5e228f0eb0 Mon Sep 17 00:00:00 2001
From: ai03
Date: Mon, 10 Feb 2020 00:53:16 -0800
Subject: [PATCH 008/108] [Keyboard] Add support for Polaris (#8123)
* Drop in old files
* Make a blank template keyboard to refresh ancient files to latest config
* Update keymaps files to new format
* Remove chunks of config asked for removal in previous pullreqs
* Remove split pin option from config
* Update rules.mk to latest version
* Remove unused functions from polaris.c
* Add via keymap
* Build basic tsangan keymap; add QMK configurator info
* Remove temporary template
* Update keyboards/ai03/polaris/config.h
* Update keyboards/ai03/polaris/readme.md
* Update keyboards/ai03/polaris/readme.md
* Update keyboards/ai03/polaris/readme.md
* Update rules.mk
* Fixes as per pullreq
* Update keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c
* Update keyboards/ai03/polaris/polaris.h
* Update keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c
* Update keyboards/ai03/polaris/info.json
* Update keyboards/ai03/polaris/keymaps/testing/readme.md
---
keyboards/ai03/polaris/config.h | 169 ++++++++++++++++++
keyboards/ai03/polaris/info.json | 145 +++++++++++++++
.../ai03/polaris/keymaps/default/keymap.c | 39 ++++
.../ai03/polaris/keymaps/default/readme.md | 3 +
.../keymaps/default_ansi_tsangan/keymap.c | 38 ++++
.../keymaps/default_ansi_tsangan/readme.md | 3 +
.../ai03/polaris/keymaps/testing/keymap.c | 39 ++++
.../ai03/polaris/keymaps/testing/readme.md | 16 ++
keyboards/ai03/polaris/keymaps/via/keymap.c | 55 ++++++
keyboards/ai03/polaris/keymaps/via/readme.md | 3 +
keyboards/ai03/polaris/keymaps/via/rules.mk | 1 +
keyboards/ai03/polaris/polaris.c | 16 ++
keyboards/ai03/polaris/polaris.h | 56 ++++++
keyboards/ai03/polaris/readme.md | 15 ++
keyboards/ai03/polaris/rules.mk | 32 ++++
15 files changed, 630 insertions(+)
create mode 100644 keyboards/ai03/polaris/config.h
create mode 100644 keyboards/ai03/polaris/info.json
create mode 100644 keyboards/ai03/polaris/keymaps/default/keymap.c
create mode 100644 keyboards/ai03/polaris/keymaps/default/readme.md
create mode 100644 keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c
create mode 100644 keyboards/ai03/polaris/keymaps/default_ansi_tsangan/readme.md
create mode 100644 keyboards/ai03/polaris/keymaps/testing/keymap.c
create mode 100644 keyboards/ai03/polaris/keymaps/testing/readme.md
create mode 100644 keyboards/ai03/polaris/keymaps/via/keymap.c
create mode 100644 keyboards/ai03/polaris/keymaps/via/readme.md
create mode 100644 keyboards/ai03/polaris/keymaps/via/rules.mk
create mode 100644 keyboards/ai03/polaris/polaris.c
create mode 100644 keyboards/ai03/polaris/polaris.h
create mode 100644 keyboards/ai03/polaris/readme.md
create mode 100644 keyboards/ai03/polaris/rules.mk
diff --git a/keyboards/ai03/polaris/config.h b/keyboards/ai03/polaris/config.h
new file mode 100644
index 000000000000..bb3307d97cef
--- /dev/null
+++ b/keyboards/ai03/polaris/config.h
@@ -0,0 +1,169 @@
+/*
+Copyright 2019 Ryota Goto
+
+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 .
+*/
+
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0xA103
+#define PRODUCT_ID 0x0002
+#define DEVICE_VER 0x0001
+#define MANUFACTURER ai03 Design Studio
+#define PRODUCT Polaris
+#define DESCRIPTION Basic 60% keyboard
+
+/* key matrix size */
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 14
+
+/*
+ * Keyboard Matrix Assignments
+ *
+ * Change this to how you wired your keyboard
+ * COLS: AVR pins used for columns, left to right
+ * ROWS: AVR pins used for rows, top to bottom
+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
+ * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
+ *
+*/
+#define MATRIX_ROW_PINS { B1, B2, B3, F0, F1 }
+#define MATRIX_COL_PINS { F4, F7, F5, F6, C7, C6, B6, B5, B4, D7, D6, D4, D5, D3 }
+#define UNUSED_PINS
+
+/* COL2ROW, ROW2COL*/
+#define DIODE_DIRECTION COL2ROW
+
+#define BACKLIGHT_PIN B7
+#define BACKLIGHT_BREATHING
+#define BACKLIGHT_LEVELS 5
+
+#define RGB_DI_PIN D2
+#ifdef RGB_DI_PIN
+ #define RGBLED_NUM 14
+ #define RGBLIGHT_HUE_STEP 8
+ #define RGBLIGHT_SAT_STEP 8
+ #define RGBLIGHT_VAL_STEP 8
+ #define RGBLIGHT_LIMIT_VAL 200 /* The maximum brightness level */
+ #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
+/*== all animations enable ==*/
+ #define RGBLIGHT_ANIMATIONS
+// /*== or choose animations ==*/
+// #define RGBLIGHT_EFFECT_BREATHING
+// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
+// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
+// #define RGBLIGHT_EFFECT_SNAKE
+// #define RGBLIGHT_EFFECT_KNIGHT
+// #define RGBLIGHT_EFFECT_CHRISTMAS
+// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
+// #define RGBLIGHT_EFFECT_RGB_TEST
+// #define RGBLIGHT_EFFECT_ALTERNATING
+// /*== customize breathing effect ==*/
+// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
+// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
+// /*==== use exp() and sin() ====*/
+// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
+// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
+#endif
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCE 5
+
+/* define if matrix has ghost (lacks anti-ghosting diodes) */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+/*
+ * Magic Key Options
+ *
+ * Magic keys are hotkey commands that allow control over firmware functions of
+ * the keyboard. They are best used in combination with the HID Listen program,
+ * found here: https://www.pjrc.com/teensy/hid_listen.html
+ *
+ * The options below allow the magic key functionality to be changed. This is
+ * useful if your keyboard/keypad is missing keys and you want magic key support.
+ *
+ */
+
+/* key combination for magic key command */
+/* defined by default; to change, uncomment and set to the combination you want */
+// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
+
+/* control how magic key switches layers */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
+
+/* override magic key keymap */
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
+//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
+//#define MAGIC_KEY_HELP H
+//#define MAGIC_KEY_HELP_ALT SLASH
+//#define MAGIC_KEY_DEBUG D
+//#define MAGIC_KEY_DEBUG_MATRIX X
+//#define MAGIC_KEY_DEBUG_KBD K
+//#define MAGIC_KEY_DEBUG_MOUSE M
+//#define MAGIC_KEY_VERSION V
+//#define MAGIC_KEY_STATUS S
+//#define MAGIC_KEY_CONSOLE C
+//#define MAGIC_KEY_LAYER0 0
+//#define MAGIC_KEY_LAYER0_ALT GRAVE
+//#define MAGIC_KEY_LAYER1 1
+//#define MAGIC_KEY_LAYER2 2
+//#define MAGIC_KEY_LAYER3 3
+//#define MAGIC_KEY_LAYER4 4
+//#define MAGIC_KEY_LAYER5 5
+//#define MAGIC_KEY_LAYER6 6
+//#define MAGIC_KEY_LAYER7 7
+//#define MAGIC_KEY_LAYER8 8
+//#define MAGIC_KEY_LAYER9 9
+//#define MAGIC_KEY_BOOTLOADER B
+//#define MAGIC_KEY_BOOTLOADER_ALT ESC
+//#define MAGIC_KEY_LOCK CAPS
+//#define MAGIC_KEY_EEPROM E
+//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
+//#define MAGIC_KEY_NKRO N
+//#define MAGIC_KEY_SLEEP_LED Z
+
+/*
+ * Feature disable options
+ * These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+/* Bootmagic Lite key configuration */
+// #define BOOTMAGIC_LITE_ROW 0
+// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/ai03/polaris/info.json b/keyboards/ai03/polaris/info.json
new file mode 100644
index 000000000000..f40e7bec77d6
--- /dev/null
+++ b/keyboards/ai03/polaris/info.json
@@ -0,0 +1,145 @@
+{
+ "keyboard_name": "Polaris",
+ "url": "https://kb.ai03.me/projects/polaris.html",
+ "maintainer": "ai03",
+ "width": 15,
+ "height": 5,
+ "layouts": {
+ "LAYOUT_all": {
+ "layout": [
+ {"label":"~", "x":0, "y":0},
+ {"label":"!", "x":1, "y":0},
+ {"label":"@", "x":2, "y":0},
+ {"label":"#", "x":3, "y":0},
+ {"label":"$", "x":4, "y":0},
+ {"label":"%", "x":5, "y":0},
+ {"label":"^", "x":6, "y":0},
+ {"label":"&", "x":7, "y":0},
+ {"label":"*", "x":8, "y":0},
+ {"label":"(", "x":9, "y":0},
+ {"label":")", "x":10, "y":0},
+ {"label":"_", "x":11, "y":0},
+ {"label":"+", "x":12, "y":0},
+ {"label":"Backspace", "x":13, "y":0},
+ {"label":"Delete", "x":14, "y":0},
+ {"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":1.25},
+ {"label":"|", "x":1.25, "y":3},
+ {"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":1.75},
+ {"label":"Print Screen", "x":14, "y":3},
+ {"label":"Ctrl", "x":0, "y":4, "w":1.25},
+ {"label":"Win", "x":1.25, "y":4, "w":1.25},
+ {"label":"Alt", "x":2.5, "y":4, "w":1.25},
+ {"x":3.75, "y":4, "w":2.25},
+ {"x":6, "y":4, "w":1.25},
+ {"x":7.25, "y":4, "w":2.75},
+ {"label":"Alt", "x":10, "y":4, "w":1.25},
+ {"label":"Win", "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}
+ ]
+ },
+ "LAYOUT_60_ansi_tsangan_split_rshift": {
+ "layout": [
+ {"label":"~", "x":0, "y":0},
+ {"label":"!", "x":1, "y":0},
+ {"label":"@", "x":2, "y":0},
+ {"label":"#", "x":3, "y":0},
+ {"label":"$", "x":4, "y":0},
+ {"label":"%", "x":5, "y":0},
+ {"label":"^", "x":6, "y":0},
+ {"label":"&", "x":7, "y":0},
+ {"label":"*", "x":8, "y":0},
+ {"label":"(", "x":9, "y":0},
+ {"label":")", "x":10, "y":0},
+ {"label":"_", "x":11, "y":0},
+ {"label":"+", "x":12, "y":0},
+ {"label":"Backspace", "x":13, "y":0},
+ {"label":"Delete", "x":14, "y":0},
+ {"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":1.75},
+ {"label":"Print Screen", "x":14, "y":3},
+ {"label":"Ctrl", "x":0, "y":4, "w":1.5},
+ {"label":"Win", "x":1.5, "y":4},
+ {"label":"Alt", "x":2.5, "y":4, "w":1.5},
+ {"x":4, "y":4, "w":7},
+ {"label":"Alt", "x":11, "y":4, "w":1.5},
+ {"label":"Win", "x":12.5, "y":4},
+ {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}
+ ]
+ }
+ }
+}
diff --git a/keyboards/ai03/polaris/keymaps/default/keymap.c b/keyboards/ai03/polaris/keymaps/default/keymap.c
new file mode 100644
index 000000000000..65902ae583e8
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/default/keymap.c
@@ -0,0 +1,39 @@
+/* Copyright 2019 Ryota Goto
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+enum layer_names {
+ _BASE,
+ _FN
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_BASE] = LAYOUT_all( /* Base */
+ KC_ESC, 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, KC_DEL,
+ 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,
+ MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL
+ ),
+ [_FN] = LAYOUT_all( /* FN */
+ RESET, 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_DEL, KC_BSPC,
+ _______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, KC_MPRV, KC_MPLY, KC_MNXT, BL_STEP,
+ _______, KC_HOME, KC_PGDN, KC_END, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
+ _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_PSCR, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ )
+};
+
diff --git a/keyboards/ai03/polaris/keymaps/default/readme.md b/keyboards/ai03/polaris/keymaps/default/readme.md
new file mode 100644
index 000000000000..ec7f3154a4f8
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/default/readme.md
@@ -0,0 +1,3 @@
+# The default keymap for Polaris
+
+Fits just about everything on two layers.
\ No newline at end of file
diff --git a/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c b/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c
new file mode 100644
index 000000000000..3ccaa28fe3bc
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c
@@ -0,0 +1,38 @@
+/* Copyright 2019 Ryota Goto
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+enum layer_names {
+ _BASE,
+ _FN
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_BASE] = LAYOUT_60_ansi_tsangan_split_rshift( /* Base */
+ KC_ESC, 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, KC_DEL,
+ 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,
+ MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL
+ ),
+ [_FN] = LAYOUT_60_ansi_tsangan_split_rshift( /* FN */
+ RESET, 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_DEL, KC_BSPC,
+ _______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, KC_MPRV, KC_MPLY, KC_MNXT, BL_STEP,
+ _______, KC_HOME, KC_PGDN, KC_END, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
+ _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_PSCR, _______,
+ _______, _______, _______, _______, _______, _______, _______
+ )
+};
diff --git a/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/readme.md b/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/readme.md
new file mode 100644
index 000000000000..a6a85dd525f7
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/readme.md
@@ -0,0 +1,3 @@
+# The default_ansi_tsangan keymap for Polaris
+
+Simplified down to the basic ANSI Tsangan layouts for ease of configuration.
\ No newline at end of file
diff --git a/keyboards/ai03/polaris/keymaps/testing/keymap.c b/keyboards/ai03/polaris/keymaps/testing/keymap.c
new file mode 100644
index 000000000000..c8192251034b
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/testing/keymap.c
@@ -0,0 +1,39 @@
+/* Copyright 2019 Ryota Goto
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+enum layer_names {
+ _BASE,
+ _FN
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_BASE] = LAYOUT_all( /* Base */
+ BL_TOGG, BL_STEP, KC_NO, KC_NO, KC_NO, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_BSPC, KC_DEL,
+ 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,
+ MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL
+ ),
+ [_FN] = LAYOUT_all( /* FN */
+ RESET, 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_DEL, KC_BSPC,
+ _______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, KC_MPRV, KC_MPLY, KC_MNXT, BL_STEP,
+ _______, KC_HOME, KC_PGDN, KC_END, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
+ _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_PSCR, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ )
+};
+
diff --git a/keyboards/ai03/polaris/keymaps/testing/readme.md b/keyboards/ai03/polaris/keymaps/testing/readme.md
new file mode 100644
index 000000000000..ceefe30e8a02
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/testing/readme.md
@@ -0,0 +1,16 @@
+# The PCB testing keymap for Polaris
+
+LED control keys are placed on the numrow.
+Mainly for factory testing use only.
+
+ESC = Backlight Toggle
+1 = Backlight Step
+
+5 = RGB Toggle
+6 = RGB Mode Cycle
+7 = RGB Hue Increase
+8 = RGB Hue Decrease
+9 = RGB Saturation Increase
+0 = RGB Saturation Decrease
+MINS = RGB Value Increase
+EQL = RGB Value Decrease
diff --git a/keyboards/ai03/polaris/keymaps/via/keymap.c b/keyboards/ai03/polaris/keymaps/via/keymap.c
new file mode 100644
index 000000000000..67c5cd37eabc
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/via/keymap.c
@@ -0,0 +1,55 @@
+/* Copyright 2019 Ryota Goto
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+enum layer_names {
+ _BASE,
+ _FN,
+ _EXTRA_ONE,
+ _EXTRA_TWO
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_BASE] = LAYOUT_all( /* Base */
+ KC_ESC, 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, KC_DEL,
+ 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,
+ MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RALT, KC_RGUI, KC_RCTL
+ ),
+ [_FN] = LAYOUT_all( /* FN */
+ _______, 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_DEL, KC_BSPC,
+ _______, _______, _______, KC_PGUP, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______, BL_STEP,
+ _______, _______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
+ _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_PSCR, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [_EXTRA_ONE] = LAYOUT_all( /* Layer 3 */
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [_EXTRA_TWO] = LAYOUT_all( /* Layer 3 */
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ )
+};
+
diff --git a/keyboards/ai03/polaris/keymaps/via/readme.md b/keyboards/ai03/polaris/keymaps/via/readme.md
new file mode 100644
index 000000000000..6e4d2c7446c6
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/via/readme.md
@@ -0,0 +1,3 @@
+# The via keymap for Polaris
+
+For via configurator use
\ No newline at end of file
diff --git a/keyboards/ai03/polaris/keymaps/via/rules.mk b/keyboards/ai03/polaris/keymaps/via/rules.mk
new file mode 100644
index 000000000000..036bd6d1c3ec
--- /dev/null
+++ b/keyboards/ai03/polaris/keymaps/via/rules.mk
@@ -0,0 +1 @@
+VIA_ENABLE = yes
\ No newline at end of file
diff --git a/keyboards/ai03/polaris/polaris.c b/keyboards/ai03/polaris/polaris.c
new file mode 100644
index 000000000000..256dcb930a6d
--- /dev/null
+++ b/keyboards/ai03/polaris/polaris.c
@@ -0,0 +1,16 @@
+/* Copyright 2019 Ryota Goto
+ *
+ * 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 .
+ */
+#include "polaris.h"
diff --git a/keyboards/ai03/polaris/polaris.h b/keyboards/ai03/polaris/polaris.h
new file mode 100644
index 000000000000..306f446765e7
--- /dev/null
+++ b/keyboards/ai03/polaris/polaris.h
@@ -0,0 +1,56 @@
+/* Copyright 2019 Ryota Goto
+ *
+ * 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 .
+ */
+#pragma once
+
+#include "quantum.h"
+
+/* This a shortcut to help you visually see your layout.
+ *
+ * The first section contains all of the arguments representing the physical
+ * layout of the board and position of the keys.
+ *
+ * The second converts the arguments into a two-dimensional array which
+ * represents the switch matrix.
+ */
+#define LAYOUT_all( \
+ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K212, \
+ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
+ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \
+ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \
+ K400, K401, K402, K404, K406, K408, K410, K411, K412, K413 \
+) \
+{ \
+ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \
+ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \
+ { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \
+ { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \
+ { K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413 } \
+}
+
+#define LAYOUT_60_ansi_tsangan_split_rshift( \
+ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K212, \
+ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
+ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \
+ K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \
+ K400, K401, K402, K406, K411, K412, K413 \
+) \
+{ \
+ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \
+ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \
+ { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \
+ { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \
+ { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, K412, K413 } \
+}
diff --git a/keyboards/ai03/polaris/readme.md b/keyboards/ai03/polaris/readme.md
new file mode 100644
index 000000000000..c9c8e7e222a0
--- /dev/null
+++ b/keyboards/ai03/polaris/readme.md
@@ -0,0 +1,15 @@
+# Polaris
+
+![Polaris](https://i.imgur.com/bENjPiKh.jpg)
+
+A basic 60% keyboard
+
+* Keyboard Maintainer: [ai03](https://github.com/ai03-2725)
+* Hardware Supported: Polaris PCB/case
+* Hardware Availability: Will be posted [here](https://kb.ai03.me/projects/polaris.html)
+
+Make example for this keyboard (after setting up your build environment):
+
+ make ai03/polaris:default
+
+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).
diff --git a/keyboards/ai03/polaris/rules.mk b/keyboards/ai03/polaris/rules.mk
new file mode 100644
index 000000000000..547bb88c7417
--- /dev/null
+++ b/keyboards/ai03/polaris/rules.mk
@@ -0,0 +1,32 @@
+# MCU name
+MCU = atmega32u4
+
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = atmel-dfu
+
+# Build Options
+# change yes to no to disable
+#
+BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
+MOUSEKEY_ENABLE = yes # Mouse keys
+EXTRAKEY_ENABLE = yes # Audio control and System control
+CONSOLE_ENABLE = no # Console for debug
+COMMAND_ENABLE = yes # Commands for debug and configuration
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = yes # USB Nkey Rollover
+BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
+MIDI_ENABLE = no # MIDI support
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output on port C6
+FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs
From 89c528e443561731eb3cf4ed3d49002545421afe Mon Sep 17 00:00:00 2001
From: Josh Johnson
Date: Tue, 11 Feb 2020 00:16:27 +1100
Subject: [PATCH 009/108] [Keyboard] Add support for Hub16 (#7794)
Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>
Co-Authored-By: fauxpark
---
keyboards/hub16/config.h | 97 ++++++++
keyboards/hub16/hub16.c | 16 ++
keyboards/hub16/hub16.h | 42 ++++
keyboards/hub16/keymaps/default/keymap.c | 96 ++++++++
keyboards/hub16/keymaps/no_mod/keymap.c | 63 ++++++
keyboards/hub16/matrix.c | 270 +++++++++++++++++++++++
keyboards/hub16/readme.md | 15 ++
keyboards/hub16/rules.mk | 38 ++++
8 files changed, 637 insertions(+)
create mode 100755 keyboards/hub16/config.h
create mode 100755 keyboards/hub16/hub16.c
create mode 100755 keyboards/hub16/hub16.h
create mode 100755 keyboards/hub16/keymaps/default/keymap.c
create mode 100755 keyboards/hub16/keymaps/no_mod/keymap.c
create mode 100644 keyboards/hub16/matrix.c
create mode 100755 keyboards/hub16/readme.md
create mode 100755 keyboards/hub16/rules.mk
diff --git a/keyboards/hub16/config.h b/keyboards/hub16/config.h
new file mode 100755
index 000000000000..c7dec995ebc2
--- /dev/null
+++ b/keyboards/hub16/config.h
@@ -0,0 +1,97 @@
+/*
+Copyright 2019 Josh Johnson
+
+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 .
+*/
+
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x8F73
+#define DEVICE_VER 0x0001
+#define MANUFACTURER Josh Johnson
+#define PRODUCT Hub16
+#define DESCRIPTION Macro Pad with USB Hub and Encoders
+
+/* key matrix size */
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 4
+
+/*
+ * Keyboard Matrix Assignments
+ *
+ * Change this to how you wired your keyboard
+ * COLS: AVR pins used for columns, left to right
+ * ROWS: AVR pins used for rows, top to bottom
+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
+ * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
+ *
+ */
+#define MATRIX_ROW_PINS \
+ { F0, C7, C6, B6, E6}
+#define MATRIX_COL_PINS \
+ { F4, F1, D5, D3 }
+
+/* COL2ROW, ROW2COL*/
+#define DIODE_DIRECTION COL2ROW
+
+#define RGB_DI_PIN D1
+// #ifdef RGB_DI_PIN
+#define RGBLED_NUM 11
+#define RGBLIGHT_HUE_STEP 8
+#define RGBLIGHT_SAT_STEP 8
+#define RGBLIGHT_VAL_STEP 8
+#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
+#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
+// /*== all animations enable ==*/
+// #define RGBLIGHT_ANIMATIONS
+// /*== or choose animations ==*/
+#define RGBLIGHT_EFFECT_BREATHING
+#define RGBLIGHT_EFFECT_RAINBOW_MOOD
+#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
+#define RGBLIGHT_EFFECT_SNAKE
+#define RGBLIGHT_EFFECT_KNIGHT
+// #define RGBLIGHT_EFFECT_CHRISTMAS
+// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
+// #define RGBLIGHT_EFFECT_RGB_TEST
+// #define RGBLIGHT_EFFECT_ALTERNATING
+// /*== customize breathing effect ==*/
+// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
+// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
+// /*==== use exp() and sin() ====*/
+// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
+// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
+// #endif
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCE 20
+
+/* ENCODER THINGS */
+
+// #define NUMBER_OF_ENCODERS 2
+#define ENCODERS_PAD_A \
+ { F6, B4 }
+#define ENCODERS_PAD_B \
+ { F5, B5 }
+
+/* Tap Dance timing */
+#define TAPPING_TERM 200
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
diff --git a/keyboards/hub16/hub16.c b/keyboards/hub16/hub16.c
new file mode 100755
index 000000000000..e18ba5526916
--- /dev/null
+++ b/keyboards/hub16/hub16.c
@@ -0,0 +1,16 @@
+/* Copyright 2019 Josh Johnson
+ *
+ * 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 .
+ */
+#include "hub16.h"
\ No newline at end of file
diff --git a/keyboards/hub16/hub16.h b/keyboards/hub16/hub16.h
new file mode 100755
index 000000000000..36830bf5c086
--- /dev/null
+++ b/keyboards/hub16/hub16.h
@@ -0,0 +1,42 @@
+/* Copyright 2019 Josh Johnson
+ *
+ * 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 .
+ */
+#pragma once
+
+#include "quantum.h"
+#define ___ KC_NO
+
+/* This a shortcut to help you visually see your layout.
+ *
+ * The first section contains all of the arguments representing the physical
+ * layout of the board and position of the keys.
+ *
+ * The second converts the arguments into a two-dimensional array which
+ * represents the switch matrix.
+ */
+#define LAYOUT( \
+ k40, k41, \
+ k00, k01, k02, k03, \
+ k10, k11, k12, k13, \
+ k20, k21, k22, k23, \
+ k30, k31, k32, k33 \
+) { \
+ { k00, k01, k02, k03, }, \
+ { k10, k11, k12, k13, }, \
+ { k20, k21, k22, k23, }, \
+ { k30, k31, k32, k33, }, \
+ { k40, k41, ___, ___, } \
+}
+
diff --git a/keyboards/hub16/keymaps/default/keymap.c b/keyboards/hub16/keymaps/default/keymap.c
new file mode 100755
index 000000000000..a77c8bc78294
--- /dev/null
+++ b/keyboards/hub16/keymaps/default/keymap.c
@@ -0,0 +1,96 @@
+/* Copyright 2019 Josh Johnson
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+// Function key we are 'wrapping' usual key presses in
+#define KC_WRAP KC_F24
+
+// Tap Dance Declarations
+enum { TD_TO_LED = 0, TD_TO_DEFAULT = 1 };
+
+qk_tap_dance_action_t tap_dance_actions[] = {
+ // Tap once for HID, twice to toggle layer 1
+ [TD_TO_LED] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 1),
+ [TD_TO_DEFAULT] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 0)};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT( /* Base */
+ KC_S, KC_V,
+ KC_A, KC_B, KC_C, KC_D,
+ KC_E, KC_F, KC_G, KC_H,
+ KC_I, KC_J, KC_K, KC_L,
+ KC_M, KC_N, KC_O, TD(TD_TO_LED)
+ ),
+
+ [1] = LAYOUT( /* LED Control */
+ KC_NO, KC_NO,
+ _______, RGB_MOD, RGB_RMOD, RGB_TOG,
+ RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI,
+ RGB_SAD, RGB_SAI, _______, _______,
+ _______, _______, RESET, TD(TD_TO_DEFAULT)
+ ),
+};
+
+// Keyboard is setup to 'warp' the pressed key with F24,
+// allowing for easy differentiation from a real keyboard.
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) { /* Left Encoder */
+ if (clockwise) {
+ register_code(KC_WRAP);
+ tap_code(KC_R);
+ unregister_code(KC_WRAP);
+ } else {
+ register_code(KC_WRAP);
+ tap_code(KC_Q);
+ unregister_code(KC_WRAP);
+ }
+ } else if (index == 1) { /* Right Encoder */
+ if (clockwise) {
+ register_code(KC_WRAP);
+ tap_code(KC_U);
+ unregister_code(KC_WRAP);
+ } else {
+ register_code(KC_WRAP);
+ tap_code(KC_T);
+ unregister_code(KC_WRAP);
+ }
+ }
+}
+
+// Below stolen from TaranVH (https://github.com/TaranVH/2nd-keyboard/blob/master/HASU_USB/F24/keymap.c)
+// Shoutout to drashna on the QMK discord for basically writing this for me.... :P
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ static uint8_t f24_tracker;
+ switch (keycode) {
+ case KC_A ... KC_F23:
+ case KC_EXECUTE ... KC_EXSEL:
+ if (record->event.pressed) {
+ register_code(KC_WRAP);
+ f24_tracker++;
+ register_code(keycode);
+ } else {
+ unregister_code(keycode);
+ f24_tracker--;
+ if (!f24_tracker) {
+ unregister_code(KC_WRAP);
+ }
+ }
+ return false;
+ break;
+ }
+ return true;
+}
diff --git a/keyboards/hub16/keymaps/no_mod/keymap.c b/keyboards/hub16/keymaps/no_mod/keymap.c
new file mode 100755
index 000000000000..c86ffcc16d27
--- /dev/null
+++ b/keyboards/hub16/keymaps/no_mod/keymap.c
@@ -0,0 +1,63 @@
+/* Copyright 2019 Josh Johnson
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+// Function key we are 'wrapping' usual key presses in
+#define KC_WRAP KC_F24
+
+// Tap Dance Declarations
+enum { TD_TO_LED = 0, TD_TO_DEFAULT = 1 };
+
+qk_tap_dance_action_t tap_dance_actions[] = {
+ // Tap once for HID, twice to toggle layer 1
+ [TD_TO_LED] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 1),
+ [TD_TO_DEFAULT] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 0)};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT( /* Base */
+ KC_S, KC_V,
+ KC_A, KC_B, KC_C, KC_D,
+ KC_E, KC_F, KC_G, KC_H,
+ KC_I, KC_J, KC_K, KC_L,
+ KC_M, KC_N, KC_O, TD(TD_TO_LED)
+ ),
+
+ [1] = LAYOUT( /* LED Control */
+ KC_NO, KC_NO,
+ _______, RGB_MOD, RGB_RMOD, RGB_TOG,
+ RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI,
+ RGB_SAD, RGB_SAI, _______, _______,
+ _______, _______, RESET, TD(TD_TO_DEFAULT)
+ ),
+};
+
+// Keyboard is setup to 'warp' the pressed key with F24,
+// allowing for easy differentiation from a real keyboard.
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) { /* Left Encoder */
+ if (clockwise) {
+ tap_code(KC_R);
+ } else {
+ tap_code(KC_Q);
+ }
+ } else if (index == 1) { /* Right Encoder */
+ if (clockwise) {
+ tap_code(KC_U);
+ } else {
+ tap_code(KC_T);
+ }
+ }
+}
\ No newline at end of file
diff --git a/keyboards/hub16/matrix.c b/keyboards/hub16/matrix.c
new file mode 100644
index 000000000000..ad77c923bea6
--- /dev/null
+++ b/keyboards/hub16/matrix.c
@@ -0,0 +1,270 @@
+/*
+Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar
+
+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 .
+*/
+#include
+#include
+#include "wait.h"
+#include "util.h"
+#include "matrix.h"
+#include "debounce.h"
+#include "quantum.h"
+
+// Encoder things
+#define SWITCH_1 F7
+#define SWITCH_2 D7
+static bool read_encoder_values(matrix_row_t current_matrix[], uint8_t current_row);
+
+#ifdef MATRIX_MASKED
+extern const matrix_row_t matrix_mask[];
+#endif
+
+#ifdef DIRECT_PINS
+static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS;
+#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
+static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
+static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
+#endif
+
+/* matrix state(1:on, 0:off) */
+static matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
+static matrix_row_t matrix[MATRIX_ROWS]; // debounced values
+
+// helper functions
+
+inline bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & ((matrix_row_t)1 << col)); }
+
+inline matrix_row_t matrix_get_row(uint8_t row) {
+ // Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
+ // switch blocker installed and the switch is always pressed.
+#ifdef MATRIX_MASKED
+ return matrix[row] & matrix_mask[row];
+#else
+ return matrix[row];
+#endif
+}
+
+// matrix code
+
+#ifdef DIRECT_PINS
+
+static void init_pins(void) {
+ for (int row = 0; row < MATRIX_ROWS; row++) {
+ for (int col = 0; col < MATRIX_COLS; col++) {
+ pin_t pin = direct_pins[row][col];
+ if (pin != NO_PIN) {
+ setPinInputHigh(pin);
+ }
+ }
+ }
+}
+
+static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
+ matrix_row_t last_row_value = current_matrix[current_row];
+ current_matrix[current_row] = 0;
+
+ for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
+ pin_t pin = direct_pins[current_row][col_index];
+ if (pin != NO_PIN) {
+ current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
+ }
+ }
+
+ return (last_row_value != current_matrix[current_row]);
+}
+
+#elif (DIODE_DIRECTION == COL2ROW)
+
+static void select_row(uint8_t row) {
+ setPinOutput(row_pins[row]);
+ writePinLow(row_pins[row]);
+}
+
+static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); }
+
+static void unselect_rows(void) {
+ for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
+ setPinInputHigh(row_pins[x]);
+ }
+}
+
+static void init_pins(void) {
+ unselect_rows();
+ for (uint8_t x = 0; x < MATRIX_COLS; x++) {
+ setPinInputHigh(col_pins[x]);
+ }
+}
+
+static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
+ // Store last value of row prior to reading
+ matrix_row_t last_row_value = current_matrix[current_row];
+
+ // Clear data in matrix row
+ current_matrix[current_row] = 0;
+
+ // Select row and wait for row selecton to stabilize
+ select_row(current_row);
+ wait_us(30);
+
+ // For each col...
+ for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
+ // Select the col pin to read (active low)
+ uint8_t pin_state = readPin(col_pins[col_index]);
+
+ // Populate the matrix row with the state of the col pin
+ current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
+ }
+
+ // Unselect row
+ unselect_row(current_row);
+
+ return (last_row_value != current_matrix[current_row]);
+}
+
+#elif (DIODE_DIRECTION == ROW2COL)
+
+static void select_col(uint8_t col) {
+ setPinOutput(col_pins[col]);
+ writePinLow(col_pins[col]);
+}
+
+static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); }
+
+static void unselect_cols(void) {
+ for (uint8_t x = 0; x < MATRIX_COLS; x++) {
+ setPinInputHigh(col_pins[x]);
+ }
+}
+
+static void init_pins(void) {
+ unselect_cols();
+ for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
+ setPinInputHigh(row_pins[x]);
+ }
+}
+
+static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
+ bool matrix_changed = false;
+
+ // Select col and wait for col selecton to stabilize
+ select_col(current_col);
+ wait_us(30);
+
+ // For each row...
+ for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
+ // Store last value of row prior to reading
+ matrix_row_t last_row_value = current_matrix[row_index];
+
+ // Check row pin state
+ if (readPin(row_pins[row_index]) == 0) {
+ // Pin LO, set col bit
+ current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
+ } else {
+ // Pin HI, clear col bit
+ current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col);
+ }
+
+ // Determine if the matrix changed state
+ if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) {
+ matrix_changed = true;
+ }
+ }
+
+ // Unselect col
+ unselect_col(current_col);
+
+ return matrix_changed;
+}
+
+#endif
+
+void matrix_init(void) {
+ // initialize key pins
+ init_pins();
+
+ // initialize matrix state: all keys off
+ for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+ raw_matrix[i] = 0;
+ matrix[i] = 0;
+ }
+
+ debounce_init(MATRIX_ROWS);
+
+ matrix_init_quantum();
+}
+
+uint8_t matrix_scan(void) {
+ bool changed = false;
+
+#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW)
+ // Set row, read cols
+ for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
+ changed |= read_cols_on_row(raw_matrix, current_row);
+ }
+#elif (DIODE_DIRECTION == ROW2COL)
+ // Set col, read rows
+ for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
+ changed |= read_rows_on_col(raw_matrix, current_col);
+ }
+#endif
+
+ debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
+
+ // Read encoder switches, already debounced
+ changed |= read_encoder_values(matrix, 4);
+
+ matrix_scan_quantum();
+ return (uint8_t)changed;
+}
+
+// Customisations for the encoders
+void matrix_init_kb(void){
+ setPinInput(SWITCH_1);
+ setPinInput(SWITCH_2);
+}
+
+void matrix_scan_kb(void){
+
+}
+
+void matrix_print(void){
+
+}
+
+static bool read_encoder_values(matrix_row_t current_matrix[], uint8_t current_row) {
+ // Store last value of row prior to reading
+ matrix_row_t last_row_value = current_matrix[current_row];
+
+ // Clear data in matrix row
+ current_matrix[current_row] = 0;
+
+ // Debounce the encoder buttons using a shift register
+ static uint8_t btn_1_array;
+ static uint8_t btn_2_array;
+ bool btn_1_rising = 0;
+ bool btn_2_rising = 0;
+ btn_1_array <<= 1;
+ btn_2_array <<= 1;
+ btn_1_array |= readPin(SWITCH_1);
+ btn_2_array |= readPin(SWITCH_2);
+ (btn_1_array == 0b01111111) ? (btn_1_rising = 1) : (btn_1_rising = 0);
+ (btn_2_array == 0b01111111) ? (btn_2_rising = 1) : (btn_2_rising = 0);
+
+ // Populate the matrix row with the state of the encoder
+ current_matrix[current_row] |= btn_1_rising ? (1 << 0) : 0;
+ current_matrix[current_row] |= btn_2_rising ? (1 << 1) : 0;
+
+ return (last_row_value != current_matrix[current_row]);
+}
\ No newline at end of file
diff --git a/keyboards/hub16/readme.md b/keyboards/hub16/readme.md
new file mode 100755
index 000000000000..996fa4463506
--- /dev/null
+++ b/keyboards/hub16/readme.md
@@ -0,0 +1,15 @@
+# Hub16
+
+Hub16 is a 16 Key Macro Pad with inbuilt USB 2.0 hub and dual rotary encoders.
+
+For more information regarding the keyboard, please visit the [Hub16 Webpage](https://www.joshajohnson.com/hub16-keyboard/) or [GitHub Repo](https://github.com/joshajohnson/Hub16).
+
+* Keyboard Maintainer: [Josh Johnson](https://github.com/joshajohnson)
+* Hardware Supported: Hub16 PCB (atmega32u4)
+* Hardware Availability: [Josh Johnson](https://www.joshajohnson.com/hub16-keyboard/)
+
+Make example for this keyboard (after setting up your build environment):
+
+ make hub16:default
+
+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).
diff --git a/keyboards/hub16/rules.mk b/keyboards/hub16/rules.mk
new file mode 100755
index 000000000000..ad1e238604df
--- /dev/null
+++ b/keyboards/hub16/rules.mk
@@ -0,0 +1,38 @@
+# MCU name
+MCU = atmega32u4
+
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = caterina
+
+# Build Options
+# change yes to no to disable
+#
+CUSTOM_MATRIX = yes # Custom scanning of matrix
+BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
+MOUSEKEY_ENABLE = no # Mouse keys
+EXTRAKEY_ENABLE = yes # Audio control and System control
+CONSOLE_ENABLE = yes # Console for debug
+COMMAND_ENABLE = yes # Commands for debug and configuration
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = no # USB Nkey Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
+MIDI_ENABLE = no # MIDI support
+UNICODE_ENABLE = no # Unicode
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output on port C6
+FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs
+ENCODER_ENABLE = yes # Rotary Encoder support
+TAP_DANCE_ENABLE = yes # Support for tap dancing
+
+SRC = matrix.c
From 9398c11b5190372e11cfe20222a9c872710dd86c Mon Sep 17 00:00:00 2001
From: Nick Brassel
Date: Tue, 11 Feb 2020 07:52:40 +1100
Subject: [PATCH 010/108] Remove tzarc's Luddite keymap. (#8139)
---
.../luddite/keymaps/tzarc/config.h | 6 ----
.../luddite/keymaps/tzarc/keymap.c | 30 -------------------
.../luddite/keymaps/tzarc/rules.mk | 1 -
3 files changed, 37 deletions(-)
delete mode 100644 keyboards/40percentclub/luddite/keymaps/tzarc/config.h
delete mode 100644 keyboards/40percentclub/luddite/keymaps/tzarc/keymap.c
delete mode 100644 keyboards/40percentclub/luddite/keymaps/tzarc/rules.mk
diff --git a/keyboards/40percentclub/luddite/keymaps/tzarc/config.h b/keyboards/40percentclub/luddite/keymaps/tzarc/config.h
deleted file mode 100644
index f8feb798d42a..000000000000
--- a/keyboards/40percentclub/luddite/keymaps/tzarc/config.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#undef RGBLED_NUM
-#define RGBLED_NUM 16
-
-#define QMK_ESC_OUTPUT F4
-#define QMK_ESC_INPUT D3
-#define QMK_LED B0
diff --git a/keyboards/40percentclub/luddite/keymaps/tzarc/keymap.c b/keyboards/40percentclub/luddite/keymaps/tzarc/keymap.c
deleted file mode 100644
index dfa1c499c29b..000000000000
--- a/keyboards/40percentclub/luddite/keymaps/tzarc/keymap.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include QMK_KEYBOARD_H
-
-// Each layer gets a name for readability, which is then used in the keymap matrix below.
-// The underscores don't mean anything - you can have a layer called STUFF or any other name.
-// Layer names don't all need to be of the same length, obviously, and you can also skip them
-// entirely and just use numbers.
-#define _BASE 0
-#define _FN1 1
-
-enum custom_keycodes {
- QWERTY = SAFE_RANGE,
-};
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- [_BASE] = LAYOUT_60_ansi(
- KC_GESC, 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,
- 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,
- KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
- KC_LCTL, KC_LGUI, KC_LALT , KC_SPC, KC_RALT, KC_APP, MO(_FN1), KC_RCTL
- ),
-
- [_FN1] = LAYOUT_60_ansi(
- KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
- RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- KC_GRV, _______, _______, _______, _______, KC_RGUI, _______, _______
- )
-};
diff --git a/keyboards/40percentclub/luddite/keymaps/tzarc/rules.mk b/keyboards/40percentclub/luddite/keymaps/tzarc/rules.mk
deleted file mode 100644
index 0613ea8667c0..000000000000
--- a/keyboards/40percentclub/luddite/keymaps/tzarc/rules.mk
+++ /dev/null
@@ -1 +0,0 @@
-BOOTLOADER = qmk-dfu
From 5279571e415ef5da07551655a500911551d20efc Mon Sep 17 00:00:00 2001
From: Joel Challis
Date: Mon, 10 Feb 2020 20:58:55 +0000
Subject: [PATCH 011/108] Remove zvecr dz60 keymap (#8140)
---
keyboards/dz60/keymaps/zvecr/keymap.c | 40 ---------------------------
1 file changed, 40 deletions(-)
delete mode 100644 keyboards/dz60/keymaps/zvecr/keymap.c
diff --git a/keyboards/dz60/keymaps/zvecr/keymap.c b/keyboards/dz60/keymaps/zvecr/keymap.c
deleted file mode 100644
index 9127fa0a7e65..000000000000
--- a/keyboards/dz60/keymaps/zvecr/keymap.c
+++ /dev/null
@@ -1,40 +0,0 @@
-#include QMK_KEYBOARD_H
-
-/*
-* Each layer gets a name for readability.
-* The underscores don't mean anything - you can
-* have a layer called STUFF or any other name.
-* Layer names don't all need to be of the same
-* length, and you can also skip them entirely
-* and just use numbers.
-*
-*/
-#define BL 0 // Base Layer
-#define FL 1 // Function Layer
-#define ML 2 // Macro Layer
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-
- [BL] = LAYOUT_60_ansi_split(
- KC_GESC, 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,
- 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,
- KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
- KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(FL), KC_SPC, KC_RALT, KC_RGUI, MO(ML), KC_RCTL),
-
- [FL] = LAYOUT_60_ansi_split(
- 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_DEL,
- _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______,
- _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, KC_DEL, KC_END, KC_PGDN, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
-
-
- [ML] = LAYOUT_60_ansi_split(
- _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
-
-};
From cabe4dfa72ce0ec24e7991e90977d27e97e5a95d Mon Sep 17 00:00:00 2001
From: James Young <18669334+noroadsleft@users.noreply.github.com>
Date: Mon, 10 Feb 2020 17:14:19 -0800
Subject: [PATCH 012/108] [Keyboard] VIA Support for Boardwalk (#8124)
* initial commit of VIA Support
* update PRODUCT (and MANUFACTURER) per VIA docs
Reference: https://caniusevia.com/docs/configuring_qmk#change-product
Updated MANUFACTURER so it matches what the PRODUCT says.
* enable Link Time Optimization per mechmerlin
* revert change to USB Product Name
* add two empty layers to via keymap
VIA keymaps need four layers in flash.
* correct the layer indexes
Start from 0, not 1.
---
keyboards/boardwalk/config.h | 2 +-
keyboards/boardwalk/keymaps/via/keymap.c | 110 ++++++++++++++++++++++
keyboards/boardwalk/keymaps/via/readme.md | 1 +
keyboards/boardwalk/keymaps/via/rules.mk | 2 +
4 files changed, 114 insertions(+), 1 deletion(-)
create mode 100644 keyboards/boardwalk/keymaps/via/keymap.c
create mode 100644 keyboards/boardwalk/keymaps/via/readme.md
create mode 100644 keyboards/boardwalk/keymaps/via/rules.mk
diff --git a/keyboards/boardwalk/config.h b/keyboards/boardwalk/config.h
index fa80673d80c0..e53b76afd3a0 100644
--- a/keyboards/boardwalk/config.h
+++ b/keyboards/boardwalk/config.h
@@ -21,7 +21,7 @@ along with this program. If not, see .
#define VENDOR_ID 0xCDCD
#define PRODUCT_ID 0x5337
#define DEVICE_VER 0x0001
-#define MANUFACTURER shens
+#define MANUFACTURER shensmobile
#define PRODUCT Boardwalk
#define DESCRIPTION QMK keyboard firmware for Boardwalk
diff --git a/keyboards/boardwalk/keymaps/via/keymap.c b/keyboards/boardwalk/keymaps/via/keymap.c
new file mode 100644
index 000000000000..d5b1795b6287
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/via/keymap.c
@@ -0,0 +1,110 @@
+/*
+ * 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 .
+ */
+
+#include QMK_KEYBOARD_H
+
+// Layer shorthand
+enum layer_names {
+ _BASE,
+ _FN,
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* Base Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | - | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | TAB | Q | W | E | R | T | [ | ] | Y | U | I | O | P | ' |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | CAP LK | A | S | D | F | G | HOME | PG UP | H | J | K | L | ; | ENTER |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | LSHIFT | Z | X | C | V | B | END | PG DN | N | M | , | . | / | RSHIFT |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | LCTRL | LGUI | FN | LALT | SPACE | SPACE | SPACE | SPACE | SPACE | LEFT | DOWN | UP | RIGHT | RCTRL |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [_BASE] = LAYOUT_ortho_5x14(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_LCTL, KC_LGUI, MO(_FN), KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL
+ ),
+
+ /* Function Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | | | MENU | | | | | | | | | | PRT SC | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | | | | | | | | | | | | | | RESET |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | | | | | | | | | | MUTE | VOL DN | VOL UP | \ | |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | | | | | | | | | | | | | | |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [_FN] = LAYOUT_ortho_5x14(
+ 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_DEL,
+ _______, _______, KC_APP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_BSLS, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+
+ /* Empty Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | | | | | | | | | | | | | | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | | | | | | | | | | | | | | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | | | | | | | | | | | | | | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | | | | | | | | | | | | | | |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | | | | | | | | | | | | | | |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [2] = LAYOUT_ortho_5x14(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+
+ /* Empty Layer
+ * .-----------------------------------------------------------------------------------------------------------------------------.
+ * | | | | | | | | | | | | | | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
+ * | | | | | | | | | | | | | | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
+ * | | | | | | | | | | | | | | |
+ * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
+ * | | | | | | | | | | | | | | |
+ * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
+ * | | | | | | | | | | | | | | |
+ * '-----------------------------------------------------------------------------------------------------------------------------'
+ */
+ [3] = LAYOUT_ortho_5x14(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ )
+
+};
diff --git a/keyboards/boardwalk/keymaps/via/readme.md b/keyboards/boardwalk/keymaps/via/readme.md
new file mode 100644
index 000000000000..86a7b902f35f
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/via/readme.md
@@ -0,0 +1 @@
+# The via keymap for Boardwalk
diff --git a/keyboards/boardwalk/keymaps/via/rules.mk b/keyboards/boardwalk/keymaps/via/rules.mk
new file mode 100644
index 000000000000..36b7ba9cbc98
--- /dev/null
+++ b/keyboards/boardwalk/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+LTO_ENABLE = yes
From 4b7d46ced0ba6e97bc8100d91bd2466db947d7b3 Mon Sep 17 00:00:00 2001
From: a_p_u_r_o
Date: Tue, 11 Feb 2020 10:22:37 +0900
Subject: [PATCH 013/108] [Keyboard] Use DIRECT_PINS instead of empty
MATRIX_ROW_PINS: sixshooter (#8130)
* [Keyboard] Use DIRECT_PINS instead of empty MATRIX_ROW_PINS: sixshooter
* [Keyboard] Reform the matrix into 2x3: sixshooter
---
keyboards/bpiphany/sixshooter/config.h | 24 +++++++---------------
keyboards/bpiphany/sixshooter/sixshooter.h | 10 +++++----
2 files changed, 13 insertions(+), 21 deletions(-)
diff --git a/keyboards/bpiphany/sixshooter/config.h b/keyboards/bpiphany/sixshooter/config.h
index ade95cc19188..c3ce8c88454c 100644
--- a/keyboards/bpiphany/sixshooter/config.h
+++ b/keyboards/bpiphany/sixshooter/config.h
@@ -11,26 +11,16 @@
#define DESCRIPTION A PCB for the CM Storm switch tester utilizing a Teensy 2.0.
/* key matrix size */
-#define MATRIX_ROWS 1
-#define MATRIX_COLS 6
+#define MATRIX_ROWS 2
+#define MATRIX_COLS 3
-/*
- * Keyboard Matrix Assignments
- *
- * Change this to how you wired your keyboard
- * COLS: AVR pins used for columns, left to right
- * ROWS: AVR pins used for rows, top to bottom
- * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
- * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
- *
-*/
-#define MATRIX_ROW_PINS { }
-#define MATRIX_COL_PINS { F7, F6, F1, F5, F4, F0 }
+/* Keyboard Matrix Assignments */
+#define DIRECT_PINS { \
+ { F7, F6, F1 }, \
+ { F5, F4, F0 } \
+}
#define UNUSED_PINS
-/* COL2ROW, ROW2COL*/
-#define DIODE_DIRECTION COL2ROW
-
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
diff --git a/keyboards/bpiphany/sixshooter/sixshooter.h b/keyboards/bpiphany/sixshooter/sixshooter.h
index 490d562d061a..e8fc68f5c90e 100644
--- a/keyboards/bpiphany/sixshooter/sixshooter.h
+++ b/keyboards/bpiphany/sixshooter/sixshooter.h
@@ -4,10 +4,12 @@
#include "quantum.h"
#define LAYOUT( \
- K00, K01, K02, \
- K03, K04, K05 \
-) { \
- { K00, K01, K02, K03, K04, K05 }, \
+ K00, K01, K02, \
+ K03, K04, K05 \
+) \
+{ \
+ { K00, K01, K02 }, \
+ { K03, K04, K05 } \
}
inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); }
From f4c1e066ba4064bf2c20c9ced84fd11aa1c274ae Mon Sep 17 00:00:00 2001
From: dnsnrk
Date: Tue, 11 Feb 2020 03:05:25 +0100
Subject: [PATCH 014/108] [Keymap] User keymap for KBDfans KBD67 MKII RGB
(hot-swap) (#7697)
* initial custom keymap
* initial code for caps lock LED
* added debounce overrides
* override caps lock handler
* finished up on CAPS LOCK LED customization
* lowered debounce
* layer lightning fx
* Added layer tap-toggle
* reformatting
* refined keymap
* copyright and more clean-up
* increased DEBOUNCE
* initial custom keymap
* initial code for caps lock LED
* added debounce overrides
* override caps lock handler
* finished up on CAPS LOCK LED customization
* lowered debounce
* layer lightning fx
* Added layer tap-toggle
* reformatting
* refined keymap
* copyright and more clean-up
* increased DEBOUNCE
* added readme and some more clean-up
* incorporated pull request feedback
---
.../kbd67/mkiirgb/keymaps/dnsnrk/config.h | 24 +++++
.../kbd67/mkiirgb/keymaps/dnsnrk/keymap.c | 95 +++++++++++++++++++
.../kbd67/mkiirgb/keymaps/dnsnrk/readme.md | 41 ++++++++
3 files changed, 160 insertions(+)
create mode 100644 keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/config.h
create mode 100644 keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/keymap.c
create mode 100644 keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/readme.md
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/config.h b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/config.h
new file mode 100644
index 000000000000..25f645f73490
--- /dev/null
+++ b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/config.h
@@ -0,0 +1,24 @@
+/* Copyright 2019 dnsnrk
+ * 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 .
+ */
+
+#pragma once
+
+/* place overrides here */
+#undef QMK_KEYS_PER_SCAN
+#define QMK_KEYS_PER_SCAN 4
+#undef DEBOUNCE
+#define DEBOUNCE 8
+#undef TAPPING_TOGGLE
+#define TAPPING_TOGGLE 2
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/keymap.c b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/keymap.c
new file mode 100644
index 000000000000..889a1e5f1b57
--- /dev/null
+++ b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/keymap.c
@@ -0,0 +1,95 @@
+/* Copyright 2019 dnsnrk
+ * 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 .
+ */
+
+#include QMK_KEYBOARD_H
+
+#define RC_ENT RCTL_T(KC_ENT)
+#define LC_CPS LCTL_T(KC_CAPS)
+
+enum {
+ _LAYER0 = 0,
+ _LAYER1,
+ _LAYER2
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_LAYER0] = LAYOUT_65_ansi_blocker( /* Base Layer */
+ KC_ESC, 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, KC_GRV,
+ 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_BSLASH, KC_PGUP,
+ LC_CPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, RC_ENT, KC_PGDN,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, TT(2),
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, TT(1), KC_LEFT, KC_DOWN, KC_RIGHT),
+ [_LAYER1] = LAYOUT_65_ansi_blocker( /* FN, RGB Controls */
+ 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_DEL, KC_POWER,
+ _______, RGB_TOG, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME,
+ _______, RGB_RMOD, RGB_SPD, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END,
+ _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, _______, _______, RGB_VAI, _______,
+ _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI),
+ [_LAYER2] = LAYOUT_65_ansi_blocker( /* Media, Programming */
+ _______, KC_BRMD, KC_BRMU, _______, _______, _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC__MUTE, KC_VOLD, KC_VOLU, KC_EJCT, _______,
+ _______, _______, _______, EEP_RST, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______)
+};
+
+void set_hsv_at(HSV hsv, uint8_t index);
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
+void rgb_matrix_indicators_user(void) {
+ if (rgb_matrix_config.enable) {
+ HSV hsv = rgb_matrix_config.hsv;
+ if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK)) {
+ HSV hsv_inv_hue = {hsv.h + 128, hsv.s, hsv.v};
+ set_hsv_at(hsv_inv_hue, 30);
+ }
+ // indicate which higher layer is currently active on which key
+ HSV hsv1 = {hsv.h - 64, hsv.s, hsv.v};
+ HSV hsv2 = {hsv.h + 64, hsv.s, hsv.v};
+ // except when we are in any animated LED mode
+ if (rgb_matrix_config.mode < RGB_MATRIX_BREATHING || rgb_matrix_config.mode > RGB_MATRIX_JELLYBEAN_RAINDROPS) {
+ for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+ for (uint8_t col = 0; col < MATRIX_COLS; col++) {
+ keypos_t pos = {col, row};
+ uint8_t key_layer = layer_switch_get_layer(pos);
+ uint8_t key_led = g_led_config.matrix_co[row][col];
+ if (key_led != NO_LED) {
+ switch(key_layer) {
+ case _LAYER2:
+ set_hsv_at(hsv2, key_led);
+ break;
+ case _LAYER1:
+ set_hsv_at(hsv1, key_led);
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+ }
+ // sticky layer indicators regardless of RGB mode. Hardcoded for lack of better idea.
+ set_hsv_at(hsv1, 63);
+ set_hsv_at(hsv2, 57);
+ }
+}
+
+void set_hsv_at(HSV hsv, uint8_t index) {
+ RGB rgb = hsv_to_rgb(hsv);
+ rgb_matrix_set_color(index, rgb.r, rgb.g, rgb.b);
+}
diff --git a/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/readme.md b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/readme.md
new file mode 100644
index 000000000000..5554b03e5deb
--- /dev/null
+++ b/keyboards/kbdfans/kbd67/mkiirgb/keymaps/dnsnrk/readme.md
@@ -0,0 +1,41 @@
+# dnsnrk's KDB67 MKII Layout
+
+* This is a three layer layout wih some consolidated functionality in the second and third layer.
+* The keyboard is mostly used on macOS, but also on Linux and therefore it can swap ALT/CMD.
+* There are additional CTRL keys for left and right when caps lock or enter key is held.
+* Layers can be toggled (tap twice) or actived momentarily (hold).
+* There are 2 seperate FN keys to activate layer 1 and 2 separately, indicated by different RGB colors.
+* The main custom feature is using RGB to indicate the current active layer for each key. This is best achieved in solid color RGB modes.
+
+## Layer 0
+
+This is the base QUERTY layer.
+
+* Grave is provided in the top right corner.
+* Caps lock is tapped once on and off and indicated by hue inverted LED when on.
+* Caps lock and enter become CTRL when held.
+* Primary Fn in the last row activates layer 1, indicated by hue shifted LED color.
+* Secondary Fn right to the up arrow key activates layer 2, indicated by 2nd hue shifted LED color.
+* Toggle layers by tapping Fn twice or switch on by holding Fn.
+
+## Layer 1
+
+This layer activates function keys and provides RGB controls. Keys acting on this layer are indicated by an LED color matching the current Fn key's LED color.
+
+* Number keys become equivalent function keys.
+* ESC becomes Grave.
+* Grave becomes POWER (very useful on macOS only).
+* Q toggles RGB.
+* WASD for navigating through RGB modes and adjusting speed.
+* <> control RGB saturation.
+* Arrow keys shift hue and adjust brightness.
+* PgUp, PgDown become HOME and END respectively.
+* Backspace acts as delete, pipe as insert.
+
+## Layer 2
+
+This layer comprises most macOS media keys at the top row and some additional programming options. Keys acting on this layer are indicated by an LED color matching the current Fn key's LED color.
+
+* N, M swap ALT/CMD for (N)ormal or (M)acOS.
+* E resets (E)EPROM.
+* R (R)esets keyboard.
From 1fed214490e00e83b958a239c7cb97e98eec763b Mon Sep 17 00:00:00 2001
From: Jonathan Rascher
Date: Mon, 10 Feb 2020 21:11:09 -0600
Subject: [PATCH 015/108] Tweak my TAPPING_TERM and be more futureproof (#8143)
* Explicitly undef things I override in keymaps
* Reduce TAPPING_TERM back to default
---
keyboards/crkbd/keymaps/bcat/config.h | 1 +
keyboards/keebio/quefrency/keymaps/bcat/config.h | 1 +
users/bcat/config.h | 7 +++++--
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/keyboards/crkbd/keymaps/bcat/config.h b/keyboards/crkbd/keymaps/bcat/config.h
index fd5fce542120..65e7a8052383 100644
--- a/keyboards/crkbd/keymaps/bcat/config.h
+++ b/keyboards/crkbd/keymaps/bcat/config.h
@@ -3,4 +3,5 @@
#define EE_HANDS
/* Limit max RGB LED current to avoid tripping controller fuse. */
+#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
diff --git a/keyboards/keebio/quefrency/keymaps/bcat/config.h b/keyboards/keebio/quefrency/keymaps/bcat/config.h
index 071856f10b2c..34387f2dd044 100644
--- a/keyboards/keebio/quefrency/keymaps/bcat/config.h
+++ b/keyboards/keebio/quefrency/keymaps/bcat/config.h
@@ -13,4 +13,5 @@
#define RGBLED_NUM 17
/* Set up RGB lighting so it works with either side as master. */
+#undef RGBLED_SPLIT
#define RGBLED_SPLIT { 8, 9 }
diff --git a/users/bcat/config.h b/users/bcat/config.h
index 6b132a429cd7..da74cb0a0b1f 100644
--- a/users/bcat/config.h
+++ b/users/bcat/config.h
@@ -3,10 +3,13 @@
#define TAP_CODE_DELAY 20
-/* Extend default tap timeout because I'm too slow. :) */
+/*
+ * Force the default tapping term since some keyboards make it way too short
+ * (*cough*Lily58*cough*).
+ */
#undef TAPPING_TERM
-#define TAPPING_TERM 250
+#define TAPPING_TERM 200
/*
* Treat mod-tap keys as holds even if the mod-tap key and the key being
From 310b2f1be43a9faa8599f143b459ae43e55393a4 Mon Sep 17 00:00:00 2001
From: Mikkel Jeppesen <2756925+Duckle29@users.noreply.github.com>
Date: Tue, 11 Feb 2020 10:37:15 +0100
Subject: [PATCH 016/108] use replace() over rename() to have cross-platform
overwriting (#8148)
---
lib/python/milc.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/python/milc.py b/lib/python/milc.py
index 36072ca76415..949bb0252a6a 100644
--- a/lib/python/milc.py
+++ b/lib/python/milc.py
@@ -571,7 +571,7 @@ def save_config(self):
# Move the new config file into place atomically
if os.path.getsize(tmpfile.name) > 0:
- os.rename(tmpfile.name, str(self.config_file))
+ os.replace(tmpfile.name, str(self.config_file))
else:
self.log.warning('Config file saving failed, not replacing %s with %s.', str(self.config_file), tmpfile.name)
From fba99715551e2f106f550dd49984cd38cd8c73f4 Mon Sep 17 00:00:00 2001
From: Joel Challis
Date: Tue, 11 Feb 2020 14:59:58 +0000
Subject: [PATCH 017/108] Align max backlight level in docs (#8142)
---
docs/config_options.md | 2 +-
docs/ja/config_options.md | 2 +-
...porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/config_options.md b/docs/config_options.md
index be328405e029..5344fe851f45 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -78,7 +78,7 @@ This is a C header file that is one of the first things included, and will persi
* `#define BACKLIGHT_PIN B7`
* pin of the backlight
* `#define BACKLIGHT_LEVELS 3`
- * number of levels your backlight will have (maximum 15 excluding off)
+ * number of levels your backlight will have (maximum 31 excluding off)
* `#define BACKLIGHT_BREATHING`
* enables backlight breathing
* `#define BREATHING_PERIOD 6`
diff --git a/docs/ja/config_options.md b/docs/ja/config_options.md
index a1d74543818c..ca6ea5479fad 100644
--- a/docs/ja/config_options.md
+++ b/docs/ja/config_options.md
@@ -83,7 +83,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
* `#define BACKLIGHT_PIN B7`
* バックライトのピン
* `#define BACKLIGHT_LEVELS 3`
- * バックライトのレベル数 (off を除いて最大15)
+ * バックライトのレベル数 (off を除いて最大31)
* `#define BACKLIGHT_BREATHING`
* バックライトのブレスを有効にします
* `#define BREATHING_PERIOD 6`
diff --git a/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md b/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md
index bce9f9dc9bca..22d3de852567 100644
--- a/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md
+++ b/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md
@@ -38,7 +38,7 @@ To configure a keyboard where each switch is connected to a separate pin and gro
`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
-`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 15, and they are computed automatically from this number.
+`BACKLIGHT_LEVELS` is how many levels exist for your backlight - max is 31, and they are computed automatically from this number.
## `/keyboards//Makefile`
From a624c439a436c7cdcedbdbe50db4c26da117251f Mon Sep 17 00:00:00 2001
From: a_p_u_r_o
Date: Wed, 12 Feb 2020 00:02:18 +0900
Subject: [PATCH 018/108] [Keyboard] Fixed inconsistent MATRIX_ROWS and
MATRIX_COLS: wsk/gothic50 (#8150)
---
keyboards/wsk/gothic50/config.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/keyboards/wsk/gothic50/config.h b/keyboards/wsk/gothic50/config.h
index 5eb4b30f2e93..af5b473e2532 100644
--- a/keyboards/wsk/gothic50/config.h
+++ b/keyboards/wsk/gothic50/config.h
@@ -11,8 +11,8 @@
#define DESCRIPTION Expanded Ergo Keyboard
/* key matrix size */
-#define MATRIX_ROWS 5
-#define MATRIX_COLS 15
+#define MATRIX_ROWS 4
+#define MATRIX_COLS 14
/* key matrix pins */
From 387c486e570cc94d6798a8f326dcfe7fdeb7891f Mon Sep 17 00:00:00 2001
From: Jonathan Rascher
Date: Tue, 11 Feb 2020 11:47:16 -0600
Subject: [PATCH 019/108] Rename Polaris Tsangan layout to 60_tsangan_hhkb and
enable community layout support (#8144)
* Rename Polaris Tsangan layout to 60_tsangan_hhkb
---
keyboards/ai03/polaris/info.json | 2 +-
keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c | 4 ++--
keyboards/ai03/polaris/polaris.h | 2 +-
keyboards/ai03/polaris/rules.mk | 2 ++
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/keyboards/ai03/polaris/info.json b/keyboards/ai03/polaris/info.json
index f40e7bec77d6..59a24e2e5999 100644
--- a/keyboards/ai03/polaris/info.json
+++ b/keyboards/ai03/polaris/info.json
@@ -75,7 +75,7 @@
{"label":"Ctrl", "x":13.75, "y":4, "w":1.25}
]
},
- "LAYOUT_60_ansi_tsangan_split_rshift": {
+ "LAYOUT_60_tsangan_hhkb": {
"layout": [
{"label":"~", "x":0, "y":0},
{"label":"!", "x":1, "y":0},
diff --git a/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c b/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c
index 3ccaa28fe3bc..410f9b379f7e 100644
--- a/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c
+++ b/keyboards/ai03/polaris/keymaps/default_ansi_tsangan/keymap.c
@@ -21,14 +21,14 @@ enum layer_names {
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- [_BASE] = LAYOUT_60_ansi_tsangan_split_rshift( /* Base */
+ [_BASE] = LAYOUT_60_tsangan_hhkb( /* Base */
KC_ESC, 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, KC_DEL,
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,
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_DEL,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL
),
- [_FN] = LAYOUT_60_ansi_tsangan_split_rshift( /* FN */
+ [_FN] = LAYOUT_60_tsangan_hhkb( /* FN */
RESET, 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_DEL, KC_BSPC,
_______, _______, KC_PGUP, _______, _______, _______, _______, _______, KC_UP, _______, KC_MPRV, KC_MPLY, KC_MNXT, BL_STEP,
_______, KC_HOME, KC_PGDN, KC_END, _______, KC_VOLD, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______,
diff --git a/keyboards/ai03/polaris/polaris.h b/keyboards/ai03/polaris/polaris.h
index 306f446765e7..2bd65806ff3c 100644
--- a/keyboards/ai03/polaris/polaris.h
+++ b/keyboards/ai03/polaris/polaris.h
@@ -40,7 +40,7 @@
{ K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413 } \
}
-#define LAYOUT_60_ansi_tsangan_split_rshift( \
+#define LAYOUT_60_tsangan_hhkb( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K212, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \
diff --git a/keyboards/ai03/polaris/rules.mk b/keyboards/ai03/polaris/rules.mk
index 547bb88c7417..150199cbe062 100644
--- a/keyboards/ai03/polaris/rules.mk
+++ b/keyboards/ai03/polaris/rules.mk
@@ -30,3 +30,5 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
+
+LAYOUTS = 60_tsangan_hhkb
From 6a165c41cb6e861efdcb737db966c4e4a0c72599 Mon Sep 17 00:00:00 2001
From: ymzcdg <49898694+ymzcdg@users.noreply.github.com>
Date: Wed, 12 Feb 2020 02:05:23 +0800
Subject: [PATCH 020/108] [Docs] doc update zh-cn (#8147)
* update zh-cn translate
Timestamp was added at the end of the document, it can help me manage version easier.
* fix _summary.md to utf-8
* fix _summary.md with vscode
---
docs/zh-cn/_summary.md | 54 +++++++++++++++++++++++++++++++-----------
1 file changed, 40 insertions(+), 14 deletions(-)
diff --git a/docs/zh-cn/_summary.md b/docs/zh-cn/_summary.md
index 033fecde42be..2f473305ae76 100644
--- a/docs/zh-cn/_summary.md
+++ b/docs/zh-cn/_summary.md
@@ -3,30 +3,41 @@
* [构建你的第一个固件](zh-cn/newbs_building_firmware.md)
* [刷新固件](zh-cn/newbs_flashing.md)
* [测试和调试](zh-cn/newbs_testing_debugging.md)
- * [Git最佳实践](zh-cn/newbs_best_practices.md)
+ * [Git最佳实践](zh-cn/newbs_git_best_practices.md)
+ * [使用你分叉(fork)的主分支(master)](zh-cn/newbs_git_using_your_master_branch.md)
+ * [解决合并冲突](zh-cn/newbs_git_resolving_merge_conflicts.md)
+ * [重新同步一个分支](zh-cn/newbs_git_resynchronize_a_branch.md)
* [学习资源](zh-cn/newbs_learn_more_resources.md)
* [QMK基础](zh-cn/README.md)
* [QMK简介](zh-cn/getting_started_introduction.md)
- * [向QMK贡献](zh-cn/contributing.md)
+ * [QMK命令行工具](zh-cn/cli.md)
+ * [QMK命令行工具配置](zh-cn/cli_configuration.md)
+ * [向QMK贡献代码](zh-cn/contributing.md)
* [如何使用Github](zh-cn/getting_started_github.md)
* [获得帮助](zh-cn/getting_started_getting_help.md)
-* [问题解答](zh-cn/faq.md)
+* [非兼容性修改](zh-cn/breaking_changes.md)
+ * [我的PR已经被标记为非兼容性修改](zh-cn/breaking_changes_instructions.md)
+ * [2019年8月30日](zh-cn/ChangeLog/20190830.md)
+
+* [问题与解答](zh-cn/faq.md)
* [一般问题](zh-cn/faq_general.md)
* [构建/编译](zh-cn/faq_build.md)
* [调试/故障排除](zh-cn/faq_debug.md)
- * [键盘映射](zh-cn/faq_keymap.md)
+ * [布局](zh-cn/faq_keymap.md)
+ * [Zadig驱动安装](zh-cn/driver_installation_zadig.md)
* 详细指南
* [安装构建工具](zh-cn/getting_started_build_tools.md)
* [vagrant指南](zh-cn/getting_started_vagrant.md)
- * [构建/编译指令](zh-cn/getting_started_make_guide.md)
+ * [构建/编译指南](zh-cn/getting_started_make_guide.md)
* [刷新固件](zh-cn/flashing.md)
* [定制功能](zh-cn/custom_quantum_functions.md)
- * [映射概述](zh-cn/keymap.md)
+ * [布局概述](zh-cn/keymap.md)
* [硬件](zh-cn/hardware.md)
+ * [兼容的单片机](zh-cn/compatible_microcontrollers.md)
* [AVR处理器](zh-cn/hardware_avr.md)
* [驱动](zh-cn/hardware_drivers.md)
@@ -34,13 +45,16 @@
* [键盘指南](zh-cn/hardware_keyboard_guidelines.md)
* [配置选项](zh-cn/config_options.md)
* [键码](zh-cn/keycodes.md)
- * [记录最佳实践](zh-cn/documentation_best_practices.md)
+ * [代码书写规范 - C](zh-cn/coding_conventions_c.md)
+ * [代码书写规范 - Python](zh-cn/coding_conventions_python.md)
+ * [文档书写规范](zh-cn/documentation_best_practices.md)
* [文档模板](zh-cn/documentation_templates.md)
* [术语表](zh-cn/reference_glossary.md)
* [单元测试](zh-cn/unit_testing.md)
- * [有用的功能](zh-cn/ref_functions.md)
+ * [实用函数](zh-cn/ref_functions.md)
* [配置器支持](zh-cn/reference_configurator_support.md)
* [info.json 格式](zh-cn/reference_info_json.md)
+ * [Python 命令行开发](zh-cn/cli_development.md)
* [特性](zh-cn/features.md)
* [基本键码](zh-cn/keycodes_basic.md)
@@ -54,22 +68,27 @@
* [热改键](zh-cn/feature_bootmagic.md)
* [组合](zh-cn/feature_combo)
* [命令](zh-cn/feature_command.md)
+ * [消抖 API](zh-cn/feature_debounce_type.md)
* [拨动开关](zh-cn/feature_dip_switch.md)
* [动态宏指令](zh-cn/feature_dynamic_macros.md)
* [编码器](zh-cn/feature_encoders.md)
* [重音号Esc复合键](zh-cn/feature_grave_esc.md)
+ * [触摸反馈](zh-cn/feature_haptic_feedback.md)
+ * [HD44780 LCD控制器](zh-cn/feature_hd44780.md)
* [自锁键](zh-cn/feature_key_lock.md)
* [布局](zh-cn/feature_layouts.md)
* [前导键](zh-cn/feature_leader_key.md)
* [LED阵列](zh-cn/feature_led_matrix.md)
* [宏指令](zh-cn/feature_macros.md)
* [鼠标键](zh-cn/feature_mouse_keys.md)
+ * [OLED驱动](zh-cn/feature_oled_driver.md)
* [一键功能](zh-cn/feature_advanced_keycodes.md#one-shot-keys)
* [指针设备](zh-cn/feature_pointing_device.md)
* [PS/2鼠标](zh-cn/feature_ps2_mouse.md)
* [RGB灯光](zh-cn/feature_rgblight.md)
* [RGB矩阵](zh-cn/feature_rgb_matrix.md)
* [空格候补换挡](zh-cn/feature_space_cadet.md)
+ * [分体键盘](zh-cn/feature_split_keyboard.md)
* [速录机](zh-cn/feature_stenography.md)
* [换手](zh-cn/feature_swap_hands.md)
* [多击键](zh-cn/feature_tap_dance.md)
@@ -79,28 +98,35 @@
* [用户空间](zh-cn/feature_userspace.md)
* [速度键](zh-cn/feature_velocikey.md)
-* 针对制造者和定制者
+* 制造和定制者指南
* [手工连线指南](zh-cn/hand_wire.md)
* [ISP刷新指南](zh-cn/isp_flashing_guide.md)
* [ARM调试指南](zh-cn/arm_debugging.md)
- * [I2C驱动](zh-cn/i2c_driver.md)
- * [GPIO控制器](zh-cn/internals_gpio_control.md)
+ * [ADC设备](zh-cn/adc_driver.md)
+ * [I2C设备](zh-cn/i2c_driver.md)
+ * [WS2812设备](zh-cn/ws2812_driver.md)
+ * [EEPROM设备](zh-cn/eeprom_driver.md)
+ * [GPIO控制](zh-cn/internals_gpio_control.md)
+ * [自定义键盘矩阵](zh-cn/custom_matrix.md)
* [Proton C转换](zh-cn/proton_c_conversion.md)
* 深入了解
- * [键盘如何工作](zh-cn/how_keyboards_work.md)
- * [理解QMK](zh-cn/understanding_qmk.md)
+ * [键盘工作原理](zh-cn/how_keyboards_work.md)
+ * [深入了解QMK](zh-cn/understanding_qmk.md)
* 其他话题
* [使用Eclipse开发QMK](zh-cn/other_eclipse.md)
* [使用VSCode开发QMK](zh-cn/other_vscode.md)
* [支持](zh-cn/support.md)
+ * [翻译QMK文档](zh-cn/translating.md)
* QMK 内构 (正在编写)
* [定义](zh-cn/internals_defines.md)
* [输入回调寄存器](zh-cn/internals_input_callback_reg.md)
* [Midi设备](zh-cn/internals_midi_device.md)
- * [Midi设备设置过程](zh-cn/internals_midi_device_setup_process.md)
+ * [Midi设备配置过程](zh-cn/internals_midi_device_setup_process.md)
* [Midi工具库](zh-cn/internals_midi_util.md)
* [发送函数](zh-cn/internals_send_functions.md)
* [Sysex工具](zh-cn/internals_sysex_tools.md)
+
+
\ No newline at end of file
From c53d4ecf3250aacdd226e8cd7d45f7af9788873a Mon Sep 17 00:00:00 2001
From: MechMerlin <30334081+mechmerlin@users.noreply.github.com>
Date: Tue, 11 Feb 2020 10:07:06 -0800
Subject: [PATCH 021/108] VIA Support: Duck Eagle V2 (#8133)
* add via keymap
* Update keyboards/duck/eagle_viper/v2/keymaps/via/keymap.c
---
.../duck/eagle_viper/v2/keymaps/via/keymap.c | 51 +++++++++++++++++++
.../duck/eagle_viper/v2/keymaps/via/readme.md | 10 ++++
.../duck/eagle_viper/v2/keymaps/via/rules.mk | 2 +
3 files changed, 63 insertions(+)
create mode 100644 keyboards/duck/eagle_viper/v2/keymaps/via/keymap.c
create mode 100644 keyboards/duck/eagle_viper/v2/keymaps/via/readme.md
create mode 100644 keyboards/duck/eagle_viper/v2/keymaps/via/rules.mk
diff --git a/keyboards/duck/eagle_viper/v2/keymaps/via/keymap.c b/keyboards/duck/eagle_viper/v2/keymaps/via/keymap.c
new file mode 100644
index 000000000000..61981459824c
--- /dev/null
+++ b/keyboards/duck/eagle_viper/v2/keymaps/via/keymap.c
@@ -0,0 +1,51 @@
+/* Copyright 2020 MechMerlin
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /* layer 0: qwerty */
+ [0] = LAYOUT_all(\
+ 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, XXXXXXX, KC_BSPC, \
+ 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, \
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \
+ KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, \
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL \
+ ),
+
+ [1] = LAYOUT_all(\
+ _______, RGB_TOG, RGB_MOD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______ \
+ ),
+
+ [2] = LAYOUT_all(\
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______ \
+ ),
+
+ [3] = LAYOUT_all(\
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______ \
+ )
+};
diff --git a/keyboards/duck/eagle_viper/v2/keymaps/via/readme.md b/keyboards/duck/eagle_viper/v2/keymaps/via/readme.md
new file mode 100644
index 000000000000..834ff7cd3a67
--- /dev/null
+++ b/keyboards/duck/eagle_viper/v2/keymaps/via/readme.md
@@ -0,0 +1,10 @@
+# Default Eagle Layout
+
+This is the default implement layout for Duck Eagle V2.
+
+![Duck Eagle V2 Default Layout](https://imgur.com/mWBY3Dc.png)
+
+
+## Features
+
+* Default QWERTY layer
diff --git a/keyboards/duck/eagle_viper/v2/keymaps/via/rules.mk b/keyboards/duck/eagle_viper/v2/keymaps/via/rules.mk
new file mode 100644
index 000000000000..36b7ba9cbc98
--- /dev/null
+++ b/keyboards/duck/eagle_viper/v2/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+LTO_ENABLE = yes
From 78e060f55adef8de358ba4bf7f5d5854a70dd421 Mon Sep 17 00:00:00 2001
From: IFo Hancroft
Date: Tue, 11 Feb 2020 22:44:09 +0200
Subject: [PATCH 022/108] VIA Support for the Idobo (ID75) (#8146)
* VIA Support for the Idobo (ID75)
* Implemented the requested PR changes
* Readme was pointing to the wrong board
* Fixed Product ID
* Fixed Manufacturer name
* Better Vendor ID
Using the two 8-bit ASCII values from the keyboard name.
* Removed Bootmagic Lite as enabled anyway by VIA
---
keyboards/idobo/config.h | 8 ++---
keyboards/idobo/keymaps/via/keymap.c | 52 ++++++++++++++++++++++++++++
keyboards/idobo/keymaps/via/rules.mk | 1 +
keyboards/idobo/readme.md | 2 +-
4 files changed, 58 insertions(+), 5 deletions(-)
create mode 100644 keyboards/idobo/keymaps/via/keymap.c
create mode 100644 keyboards/idobo/keymaps/via/rules.mk
diff --git a/keyboards/idobo/config.h b/keyboards/idobo/config.h
index e1c08afae160..d764512dc749 100644
--- a/keyboards/idobo/config.h
+++ b/keyboards/idobo/config.h
@@ -20,11 +20,11 @@ along with this program. If not, see .
#include "config_common.h"
/* USB Device descriptor parameter */
-#define VENDOR_ID 0xFEED
-#define PRODUCT_ID 0x0000
+#define VENDOR_ID 0x6964 // ID
+#define PRODUCT_ID 0x0075
#define DEVICE_VER 0x0001
-#define MANUFACTURER You
-#define PRODUCT idobo
+#define MANUFACTURER Generic
+#define PRODUCT Idobo
#define DESCRIPTION A custom keyboard
/* key matrix size */
diff --git a/keyboards/idobo/keymaps/via/keymap.c b/keyboards/idobo/keymaps/via/keymap.c
new file mode 100644
index 000000000000..de7581ea039b
--- /dev/null
+++ b/keyboards/idobo/keymaps/via/keymap.c
@@ -0,0 +1,52 @@
+/* Copyright 2020 IFo Hancroft
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [0] = LAYOUT_ortho_5x15(
+ KC_ESC, 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_BSLS, KC_GRV,
+ 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_BSPC, KC_DEL,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_ENT, KC_PGUP,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
+ ),
+
+ [1] = LAYOUT_ortho_5x15(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+
+ [2] = LAYOUT_ortho_5x15(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+
+ [3] = LAYOUT_ortho_5x15(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+
+};
diff --git a/keyboards/idobo/keymaps/via/rules.mk b/keyboards/idobo/keymaps/via/rules.mk
new file mode 100644
index 000000000000..1e5b99807cb7
--- /dev/null
+++ b/keyboards/idobo/keymaps/via/rules.mk
@@ -0,0 +1 @@
+VIA_ENABLE = yes
diff --git a/keyboards/idobo/readme.md b/keyboards/idobo/readme.md
index 7f2c684464a3..254616decb86 100644
--- a/keyboards/idobo/readme.md
+++ b/keyboards/idobo/readme.md
@@ -8,7 +8,7 @@ Firmware here originally appeared on qmkeyboard.cn
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
Hardware Supported: IDOBO PCB
-Hardware Availability: [IDOBO on Massdrop](https://www.massdrop.com/buy/xd75-aluminum-mechanical-keyboard)
+Hardware Availability: [IDOBO on Drop](https://drop.com/buy/id75-hot-swappable-ortholinear-keyboard-kit)
Make example for this keyboard (after setting up your build environment):
From 9456832a3bba4dd766a26a6286e78d3e88e4efce Mon Sep 17 00:00:00 2001
From: Ted M Lin
Date: Tue, 11 Feb 2020 16:38:20 -0500
Subject: [PATCH 023/108] Fix out of bound OLED font access (#8145)
* Fix out of bound OLED font access
The default font is 1344 bytes, or a total of 224 glyphs (each 6-bytes wide).
OLED_FONT_END defaults to 224, which if used will then index off the end of
the font array. So either the documentation or code is wrong.
Instead of figuring out the rewording of the documentation, just change
the OLED_FONT_END default value to 223, to match the documentation and code.
* Add static assert to check array size
Build bomb if the font array size doesn't match to the defines.
---
docs/feature_oled_driver.md | 2 +-
drivers/oled/oled_driver.c | 4 +++-
drivers/oled/oled_driver.h | 4 ++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/docs/feature_oled_driver.md b/docs/feature_oled_driver.md
index 29548cb8204d..ebabc314ffec 100644
--- a/docs/feature_oled_driver.md
+++ b/docs/feature_oled_driver.md
@@ -104,7 +104,7 @@ void oled_task_user(void) {
|`OLED_DISPLAY_ADDRESS` |`0x3C` |The i2c address of the OLED Display |
|`OLED_FONT_H` |`"glcdfont.c"` |The font code file to use for custom fonts |
|`OLED_FONT_START` |`0` |The starting characer index for custom fonts |
-|`OLED_FONT_END` |`224` |The ending characer index for custom fonts |
+|`OLED_FONT_END` |`223` |The ending characer index for custom fonts |
|`OLED_FONT_WIDTH` |`6` |The font width |
|`OLED_FONT_HEIGHT` |`8` |The font height (untested) |
|`OLED_TIMEOUT` |`60000` |Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c
index f20f4629aafa..e541228ea92d 100644
--- a/drivers/oled/oled_driver.c
+++ b/drivers/oled/oled_driver.c
@@ -392,6 +392,8 @@ void oled_write_char(const char data, bool invert) {
static uint8_t oled_temp_buffer[OLED_FONT_WIDTH];
memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH);
+ _Static_assert(sizeof(font) >= ((OLED_FONT_END + 1 - OLED_FONT_START) * OLED_FONT_WIDTH), "OLED_FONT_END references outside array");
+
// set the reder buffer data
uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index
if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) {
@@ -585,4 +587,4 @@ void oled_task(void) {
#endif
}
-__attribute__((weak)) void oled_task_user(void) {}
\ No newline at end of file
+__attribute__((weak)) void oled_task_user(void) {}
diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h
index f490f367ae32..e8a7188577dc 100644
--- a/drivers/oled/oled_driver.h
+++ b/drivers/oled/oled_driver.h
@@ -131,7 +131,7 @@ along with this program. If not, see .
#endif
// unsigned char value of the last character in the font file
#if !defined(OLED_FONT_END)
-# define OLED_FONT_END 224
+# define OLED_FONT_END 223
#endif
// Font render width
#if !defined(OLED_FONT_WIDTH)
@@ -260,4 +260,4 @@ bool oled_scroll_off(void);
uint8_t oled_max_chars(void);
// Returns the maximum number of lines that will fit on the oled
-uint8_t oled_max_lines(void);
\ No newline at end of file
+uint8_t oled_max_lines(void);
From 177666cbc8d6f9859773f8fc0232ba4b3a1f9a97 Mon Sep 17 00:00:00 2001
From: Rys Sommefeldt
Date: Wed, 12 Feb 2020 04:33:05 +0000
Subject: [PATCH 024/108] VIA support for Graystudio Space65 (#8126)
* VIA support for Graystudio Space65
* Update Space65 PRODUCT and remove VIA JSON def
---
keyboards/gray_studio/space65/config.h | 8 ++--
.../gray_studio/space65/keymaps/via/keymap.c | 47 +++++++++++++++++++
.../gray_studio/space65/keymaps/via/rules.mk | 2 +
3 files changed, 53 insertions(+), 4 deletions(-)
create mode 100644 keyboards/gray_studio/space65/keymaps/via/keymap.c
create mode 100644 keyboards/gray_studio/space65/keymaps/via/rules.mk
diff --git a/keyboards/gray_studio/space65/config.h b/keyboards/gray_studio/space65/config.h
index 979cb0a604eb..0485afca40cb 100644
--- a/keyboards/gray_studio/space65/config.h
+++ b/keyboards/gray_studio/space65/config.h
@@ -20,12 +20,12 @@ along with this program. If not, see .
#include "config_common.h"
/* USB Device descriptor parameter */
-#define VENDOR_ID 0xFEED
-#define PRODUCT_ID 0x0000
+#define VENDOR_ID 0x4753
+#define PRODUCT_ID 0x3000
#define DEVICE_VER 0x0001
-#define MANUFACTURER Gray Studio
+#define MANUFACTURER Graystudio
#define PRODUCT Space65
-#define DESCRIPTION 65% custom keyboard
+#define DESCRIPTION Graystudio Space65
/* key matrix size */
#define MATRIX_ROWS 5
diff --git a/keyboards/gray_studio/space65/keymaps/via/keymap.c b/keyboards/gray_studio/space65/keymaps/via/keymap.c
new file mode 100644
index 000000000000..e621685e1a90
--- /dev/null
+++ b/keyboards/gray_studio/space65/keymaps/via/keymap.c
@@ -0,0 +1,47 @@
+/* Copyright 2020 Rys Sommefeldt
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT(
+ KC_GESC, 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, KC_BSPC, KC_DEL,
+ 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, KC_HOME,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
+ KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
+ ),
+ [1] = LAYOUT(
+ RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______,
+ _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [2] = LAYOUT(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [3] = LAYOUT(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+};
diff --git a/keyboards/gray_studio/space65/keymaps/via/rules.mk b/keyboards/gray_studio/space65/keymaps/via/rules.mk
new file mode 100644
index 000000000000..96d2d189b2e6
--- /dev/null
+++ b/keyboards/gray_studio/space65/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+MOUSEKEY_ENABLE = no
From f318d6fffcda102b9063effb5403598d4bbf1213 Mon Sep 17 00:00:00 2001
From: Rys Sommefeldt
Date: Wed, 12 Feb 2020 04:33:29 +0000
Subject: [PATCH 025/108] VIA support for the Think6.5 (#8118)
* VIA support for Think6.5
* VIA support for Think6.5 Hotswap
* VIA works better with separate layout options
* Remove the colours used to help develop it in KLE
* Pay better attention to the JSON linter
* Update Think6.5 PRODUCT and remove VIA JSON defs
---
.../gray_studio/think65/hotswap/config.h | 12 ++---
.../think65/hotswap/keymaps/via/keymap.c | 47 +++++++++++++++++++
.../think65/hotswap/keymaps/via/rules.mk | 2 +
keyboards/gray_studio/think65/solder/config.h | 12 ++---
.../think65/solder/keymaps/via/keymap.c | 47 +++++++++++++++++++
.../think65/solder/keymaps/via/rules.mk | 2 +
6 files changed, 110 insertions(+), 12 deletions(-)
create mode 100644 keyboards/gray_studio/think65/hotswap/keymaps/via/keymap.c
create mode 100644 keyboards/gray_studio/think65/hotswap/keymaps/via/rules.mk
create mode 100644 keyboards/gray_studio/think65/solder/keymaps/via/keymap.c
create mode 100644 keyboards/gray_studio/think65/solder/keymaps/via/rules.mk
diff --git a/keyboards/gray_studio/think65/hotswap/config.h b/keyboards/gray_studio/think65/hotswap/config.h
index fc1734146da8..05a818a7310c 100644
--- a/keyboards/gray_studio/think65/hotswap/config.h
+++ b/keyboards/gray_studio/think65/hotswap/config.h
@@ -20,12 +20,12 @@ along with this program. If not, see .
#include "config_common.h"
/* USB Device descriptor parameter */
-#define VENDOR_ID 0xFEED
-#define PRODUCT_ID 0x0000
+#define VENDOR_ID 0x4753
+#define PRODUCT_ID 0x4001
#define DEVICE_VER 0x0001
-#define MANUFACTURER Gray Studio
-#define PRODUCT THINK6.5
-#define DESCRIPTION 65% 6.5 degree custom keyboard
+#define MANUFACTURER Graystudio
+#define PRODUCT Think6.5° Hotswap
+#define DESCRIPTION Graystudio Think6.5 Hotswap
/* key matrix size */
#define MATRIX_ROWS 5
@@ -69,4 +69,4 @@ along with this program. If not, see .
#endif
// generated by KBFirmware JSON to QMK Parser
-// https://noroadsleft.github.io/kbf_qmk_converter/
\ No newline at end of file
+// https://noroadsleft.github.io/kbf_qmk_converter/
diff --git a/keyboards/gray_studio/think65/hotswap/keymaps/via/keymap.c b/keyboards/gray_studio/think65/hotswap/keymaps/via/keymap.c
new file mode 100644
index 000000000000..5079ca5551d3
--- /dev/null
+++ b/keyboards/gray_studio/think65/hotswap/keymaps/via/keymap.c
@@ -0,0 +1,47 @@
+/* Copyright 2019 Rys Sommefeldt
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_65_ansi_blocker(
+ KC_GESC, 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, KC_DEL,
+ 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, KC_HOME,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
+ ),
+ [1] = LAYOUT_65_ansi_blocker(
+ RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
+ _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [2] = LAYOUT_65_ansi_blocker(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [3] = LAYOUT_65_ansi_blocker(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+};
diff --git a/keyboards/gray_studio/think65/hotswap/keymaps/via/rules.mk b/keyboards/gray_studio/think65/hotswap/keymaps/via/rules.mk
new file mode 100644
index 000000000000..96d2d189b2e6
--- /dev/null
+++ b/keyboards/gray_studio/think65/hotswap/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+MOUSEKEY_ENABLE = no
diff --git a/keyboards/gray_studio/think65/solder/config.h b/keyboards/gray_studio/think65/solder/config.h
index cc8892a1167c..f75635402bc2 100644
--- a/keyboards/gray_studio/think65/solder/config.h
+++ b/keyboards/gray_studio/think65/solder/config.h
@@ -20,12 +20,12 @@ along with this program. If not, see .
#include "config_common.h"
/* USB Device descriptor parameter */
-#define VENDOR_ID 0xFEED
-#define PRODUCT_ID 0x0000
+#define VENDOR_ID 0x4753
+#define PRODUCT_ID 0x4000
#define DEVICE_VER 0x0001
-#define MANUFACTURER Gray Studio
-#define PRODUCT THINK6.5
-#define DESCRIPTION 65% 6.5 degree custom keyboard
+#define MANUFACTURER Graystudio
+#define PRODUCT Think6.5°
+#define DESCRIPTION Graystudio Think6.5
/* key matrix size */
#define MATRIX_ROWS 5
@@ -70,4 +70,4 @@ along with this program. If not, see .
#endif
// generated by KBFirmware JSON to QMK Parser
-// https://noroadsleft.github.io/kbf_qmk_converter/
\ No newline at end of file
+// https://noroadsleft.github.io/kbf_qmk_converter/
diff --git a/keyboards/gray_studio/think65/solder/keymaps/via/keymap.c b/keyboards/gray_studio/think65/solder/keymaps/via/keymap.c
new file mode 100644
index 000000000000..0dbe44c8725a
--- /dev/null
+++ b/keyboards/gray_studio/think65/solder/keymaps/via/keymap.c
@@ -0,0 +1,47 @@
+/* Copyright 2019 Rys Sommefeldt
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_all(
+ KC_GESC, 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, KC_BSPC, KC_DEL,
+ 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, KC_HOME,
+ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP,
+ KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT
+ ),
+ [1] = LAYOUT_all(
+ RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______,
+ _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [2] = LAYOUT_all(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [3] = LAYOUT_all(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+};
diff --git a/keyboards/gray_studio/think65/solder/keymaps/via/rules.mk b/keyboards/gray_studio/think65/solder/keymaps/via/rules.mk
new file mode 100644
index 000000000000..96d2d189b2e6
--- /dev/null
+++ b/keyboards/gray_studio/think65/solder/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+MOUSEKEY_ENABLE = no
From eaf32621aa0c067b2cab203e5e8e58c7c07a4ff4 Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Wed, 12 Feb 2020 17:19:39 +1100
Subject: [PATCH 026/108] Align VUSB HID descriptors with LUFA/ChibiOS (#7675)
* Align VUSB HID descriptors with LUFA/ChibiOS
* Wrap send_system and send_consumer in ifdefs too
* Offset system usages to match LUFA/ChibiOS
---
tmk_core/protocol/vusb/vusb.c | 247 +++++++++++++++++-----------------
1 file changed, 127 insertions(+), 120 deletions(-)
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c
index 110b3069bddf..7c1f4ca7f0d5 100644
--- a/tmk_core/protocol/vusb/vusb.c
+++ b/tmk_core/protocol/vusb/vusb.c
@@ -112,6 +112,7 @@ static void send_mouse(report_mouse_t *report) {
}
}
+#ifdef EXTRAKEY_ENABLE
static void send_extra(uint8_t report_id, uint16_t data) {
static uint8_t last_id = 0;
static uint16_t last_data = 0;
@@ -124,10 +125,19 @@ static void send_extra(uint8_t report_id, uint16_t data) {
usbSetInterrupt3((void *)&report, sizeof(report));
}
}
+#endif
-static void send_system(uint16_t data) { send_extra(REPORT_ID_SYSTEM, data); }
+static void send_system(uint16_t data) {
+#ifdef EXTRAKEY_ENABLE
+ send_extra(REPORT_ID_SYSTEM, data - SYSTEM_POWER_DOWN + 1);
+#endif
+}
-static void send_consumer(uint16_t data) { send_extra(REPORT_ID_CONSUMER, data); }
+static void send_consumer(uint16_t data) {
+#ifdef EXTRAKEY_ENABLE
+ send_extra(REPORT_ID_CONSUMER, data);
+#endif
+}
/*------------------------------------------------------------------*
* Request from host *
@@ -200,128 +210,125 @@ uchar usbFunctionWrite(uchar *data, uchar len) {
* Descriptors *
*------------------------------------------------------------------*/
-/*
- * Report Descriptor for keyboard
- *
- * from an example in HID spec appendix
- */
const PROGMEM uchar keyboard_hid_report[] = {
- 0x05, 0x01, // Usage Page (Generic Desktop),
- 0x09, 0x06, // Usage (Keyboard),
- 0xA1, 0x01, // Collection (Application),
- 0x75, 0x01, // Report Size (1),
- 0x95, 0x08, // Report Count (8),
- 0x05, 0x07, // Usage Page (Key Codes),
- 0x19, 0xE0, // Usage Minimum (224),
- 0x29, 0xE7, // Usage Maximum (231),
- 0x15, 0x00, // Logical Minimum (0),
- 0x25, 0x01, // Logical Maximum (1),
- 0x81, 0x02, // Input (Data, Variable, Absolute), ;Modifier byte
- 0x95, 0x01, // Report Count (1),
- 0x75, 0x08, // Report Size (8),
- 0x81, 0x03, // Input (Constant), ;Reserved byte
- 0x95, 0x05, // Report Count (5),
- 0x75, 0x01, // Report Size (1),
- 0x05, 0x08, // Usage Page (LEDs),
- 0x19, 0x01, // Usage Minimum (1),
- 0x29, 0x05, // Usage Maximum (5),
- 0x91, 0x02, // Output (Data, Variable, Absolute), ;LED report
- 0x95, 0x01, // Report Count (1),
- 0x75, 0x03, // Report Size (3),
- 0x91, 0x03, // Output (Constant), ;LED report padding
- 0x95, 0x06, // Report Count (6),
- 0x75, 0x08, // Report Size (8),
- 0x15, 0x00, // Logical Minimum (0),
- 0x26, 0xFF, 0x00, // Logical Maximum(255),
- 0x05, 0x07, // Usage Page (Key Codes),
- 0x19, 0x00, // Usage Minimum (0),
- 0x29, 0xFF, // Usage Maximum (255),
- 0x81, 0x00, // Input (Data, Array),
- 0xc0 // End Collection
+ 0x05, 0x01, // Usage Page (Generic Desktop)
+ 0x09, 0x06, // Usage (Keyboard)
+ 0xA1, 0x01, // Collection (Application)
+ // Modifiers (8 bits)
+ 0x05, 0x07, // Usage Page (Keyboard/Keypad)
+ 0x19, 0xE0, // Usage Minimum (Keyboard Left Control)
+ 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI)
+ 0x15, 0x00, // Logical Minimum (0)
+ 0x25, 0x01, // Logical Maximum (1)
+ 0x95, 0x08, // Report Count (8)
+ 0x75, 0x01, // Report Size (1)
+ 0x81, 0x02, // Input (Data, Variable, Absolute)
+ // Reserved (1 byte)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x03, // Input (Constant)
+ // Keycodes (6 bytes)
+ 0x05, 0x07, // Usage Page (Keyboard/Keypad)
+ 0x19, 0x00, // Usage Minimum (0)
+ 0x29, 0xFF, // Usage Maximum (255)
+ 0x15, 0x00, // Logical Minimum (0)
+ 0x26, 0xFF, 0x00, // Logical Maximum (255)
+ 0x95, 0x06, // Report Count (6)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x00, // Input (Data, Array, Absolute)
+
+ // Status LEDs (5 bits)
+ 0x05, 0x08, // Usage Page (LED)
+ 0x19, 0x01, // Usage Minimum (Num Lock)
+ 0x29, 0x05, // Usage Maximum (Kana)
+ 0x95, 0x05, // Report Count (5)
+ 0x75, 0x01, // Report Size (1)
+ 0x91, 0x02, // Output (Data, Variable, Absolute)
+ // LED padding (3 bits)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x03, // Report Size (3)
+ 0x91, 0x03, // Output (Constant)
+ 0xC0 // End Collection
};
-/*
- * Report Descriptor for mouse
- *
- * Mouse Protocol 1, HID 1.11 spec, Appendix B, page 59-60, with wheel extension
- * http://www.microchip.com/forums/tm.aspx?high=&m=391435&mpage=1#391521
- * http://www.keil.com/forum/15671/
- * http://www.microsoft.com/whdc/device/input/wheel.mspx
- */
const PROGMEM uchar mouse_hid_report[] = {
- /* mouse */
- 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
- 0x09, 0x02, // USAGE (Mouse)
- 0xa1, 0x01, // COLLECTION (Application)
- 0x85, REPORT_ID_MOUSE, // REPORT_ID (1)
- 0x09, 0x01, // USAGE (Pointer)
- 0xa1, 0x00, // COLLECTION (Physical)
- // ---------------------------- Buttons
- 0x05, 0x09, // USAGE_PAGE (Button)
- 0x19, 0x01, // USAGE_MINIMUM (Button 1)
- 0x29, 0x05, // USAGE_MAXIMUM (Button 5)
- 0x15, 0x00, // LOGICAL_MINIMUM (0)
- 0x25, 0x01, // LOGICAL_MAXIMUM (1)
- 0x75, 0x01, // REPORT_SIZE (1)
- 0x95, 0x05, // REPORT_COUNT (5)
- 0x81, 0x02, // INPUT (Data,Var,Abs)
- 0x75, 0x03, // REPORT_SIZE (3)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x03, // INPUT (Cnst,Var,Abs)
- // ---------------------------- X,Y position
- 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
- 0x09, 0x30, // USAGE (X)
- 0x09, 0x31, // USAGE (Y)
- 0x15, 0x81, // LOGICAL_MINIMUM (-127)
- 0x25, 0x7f, // LOGICAL_MAXIMUM (127)
- 0x75, 0x08, // REPORT_SIZE (8)
- 0x95, 0x02, // REPORT_COUNT (2)
- 0x81, 0x06, // INPUT (Data,Var,Rel)
- // ---------------------------- Vertical wheel
- 0x09, 0x38, // USAGE (Wheel)
- 0x15, 0x81, // LOGICAL_MINIMUM (-127)
- 0x25, 0x7f, // LOGICAL_MAXIMUM (127)
- 0x35, 0x00, // PHYSICAL_MINIMUM (0) - reset physical
- 0x45, 0x00, // PHYSICAL_MAXIMUM (0)
- 0x75, 0x08, // REPORT_SIZE (8)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x06, // INPUT (Data,Var,Rel)
- // ---------------------------- Horizontal wheel
- 0x05, 0x0c, // USAGE_PAGE (Consumer Devices)
- 0x0a, 0x38, 0x02, // USAGE (AC Pan)
- 0x15, 0x81, // LOGICAL_MINIMUM (-127)
- 0x25, 0x7f, // LOGICAL_MAXIMUM (127)
- 0x75, 0x08, // REPORT_SIZE (8)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x06, // INPUT (Data,Var,Rel)
- 0xc0, // END_COLLECTION
- 0xc0, // END_COLLECTION
- /* system control */
- 0x05, 0x01, // USAGE_PAGE (Generic Desktop)
- 0x09, 0x80, // USAGE (System Control)
- 0xa1, 0x01, // COLLECTION (Application)
- 0x85, REPORT_ID_SYSTEM, // REPORT_ID (2)
- 0x15, 0x01, // LOGICAL_MINIMUM (0x1)
- 0x26, 0xb7, 0x00, // LOGICAL_MAXIMUM (0xb7)
- 0x19, 0x01, // USAGE_MINIMUM (0x1)
- 0x29, 0xb7, // USAGE_MAXIMUM (0xb7)
- 0x75, 0x10, // REPORT_SIZE (16)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x00, // INPUT (Data,Array,Abs)
- 0xc0, // END_COLLECTION
- /* consumer */
- 0x05, 0x0c, // USAGE_PAGE (Consumer Devices)
- 0x09, 0x01, // USAGE (Consumer Control)
- 0xa1, 0x01, // COLLECTION (Application)
- 0x85, REPORT_ID_CONSUMER, // REPORT_ID (3)
- 0x15, 0x01, // LOGICAL_MINIMUM (0x1)
- 0x26, 0x9c, 0x02, // LOGICAL_MAXIMUM (0x29c)
- 0x19, 0x01, // USAGE_MINIMUM (0x1)
- 0x2a, 0x9c, 0x02, // USAGE_MAXIMUM (0x29c)
- 0x75, 0x10, // REPORT_SIZE (16)
- 0x95, 0x01, // REPORT_COUNT (1)
- 0x81, 0x00, // INPUT (Data,Array,Abs)
- 0xc0, // END_COLLECTION
+ // Mouse report descriptor
+ 0x05, 0x01, // Usage Page (Generic Desktop)
+ 0x09, 0x02, // Usage (Mouse)
+ 0xA1, 0x01, // Collection (Application)
+ 0x85, REPORT_ID_MOUSE, // Report ID
+ 0x09, 0x01, // Usage (Pointer)
+ 0xA1, 0x00, // Collection (Physical)
+ // Buttons (5 bits)
+ 0x05, 0x09, // Usage Page (Button)
+ 0x19, 0x01, // Usage Minimum (Button 1)
+ 0x29, 0x05, // Usage Maximum (Button 5)
+ 0x15, 0x00, // Logical Minimum (0)
+ 0x25, 0x01, // Logical Maximum (1)
+ 0x95, 0x05, // Report Count (5)
+ 0x75, 0x01, // Report Size (1)
+ 0x81, 0x02, // Input (Data, Variable, Absolute)
+ // Button padding (3 bits)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x03, // Report Size (3)
+ 0x81, 0x03, // Input (Constant)
+
+ // X/Y position (2 bytes)
+ 0x05, 0x01, // Usage Page (Generic Desktop)
+ 0x09, 0x30, // Usage (X)
+ 0x09, 0x31, // Usage (Y)
+ 0x15, 0x81, // Logical Minimum (-127)
+ 0x25, 0x7F, // Logical Maximum (127)
+ 0x95, 0x02, // Report Count (2)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x06, // Input (Data, Variable, Relative)
+
+ // Vertical wheel (1 byte)
+ 0x09, 0x38, // Usage (Wheel)
+ 0x15, 0x81, // Logical Minimum (-127)
+ 0x25, 0x7F, // Logical Maximum (127)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x06, // Input (Data, Variable, Relative)
+ // Horizontal wheel (1 byte)
+ 0x05, 0x0C, // Usage Page (Consumer)
+ 0x0A, 0x38, 0x02, // Usage (AC Pan)
+ 0x15, 0x81, // Logical Minimum (-127)
+ 0x25, 0x7F, // Logical Maximum (127)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x06, // Input (Data, Variable, Relative)
+ 0xC0, // End Collection
+ 0xC0, // End Collection
+
+#ifdef EXTRAKEY_ENABLE
+ // Extrakeys report descriptor
+ 0x05, 0x01, // Usage Page (Generic Desktop)
+ 0x09, 0x80, // Usage (System Control)
+ 0xA1, 0x01, // Collection (Application)
+ 0x85, REPORT_ID_SYSTEM, // Report ID
+ 0x1A, 0x81, 0x00, // Usage Minimum (System Power Down)
+ 0x2A, 0x83, 0x00, // Usage Maximum (System Wake Up)
+ 0x16, 0x01, 0x00, // Logical Minimum
+ 0x26, 0x03, 0x00, // Logical Maximum
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x10, // Report Size (16)
+ 0x81, 0x00, // Input (Data, Array, Absolute)
+ 0xC0, // End Collection
+
+ 0x05, 0x0C, // Usage Page (Consumer)
+ 0x09, 0x01, // Usage (Consumer Control)
+ 0xA1, 0x01, // Collection (Application)
+ 0x85, REPORT_ID_CONSUMER, // Report ID
+ 0x1A, 0x01, 0x00, // Usage Minimum (Consumer Control)
+ 0x2A, 0x9C, 0x02, // Usage Maximum (AC Distribute Vertically)
+ 0x16, 0x01, 0x00, // Logical Minimum
+ 0x26, 0x9C, 0x02, // Logical Maximum
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x10, // Report Size (16)
+ 0x81, 0x00, // Input (Data, Array, Absolute)
+ 0xC0 // End Collection
+#endif
};
#ifndef USB_MAX_POWER_CONSUMPTION
From 7740470a94ef10de3cedbe57c38d9f06c06a618d Mon Sep 17 00:00:00 2001
From: QMK Bot
Date: Wed, 12 Feb 2020 06:50:23 +0000
Subject: [PATCH 027/108] format code according to conventions [skip ci]
---
tmk_core/protocol/vusb/vusb.c | 116 +++++++++++++++++-----------------
1 file changed, 58 insertions(+), 58 deletions(-)
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c
index 7c1f4ca7f0d5..2d2e5ca5c3e8 100644
--- a/tmk_core/protocol/vusb/vusb.c
+++ b/tmk_core/protocol/vusb/vusb.c
@@ -211,22 +211,22 @@ uchar usbFunctionWrite(uchar *data, uchar len) {
*------------------------------------------------------------------*/
const PROGMEM uchar keyboard_hid_report[] = {
- 0x05, 0x01, // Usage Page (Generic Desktop)
- 0x09, 0x06, // Usage (Keyboard)
- 0xA1, 0x01, // Collection (Application)
+ 0x05, 0x01, // Usage Page (Generic Desktop)
+ 0x09, 0x06, // Usage (Keyboard)
+ 0xA1, 0x01, // Collection (Application)
// Modifiers (8 bits)
- 0x05, 0x07, // Usage Page (Keyboard/Keypad)
- 0x19, 0xE0, // Usage Minimum (Keyboard Left Control)
- 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI)
- 0x15, 0x00, // Logical Minimum (0)
- 0x25, 0x01, // Logical Maximum (1)
- 0x95, 0x08, // Report Count (8)
- 0x75, 0x01, // Report Size (1)
- 0x81, 0x02, // Input (Data, Variable, Absolute)
+ 0x05, 0x07, // Usage Page (Keyboard/Keypad)
+ 0x19, 0xE0, // Usage Minimum (Keyboard Left Control)
+ 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI)
+ 0x15, 0x00, // Logical Minimum (0)
+ 0x25, 0x01, // Logical Maximum (1)
+ 0x95, 0x08, // Report Count (8)
+ 0x75, 0x01, // Report Size (1)
+ 0x81, 0x02, // Input (Data, Variable, Absolute)
// Reserved (1 byte)
- 0x95, 0x01, // Report Count (1)
- 0x75, 0x08, // Report Size (8)
- 0x81, 0x03, // Input (Constant)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x03, // Input (Constant)
// Keycodes (6 bytes)
0x05, 0x07, // Usage Page (Keyboard/Keypad)
0x19, 0x00, // Usage Minimum (0)
@@ -238,17 +238,17 @@ const PROGMEM uchar keyboard_hid_report[] = {
0x81, 0x00, // Input (Data, Array, Absolute)
// Status LEDs (5 bits)
- 0x05, 0x08, // Usage Page (LED)
- 0x19, 0x01, // Usage Minimum (Num Lock)
- 0x29, 0x05, // Usage Maximum (Kana)
- 0x95, 0x05, // Report Count (5)
- 0x75, 0x01, // Report Size (1)
- 0x91, 0x02, // Output (Data, Variable, Absolute)
+ 0x05, 0x08, // Usage Page (LED)
+ 0x19, 0x01, // Usage Minimum (Num Lock)
+ 0x29, 0x05, // Usage Maximum (Kana)
+ 0x95, 0x05, // Report Count (5)
+ 0x75, 0x01, // Report Size (1)
+ 0x91, 0x02, // Output (Data, Variable, Absolute)
// LED padding (3 bits)
- 0x95, 0x01, // Report Count (1)
- 0x75, 0x03, // Report Size (3)
- 0x91, 0x03, // Output (Constant)
- 0xC0 // End Collection
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x03, // Report Size (3)
+ 0x91, 0x03, // Output (Constant)
+ 0xC0 // End Collection
};
const PROGMEM uchar mouse_hid_report[] = {
@@ -260,46 +260,46 @@ const PROGMEM uchar mouse_hid_report[] = {
0x09, 0x01, // Usage (Pointer)
0xA1, 0x00, // Collection (Physical)
// Buttons (5 bits)
- 0x05, 0x09, // Usage Page (Button)
- 0x19, 0x01, // Usage Minimum (Button 1)
- 0x29, 0x05, // Usage Maximum (Button 5)
- 0x15, 0x00, // Logical Minimum (0)
- 0x25, 0x01, // Logical Maximum (1)
- 0x95, 0x05, // Report Count (5)
- 0x75, 0x01, // Report Size (1)
- 0x81, 0x02, // Input (Data, Variable, Absolute)
+ 0x05, 0x09, // Usage Page (Button)
+ 0x19, 0x01, // Usage Minimum (Button 1)
+ 0x29, 0x05, // Usage Maximum (Button 5)
+ 0x15, 0x00, // Logical Minimum (0)
+ 0x25, 0x01, // Logical Maximum (1)
+ 0x95, 0x05, // Report Count (5)
+ 0x75, 0x01, // Report Size (1)
+ 0x81, 0x02, // Input (Data, Variable, Absolute)
// Button padding (3 bits)
- 0x95, 0x01, // Report Count (1)
- 0x75, 0x03, // Report Size (3)
- 0x81, 0x03, // Input (Constant)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x03, // Report Size (3)
+ 0x81, 0x03, // Input (Constant)
// X/Y position (2 bytes)
- 0x05, 0x01, // Usage Page (Generic Desktop)
- 0x09, 0x30, // Usage (X)
- 0x09, 0x31, // Usage (Y)
- 0x15, 0x81, // Logical Minimum (-127)
- 0x25, 0x7F, // Logical Maximum (127)
- 0x95, 0x02, // Report Count (2)
- 0x75, 0x08, // Report Size (8)
- 0x81, 0x06, // Input (Data, Variable, Relative)
+ 0x05, 0x01, // Usage Page (Generic Desktop)
+ 0x09, 0x30, // Usage (X)
+ 0x09, 0x31, // Usage (Y)
+ 0x15, 0x81, // Logical Minimum (-127)
+ 0x25, 0x7F, // Logical Maximum (127)
+ 0x95, 0x02, // Report Count (2)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x06, // Input (Data, Variable, Relative)
// Vertical wheel (1 byte)
- 0x09, 0x38, // Usage (Wheel)
- 0x15, 0x81, // Logical Minimum (-127)
- 0x25, 0x7F, // Logical Maximum (127)
- 0x95, 0x01, // Report Count (1)
- 0x75, 0x08, // Report Size (8)
- 0x81, 0x06, // Input (Data, Variable, Relative)
+ 0x09, 0x38, // Usage (Wheel)
+ 0x15, 0x81, // Logical Minimum (-127)
+ 0x25, 0x7F, // Logical Maximum (127)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x06, // Input (Data, Variable, Relative)
// Horizontal wheel (1 byte)
- 0x05, 0x0C, // Usage Page (Consumer)
- 0x0A, 0x38, 0x02, // Usage (AC Pan)
- 0x15, 0x81, // Logical Minimum (-127)
- 0x25, 0x7F, // Logical Maximum (127)
- 0x95, 0x01, // Report Count (1)
- 0x75, 0x08, // Report Size (8)
- 0x81, 0x06, // Input (Data, Variable, Relative)
- 0xC0, // End Collection
- 0xC0, // End Collection
+ 0x05, 0x0C, // Usage Page (Consumer)
+ 0x0A, 0x38, 0x02, // Usage (AC Pan)
+ 0x15, 0x81, // Logical Minimum (-127)
+ 0x25, 0x7F, // Logical Maximum (127)
+ 0x95, 0x01, // Report Count (1)
+ 0x75, 0x08, // Report Size (8)
+ 0x81, 0x06, // Input (Data, Variable, Relative)
+ 0xC0, // End Collection
+ 0xC0, // End Collection
#ifdef EXTRAKEY_ENABLE
// Extrakeys report descriptor
From 667b29b77c71cb0a0f8b4298900304c08b13e410 Mon Sep 17 00:00:00 2001
From: Joel Challis
Date: Wed, 12 Feb 2020 10:54:05 +0000
Subject: [PATCH 028/108] Align split_common/matrix.c with matrix.c (#8153)
---
quantum/split_common/matrix.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c
index 454ea59c3b1e..2c0e028f7da0 100644
--- a/quantum/split_common/matrix.c
+++ b/quantum/split_common/matrix.c
@@ -19,10 +19,10 @@ along with this program. If not, see .
#include "wait.h"
#include "util.h"
#include "matrix.h"
+#include "debounce.h"
+#include "quantum.h"
#include "split_util.h"
#include "config.h"
-#include "quantum.h"
-#include "debounce.h"
#include "transport.h"
#ifdef ENCODER_ENABLE
@@ -35,7 +35,7 @@ along with this program. If not, see .
#ifdef DIRECT_PINS
static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS;
-#else
+#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
#endif
@@ -115,8 +115,11 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
// For each col...
for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
+ // Select the col pin to read (active low)
+ uint8_t pin_state = readPin(col_pins[col_index]);
+
// Populate the matrix row with the state of the col pin
- current_matrix[current_row] |= readPin(col_pins[col_index]) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
+ current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
}
// Unselect row
@@ -160,12 +163,12 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
matrix_row_t last_row_value = current_matrix[row_index];
// Check row pin state
- if (readPin(row_pins[row_index])) {
- // Pin HI, clear col bit
- current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col);
- } else {
+ if (readPin(row_pins[row_index]) == 0) {
// Pin LO, set col bit
current_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
+ } else {
+ // Pin HI, clear col bit
+ current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << current_col);
}
// Determine if the matrix changed state
From 1a77abfe64f08a0b72f4f328418b4f4dc138ac8d Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Fri, 14 Feb 2020 06:36:21 +1100
Subject: [PATCH 029/108] Define backlight pin for Quefrency Rev2 (#8141)
---
keyboards/keebio/quefrency/rev2/config.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/keyboards/keebio/quefrency/rev2/config.h b/keyboards/keebio/quefrency/rev2/config.h
index e50c8142e880..4463eb73963e 100644
--- a/keyboards/keebio/quefrency/rev2/config.h
+++ b/keyboards/keebio/quefrency/rev2/config.h
@@ -46,6 +46,8 @@ along with this program. If not, see .
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
+#define BACKLIGHT_PIN B5
+
/* serial.c configuration for split keyboard */
#define SOFT_SERIAL_PIN D0
From 014ad1d747d1688dc12a690282deae00a8efb88c Mon Sep 17 00:00:00 2001
From: Joel Challis
Date: Thu, 13 Feb 2020 19:39:22 +0000
Subject: [PATCH 030/108] Fix RESET keycode on some STM32F072 keyboards (#8134)
* Add f072 board files with 'enter_bootloader_mode_if_requested' support
* rename default f072 board file to GENERIC_STM32_F072XB
* Remove board files
* Add bootloader def
* Update generic f072 board paths
* Revert wrong deletion
---
drivers/boards/GENERIC_STM32_F072XB/board.c | 109 +++
drivers/boards/GENERIC_STM32_F072XB/board.h | 923 ++++++++++++++++++
drivers/boards/GENERIC_STM32_F072XB/board.mk | 5 +
.../GENERIC_STM32_F072XB}/bootloader_defs.h | 0
.../GENERIC_STM32_F072XB/cfg/board.chcfg | 703 +++++++++++++
keyboards/at_at/660m/rules.mk | 1 +
keyboards/candybar/rules.mk | 1 +
keyboards/cannonkeys/an_c/rules.mk | 1 +
keyboards/cannonkeys/chimera65/rules.mk | 1 +
keyboards/cannonkeys/instant60/rules.mk | 1 +
keyboards/cannonkeys/iron165/rules.mk | 1 +
keyboards/cannonkeys/satisfaction75/rules.mk | 1 +
keyboards/cannonkeys/savage65/rules.mk | 1 +
keyboards/cannonkeys/tmov2/rules.mk | 1 +
keyboards/projectkb/alice/rules.mk | 1 +
keyboards/xiaomi/mk02/rules.mk | 1 +
quantum/mcu_selection.mk | 2 +-
17 files changed, 1752 insertions(+), 1 deletion(-)
create mode 100644 drivers/boards/GENERIC_STM32_F072XB/board.c
create mode 100644 drivers/boards/GENERIC_STM32_F072XB/board.h
create mode 100644 drivers/boards/GENERIC_STM32_F072XB/board.mk
rename {keyboards/handwired/ck4x4 => drivers/boards/GENERIC_STM32_F072XB}/bootloader_defs.h (100%)
create mode 100644 drivers/boards/GENERIC_STM32_F072XB/cfg/board.chcfg
diff --git a/drivers/boards/GENERIC_STM32_F072XB/board.c b/drivers/boards/GENERIC_STM32_F072XB/board.c
new file mode 100644
index 000000000000..2ad6d744be7d
--- /dev/null
+++ b/drivers/boards/GENERIC_STM32_F072XB/board.c
@@ -0,0 +1,109 @@
+/*
+ ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/*
+ * This file has been automatically generated using ChibiStudio board
+ * generator plugin. Do not edit manually.
+ */
+
+#include "hal.h"
+
+#if HAL_USE_PAL || defined(__DOXYGEN__)
+/**
+ * @brief PAL setup.
+ * @details Digital I/O ports static configuration as defined in @p board.h.
+ * This variable is used by the HAL when initializing the PAL driver.
+ */
+const PALConfig pal_default_config = {
+#if STM32_HAS_GPIOA
+ {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
+ VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
+#endif
+#if STM32_HAS_GPIOB
+ {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
+ VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
+#endif
+#if STM32_HAS_GPIOC
+ {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
+ VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
+#endif
+#if STM32_HAS_GPIOD
+ {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
+ VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
+#endif
+#if STM32_HAS_GPIOE
+ {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
+ VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
+#endif
+#if STM32_HAS_GPIOF
+ {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
+ VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
+#endif
+#if STM32_HAS_GPIOG
+ {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
+ VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
+#endif
+#if STM32_HAS_GPIOH
+ {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
+ VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
+#endif
+#if STM32_HAS_GPIOI
+ {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
+ VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
+#endif
+};
+#endif
+
+__attribute__((weak)) void enter_bootloader_mode_if_requested(void) {}
+
+/**
+ * @brief Early initialization code.
+ * @details This initialization must be performed just after stack setup
+ * and before any other initialization.
+ */
+void __early_init(void) {
+ enter_bootloader_mode_if_requested();
+ stm32_clock_init();
+}
+
+#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
+/**
+ * @brief MMC_SPI card detection.
+ */
+bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
+
+ (void)mmcp;
+ /* TODO: Fill the implementation.*/
+ return true;
+}
+
+/**
+ * @brief MMC_SPI card write protection detection.
+ */
+bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
+
+ (void)mmcp;
+ /* TODO: Fill the implementation.*/
+ return false;
+}
+#endif
+
+/**
+ * @brief Board-specific initialization code.
+ * @todo Add your board-specific code, if any.
+ */
+void boardInit(void) {
+}
diff --git a/drivers/boards/GENERIC_STM32_F072XB/board.h b/drivers/boards/GENERIC_STM32_F072XB/board.h
new file mode 100644
index 000000000000..379e690a647c
--- /dev/null
+++ b/drivers/boards/GENERIC_STM32_F072XB/board.h
@@ -0,0 +1,923 @@
+/*
+ ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/*
+ * This file has been automatically generated using ChibiStudio board
+ * generator plugin. Do not edit manually.
+ */
+
+#ifndef BOARD_H
+#define BOARD_H
+
+/*
+ * Setup for Generic STM32_F072 Board
+ */
+
+/*
+ * Board identifier.
+ */
+#define BOARD_GENERIC_STM32_F072XB
+#define BOARD_NAME "STM32_F072"
+
+/*
+ * Board oscillators-related settings.
+ * NOTE: LSE not fitted.
+ * NOTE: HSE not fitted.
+ */
+#if !defined(STM32_LSECLK)
+#define STM32_LSECLK 0U
+#endif
+
+#define STM32_LSEDRV (3U << 3U)
+
+#if !defined(STM32_HSECLK)
+#define STM32_HSECLK 0U
+#endif
+
+#define STM32_HSE_BYPASS
+
+/*
+ * MCU type as defined in the ST header.
+ */
+#define STM32F072xB
+
+/*
+ * IO pins assignments.
+ */
+#define GPIOA_BUTTON 0U
+#define GPIOA_PIN1 1U
+#define GPIOA_PIN2 2U
+#define GPIOA_PIN3 3U
+#define GPIOA_PIN4 4U
+#define GPIOA_PIN5 5U
+#define GPIOA_PIN6 6U
+#define GPIOA_PIN7 7U
+#define GPIOA_PIN8 8U
+#define GPIOA_PIN9 9U
+#define GPIOA_PIN10 10U
+#define GPIOA_USB_DM 11U
+#define GPIOA_USB_DP 12U
+#define GPIOA_SWDIO 13U
+#define GPIOA_SWCLK 14U
+#define GPIOA_PIN15 15U
+
+#define GPIOB_PIN0 0U
+#define GPIOB_PIN1 1U
+#define GPIOB_PIN2 2U
+#define GPIOB_PIN3 3U
+#define GPIOB_PIN4 4U
+#define GPIOB_PIN5 5U
+#define GPIOB_PIN6 6U
+#define GPIOB_PIN7 7U
+#define GPIOB_PIN8 8U
+#define GPIOB_PIN9 9U
+#define GPIOB_PIN10 10U
+#define GPIOB_PIN11 11U
+#define GPIOB_PIN12 12U
+#define GPIOB_SPI2_SCK 13U
+#define GPIOB_SPI2_MISO 14U
+#define GPIOB_SPI2_MOSI 15U
+
+#define GPIOC_MEMS_CS 0U
+#define GPIOC_PIN1 1U
+#define GPIOC_PIN2 2U
+#define GPIOC_PIN3 3U
+#define GPIOC_PIN4 4U
+#define GPIOC_PIN5 5U
+#define GPIOC_LED_RED 6U
+#define GPIOC_LED_BLUE 7U
+#define GPIOC_LED_ORANGE 8U
+#define GPIOC_LED_GREEN 9U
+#define GPIOC_PIN10 10U
+#define GPIOC_PIN11 11U
+#define GPIOC_PIN12 12U
+#define GPIOC_PIN13 13U
+#define GPIOC_OSC32_IN 14U
+#define GPIOC_OSC32_OUT 15U
+
+#define GPIOD_PIN0 0U
+#define GPIOD_PIN1 1U
+#define GPIOD_PIN2 2U
+#define GPIOD_PIN3 3U
+#define GPIOD_PIN4 4U
+#define GPIOD_PIN5 5U
+#define GPIOD_PIN6 6U
+#define GPIOD_PIN7 7U
+#define GPIOD_PIN8 8U
+#define GPIOD_PIN9 9U
+#define GPIOD_PIN10 10U
+#define GPIOD_PIN11 11U
+#define GPIOD_PIN12 12U
+#define GPIOD_PIN13 13U
+#define GPIOD_PIN14 14U
+#define GPIOD_PIN15 15U
+
+#define GPIOE_PIN0 0U
+#define GPIOE_PIN1 1U
+#define GPIOE_PIN2 2U
+#define GPIOE_PIN3 3U
+#define GPIOE_PIN4 4U
+#define GPIOE_PIN5 5U
+#define GPIOE_PIN6 6U
+#define GPIOE_PIN7 7U
+#define GPIOE_PIN8 8U
+#define GPIOE_PIN9 9U
+#define GPIOE_PIN10 10U
+#define GPIOE_PIN11 11U
+#define GPIOE_PIN12 12U
+#define GPIOE_PIN13 13U
+#define GPIOE_PIN14 14U
+#define GPIOE_PIN15 15U
+
+#define GPIOF_OSC_IN 0U
+#define GPIOF_OSC_OUT 1U
+#define GPIOF_PIN2 2U
+#define GPIOF_PIN3 3U
+#define GPIOF_PIN4 4U
+#define GPIOF_PIN5 5U
+#define GPIOF_PIN6 6U
+#define GPIOF_PIN7 7U
+#define GPIOF_PIN8 8U
+#define GPIOF_PIN9 9U
+#define GPIOF_PIN10 10U
+#define GPIOF_PIN11 11U
+#define GPIOF_PIN12 12U
+#define GPIOF_PIN13 13U
+#define GPIOF_PIN14 14U
+#define GPIOF_PIN15 15U
+
+/*
+ * IO lines assignments.
+ */
+#define LINE_BUTTON PAL_LINE(GPIOA, 0U)
+#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
+#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
+#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
+#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
+
+#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U)
+#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U)
+#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U)
+
+#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U)
+#define LINE_LED_RED PAL_LINE(GPIOC, 6U)
+#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U)
+#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U)
+#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U)
+#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
+#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
+
+
+
+#define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
+#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
+
+/*
+ * I/O ports initial setup, this configuration is established soon after reset
+ * in the initialization code.
+ * Please refer to the STM32 Reference Manual for details.
+ */
+#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
+#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
+#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
+#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
+#define PIN_ODR_LOW(n) (0U << (n))
+#define PIN_ODR_HIGH(n) (1U << (n))
+#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
+#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
+#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
+#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
+#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
+#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
+#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
+#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
+#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
+#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
+
+/*
+ * GPIOA setup:
+ *
+ * PA0 - BUTTON (input floating).
+ * PA1 - PIN1 (input pullup).
+ * PA2 - PIN2 (input pullup).
+ * PA3 - PIN3 (input pullup).
+ * PA4 - PIN4 (input pullup).
+ * PA5 - PIN5 (input pullup).
+ * PA6 - PIN6 (input pullup).
+ * PA7 - PIN7 (input pullup).
+ * PA8 - PIN8 (input pullup).
+ * PA9 - PIN9 (input pullup).
+ * PA10 - PIN10 (input pullup).
+ * PA11 - USB_DM (input floating).
+ * PA12 - USB_DP (input floating).
+ * PA13 - SWDIO (alternate 0).
+ * PA14 - SWCLK (alternate 0).
+ * PA15 - PIN15 (input pullup).
+ */
+#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \
+ PIN_MODE_INPUT(GPIOA_PIN1) | \
+ PIN_MODE_INPUT(GPIOA_PIN2) | \
+ PIN_MODE_INPUT(GPIOA_PIN3) | \
+ PIN_MODE_INPUT(GPIOA_PIN4) | \
+ PIN_MODE_INPUT(GPIOA_PIN5) | \
+ PIN_MODE_INPUT(GPIOA_PIN6) | \
+ PIN_MODE_INPUT(GPIOA_PIN7) | \
+ PIN_MODE_INPUT(GPIOA_PIN8) | \
+ PIN_MODE_INPUT(GPIOA_PIN9) | \
+ PIN_MODE_INPUT(GPIOA_PIN10) | \
+ PIN_MODE_INPUT(GPIOA_USB_DM) | \
+ PIN_MODE_INPUT(GPIOA_USB_DP) | \
+ PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
+ PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
+ PIN_MODE_INPUT(GPIOA_PIN15))
+#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
+ PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
+#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
+ PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
+ PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \
+ PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \
+ PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
+ PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
+ PIN_OSPEED_HIGH(GPIOA_PIN15))
+#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN1) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN7) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
+ PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
+ PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
+ PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
+ PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
+ PIN_PUPDR_PULLUP(GPIOA_PIN15))
+#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \
+ PIN_ODR_HIGH(GPIOA_PIN1) | \
+ PIN_ODR_HIGH(GPIOA_PIN2) | \
+ PIN_ODR_HIGH(GPIOA_PIN3) | \
+ PIN_ODR_HIGH(GPIOA_PIN4) | \
+ PIN_ODR_HIGH(GPIOA_PIN5) | \
+ PIN_ODR_HIGH(GPIOA_PIN6) | \
+ PIN_ODR_HIGH(GPIOA_PIN7) | \
+ PIN_ODR_HIGH(GPIOA_PIN8) | \
+ PIN_ODR_HIGH(GPIOA_PIN9) | \
+ PIN_ODR_HIGH(GPIOA_PIN10) | \
+ PIN_ODR_HIGH(GPIOA_USB_DM) | \
+ PIN_ODR_HIGH(GPIOA_USB_DP) | \
+ PIN_ODR_HIGH(GPIOA_SWDIO) | \
+ PIN_ODR_HIGH(GPIOA_SWCLK) | \
+ PIN_ODR_HIGH(GPIOA_PIN15))
+#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN7, 0U))
+#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN9, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
+ PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \
+ PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \
+ PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
+ PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
+ PIN_AFIO_AF(GPIOA_PIN15, 0U))
+
+/*
+ * GPIOB setup:
+ *
+ * PB0 - PIN0 (input pullup).
+ * PB1 - PIN1 (input pullup).
+ * PB2 - PIN2 (input pullup).
+ * PB3 - PIN3 (input pullup).
+ * PB4 - PIN4 (input pullup).
+ * PB5 - PIN5 (input pullup).
+ * PB6 - PIN6 (input pullup).
+ * PB7 - PIN7 (input pullup).
+ * PB8 - PIN8 (input pullup).
+ * PB9 - PIN9 (input pullup).
+ * PB10 - PIN10 (input pullup).
+ * PB11 - PIN11 (input pullup).
+ * PB12 - PIN12 (input pullup).
+ * PB13 - SPI2_SCK (alternate 0).
+ * PB14 - SPI2_MISO (alternate 0).
+ * PB15 - SPI2_MOSI (alternate 0).
+ */
+#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
+ PIN_MODE_INPUT(GPIOB_PIN1) | \
+ PIN_MODE_INPUT(GPIOB_PIN2) | \
+ PIN_MODE_INPUT(GPIOB_PIN3) | \
+ PIN_MODE_INPUT(GPIOB_PIN4) | \
+ PIN_MODE_INPUT(GPIOB_PIN5) | \
+ PIN_MODE_INPUT(GPIOB_PIN6) | \
+ PIN_MODE_INPUT(GPIOB_PIN7) | \
+ PIN_MODE_INPUT(GPIOB_PIN8) | \
+ PIN_MODE_INPUT(GPIOB_PIN9) | \
+ PIN_MODE_INPUT(GPIOB_PIN10) | \
+ PIN_MODE_INPUT(GPIOB_PIN11) | \
+ PIN_MODE_INPUT(GPIOB_PIN12) | \
+ PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \
+ PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \
+ PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \
+ PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
+ PIN_OSPEED_HIGH(GPIOB_PIN2) | \
+ PIN_OSPEED_HIGH(GPIOB_PIN3) | \
+ PIN_OSPEED_HIGH(GPIOB_PIN4) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
+ PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
+ PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \
+ PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \
+ PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN3) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN6) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
+ PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
+ PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \
+ PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \
+ PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
+ PIN_ODR_HIGH(GPIOB_PIN1) | \
+ PIN_ODR_HIGH(GPIOB_PIN2) | \
+ PIN_ODR_HIGH(GPIOB_PIN3) | \
+ PIN_ODR_HIGH(GPIOB_PIN4) | \
+ PIN_ODR_HIGH(GPIOB_PIN5) | \
+ PIN_ODR_HIGH(GPIOB_PIN6) | \
+ PIN_ODR_HIGH(GPIOB_PIN7) | \
+ PIN_ODR_HIGH(GPIOB_PIN8) | \
+ PIN_ODR_HIGH(GPIOB_PIN9) | \
+ PIN_ODR_HIGH(GPIOB_PIN10) | \
+ PIN_ODR_HIGH(GPIOB_PIN11) | \
+ PIN_ODR_HIGH(GPIOB_PIN12) | \
+ PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \
+ PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \
+ PIN_ODR_HIGH(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN3, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN7, 0U))
+#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
+ PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
+ PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \
+ PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \
+ PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U))
+
+/*
+ * GPIOC setup:
+ *
+ * PC0 - MEMS_CS (output pushpull maximum).
+ * PC1 - PIN1 (input pullup).
+ * PC2 - PIN2 (input pullup).
+ * PC3 - PIN3 (input pullup).
+ * PC4 - PIN4 (input pullup).
+ * PC5 - PIN5 (input pullup).
+ * PC6 - LED_RED (output pushpull maximum).
+ * PC7 - LED_BLUE (output pushpull maximum).
+ * PC8 - LED_ORANGE (output pushpull maximum).
+ * PC9 - LED_GREEN (output pushpull maximum).
+ * PC10 - PIN10 (input pullup).
+ * PC11 - PIN11 (input pullup).
+ * PC12 - PIN12 (input pullup).
+ * PC13 - PIN13 (input pullup).
+ * PC14 - OSC32_IN (input floating).
+ * PC15 - OSC32_OUT (input floating).
+ */
+#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \
+ PIN_MODE_INPUT(GPIOC_PIN1) | \
+ PIN_MODE_INPUT(GPIOC_PIN2) | \
+ PIN_MODE_INPUT(GPIOC_PIN3) | \
+ PIN_MODE_INPUT(GPIOC_PIN4) | \
+ PIN_MODE_INPUT(GPIOC_PIN5) | \
+ PIN_MODE_OUTPUT(GPIOC_LED_RED) | \
+ PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \
+ PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \
+ PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \
+ PIN_MODE_INPUT(GPIOC_PIN10) | \
+ PIN_MODE_INPUT(GPIOC_PIN11) | \
+ PIN_MODE_INPUT(GPIOC_PIN12) | \
+ PIN_MODE_INPUT(GPIOC_PIN13) | \
+ PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
+ PIN_MODE_INPUT(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
+ PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
+ PIN_OSPEED_HIGH(GPIOC_LED_RED) | \
+ PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \
+ PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \
+ PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
+ PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
+ PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
+ PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
+ PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \
+ PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \
+ PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \
+ PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
+ PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
+ PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
+ PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \
+ PIN_ODR_HIGH(GPIOC_PIN1) | \
+ PIN_ODR_HIGH(GPIOC_PIN2) | \
+ PIN_ODR_HIGH(GPIOC_PIN3) | \
+ PIN_ODR_HIGH(GPIOC_PIN4) | \
+ PIN_ODR_HIGH(GPIOC_PIN5) | \
+ PIN_ODR_LOW(GPIOC_LED_RED) | \
+ PIN_ODR_LOW(GPIOC_LED_BLUE) | \
+ PIN_ODR_LOW(GPIOC_LED_ORANGE) | \
+ PIN_ODR_LOW(GPIOC_LED_GREEN) | \
+ PIN_ODR_HIGH(GPIOC_PIN10) | \
+ PIN_ODR_HIGH(GPIOC_PIN11) | \
+ PIN_ODR_HIGH(GPIOC_PIN12) | \
+ PIN_ODR_HIGH(GPIOC_PIN13) | \
+ PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
+ PIN_ODR_HIGH(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
+ PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \
+ PIN_AFIO_AF(GPIOC_LED_BLUE, 0U))
+#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \
+ PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
+ PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
+ PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
+ PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
+
+/*
+ * GPIOD setup:
+ *
+ * PD0 - PIN0 (input pullup).
+ * PD1 - PIN1 (input pullup).
+ * PD2 - PIN2 (input pullup).
+ * PD3 - PIN3 (input pullup).
+ * PD4 - PIN4 (input pullup).
+ * PD5 - PIN5 (input pullup).
+ * PD6 - PIN6 (input pullup).
+ * PD7 - PIN7 (input pullup).
+ * PD8 - PIN8 (input pullup).
+ * PD9 - PIN9 (input pullup).
+ * PD10 - PIN10 (input pullup).
+ * PD11 - PIN11 (input pullup).
+ * PD12 - PIN12 (input pullup).
+ * PD13 - PIN13 (input pullup).
+ * PD14 - PIN14 (input pullup).
+ * PD15 - PIN15 (input pullup).
+ */
+#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
+ PIN_MODE_INPUT(GPIOD_PIN1) | \
+ PIN_MODE_INPUT(GPIOD_PIN2) | \
+ PIN_MODE_INPUT(GPIOD_PIN3) | \
+ PIN_MODE_INPUT(GPIOD_PIN4) | \
+ PIN_MODE_INPUT(GPIOD_PIN5) | \
+ PIN_MODE_INPUT(GPIOD_PIN6) | \
+ PIN_MODE_INPUT(GPIOD_PIN7) | \
+ PIN_MODE_INPUT(GPIOD_PIN8) | \
+ PIN_MODE_INPUT(GPIOD_PIN9) | \
+ PIN_MODE_INPUT(GPIOD_PIN10) | \
+ PIN_MODE_INPUT(GPIOD_PIN11) | \
+ PIN_MODE_INPUT(GPIOD_PIN12) | \
+ PIN_MODE_INPUT(GPIOD_PIN13) | \
+ PIN_MODE_INPUT(GPIOD_PIN14) | \
+ PIN_MODE_INPUT(GPIOD_PIN15))
+#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
+ PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
+#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
+ PIN_OSPEED_VERYLOW(GPIOD_PIN15))
+#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
+ PIN_PUPDR_PULLUP(GPIOD_PIN15))
+#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
+ PIN_ODR_HIGH(GPIOD_PIN1) | \
+ PIN_ODR_HIGH(GPIOD_PIN2) | \
+ PIN_ODR_HIGH(GPIOD_PIN3) | \
+ PIN_ODR_HIGH(GPIOD_PIN4) | \
+ PIN_ODR_HIGH(GPIOD_PIN5) | \
+ PIN_ODR_HIGH(GPIOD_PIN6) | \
+ PIN_ODR_HIGH(GPIOD_PIN7) | \
+ PIN_ODR_HIGH(GPIOD_PIN8) | \
+ PIN_ODR_HIGH(GPIOD_PIN9) | \
+ PIN_ODR_HIGH(GPIOD_PIN10) | \
+ PIN_ODR_HIGH(GPIOD_PIN11) | \
+ PIN_ODR_HIGH(GPIOD_PIN12) | \
+ PIN_ODR_HIGH(GPIOD_PIN13) | \
+ PIN_ODR_HIGH(GPIOD_PIN14) | \
+ PIN_ODR_HIGH(GPIOD_PIN15))
+#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN7, 0U))
+#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
+ PIN_AFIO_AF(GPIOD_PIN15, 0U))
+
+/*
+ * GPIOE setup:
+ *
+ * PE0 - PIN0 (input pullup).
+ * PE1 - PIN1 (input pullup).
+ * PE2 - PIN2 (input pullup).
+ * PE3 - PIN3 (input pullup).
+ * PE4 - PIN4 (input pullup).
+ * PE5 - PIN5 (input pullup).
+ * PE6 - PIN6 (input pullup).
+ * PE7 - PIN7 (input pullup).
+ * PE8 - PIN8 (input pullup).
+ * PE9 - PIN9 (input pullup).
+ * PE10 - PIN10 (input pullup).
+ * PE11 - PIN11 (input pullup).
+ * PE12 - PIN12 (input pullup).
+ * PE13 - PIN13 (input pullup).
+ * PE14 - PIN14 (input pullup).
+ * PE15 - PIN15 (input pullup).
+ */
+#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
+ PIN_MODE_INPUT(GPIOE_PIN1) | \
+ PIN_MODE_INPUT(GPIOE_PIN2) | \
+ PIN_MODE_INPUT(GPIOE_PIN3) | \
+ PIN_MODE_INPUT(GPIOE_PIN4) | \
+ PIN_MODE_INPUT(GPIOE_PIN5) | \
+ PIN_MODE_INPUT(GPIOE_PIN6) | \
+ PIN_MODE_INPUT(GPIOE_PIN7) | \
+ PIN_MODE_INPUT(GPIOE_PIN8) | \
+ PIN_MODE_INPUT(GPIOE_PIN9) | \
+ PIN_MODE_INPUT(GPIOE_PIN10) | \
+ PIN_MODE_INPUT(GPIOE_PIN11) | \
+ PIN_MODE_INPUT(GPIOE_PIN12) | \
+ PIN_MODE_INPUT(GPIOE_PIN13) | \
+ PIN_MODE_INPUT(GPIOE_PIN14) | \
+ PIN_MODE_INPUT(GPIOE_PIN15))
+#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
+ PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
+#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \
+ PIN_OSPEED_VERYLOW(GPIOE_PIN15))
+#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN2) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN5) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN11) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN13) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN14) | \
+ PIN_PUPDR_PULLUP(GPIOE_PIN15))
+#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
+ PIN_ODR_HIGH(GPIOE_PIN1) | \
+ PIN_ODR_HIGH(GPIOE_PIN2) | \
+ PIN_ODR_HIGH(GPIOE_PIN3) | \
+ PIN_ODR_HIGH(GPIOE_PIN4) | \
+ PIN_ODR_HIGH(GPIOE_PIN5) | \
+ PIN_ODR_HIGH(GPIOE_PIN6) | \
+ PIN_ODR_HIGH(GPIOE_PIN7) | \
+ PIN_ODR_HIGH(GPIOE_PIN8) | \
+ PIN_ODR_HIGH(GPIOE_PIN9) | \
+ PIN_ODR_HIGH(GPIOE_PIN10) | \
+ PIN_ODR_HIGH(GPIOE_PIN11) | \
+ PIN_ODR_HIGH(GPIOE_PIN12) | \
+ PIN_ODR_HIGH(GPIOE_PIN13) | \
+ PIN_ODR_HIGH(GPIOE_PIN14) | \
+ PIN_ODR_HIGH(GPIOE_PIN15))
+#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN7, 0U))
+#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
+ PIN_AFIO_AF(GPIOE_PIN15, 0U))
+
+/*
+ * GPIOF setup:
+ *
+ * PF0 - OSC_IN (input floating).
+ * PF1 - OSC_OUT (input floating).
+ * PF2 - PIN2 (input pullup).
+ * PF3 - PIN3 (input pullup).
+ * PF4 - PIN4 (input pullup).
+ * PF5 - PIN5 (input pullup).
+ * PF6 - PIN6 (input pullup).
+ * PF7 - PIN7 (input pullup).
+ * PF8 - PIN8 (input pullup).
+ * PF9 - PIN9 (input pullup).
+ * PF10 - PIN10 (input pullup).
+ * PF11 - PIN11 (input pullup).
+ * PF12 - PIN12 (input pullup).
+ * PF13 - PIN13 (input pullup).
+ * PF14 - PIN14 (input pullup).
+ * PF15 - PIN15 (input pullup).
+ */
+#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \
+ PIN_MODE_INPUT(GPIOF_OSC_OUT) | \
+ PIN_MODE_INPUT(GPIOF_PIN2) | \
+ PIN_MODE_INPUT(GPIOF_PIN3) | \
+ PIN_MODE_INPUT(GPIOF_PIN4) | \
+ PIN_MODE_INPUT(GPIOF_PIN5) | \
+ PIN_MODE_INPUT(GPIOF_PIN6) | \
+ PIN_MODE_INPUT(GPIOF_PIN7) | \
+ PIN_MODE_INPUT(GPIOF_PIN8) | \
+ PIN_MODE_INPUT(GPIOF_PIN9) | \
+ PIN_MODE_INPUT(GPIOF_PIN10) | \
+ PIN_MODE_INPUT(GPIOF_PIN11) | \
+ PIN_MODE_INPUT(GPIOF_PIN12) | \
+ PIN_MODE_INPUT(GPIOF_PIN13) | \
+ PIN_MODE_INPUT(GPIOF_PIN14) | \
+ PIN_MODE_INPUT(GPIOF_PIN15))
+#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
+ PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
+#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \
+ PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
+ PIN_OSPEED_VERYLOW(GPIOF_PIN15))
+#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \
+ PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
+ PIN_PUPDR_PULLUP(GPIOF_PIN15))
+#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \
+ PIN_ODR_HIGH(GPIOF_OSC_OUT) | \
+ PIN_ODR_HIGH(GPIOF_PIN2) | \
+ PIN_ODR_HIGH(GPIOF_PIN3) | \
+ PIN_ODR_HIGH(GPIOF_PIN4) | \
+ PIN_ODR_HIGH(GPIOF_PIN5) | \
+ PIN_ODR_HIGH(GPIOF_PIN6) | \
+ PIN_ODR_HIGH(GPIOF_PIN7) | \
+ PIN_ODR_HIGH(GPIOF_PIN8) | \
+ PIN_ODR_HIGH(GPIOF_PIN9) | \
+ PIN_ODR_HIGH(GPIOF_PIN10) | \
+ PIN_ODR_HIGH(GPIOF_PIN11) | \
+ PIN_ODR_HIGH(GPIOF_PIN12) | \
+ PIN_ODR_HIGH(GPIOF_PIN13) | \
+ PIN_ODR_HIGH(GPIOF_PIN14) | \
+ PIN_ODR_HIGH(GPIOF_PIN15))
+#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \
+ PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN7, 0U))
+#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
+ PIN_AFIO_AF(GPIOF_PIN15, 0U))
+
+
+#if !defined(_FROM_ASM_)
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void boardInit(void);
+#ifdef __cplusplus
+}
+#endif
+#endif /* _FROM_ASM_ */
+
+#endif /* BOARD_H */
diff --git a/drivers/boards/GENERIC_STM32_F072XB/board.mk b/drivers/boards/GENERIC_STM32_F072XB/board.mk
new file mode 100644
index 000000000000..c136f705a636
--- /dev/null
+++ b/drivers/boards/GENERIC_STM32_F072XB/board.mk
@@ -0,0 +1,5 @@
+# List of all the board related files.
+BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F072XB/board.c
+
+# Required include directories
+BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F072XB
diff --git a/keyboards/handwired/ck4x4/bootloader_defs.h b/drivers/boards/GENERIC_STM32_F072XB/bootloader_defs.h
similarity index 100%
rename from keyboards/handwired/ck4x4/bootloader_defs.h
rename to drivers/boards/GENERIC_STM32_F072XB/bootloader_defs.h
diff --git a/drivers/boards/GENERIC_STM32_F072XB/cfg/board.chcfg b/drivers/boards/GENERIC_STM32_F072XB/cfg/board.chcfg
new file mode 100644
index 000000000000..9c7cf4fd76a3
--- /dev/null
+++ b/drivers/boards/GENERIC_STM32_F072XB/cfg/board.chcfg
@@ -0,0 +1,703 @@
+
+
+
+
+ resources/gencfg/processors/boards/stm32f0xx/templates
+ ..
+ 3.0.x
+
+ ST STM32F072B-Discovery
+ ST_STM32F072B_DISCOVERY
+
+ STM32F072xB
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/keyboards/at_at/660m/rules.mk b/keyboards/at_at/660m/rules.mk
index 0b3685f09e4e..8c69ff7e247d 100644
--- a/keyboards/at_at/660m/rules.mk
+++ b/keyboards/at_at/660m/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/candybar/rules.mk b/keyboards/candybar/rules.mk
index cb1b832886a0..4e89dbf477b6 100644
--- a/keyboards/candybar/rules.mk
+++ b/keyboards/candybar/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/cannonkeys/an_c/rules.mk b/keyboards/cannonkeys/an_c/rules.mk
index 2050ba34c499..faaed5c1ab7f 100644
--- a/keyboards/cannonkeys/an_c/rules.mk
+++ b/keyboards/cannonkeys/an_c/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/cannonkeys/chimera65/rules.mk b/keyboards/cannonkeys/chimera65/rules.mk
index 9b1ab589917f..7476e5f007a7 100644
--- a/keyboards/cannonkeys/chimera65/rules.mk
+++ b/keyboards/cannonkeys/chimera65/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/cannonkeys/instant60/rules.mk b/keyboards/cannonkeys/instant60/rules.mk
index 0b4afd8da81e..7ae14c4986fc 100644
--- a/keyboards/cannonkeys/instant60/rules.mk
+++ b/keyboards/cannonkeys/instant60/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/cannonkeys/iron165/rules.mk b/keyboards/cannonkeys/iron165/rules.mk
index 33529718eb40..795e2baf8d92 100644
--- a/keyboards/cannonkeys/iron165/rules.mk
+++ b/keyboards/cannonkeys/iron165/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/cannonkeys/satisfaction75/rules.mk b/keyboards/cannonkeys/satisfaction75/rules.mk
index 5fd801819403..6584bb5ff3ff 100644
--- a/keyboards/cannonkeys/satisfaction75/rules.mk
+++ b/keyboards/cannonkeys/satisfaction75/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/cannonkeys/savage65/rules.mk b/keyboards/cannonkeys/savage65/rules.mk
index 1c1c4c2ec417..bf4b9a2897b3 100644
--- a/keyboards/cannonkeys/savage65/rules.mk
+++ b/keyboards/cannonkeys/savage65/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/cannonkeys/tmov2/rules.mk b/keyboards/cannonkeys/tmov2/rules.mk
index 646288504cee..7d29079c37c3 100644
--- a/keyboards/cannonkeys/tmov2/rules.mk
+++ b/keyboards/cannonkeys/tmov2/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/projectkb/alice/rules.mk b/keyboards/projectkb/alice/rules.mk
index 97fcc754da1b..503bc7ad7065 100644
--- a/keyboards/projectkb/alice/rules.mk
+++ b/keyboards/projectkb/alice/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
# Build Options
# comment out to disable the options.
diff --git a/keyboards/xiaomi/mk02/rules.mk b/keyboards/xiaomi/mk02/rules.mk
index 93ff487dc8ac..730fb0a894cf 100644
--- a/keyboards/xiaomi/mk02/rules.mk
+++ b/keyboards/xiaomi/mk02/rules.mk
@@ -1,5 +1,6 @@
# MCU name
MCU = STM32F072
+BOARD = ST_STM32F072B_DISCOVERY
MCU_LDSCRIPT = STM32F072_0x2000_bootloader
DFU_ARGS = -d 0483:df11 -a 0 -s 0x08002000:leave
diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk
index bddafa6a4c47..f41a9e8215d7 100644
--- a/quantum/mcu_selection.mk
+++ b/quantum/mcu_selection.mk
@@ -55,7 +55,7 @@ ifneq ($(findstring STM32F072, $(MCU)),)
# Board: it should exist either in /os/hal/boards/,
# /boards/, or drivers/boards/
- BOARD ?= ST_STM32F072B_DISCOVERY
+ BOARD ?= GENERIC_STM32_F072XB
USE_FPU ?= no
From 31aadc8725d836f57a983e84ac2b2bc58ddf21d5 Mon Sep 17 00:00:00 2001
From: QMK Bot
Date: Thu, 13 Feb 2020 20:09:39 +0000
Subject: [PATCH 031/108] format code according to conventions [skip ci]
---
drivers/boards/GENERIC_STM32_F072XB/board.c | 84 +-
drivers/boards/GENERIC_STM32_F072XB/board.h | 911 ++++----------------
2 files changed, 223 insertions(+), 772 deletions(-)
diff --git a/drivers/boards/GENERIC_STM32_F072XB/board.c b/drivers/boards/GENERIC_STM32_F072XB/board.c
index 2ad6d744be7d..dcbb94310f24 100644
--- a/drivers/boards/GENERIC_STM32_F072XB/board.c
+++ b/drivers/boards/GENERIC_STM32_F072XB/board.c
@@ -28,42 +28,33 @@
* This variable is used by the HAL when initializing the PAL driver.
*/
const PALConfig pal_default_config = {
-#if STM32_HAS_GPIOA
- {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
- VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
-#endif
-#if STM32_HAS_GPIOB
- {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
- VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
-#endif
-#if STM32_HAS_GPIOC
- {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
- VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
-#endif
-#if STM32_HAS_GPIOD
- {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
- VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
-#endif
-#if STM32_HAS_GPIOE
- {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
- VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
-#endif
-#if STM32_HAS_GPIOF
- {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
- VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
-#endif
-#if STM32_HAS_GPIOG
- {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
- VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
-#endif
-#if STM32_HAS_GPIOH
- {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
- VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
-#endif
-#if STM32_HAS_GPIOI
- {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
- VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
-#endif
+# if STM32_HAS_GPIOA
+ {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
+# endif
+# if STM32_HAS_GPIOB
+ {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
+# endif
+# if STM32_HAS_GPIOC
+ {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
+# endif
+# if STM32_HAS_GPIOD
+ {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
+# endif
+# if STM32_HAS_GPIOE
+ {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
+# endif
+# if STM32_HAS_GPIOF
+ {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
+# endif
+# if STM32_HAS_GPIOG
+ {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
+# endif
+# if STM32_HAS_GPIOH
+ {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
+# endif
+# if STM32_HAS_GPIOI
+ {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
+# endif
};
#endif
@@ -75,8 +66,8 @@ __attribute__((weak)) void enter_bootloader_mode_if_requested(void) {}
* and before any other initialization.
*/
void __early_init(void) {
- enter_bootloader_mode_if_requested();
- stm32_clock_init();
+ enter_bootloader_mode_if_requested();
+ stm32_clock_init();
}
#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
@@ -84,20 +75,18 @@ void __early_init(void) {
* @brief MMC_SPI card detection.
*/
bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
-
- (void)mmcp;
- /* TODO: Fill the implementation.*/
- return true;
+ (void)mmcp;
+ /* TODO: Fill the implementation.*/
+ return true;
}
/**
* @brief MMC_SPI card write protection detection.
*/
bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
-
- (void)mmcp;
- /* TODO: Fill the implementation.*/
- return false;
+ (void)mmcp;
+ /* TODO: Fill the implementation.*/
+ return false;
}
#endif
@@ -105,5 +94,4 @@ bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
* @brief Board-specific initialization code.
* @todo Add your board-specific code, if any.
*/
-void boardInit(void) {
-}
+void boardInit(void) {}
diff --git a/drivers/boards/GENERIC_STM32_F072XB/board.h b/drivers/boards/GENERIC_STM32_F072XB/board.h
index 379e690a647c..c625a4330adb 100644
--- a/drivers/boards/GENERIC_STM32_F072XB/board.h
+++ b/drivers/boards/GENERIC_STM32_F072XB/board.h
@@ -38,13 +38,13 @@
* NOTE: HSE not fitted.
*/
#if !defined(STM32_LSECLK)
-#define STM32_LSECLK 0U
+# define STM32_LSECLK 0U
#endif
-#define STM32_LSEDRV (3U << 3U)
+#define STM32_LSEDRV (3U << 3U)
#if !defined(STM32_HSECLK)
-#define STM32_HSECLK 0U
+# define STM32_HSECLK 0U
#endif
#define STM32_HSE_BYPASS
@@ -57,155 +57,153 @@
/*
* IO pins assignments.
*/
-#define GPIOA_BUTTON 0U
-#define GPIOA_PIN1 1U
-#define GPIOA_PIN2 2U
-#define GPIOA_PIN3 3U
-#define GPIOA_PIN4 4U
-#define GPIOA_PIN5 5U
-#define GPIOA_PIN6 6U
-#define GPIOA_PIN7 7U
-#define GPIOA_PIN8 8U
-#define GPIOA_PIN9 9U
-#define GPIOA_PIN10 10U
-#define GPIOA_USB_DM 11U
-#define GPIOA_USB_DP 12U
-#define GPIOA_SWDIO 13U
-#define GPIOA_SWCLK 14U
-#define GPIOA_PIN15 15U
-
-#define GPIOB_PIN0 0U
-#define GPIOB_PIN1 1U
-#define GPIOB_PIN2 2U
-#define GPIOB_PIN3 3U
-#define GPIOB_PIN4 4U
-#define GPIOB_PIN5 5U
-#define GPIOB_PIN6 6U
-#define GPIOB_PIN7 7U
-#define GPIOB_PIN8 8U
-#define GPIOB_PIN9 9U
-#define GPIOB_PIN10 10U
-#define GPIOB_PIN11 11U
-#define GPIOB_PIN12 12U
-#define GPIOB_SPI2_SCK 13U
-#define GPIOB_SPI2_MISO 14U
-#define GPIOB_SPI2_MOSI 15U
-
-#define GPIOC_MEMS_CS 0U
-#define GPIOC_PIN1 1U
-#define GPIOC_PIN2 2U
-#define GPIOC_PIN3 3U
-#define GPIOC_PIN4 4U
-#define GPIOC_PIN5 5U
-#define GPIOC_LED_RED 6U
-#define GPIOC_LED_BLUE 7U
-#define GPIOC_LED_ORANGE 8U
-#define GPIOC_LED_GREEN 9U
-#define GPIOC_PIN10 10U
-#define GPIOC_PIN11 11U
-#define GPIOC_PIN12 12U
-#define GPIOC_PIN13 13U
-#define GPIOC_OSC32_IN 14U
-#define GPIOC_OSC32_OUT 15U
-
-#define GPIOD_PIN0 0U
-#define GPIOD_PIN1 1U
-#define GPIOD_PIN2 2U
-#define GPIOD_PIN3 3U
-#define GPIOD_PIN4 4U
-#define GPIOD_PIN5 5U
-#define GPIOD_PIN6 6U
-#define GPIOD_PIN7 7U
-#define GPIOD_PIN8 8U
-#define GPIOD_PIN9 9U
-#define GPIOD_PIN10 10U
-#define GPIOD_PIN11 11U
-#define GPIOD_PIN12 12U
-#define GPIOD_PIN13 13U
-#define GPIOD_PIN14 14U
-#define GPIOD_PIN15 15U
-
-#define GPIOE_PIN0 0U
-#define GPIOE_PIN1 1U
-#define GPIOE_PIN2 2U
-#define GPIOE_PIN3 3U
-#define GPIOE_PIN4 4U
-#define GPIOE_PIN5 5U
-#define GPIOE_PIN6 6U
-#define GPIOE_PIN7 7U
-#define GPIOE_PIN8 8U
-#define GPIOE_PIN9 9U
-#define GPIOE_PIN10 10U
-#define GPIOE_PIN11 11U
-#define GPIOE_PIN12 12U
-#define GPIOE_PIN13 13U
-#define GPIOE_PIN14 14U
-#define GPIOE_PIN15 15U
-
-#define GPIOF_OSC_IN 0U
-#define GPIOF_OSC_OUT 1U
-#define GPIOF_PIN2 2U
-#define GPIOF_PIN3 3U
-#define GPIOF_PIN4 4U
-#define GPIOF_PIN5 5U
-#define GPIOF_PIN6 6U
-#define GPIOF_PIN7 7U
-#define GPIOF_PIN8 8U
-#define GPIOF_PIN9 9U
-#define GPIOF_PIN10 10U
-#define GPIOF_PIN11 11U
-#define GPIOF_PIN12 12U
-#define GPIOF_PIN13 13U
-#define GPIOF_PIN14 14U
-#define GPIOF_PIN15 15U
+#define GPIOA_BUTTON 0U
+#define GPIOA_PIN1 1U
+#define GPIOA_PIN2 2U
+#define GPIOA_PIN3 3U
+#define GPIOA_PIN4 4U
+#define GPIOA_PIN5 5U
+#define GPIOA_PIN6 6U
+#define GPIOA_PIN7 7U
+#define GPIOA_PIN8 8U
+#define GPIOA_PIN9 9U
+#define GPIOA_PIN10 10U
+#define GPIOA_USB_DM 11U
+#define GPIOA_USB_DP 12U
+#define GPIOA_SWDIO 13U
+#define GPIOA_SWCLK 14U
+#define GPIOA_PIN15 15U
+
+#define GPIOB_PIN0 0U
+#define GPIOB_PIN1 1U
+#define GPIOB_PIN2 2U
+#define GPIOB_PIN3 3U
+#define GPIOB_PIN4 4U
+#define GPIOB_PIN5 5U
+#define GPIOB_PIN6 6U
+#define GPIOB_PIN7 7U
+#define GPIOB_PIN8 8U
+#define GPIOB_PIN9 9U
+#define GPIOB_PIN10 10U
+#define GPIOB_PIN11 11U
+#define GPIOB_PIN12 12U
+#define GPIOB_SPI2_SCK 13U
+#define GPIOB_SPI2_MISO 14U
+#define GPIOB_SPI2_MOSI 15U
+
+#define GPIOC_MEMS_CS 0U
+#define GPIOC_PIN1 1U
+#define GPIOC_PIN2 2U
+#define GPIOC_PIN3 3U
+#define GPIOC_PIN4 4U
+#define GPIOC_PIN5 5U
+#define GPIOC_LED_RED 6U
+#define GPIOC_LED_BLUE 7U
+#define GPIOC_LED_ORANGE 8U
+#define GPIOC_LED_GREEN 9U
+#define GPIOC_PIN10 10U
+#define GPIOC_PIN11 11U
+#define GPIOC_PIN12 12U
+#define GPIOC_PIN13 13U
+#define GPIOC_OSC32_IN 14U
+#define GPIOC_OSC32_OUT 15U
+
+#define GPIOD_PIN0 0U
+#define GPIOD_PIN1 1U
+#define GPIOD_PIN2 2U
+#define GPIOD_PIN3 3U
+#define GPIOD_PIN4 4U
+#define GPIOD_PIN5 5U
+#define GPIOD_PIN6 6U
+#define GPIOD_PIN7 7U
+#define GPIOD_PIN8 8U
+#define GPIOD_PIN9 9U
+#define GPIOD_PIN10 10U
+#define GPIOD_PIN11 11U
+#define GPIOD_PIN12 12U
+#define GPIOD_PIN13 13U
+#define GPIOD_PIN14 14U
+#define GPIOD_PIN15 15U
+
+#define GPIOE_PIN0 0U
+#define GPIOE_PIN1 1U
+#define GPIOE_PIN2 2U
+#define GPIOE_PIN3 3U
+#define GPIOE_PIN4 4U
+#define GPIOE_PIN5 5U
+#define GPIOE_PIN6 6U
+#define GPIOE_PIN7 7U
+#define GPIOE_PIN8 8U
+#define GPIOE_PIN9 9U
+#define GPIOE_PIN10 10U
+#define GPIOE_PIN11 11U
+#define GPIOE_PIN12 12U
+#define GPIOE_PIN13 13U
+#define GPIOE_PIN14 14U
+#define GPIOE_PIN15 15U
+
+#define GPIOF_OSC_IN 0U
+#define GPIOF_OSC_OUT 1U
+#define GPIOF_PIN2 2U
+#define GPIOF_PIN3 3U
+#define GPIOF_PIN4 4U
+#define GPIOF_PIN5 5U
+#define GPIOF_PIN6 6U
+#define GPIOF_PIN7 7U
+#define GPIOF_PIN8 8U
+#define GPIOF_PIN9 9U
+#define GPIOF_PIN10 10U
+#define GPIOF_PIN11 11U
+#define GPIOF_PIN12 12U
+#define GPIOF_PIN13 13U
+#define GPIOF_PIN14 14U
+#define GPIOF_PIN15 15U
/*
* IO lines assignments.
*/
-#define LINE_BUTTON PAL_LINE(GPIOA, 0U)
-#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
-#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
-#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
-#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
-
-#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U)
-#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U)
-#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U)
-
-#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U)
-#define LINE_LED_RED PAL_LINE(GPIOC, 6U)
-#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U)
-#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U)
-#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U)
-#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
-#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
-
-
-
-#define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
-#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
+#define LINE_BUTTON PAL_LINE(GPIOA, 0U)
+#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
+#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
+#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
+#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
+
+#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U)
+#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U)
+#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U)
+
+#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U)
+#define LINE_LED_RED PAL_LINE(GPIOC, 6U)
+#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U)
+#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U)
+#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U)
+#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
+#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
+
+#define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
+#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
/*
* I/O ports initial setup, this configuration is established soon after reset
* in the initialization code.
* Please refer to the STM32 Reference Manual for details.
*/
-#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
-#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
-#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
-#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
-#define PIN_ODR_LOW(n) (0U << (n))
-#define PIN_ODR_HIGH(n) (1U << (n))
-#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
-#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
-#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
-#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
-#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
-#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
-#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
-#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
-#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
-#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
+#define PIN_MODE_INPUT(n) (0U << ((n)*2U))
+#define PIN_MODE_OUTPUT(n) (1U << ((n)*2U))
+#define PIN_MODE_ALTERNATE(n) (2U << ((n)*2U))
+#define PIN_MODE_ANALOG(n) (3U << ((n)*2U))
+#define PIN_ODR_LOW(n) (0U << (n))
+#define PIN_ODR_HIGH(n) (1U << (n))
+#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
+#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
+#define PIN_OSPEED_VERYLOW(n) (0U << ((n)*2U))
+#define PIN_OSPEED_LOW(n) (1U << ((n)*2U))
+#define PIN_OSPEED_MEDIUM(n) (2U << ((n)*2U))
+#define PIN_OSPEED_HIGH(n) (3U << ((n)*2U))
+#define PIN_PUPDR_FLOATING(n) (0U << ((n)*2U))
+#define PIN_PUPDR_PULLUP(n) (1U << ((n)*2U))
+#define PIN_PUPDR_PULLDOWN(n) (2U << ((n)*2U))
+#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
/*
* GPIOA setup:
@@ -227,102 +225,13 @@
* PA14 - SWCLK (alternate 0).
* PA15 - PIN15 (input pullup).
*/
-#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \
- PIN_MODE_INPUT(GPIOA_PIN1) | \
- PIN_MODE_INPUT(GPIOA_PIN2) | \
- PIN_MODE_INPUT(GPIOA_PIN3) | \
- PIN_MODE_INPUT(GPIOA_PIN4) | \
- PIN_MODE_INPUT(GPIOA_PIN5) | \
- PIN_MODE_INPUT(GPIOA_PIN6) | \
- PIN_MODE_INPUT(GPIOA_PIN7) | \
- PIN_MODE_INPUT(GPIOA_PIN8) | \
- PIN_MODE_INPUT(GPIOA_PIN9) | \
- PIN_MODE_INPUT(GPIOA_PIN10) | \
- PIN_MODE_INPUT(GPIOA_USB_DM) | \
- PIN_MODE_INPUT(GPIOA_USB_DP) | \
- PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
- PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
- PIN_MODE_INPUT(GPIOA_PIN15))
-#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
- PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
- PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
- PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
- PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
- PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
-#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
- PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
- PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \
- PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \
- PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
- PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
- PIN_OSPEED_HIGH(GPIOA_PIN15))
-#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN1) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN7) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
- PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
- PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
- PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
- PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
- PIN_PUPDR_PULLUP(GPIOA_PIN15))
-#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \
- PIN_ODR_HIGH(GPIOA_PIN1) | \
- PIN_ODR_HIGH(GPIOA_PIN2) | \
- PIN_ODR_HIGH(GPIOA_PIN3) | \
- PIN_ODR_HIGH(GPIOA_PIN4) | \
- PIN_ODR_HIGH(GPIOA_PIN5) | \
- PIN_ODR_HIGH(GPIOA_PIN6) | \
- PIN_ODR_HIGH(GPIOA_PIN7) | \
- PIN_ODR_HIGH(GPIOA_PIN8) | \
- PIN_ODR_HIGH(GPIOA_PIN9) | \
- PIN_ODR_HIGH(GPIOA_PIN10) | \
- PIN_ODR_HIGH(GPIOA_USB_DM) | \
- PIN_ODR_HIGH(GPIOA_USB_DP) | \
- PIN_ODR_HIGH(GPIOA_SWDIO) | \
- PIN_ODR_HIGH(GPIOA_SWCLK) | \
- PIN_ODR_HIGH(GPIOA_PIN15))
-#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN7, 0U))
-#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN9, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
- PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \
- PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \
- PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
- PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
- PIN_AFIO_AF(GPIOA_PIN15, 0U))
+#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | PIN_MODE_INPUT(GPIOA_PIN1) | PIN_MODE_INPUT(GPIOA_PIN2) | PIN_MODE_INPUT(GPIOA_PIN3) | PIN_MODE_INPUT(GPIOA_PIN4) | PIN_MODE_INPUT(GPIOA_PIN5) | PIN_MODE_INPUT(GPIOA_PIN6) | PIN_MODE_INPUT(GPIOA_PIN7) | PIN_MODE_INPUT(GPIOA_PIN8) | PIN_MODE_INPUT(GPIOA_PIN9) | PIN_MODE_INPUT(GPIOA_PIN10) | PIN_MODE_INPUT(GPIOA_USB_DM) | PIN_MODE_INPUT(GPIOA_USB_DP) | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | PIN_MODE_INPUT(GPIOA_PIN15))
+#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
+#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | PIN_OSPEED_VERYLOW(GPIOA_PIN1) | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | PIN_OSPEED_HIGH(GPIOA_SWDIO) | PIN_OSPEED_HIGH(GPIOA_SWCLK) | PIN_OSPEED_HIGH(GPIOA_PIN15))
+#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | PIN_PUPDR_PULLUP(GPIOA_PIN1) | PIN_PUPDR_PULLUP(GPIOA_PIN2) | PIN_PUPDR_PULLUP(GPIOA_PIN3) | PIN_PUPDR_PULLUP(GPIOA_PIN4) | PIN_PUPDR_PULLUP(GPIOA_PIN5) | PIN_PUPDR_PULLUP(GPIOA_PIN6) | PIN_PUPDR_PULLUP(GPIOA_PIN7) | PIN_PUPDR_PULLUP(GPIOA_PIN8) | PIN_PUPDR_PULLUP(GPIOA_PIN9) | PIN_PUPDR_PULLUP(GPIOA_PIN10) | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | PIN_PUPDR_PULLUP(GPIOA_PIN15))
+#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | PIN_ODR_HIGH(GPIOA_PIN1) | PIN_ODR_HIGH(GPIOA_PIN2) | PIN_ODR_HIGH(GPIOA_PIN3) | PIN_ODR_HIGH(GPIOA_PIN4) | PIN_ODR_HIGH(GPIOA_PIN5) | PIN_ODR_HIGH(GPIOA_PIN6) | PIN_ODR_HIGH(GPIOA_PIN7) | PIN_ODR_HIGH(GPIOA_PIN8) | PIN_ODR_HIGH(GPIOA_PIN9) | PIN_ODR_HIGH(GPIOA_PIN10) | PIN_ODR_HIGH(GPIOA_USB_DM) | PIN_ODR_HIGH(GPIOA_USB_DP) | PIN_ODR_HIGH(GPIOA_SWDIO) | PIN_ODR_HIGH(GPIOA_SWCLK) | PIN_ODR_HIGH(GPIOA_PIN15))
+#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | PIN_AFIO_AF(GPIOA_PIN1, 0U) | PIN_AFIO_AF(GPIOA_PIN2, 0U) | PIN_AFIO_AF(GPIOA_PIN3, 0U) | PIN_AFIO_AF(GPIOA_PIN4, 0U) | PIN_AFIO_AF(GPIOA_PIN5, 0U) | PIN_AFIO_AF(GPIOA_PIN6, 0U) | PIN_AFIO_AF(GPIOA_PIN7, 0U))
+#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | PIN_AFIO_AF(GPIOA_PIN9, 0U) | PIN_AFIO_AF(GPIOA_PIN10, 0U) | PIN_AFIO_AF(GPIOA_USB_DM, 0U) | PIN_AFIO_AF(GPIOA_USB_DP, 0U) | PIN_AFIO_AF(GPIOA_SWDIO, 0U) | PIN_AFIO_AF(GPIOA_SWCLK, 0U) | PIN_AFIO_AF(GPIOA_PIN15, 0U))
/*
* GPIOB setup:
@@ -344,102 +253,13 @@
* PB14 - SPI2_MISO (alternate 0).
* PB15 - SPI2_MOSI (alternate 0).
*/
-#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
- PIN_MODE_INPUT(GPIOB_PIN1) | \
- PIN_MODE_INPUT(GPIOB_PIN2) | \
- PIN_MODE_INPUT(GPIOB_PIN3) | \
- PIN_MODE_INPUT(GPIOB_PIN4) | \
- PIN_MODE_INPUT(GPIOB_PIN5) | \
- PIN_MODE_INPUT(GPIOB_PIN6) | \
- PIN_MODE_INPUT(GPIOB_PIN7) | \
- PIN_MODE_INPUT(GPIOB_PIN8) | \
- PIN_MODE_INPUT(GPIOB_PIN9) | \
- PIN_MODE_INPUT(GPIOB_PIN10) | \
- PIN_MODE_INPUT(GPIOB_PIN11) | \
- PIN_MODE_INPUT(GPIOB_PIN12) | \
- PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \
- PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \
- PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI))
-#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
- PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
- PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \
- PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \
- PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI))
-#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
- PIN_OSPEED_HIGH(GPIOB_PIN2) | \
- PIN_OSPEED_HIGH(GPIOB_PIN3) | \
- PIN_OSPEED_HIGH(GPIOB_PIN4) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
- PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
- PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \
- PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \
- PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI))
-#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN3) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN6) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
- PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
- PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \
- PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \
- PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI))
-#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
- PIN_ODR_HIGH(GPIOB_PIN1) | \
- PIN_ODR_HIGH(GPIOB_PIN2) | \
- PIN_ODR_HIGH(GPIOB_PIN3) | \
- PIN_ODR_HIGH(GPIOB_PIN4) | \
- PIN_ODR_HIGH(GPIOB_PIN5) | \
- PIN_ODR_HIGH(GPIOB_PIN6) | \
- PIN_ODR_HIGH(GPIOB_PIN7) | \
- PIN_ODR_HIGH(GPIOB_PIN8) | \
- PIN_ODR_HIGH(GPIOB_PIN9) | \
- PIN_ODR_HIGH(GPIOB_PIN10) | \
- PIN_ODR_HIGH(GPIOB_PIN11) | \
- PIN_ODR_HIGH(GPIOB_PIN12) | \
- PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \
- PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \
- PIN_ODR_HIGH(GPIOB_SPI2_MOSI))
-#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN3, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN7, 0U))
-#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
- PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
- PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \
- PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \
- PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U))
+#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | PIN_MODE_INPUT(GPIOB_PIN1) | PIN_MODE_INPUT(GPIOB_PIN2) | PIN_MODE_INPUT(GPIOB_PIN3) | PIN_MODE_INPUT(GPIOB_PIN4) | PIN_MODE_INPUT(GPIOB_PIN5) | PIN_MODE_INPUT(GPIOB_PIN6) | PIN_MODE_INPUT(GPIOB_PIN7) | PIN_MODE_INPUT(GPIOB_PIN8) | PIN_MODE_INPUT(GPIOB_PIN9) | PIN_MODE_INPUT(GPIOB_PIN10) | PIN_MODE_INPUT(GPIOB_PIN11) | PIN_MODE_INPUT(GPIOB_PIN12) | PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | PIN_OSPEED_HIGH(GPIOB_PIN2) | PIN_OSPEED_HIGH(GPIOB_PIN3) | PIN_OSPEED_HIGH(GPIOB_PIN4) | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | PIN_OSPEED_VERYLOW(GPIOB_PIN6) | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | PIN_PUPDR_PULLUP(GPIOB_PIN1) | PIN_PUPDR_PULLUP(GPIOB_PIN2) | PIN_PUPDR_PULLUP(GPIOB_PIN3) | PIN_PUPDR_PULLUP(GPIOB_PIN4) | PIN_PUPDR_PULLUP(GPIOB_PIN5) | PIN_PUPDR_PULLUP(GPIOB_PIN6) | PIN_PUPDR_PULLUP(GPIOB_PIN7) | PIN_PUPDR_PULLUP(GPIOB_PIN8) | PIN_PUPDR_PULLUP(GPIOB_PIN9) | PIN_PUPDR_PULLUP(GPIOB_PIN10) | PIN_PUPDR_PULLUP(GPIOB_PIN11) | PIN_PUPDR_PULLUP(GPIOB_PIN12) | PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | PIN_ODR_HIGH(GPIOB_PIN1) | PIN_ODR_HIGH(GPIOB_PIN2) | PIN_ODR_HIGH(GPIOB_PIN3) | PIN_ODR_HIGH(GPIOB_PIN4) | PIN_ODR_HIGH(GPIOB_PIN5) | PIN_ODR_HIGH(GPIOB_PIN6) | PIN_ODR_HIGH(GPIOB_PIN7) | PIN_ODR_HIGH(GPIOB_PIN8) | PIN_ODR_HIGH(GPIOB_PIN9) | PIN_ODR_HIGH(GPIOB_PIN10) | PIN_ODR_HIGH(GPIOB_PIN11) | PIN_ODR_HIGH(GPIOB_PIN12) | PIN_ODR_HIGH(GPIOB_SPI2_SCK) | PIN_ODR_HIGH(GPIOB_SPI2_MISO) | PIN_ODR_HIGH(GPIOB_SPI2_MOSI))
+#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | PIN_AFIO_AF(GPIOB_PIN1, 0U) | PIN_AFIO_AF(GPIOB_PIN2, 0U) | PIN_AFIO_AF(GPIOB_PIN3, 0U) | PIN_AFIO_AF(GPIOB_PIN4, 0U) | PIN_AFIO_AF(GPIOB_PIN5, 0U) | PIN_AFIO_AF(GPIOB_PIN6, 0U) | PIN_AFIO_AF(GPIOB_PIN7, 0U))
+#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | PIN_AFIO_AF(GPIOB_PIN9, 0U) | PIN_AFIO_AF(GPIOB_PIN10, 0U) | PIN_AFIO_AF(GPIOB_PIN11, 0U) | PIN_AFIO_AF(GPIOB_PIN12, 0U) | PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U))
/*
* GPIOC setup:
@@ -461,102 +281,13 @@
* PC14 - OSC32_IN (input floating).
* PC15 - OSC32_OUT (input floating).
*/
-#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \
- PIN_MODE_INPUT(GPIOC_PIN1) | \
- PIN_MODE_INPUT(GPIOC_PIN2) | \
- PIN_MODE_INPUT(GPIOC_PIN3) | \
- PIN_MODE_INPUT(GPIOC_PIN4) | \
- PIN_MODE_INPUT(GPIOC_PIN5) | \
- PIN_MODE_OUTPUT(GPIOC_LED_RED) | \
- PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \
- PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \
- PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \
- PIN_MODE_INPUT(GPIOC_PIN10) | \
- PIN_MODE_INPUT(GPIOC_PIN11) | \
- PIN_MODE_INPUT(GPIOC_PIN12) | \
- PIN_MODE_INPUT(GPIOC_PIN13) | \
- PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
- PIN_MODE_INPUT(GPIOC_OSC32_OUT))
-#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
- PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \
- PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \
- PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \
- PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
- PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
- PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
- PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
-#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
- PIN_OSPEED_HIGH(GPIOC_LED_RED) | \
- PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \
- PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \
- PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
- PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
- PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
- PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
-#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
- PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \
- PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \
- PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \
- PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
- PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
- PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
- PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
-#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \
- PIN_ODR_HIGH(GPIOC_PIN1) | \
- PIN_ODR_HIGH(GPIOC_PIN2) | \
- PIN_ODR_HIGH(GPIOC_PIN3) | \
- PIN_ODR_HIGH(GPIOC_PIN4) | \
- PIN_ODR_HIGH(GPIOC_PIN5) | \
- PIN_ODR_LOW(GPIOC_LED_RED) | \
- PIN_ODR_LOW(GPIOC_LED_BLUE) | \
- PIN_ODR_LOW(GPIOC_LED_ORANGE) | \
- PIN_ODR_LOW(GPIOC_LED_GREEN) | \
- PIN_ODR_HIGH(GPIOC_PIN10) | \
- PIN_ODR_HIGH(GPIOC_PIN11) | \
- PIN_ODR_HIGH(GPIOC_PIN12) | \
- PIN_ODR_HIGH(GPIOC_PIN13) | \
- PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
- PIN_ODR_HIGH(GPIOC_OSC32_OUT))
-#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
- PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \
- PIN_AFIO_AF(GPIOC_LED_BLUE, 0U))
-#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \
- PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
- PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
- PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
- PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
+#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | PIN_MODE_INPUT(GPIOC_PIN1) | PIN_MODE_INPUT(GPIOC_PIN2) | PIN_MODE_INPUT(GPIOC_PIN3) | PIN_MODE_INPUT(GPIOC_PIN4) | PIN_MODE_INPUT(GPIOC_PIN5) | PIN_MODE_OUTPUT(GPIOC_LED_RED) | PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | PIN_MODE_INPUT(GPIOC_PIN10) | PIN_MODE_INPUT(GPIOC_PIN11) | PIN_MODE_INPUT(GPIOC_PIN12) | PIN_MODE_INPUT(GPIOC_PIN13) | PIN_MODE_INPUT(GPIOC_OSC32_IN) | PIN_MODE_INPUT(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | PIN_OSPEED_HIGH(GPIOC_LED_RED) | PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | PIN_PUPDR_PULLUP(GPIOC_PIN1) | PIN_PUPDR_PULLUP(GPIOC_PIN2) | PIN_PUPDR_PULLUP(GPIOC_PIN3) | PIN_PUPDR_PULLUP(GPIOC_PIN4) | PIN_PUPDR_PULLUP(GPIOC_PIN5) | PIN_PUPDR_FLOATING(GPIOC_LED_RED) | PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | PIN_PUPDR_PULLUP(GPIOC_PIN10) | PIN_PUPDR_PULLUP(GPIOC_PIN11) | PIN_PUPDR_PULLUP(GPIOC_PIN12) | PIN_PUPDR_PULLUP(GPIOC_PIN13) | PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | PIN_ODR_HIGH(GPIOC_PIN1) | PIN_ODR_HIGH(GPIOC_PIN2) | PIN_ODR_HIGH(GPIOC_PIN3) | PIN_ODR_HIGH(GPIOC_PIN4) | PIN_ODR_HIGH(GPIOC_PIN5) | PIN_ODR_LOW(GPIOC_LED_RED) | PIN_ODR_LOW(GPIOC_LED_BLUE) | PIN_ODR_LOW(GPIOC_LED_ORANGE) | PIN_ODR_LOW(GPIOC_LED_GREEN) | PIN_ODR_HIGH(GPIOC_PIN10) | PIN_ODR_HIGH(GPIOC_PIN11) | PIN_ODR_HIGH(GPIOC_PIN12) | PIN_ODR_HIGH(GPIOC_PIN13) | PIN_ODR_HIGH(GPIOC_OSC32_IN) | PIN_ODR_HIGH(GPIOC_OSC32_OUT))
+#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | PIN_AFIO_AF(GPIOC_PIN1, 0U) | PIN_AFIO_AF(GPIOC_PIN2, 0U) | PIN_AFIO_AF(GPIOC_PIN3, 0U) | PIN_AFIO_AF(GPIOC_PIN4, 0U) | PIN_AFIO_AF(GPIOC_PIN5, 0U) | PIN_AFIO_AF(GPIOC_LED_RED, 0U) | PIN_AFIO_AF(GPIOC_LED_BLUE, 0U))
+#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | PIN_AFIO_AF(GPIOC_PIN10, 0U) | PIN_AFIO_AF(GPIOC_PIN11, 0U) | PIN_AFIO_AF(GPIOC_PIN12, 0U) | PIN_AFIO_AF(GPIOC_PIN13, 0U) | PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
/*
* GPIOD setup:
@@ -578,102 +309,13 @@
* PD14 - PIN14 (input pullup).
* PD15 - PIN15 (input pullup).
*/
-#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
- PIN_MODE_INPUT(GPIOD_PIN1) | \
- PIN_MODE_INPUT(GPIOD_PIN2) | \
- PIN_MODE_INPUT(GPIOD_PIN3) | \
- PIN_MODE_INPUT(GPIOD_PIN4) | \
- PIN_MODE_INPUT(GPIOD_PIN5) | \
- PIN_MODE_INPUT(GPIOD_PIN6) | \
- PIN_MODE_INPUT(GPIOD_PIN7) | \
- PIN_MODE_INPUT(GPIOD_PIN8) | \
- PIN_MODE_INPUT(GPIOD_PIN9) | \
- PIN_MODE_INPUT(GPIOD_PIN10) | \
- PIN_MODE_INPUT(GPIOD_PIN11) | \
- PIN_MODE_INPUT(GPIOD_PIN12) | \
- PIN_MODE_INPUT(GPIOD_PIN13) | \
- PIN_MODE_INPUT(GPIOD_PIN14) | \
- PIN_MODE_INPUT(GPIOD_PIN15))
-#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
- PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
-#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
- PIN_OSPEED_VERYLOW(GPIOD_PIN15))
-#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
- PIN_PUPDR_PULLUP(GPIOD_PIN15))
-#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
- PIN_ODR_HIGH(GPIOD_PIN1) | \
- PIN_ODR_HIGH(GPIOD_PIN2) | \
- PIN_ODR_HIGH(GPIOD_PIN3) | \
- PIN_ODR_HIGH(GPIOD_PIN4) | \
- PIN_ODR_HIGH(GPIOD_PIN5) | \
- PIN_ODR_HIGH(GPIOD_PIN6) | \
- PIN_ODR_HIGH(GPIOD_PIN7) | \
- PIN_ODR_HIGH(GPIOD_PIN8) | \
- PIN_ODR_HIGH(GPIOD_PIN9) | \
- PIN_ODR_HIGH(GPIOD_PIN10) | \
- PIN_ODR_HIGH(GPIOD_PIN11) | \
- PIN_ODR_HIGH(GPIOD_PIN12) | \
- PIN_ODR_HIGH(GPIOD_PIN13) | \
- PIN_ODR_HIGH(GPIOD_PIN14) | \
- PIN_ODR_HIGH(GPIOD_PIN15))
-#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN7, 0U))
-#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
- PIN_AFIO_AF(GPIOD_PIN15, 0U))
+#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | PIN_MODE_INPUT(GPIOD_PIN1) | PIN_MODE_INPUT(GPIOD_PIN2) | PIN_MODE_INPUT(GPIOD_PIN3) | PIN_MODE_INPUT(GPIOD_PIN4) | PIN_MODE_INPUT(GPIOD_PIN5) | PIN_MODE_INPUT(GPIOD_PIN6) | PIN_MODE_INPUT(GPIOD_PIN7) | PIN_MODE_INPUT(GPIOD_PIN8) | PIN_MODE_INPUT(GPIOD_PIN9) | PIN_MODE_INPUT(GPIOD_PIN10) | PIN_MODE_INPUT(GPIOD_PIN11) | PIN_MODE_INPUT(GPIOD_PIN12) | PIN_MODE_INPUT(GPIOD_PIN13) | PIN_MODE_INPUT(GPIOD_PIN14) | PIN_MODE_INPUT(GPIOD_PIN15))
+#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
+#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | PIN_OSPEED_VERYLOW(GPIOD_PIN15))
+#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | PIN_PUPDR_PULLUP(GPIOD_PIN1) | PIN_PUPDR_PULLUP(GPIOD_PIN2) | PIN_PUPDR_PULLUP(GPIOD_PIN3) | PIN_PUPDR_PULLUP(GPIOD_PIN4) | PIN_PUPDR_PULLUP(GPIOD_PIN5) | PIN_PUPDR_PULLUP(GPIOD_PIN6) | PIN_PUPDR_PULLUP(GPIOD_PIN7) | PIN_PUPDR_PULLUP(GPIOD_PIN8) | PIN_PUPDR_PULLUP(GPIOD_PIN9) | PIN_PUPDR_PULLUP(GPIOD_PIN10) | PIN_PUPDR_PULLUP(GPIOD_PIN11) | PIN_PUPDR_PULLUP(GPIOD_PIN12) | PIN_PUPDR_PULLUP(GPIOD_PIN13) | PIN_PUPDR_PULLUP(GPIOD_PIN14) | PIN_PUPDR_PULLUP(GPIOD_PIN15))
+#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | PIN_ODR_HIGH(GPIOD_PIN1) | PIN_ODR_HIGH(GPIOD_PIN2) | PIN_ODR_HIGH(GPIOD_PIN3) | PIN_ODR_HIGH(GPIOD_PIN4) | PIN_ODR_HIGH(GPIOD_PIN5) | PIN_ODR_HIGH(GPIOD_PIN6) | PIN_ODR_HIGH(GPIOD_PIN7) | PIN_ODR_HIGH(GPIOD_PIN8) | PIN_ODR_HIGH(GPIOD_PIN9) | PIN_ODR_HIGH(GPIOD_PIN10) | PIN_ODR_HIGH(GPIOD_PIN11) | PIN_ODR_HIGH(GPIOD_PIN12) | PIN_ODR_HIGH(GPIOD_PIN13) | PIN_ODR_HIGH(GPIOD_PIN14) | PIN_ODR_HIGH(GPIOD_PIN15))
+#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | PIN_AFIO_AF(GPIOD_PIN1, 0U) | PIN_AFIO_AF(GPIOD_PIN2, 0U) | PIN_AFIO_AF(GPIOD_PIN3, 0U) | PIN_AFIO_AF(GPIOD_PIN4, 0U) | PIN_AFIO_AF(GPIOD_PIN5, 0U) | PIN_AFIO_AF(GPIOD_PIN6, 0U) | PIN_AFIO_AF(GPIOD_PIN7, 0U))
+#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | PIN_AFIO_AF(GPIOD_PIN9, 0U) | PIN_AFIO_AF(GPIOD_PIN10, 0U) | PIN_AFIO_AF(GPIOD_PIN11, 0U) | PIN_AFIO_AF(GPIOD_PIN12, 0U) | PIN_AFIO_AF(GPIOD_PIN13, 0U) | PIN_AFIO_AF(GPIOD_PIN14, 0U) | PIN_AFIO_AF(GPIOD_PIN15, 0U))
/*
* GPIOE setup:
@@ -695,102 +337,13 @@
* PE14 - PIN14 (input pullup).
* PE15 - PIN15 (input pullup).
*/
-#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
- PIN_MODE_INPUT(GPIOE_PIN1) | \
- PIN_MODE_INPUT(GPIOE_PIN2) | \
- PIN_MODE_INPUT(GPIOE_PIN3) | \
- PIN_MODE_INPUT(GPIOE_PIN4) | \
- PIN_MODE_INPUT(GPIOE_PIN5) | \
- PIN_MODE_INPUT(GPIOE_PIN6) | \
- PIN_MODE_INPUT(GPIOE_PIN7) | \
- PIN_MODE_INPUT(GPIOE_PIN8) | \
- PIN_MODE_INPUT(GPIOE_PIN9) | \
- PIN_MODE_INPUT(GPIOE_PIN10) | \
- PIN_MODE_INPUT(GPIOE_PIN11) | \
- PIN_MODE_INPUT(GPIOE_PIN12) | \
- PIN_MODE_INPUT(GPIOE_PIN13) | \
- PIN_MODE_INPUT(GPIOE_PIN14) | \
- PIN_MODE_INPUT(GPIOE_PIN15))
-#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
- PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
-#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \
- PIN_OSPEED_VERYLOW(GPIOE_PIN15))
-#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN2) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN5) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN11) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN13) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN14) | \
- PIN_PUPDR_PULLUP(GPIOE_PIN15))
-#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
- PIN_ODR_HIGH(GPIOE_PIN1) | \
- PIN_ODR_HIGH(GPIOE_PIN2) | \
- PIN_ODR_HIGH(GPIOE_PIN3) | \
- PIN_ODR_HIGH(GPIOE_PIN4) | \
- PIN_ODR_HIGH(GPIOE_PIN5) | \
- PIN_ODR_HIGH(GPIOE_PIN6) | \
- PIN_ODR_HIGH(GPIOE_PIN7) | \
- PIN_ODR_HIGH(GPIOE_PIN8) | \
- PIN_ODR_HIGH(GPIOE_PIN9) | \
- PIN_ODR_HIGH(GPIOE_PIN10) | \
- PIN_ODR_HIGH(GPIOE_PIN11) | \
- PIN_ODR_HIGH(GPIOE_PIN12) | \
- PIN_ODR_HIGH(GPIOE_PIN13) | \
- PIN_ODR_HIGH(GPIOE_PIN14) | \
- PIN_ODR_HIGH(GPIOE_PIN15))
-#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN7, 0U))
-#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
- PIN_AFIO_AF(GPIOE_PIN15, 0U))
+#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | PIN_MODE_INPUT(GPIOE_PIN1) | PIN_MODE_INPUT(GPIOE_PIN2) | PIN_MODE_INPUT(GPIOE_PIN3) | PIN_MODE_INPUT(GPIOE_PIN4) | PIN_MODE_INPUT(GPIOE_PIN5) | PIN_MODE_INPUT(GPIOE_PIN6) | PIN_MODE_INPUT(GPIOE_PIN7) | PIN_MODE_INPUT(GPIOE_PIN8) | PIN_MODE_INPUT(GPIOE_PIN9) | PIN_MODE_INPUT(GPIOE_PIN10) | PIN_MODE_INPUT(GPIOE_PIN11) | PIN_MODE_INPUT(GPIOE_PIN12) | PIN_MODE_INPUT(GPIOE_PIN13) | PIN_MODE_INPUT(GPIOE_PIN14) | PIN_MODE_INPUT(GPIOE_PIN15))
+#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
+#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | PIN_OSPEED_VERYLOW(GPIOE_PIN3) | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | PIN_OSPEED_VERYLOW(GPIOE_PIN8) | PIN_OSPEED_VERYLOW(GPIOE_PIN9) | PIN_OSPEED_VERYLOW(GPIOE_PIN10) | PIN_OSPEED_VERYLOW(GPIOE_PIN11) | PIN_OSPEED_VERYLOW(GPIOE_PIN12) | PIN_OSPEED_VERYLOW(GPIOE_PIN13) | PIN_OSPEED_VERYLOW(GPIOE_PIN14) | PIN_OSPEED_VERYLOW(GPIOE_PIN15))
+#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | PIN_PUPDR_PULLUP(GPIOE_PIN1) | PIN_PUPDR_PULLUP(GPIOE_PIN2) | PIN_PUPDR_PULLUP(GPIOE_PIN3) | PIN_PUPDR_PULLUP(GPIOE_PIN4) | PIN_PUPDR_PULLUP(GPIOE_PIN5) | PIN_PUPDR_PULLUP(GPIOE_PIN6) | PIN_PUPDR_PULLUP(GPIOE_PIN7) | PIN_PUPDR_PULLUP(GPIOE_PIN8) | PIN_PUPDR_PULLUP(GPIOE_PIN9) | PIN_PUPDR_PULLUP(GPIOE_PIN10) | PIN_PUPDR_PULLUP(GPIOE_PIN11) | PIN_PUPDR_PULLUP(GPIOE_PIN12) | PIN_PUPDR_PULLUP(GPIOE_PIN13) | PIN_PUPDR_PULLUP(GPIOE_PIN14) | PIN_PUPDR_PULLUP(GPIOE_PIN15))
+#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | PIN_ODR_HIGH(GPIOE_PIN1) | PIN_ODR_HIGH(GPIOE_PIN2) | PIN_ODR_HIGH(GPIOE_PIN3) | PIN_ODR_HIGH(GPIOE_PIN4) | PIN_ODR_HIGH(GPIOE_PIN5) | PIN_ODR_HIGH(GPIOE_PIN6) | PIN_ODR_HIGH(GPIOE_PIN7) | PIN_ODR_HIGH(GPIOE_PIN8) | PIN_ODR_HIGH(GPIOE_PIN9) | PIN_ODR_HIGH(GPIOE_PIN10) | PIN_ODR_HIGH(GPIOE_PIN11) | PIN_ODR_HIGH(GPIOE_PIN12) | PIN_ODR_HIGH(GPIOE_PIN13) | PIN_ODR_HIGH(GPIOE_PIN14) | PIN_ODR_HIGH(GPIOE_PIN15))
+#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | PIN_AFIO_AF(GPIOE_PIN1, 0U) | PIN_AFIO_AF(GPIOE_PIN2, 0U) | PIN_AFIO_AF(GPIOE_PIN3, 0U) | PIN_AFIO_AF(GPIOE_PIN4, 0U) | PIN_AFIO_AF(GPIOE_PIN5, 0U) | PIN_AFIO_AF(GPIOE_PIN6, 0U) | PIN_AFIO_AF(GPIOE_PIN7, 0U))
+#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | PIN_AFIO_AF(GPIOE_PIN9, 0U) | PIN_AFIO_AF(GPIOE_PIN10, 0U) | PIN_AFIO_AF(GPIOE_PIN11, 0U) | PIN_AFIO_AF(GPIOE_PIN12, 0U) | PIN_AFIO_AF(GPIOE_PIN13, 0U) | PIN_AFIO_AF(GPIOE_PIN14, 0U) | PIN_AFIO_AF(GPIOE_PIN15, 0U))
/*
* GPIOF setup:
@@ -812,112 +365,22 @@
* PF14 - PIN14 (input pullup).
* PF15 - PIN15 (input pullup).
*/
-#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \
- PIN_MODE_INPUT(GPIOF_OSC_OUT) | \
- PIN_MODE_INPUT(GPIOF_PIN2) | \
- PIN_MODE_INPUT(GPIOF_PIN3) | \
- PIN_MODE_INPUT(GPIOF_PIN4) | \
- PIN_MODE_INPUT(GPIOF_PIN5) | \
- PIN_MODE_INPUT(GPIOF_PIN6) | \
- PIN_MODE_INPUT(GPIOF_PIN7) | \
- PIN_MODE_INPUT(GPIOF_PIN8) | \
- PIN_MODE_INPUT(GPIOF_PIN9) | \
- PIN_MODE_INPUT(GPIOF_PIN10) | \
- PIN_MODE_INPUT(GPIOF_PIN11) | \
- PIN_MODE_INPUT(GPIOF_PIN12) | \
- PIN_MODE_INPUT(GPIOF_PIN13) | \
- PIN_MODE_INPUT(GPIOF_PIN14) | \
- PIN_MODE_INPUT(GPIOF_PIN15))
-#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \
- PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
- PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
-#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \
- PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
- PIN_OSPEED_VERYLOW(GPIOF_PIN15))
-#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \
- PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
- PIN_PUPDR_PULLUP(GPIOF_PIN15))
-#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \
- PIN_ODR_HIGH(GPIOF_OSC_OUT) | \
- PIN_ODR_HIGH(GPIOF_PIN2) | \
- PIN_ODR_HIGH(GPIOF_PIN3) | \
- PIN_ODR_HIGH(GPIOF_PIN4) | \
- PIN_ODR_HIGH(GPIOF_PIN5) | \
- PIN_ODR_HIGH(GPIOF_PIN6) | \
- PIN_ODR_HIGH(GPIOF_PIN7) | \
- PIN_ODR_HIGH(GPIOF_PIN8) | \
- PIN_ODR_HIGH(GPIOF_PIN9) | \
- PIN_ODR_HIGH(GPIOF_PIN10) | \
- PIN_ODR_HIGH(GPIOF_PIN11) | \
- PIN_ODR_HIGH(GPIOF_PIN12) | \
- PIN_ODR_HIGH(GPIOF_PIN13) | \
- PIN_ODR_HIGH(GPIOF_PIN14) | \
- PIN_ODR_HIGH(GPIOF_PIN15))
-#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \
- PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN7, 0U))
-#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
- PIN_AFIO_AF(GPIOF_PIN15, 0U))
-
+#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | PIN_MODE_INPUT(GPIOF_OSC_OUT) | PIN_MODE_INPUT(GPIOF_PIN2) | PIN_MODE_INPUT(GPIOF_PIN3) | PIN_MODE_INPUT(GPIOF_PIN4) | PIN_MODE_INPUT(GPIOF_PIN5) | PIN_MODE_INPUT(GPIOF_PIN6) | PIN_MODE_INPUT(GPIOF_PIN7) | PIN_MODE_INPUT(GPIOF_PIN8) | PIN_MODE_INPUT(GPIOF_PIN9) | PIN_MODE_INPUT(GPIOF_PIN10) | PIN_MODE_INPUT(GPIOF_PIN11) | PIN_MODE_INPUT(GPIOF_PIN12) | PIN_MODE_INPUT(GPIOF_PIN13) | PIN_MODE_INPUT(GPIOF_PIN14) | PIN_MODE_INPUT(GPIOF_PIN15))
+#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
+#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | PIN_OSPEED_VERYLOW(GPIOF_PIN15))
+#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | PIN_PUPDR_PULLUP(GPIOF_PIN2) | PIN_PUPDR_PULLUP(GPIOF_PIN3) | PIN_PUPDR_PULLUP(GPIOF_PIN4) | PIN_PUPDR_PULLUP(GPIOF_PIN5) | PIN_PUPDR_PULLUP(GPIOF_PIN6) | PIN_PUPDR_PULLUP(GPIOF_PIN7) | PIN_PUPDR_PULLUP(GPIOF_PIN8) | PIN_PUPDR_PULLUP(GPIOF_PIN9) | PIN_PUPDR_PULLUP(GPIOF_PIN10) | PIN_PUPDR_PULLUP(GPIOF_PIN11) | PIN_PUPDR_PULLUP(GPIOF_PIN12) | PIN_PUPDR_PULLUP(GPIOF_PIN13) | PIN_PUPDR_PULLUP(GPIOF_PIN14) | PIN_PUPDR_PULLUP(GPIOF_PIN15))
+#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | PIN_ODR_HIGH(GPIOF_OSC_OUT) | PIN_ODR_HIGH(GPIOF_PIN2) | PIN_ODR_HIGH(GPIOF_PIN3) | PIN_ODR_HIGH(GPIOF_PIN4) | PIN_ODR_HIGH(GPIOF_PIN5) | PIN_ODR_HIGH(GPIOF_PIN6) | PIN_ODR_HIGH(GPIOF_PIN7) | PIN_ODR_HIGH(GPIOF_PIN8) | PIN_ODR_HIGH(GPIOF_PIN9) | PIN_ODR_HIGH(GPIOF_PIN10) | PIN_ODR_HIGH(GPIOF_PIN11) | PIN_ODR_HIGH(GPIOF_PIN12) | PIN_ODR_HIGH(GPIOF_PIN13) | PIN_ODR_HIGH(GPIOF_PIN14) | PIN_ODR_HIGH(GPIOF_PIN15))
+#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | PIN_AFIO_AF(GPIOF_PIN2, 0U) | PIN_AFIO_AF(GPIOF_PIN3, 0U) | PIN_AFIO_AF(GPIOF_PIN4, 0U) | PIN_AFIO_AF(GPIOF_PIN5, 0U) | PIN_AFIO_AF(GPIOF_PIN6, 0U) | PIN_AFIO_AF(GPIOF_PIN7, 0U))
+#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | PIN_AFIO_AF(GPIOF_PIN9, 0U) | PIN_AFIO_AF(GPIOF_PIN10, 0U) | PIN_AFIO_AF(GPIOF_PIN11, 0U) | PIN_AFIO_AF(GPIOF_PIN12, 0U) | PIN_AFIO_AF(GPIOF_PIN13, 0U) | PIN_AFIO_AF(GPIOF_PIN14, 0U) | PIN_AFIO_AF(GPIOF_PIN15, 0U))
#if !defined(_FROM_ASM_)
-#ifdef __cplusplus
+# ifdef __cplusplus
extern "C" {
-#endif
- void boardInit(void);
-#ifdef __cplusplus
+# endif
+void boardInit(void);
+# ifdef __cplusplus
}
-#endif
+# endif
#endif /* _FROM_ASM_ */
#endif /* BOARD_H */
From 9241d11dc5f98a862fb58cb0c125d14451568e78 Mon Sep 17 00:00:00 2001
From: Keelhauler <41901381+Keelhauler@users.noreply.github.com>
Date: Thu, 13 Feb 2020 14:35:53 -0600
Subject: [PATCH 032/108] [Keymap] Add personal keymap (#7338)
* Copy default config
* Copy and edit Preonic keymap layers
* Update README
---
keyboards/preonic/keymaps/keelhauler/config.h | 37 +++
keyboards/preonic/keymaps/keelhauler/keymap.c | 314 ++++++++++++++++++
.../preonic/keymaps/keelhauler/readme.md | 11 +
keyboards/preonic/keymaps/keelhauler/rules.mk | 1 +
4 files changed, 363 insertions(+)
create mode 100644 keyboards/preonic/keymaps/keelhauler/config.h
create mode 100644 keyboards/preonic/keymaps/keelhauler/keymap.c
create mode 100644 keyboards/preonic/keymaps/keelhauler/readme.md
create mode 100644 keyboards/preonic/keymaps/keelhauler/rules.mk
diff --git a/keyboards/preonic/keymaps/keelhauler/config.h b/keyboards/preonic/keymaps/keelhauler/config.h
new file mode 100644
index 000000000000..40a9524b469d
--- /dev/null
+++ b/keyboards/preonic/keymaps/keelhauler/config.h
@@ -0,0 +1,37 @@
+#pragma once
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(PREONIC_SOUND)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_SOUND) \
+ }
+#endif
+
+#define MUSIC_MASK (keycode != KC_NO)
+
+/*
+ * MIDI options
+ */
+
+/* Prevent use of disabled MIDI features in the keymap */
+//#define MIDI_ENABLE_STRICT 1
+
+/* enable basic MIDI features:
+ - MIDI notes can be sent when in Music mode is on
+*/
+
+#define MIDI_BASIC
+
+/* enable advanced MIDI features:
+ - MIDI notes can be added to the keymap
+ - Octave shift and transpose
+ - Virtual sustain, portamento, and modulation wheel
+ - etc.
+*/
+//#define MIDI_ADVANCED
+
+/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
+//#define MIDI_TONE_KEYCODE_OCTAVES 2
diff --git a/keyboards/preonic/keymaps/keelhauler/keymap.c b/keyboards/preonic/keymaps/keelhauler/keymap.c
new file mode 100644
index 000000000000..e83e40dfc5b2
--- /dev/null
+++ b/keyboards/preonic/keymaps/keelhauler/keymap.c
@@ -0,0 +1,314 @@
+/* Copyright 2015-2017 Jack Humbert
+ *
+ * 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 .
+ */
+
+#include QMK_KEYBOARD_H
+#include "muse.h"
+
+// Tap and hold mods
+ // Enter into right shift
+ #define ENT_RSFT RSFT_T(KC_ENT)
+
+enum preonic_layers {
+ _QWERTY,
+ _COLEMAK,
+ _DVORAK,
+ _LOWER,
+ _RAISE,
+ _ADJUST
+};
+
+enum preonic_keycodes {
+ QWERTY = SAFE_RANGE,
+ COLEMAK,
+ DVORAK,
+ LOWER,
+ RAISE,
+ BACKLIT
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt | PSCR |Lower | Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = LAYOUT_preonic_grid( \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \
+ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, ENT_RSFT, \
+ KC_LCTL, KC_LGUI, KC_LALT, KC_PSCR, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+),
+
+/* Colemak
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | R | S | T | D | H | N | E | I | O | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt | PSCR |Lower | Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_COLEMAK] = LAYOUT_preonic_grid( \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
+ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \
+ KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, ENT_RSFT, \
+ KC_LCTL, KC_LGUI, KC_LALT, KC_PSCR, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+),
+
+/* Dvorak
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Tab | " | , | . | P | Y | F | G | C | R | L | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | O | E | U | I | D | H | T | N | S | / |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt | PSCR |Lower | Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_DVORAK] = LAYOUT_preonic_grid( \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
+ KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \
+ KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
+ KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, ENT_RSFT, \
+ KC_LCTL, KC_LGUI, KC_LALT, KC_PSCR, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Home | End | Play |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Prev | Vol- | Vol+ | Next |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = LAYOUT_preonic_grid( \
+ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
+ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
+ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
+ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, KC_MPLY, \
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Pg Up| Pg Dn| Play |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Prev | Vol- | Vol+ | Next |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = LAYOUT_preonic_grid( \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
+ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
+ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGUP, KC_PGDN, KC_MPLY, \
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | Reset| | | | | | | | | | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_preonic_grid( \
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
+ _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \
+ _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
+ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
+)
+
+
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case QWERTY:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_QWERTY);
+ }
+ return false;
+ break;
+ case COLEMAK:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_COLEMAK);
+ }
+ return false;
+ break;
+ case DVORAK:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_DVORAK);
+ }
+ return false;
+ break;
+ case LOWER:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case BACKLIT:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+ #ifdef BACKLIGHT_ENABLE
+ backlight_step();
+ #endif
+ #ifdef __AVR__
+ writePinLow(E6);
+ #endif
+ } else {
+ unregister_code(KC_RSFT);
+ #ifdef __AVR__
+ writePinHigh(E6);
+ #endif
+ }
+ return false;
+ break;
+ }
+ return true;
+};
+
+bool muse_mode = false;
+uint8_t last_muse_note = 0;
+uint16_t muse_counter = 0;
+uint8_t muse_offset = 70;
+uint16_t muse_tempo = 50;
+
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (muse_mode) {
+ if (IS_LAYER_ON(_RAISE)) {
+ if (clockwise) {
+ muse_offset++;
+ } else {
+ muse_offset--;
+ }
+ } else {
+ if (clockwise) {
+ muse_tempo+=1;
+ } else {
+ muse_tempo-=1;
+ }
+ }
+ } else {
+ if (clockwise) {
+ register_code(KC_PGDN);
+ unregister_code(KC_PGDN);
+ } else {
+ register_code(KC_PGUP);
+ unregister_code(KC_PGUP);
+ }
+ }
+}
+
+void dip_switch_update_user(uint8_t index, bool active) {
+ switch (index) {
+ case 0:
+ if (active) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ break;
+ case 1:
+ if (active) {
+ muse_mode = true;
+ } else {
+ muse_mode = false;
+ }
+ }
+}
+
+
+void matrix_scan_user(void) {
+#ifdef AUDIO_ENABLE
+ if (muse_mode) {
+ if (muse_counter == 0) {
+ uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
+ if (muse_note != last_muse_note) {
+ stop_note(compute_freq_for_midi_note(last_muse_note));
+ play_note(compute_freq_for_midi_note(muse_note), 0xF);
+ last_muse_note = muse_note;
+ }
+ }
+ muse_counter = (muse_counter + 1) % muse_tempo;
+ } else {
+ if (muse_counter) {
+ stop_all_notes();
+ muse_counter = 0;
+ }
+ }
+#endif
+}
+
+bool music_mask_user(uint16_t keycode) {
+ switch (keycode) {
+ case RAISE:
+ case LOWER:
+ return false;
+ default:
+ return true;
+ }
+}
diff --git a/keyboards/preonic/keymaps/keelhauler/readme.md b/keyboards/preonic/keymaps/keelhauler/readme.md
new file mode 100644
index 000000000000..93c026d9c6f6
--- /dev/null
+++ b/keyboards/preonic/keymaps/keelhauler/readme.md
@@ -0,0 +1,11 @@
+# Keelhauler's Preonic layout
+
+## Aims to provide a more seamless transition from a normal full-size keyboard and layout to the otholinear 50% layout of the preonic than the stock keymap.
+
+## Includes some personal touches that I find more helpful than the stock keymaps.
+
+### Base Keymap Improvements
+
+ FN key removed
+ Bottom left redesign from FN, CTRL, ALT, OS to CTRL, OS, ALT, PSCR
+ Enter functions as RShift when held, Enter when tapped
diff --git a/keyboards/preonic/keymaps/keelhauler/rules.mk b/keyboards/preonic/keymaps/keelhauler/rules.mk
new file mode 100644
index 000000000000..dcf16bef3994
--- /dev/null
+++ b/keyboards/preonic/keymaps/keelhauler/rules.mk
@@ -0,0 +1 @@
+SRC += muse.c
From 806cd392e70b81bbefdc06f111d2562ead4094ba Mon Sep 17 00:00:00 2001
From: Morton Jonuschat
Date: Thu, 13 Feb 2020 19:30:32 -0800
Subject: [PATCH 033/108] [osx_neo2] Bugfixes and improvements to Ergodox macOS
Neo2 keymap (#8154)
* Use TAPPING_TERM constant (and redefine value to 200ms)
* change TAPPING_TOGGLE to 2 to require two taps to lock in layer 4
* add support for Shift-Command 3/4/5 key combinations that are used in
macOS Catalina
* avoid false positive tap detecion for RMOD3 when the whole sequence of
pressing RMOD3, tapping another key and releasing RMOD3 took less than
TAPPING_TERM milliseconds.
* replace SEND_STRING with tap_code()/tap_code16(), saving ~860 bytes in
compiled firmware size.
---
layouts/community/ergodox/osx_neo2/config.h | 7 ++
layouts/community/ergodox/osx_neo2/keymap.c | 113 +++++++++++++-------
2 files changed, 79 insertions(+), 41 deletions(-)
create mode 100644 layouts/community/ergodox/osx_neo2/config.h
diff --git a/layouts/community/ergodox/osx_neo2/config.h b/layouts/community/ergodox/osx_neo2/config.h
new file mode 100644
index 000000000000..faa79da02622
--- /dev/null
+++ b/layouts/community/ergodox/osx_neo2/config.h
@@ -0,0 +1,7 @@
+#pragma once
+
+#undef TAPPING_TERM
+#define TAPPING_TERM 200
+
+#undef TAPPING_TOGGLE
+#define TAPPING_TOGGLE 2
diff --git a/layouts/community/ergodox/osx_neo2/keymap.c b/layouts/community/ergodox/osx_neo2/keymap.c
index 9e379c73f5a4..3dbfceabc431 100644
--- a/layouts/community/ergodox/osx_neo2/keymap.c
+++ b/layouts/community/ergodox/osx_neo2/keymap.c
@@ -5,6 +5,9 @@
// Timer to detect tap/hold on NEO_RMOD3 key
static uint16_t neo3_timer;
// State bitmap to track which key(s) enabled NEO_3 layer
+// Bit 1 = LMOD state
+// Bit 2 = RMOD state
+// Bit 3 = Seen other keypress
static uint8_t neo3_state = 0;
// State bitmap to track key combo for CAPSLOCK
static uint8_t capslock_state = 0;
@@ -453,6 +456,7 @@ void tap_with_modifiers(uint16_t keycode, uint8_t force_modifiers) {
bool process_record_user_shifted(uint16_t keycode, keyrecord_t *record) {
uint8_t active_modifiers = get_mods();
uint8_t shifted = active_modifiers & MOD_MASK_SHIFT;
+ uint8_t command = active_modifiers & MOD_MASK_GUI;
// Early return on key release
if (!record->event.pressed) {
@@ -465,67 +469,81 @@ bool process_record_user_shifted(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case NEO2_1:
// degree symbol
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_8) SS_UP(X_LSHIFT) SS_UP(X_LALT));
+ tap_code16(S(A(KC_8)));
break;
case NEO2_2:
// section symbol
- SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_6) SS_UP(X_LALT));
+ tap_code16(A(KC_6));
break;
case NEO2_3:
- // There is no OSX key combination for the script small l character
+ if (command) {
+ tap_code16(S(G(KC_3)));
+ } else {
+ // There is no OSX key combination for the script small l character
+ }
break;
case NEO2_4:
- // right angled quote
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_BSLASH) SS_UP(X_LSHIFT) SS_UP(X_LALT));
+ if (command) {
+ tap_code16(S(G(KC_4)));
+ } else {
+ tap_code16(S(A(KC_BSLASH)));
+ }
break;
case NEO2_5:
- // left angled quote
- SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_BSLASH) SS_UP(X_LALT));
+ if (command) {
+ tap_code16(S(G(KC_5)));
+ } else {
+ // left angled quote
+ tap_code16(A(KC_BSLASH));
+ }
break;
case NEO2_6:
// dollar sign
- SEND_STRING(SS_DOWN(X_LSHIFT) SS_TAP(X_4) SS_UP(X_LSHIFT));
+ tap_code16(S(KC_4));
break;
case NEO2_7:
// euro sign
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_2) SS_UP(X_LSHIFT) SS_UP(X_LALT));
+ tap_code16(S(A(KC_2)));
break;
case NEO2_8:
// low9 double quote
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_W) SS_UP(X_LSHIFT) SS_UP(X_LALT));
+ tap_code16(S(A(KC_W)));
break;
case NEO2_9:
// left double quote
- SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_LBRACKET) SS_UP(X_LALT));
+ tap_code16(A(KC_LBRACKET));
break;
case NEO2_0:
// right double quote
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_LBRACKET) SS_UP(X_LSHIFT) SS_UP(X_LALT));
+ tap_code16(S(A(KC_LBRACKET)));
break;
case NEO2_MINUS:
// em dash
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_MINUS) SS_UP(X_LSHIFT) SS_UP(X_LALT));
+ tap_code16(S(A(KC_MINUS)));
break;
case NEO2_COMMA:
// en dash
- SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_MINUS) SS_UP(X_LALT));
+ tap_code16(A(KC_MINUS));
break;
case NEO2_DOT:
// bullet
- SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_8) SS_UP(X_LALT));
+ tap_code16(A(KC_8));
break;
case NEO2_SHARP_S:
// german sharp s
- SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_S) SS_UP(X_LALT));
+ tap_code16(S(KC_S));
break;
case NEO2_UE:
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_U) SS_UP(X_LSHIFT));
+ tap_code16(A(KC_U));
+ tap_code16(S(KC_U));
break;
case NEO2_OE:
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_O) SS_UP(X_LSHIFT));
+ tap_code16(A(KC_U));
+ tap_code16(S(KC_O));
break;
case NEO2_AE:
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_DOWN(X_LSHIFT) SS_TAP(X_A) SS_UP(X_LSHIFT));
+ tap_code16(A(KC_U));
+ tap_code16(S(KC_A));
break;
default:
set_mods(active_modifiers);
@@ -537,56 +555,59 @@ bool process_record_user_shifted(uint16_t keycode, keyrecord_t *record) {
} else {
switch (keycode) {
case NEO2_1:
- SEND_STRING(SS_TAP(X_1));
+ tap_code(KC_1);
break;
case NEO2_2:
- SEND_STRING(SS_TAP(X_2));
+ tap_code(KC_2);
break;
case NEO2_3:
- SEND_STRING(SS_TAP(X_3));
+ tap_code(KC_3);
break;
case NEO2_4:
- SEND_STRING(SS_TAP(X_4));
+ tap_code(KC_4);
break;
case NEO2_5:
- SEND_STRING(SS_TAP(X_5));
+ tap_code(KC_5);
break;
case NEO2_6:
- SEND_STRING(SS_TAP(X_6));
+ tap_code(KC_6);
break;
case NEO2_7:
- SEND_STRING(SS_TAP(X_7));
+ tap_code(KC_7);
break;
case NEO2_8:
- SEND_STRING(SS_TAP(X_8));
+ tap_code(KC_8);
break;
case NEO2_9:
- SEND_STRING(SS_TAP(X_9));
+ tap_code(KC_9);
break;
case NEO2_0:
- SEND_STRING(SS_TAP(X_0));
+ tap_code(KC_0);
break;
case NEO2_MINUS:
- SEND_STRING(SS_TAP(X_MINUS));
+ tap_code(KC_MINUS);
break;
case NEO2_COMMA:
- SEND_STRING(SS_TAP(X_COMMA));
+ tap_code(KC_COMMA);
break;
case NEO2_DOT:
- SEND_STRING(SS_TAP(X_DOT));
+ tap_code(KC_DOT);
break;
case NEO2_SHARP_S:
// german sharp s
- SEND_STRING(SS_DOWN(X_LALT) SS_TAP(X_S) SS_UP(X_LALT));
+ tap_code16(A(KC_S));
break;
case NEO2_UE:
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_U));
+ tap_code16(A(KC_U));
+ tap_code(KC_U);
break;
case NEO2_OE:
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_O));
+ tap_code16(A(KC_U));
+ tap_code(KC_O);
break;
case NEO2_AE:
- SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_U) SS_UP(X_U) SS_UP(X_LALT) SS_TAP(X_A));
+ tap_code16(A(KC_U));
+ tap_code(KC_A);
break;
default:
return true;
@@ -619,7 +640,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
neo3_state |= (1 << 1);
} else {
// Turn off NEO_3 layer unless it's enabled through NEO2_RMOD3 as well.
- if ((neo3_state & ~(1 << 1)) == 0) {
+ if ((neo3_state & (1 << 2)) == 0) {
layer_off(NEO_3);
}
neo3_state &= ~(1 << 1);
@@ -629,28 +650,38 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
neo3_timer = timer_read();
neo3_state |= (1 << 2);
+ // Reset tap detection state
+ neo3_state &= ~(1 << 3);
layer_on(NEO_3);
} else {
// Turn off NEO_3 layer unless it's enabled through NEO2_LMOD3 as well.
- if ((neo3_state & ~(1 << 2)) == 0) {
+ if ((neo3_state & (1 << 1)) == 0) {
layer_off(NEO_3);
}
neo3_state &= ~(1 << 2);
// Was the NEO2_RMOD3 key TAPPED?
- if (timer_elapsed(neo3_timer) <= 150) {
- if (neo3_state > 0) {
+ if (timer_elapsed(neo3_timer) <= TAPPING_TERM) {
+ if ((neo3_state & ~(1 << 3)) > 0) {
// We are still in NEO_3 layer, send keycode and modifiers for @
tap_with_modifiers(KC_2, MOD_MASK_SHIFT);
return false;
} else {
// Do the normal key processing, send y
- tap_with_modifiers(KC_Y, MOD_MASK_NONE);
+ if ((neo3_state & (1 << 3)) == 0) {
+ tap_with_modifiers(KC_Y, MOD_MASK_NONE);
+ }
return false;
}
}
}
break;
+ default:
+ if (record->event.pressed && neo3_state > 0) {
+ // Track that we've seen a separate keypress event
+ neo3_state |= (1 << 3);
+ }
+ break;
}
if ((capslock_state & MOD_MASK_SHIFT) == MOD_MASK_SHIFT) {
From ac0947c9e8fc97797880cf96c983a718e6ada4a9 Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Fri, 14 Feb 2020 17:20:18 +1100
Subject: [PATCH 034/108] Convert two handwired default keymaps to Dynamic
Macro feature (#8166)
---
.../handwired/daishi/keymaps/default/keymap.c | 12 +++---------
keyboards/handwired/daishi/rules.mk | 1 +
.../space_oddity/keymaps/default/keymap.c | 17 ++++-------------
keyboards/handwired/space_oddity/rules.mk | 1 +
4 files changed, 9 insertions(+), 22 deletions(-)
diff --git a/keyboards/handwired/daishi/keymaps/default/keymap.c b/keyboards/handwired/daishi/keymaps/default/keymap.c
index c0baf7006b93..eef82dd9b9f9 100644
--- a/keyboards/handwired/daishi/keymaps/default/keymap.c
+++ b/keyboards/handwired/daishi/keymaps/default/keymap.c
@@ -6,12 +6,9 @@
enum custom_keycodes {
M_EXAMPLE1 = SAFE_RANGE,
- M_EXAMPLE2,
- DYNAMIC_MACRO_RANGE,
+ M_EXAMPLE2
};
-#include "dynamic_macro.h"
-
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
@@ -33,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_QW] = LAYOUT( /* QWERTY */
- KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______,DYN_MACRO_PLAY1,DYN_MACRO_PLAY2,DYN_REC_STOP, KC_PSCR, KC_SLCK, KC_PAUS, MO(_FN), KC_MUTE,
+ KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, DM_PLY1, DM_PLY2, DM_RSTP, KC_PSCR, KC_SLCK, KC_PAUS, MO(_FN), KC_MUTE,
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_DEL , KC_HOME, KC_PGUP, KC_END , KC_INS , KC_NLCK,
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, KC_PGDN, KC_PSLS, KC_PAST, KC_PMNS,
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, KC_P7 , KC_P8 , KC_P9 , KC_PPLS,
@@ -61,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_FN] = LAYOUT( /* Function */
- RESET , KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_F17 , KC_F18 , KC_F19 , KC_F20 , KC_F21 ,DYN_REC_START1,DYN_REC_START2,DYN_REC_STOP, _______, _______, _______, MO(_FN), DEBUG,
+ RESET , KC_F13 , KC_F14 , KC_F15 , KC_F16 , KC_F17 , KC_F18 , KC_F19 , KC_F20 , KC_F21 , DM_REC1, DM_REC2, DM_RSTP, _______, _______, _______, MO(_FN), DEBUG,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
@@ -72,9 +69,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- if (!process_record_dynamic_macro(keycode, record)) {
- return false;
- }
if (record->event.pressed) {
switch(keycode) {
case M_EXAMPLE1:
diff --git a/keyboards/handwired/daishi/rules.mk b/keyboards/handwired/daishi/rules.mk
index dacecfb0b166..5e8cc85e6520 100644
--- a/keyboards/handwired/daishi/rules.mk
+++ b/keyboards/handwired/daishi/rules.mk
@@ -29,3 +29,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ENCODER_ENABLE = yes # Add rotary encoder support
+DYNAMIC_MACRO_ENABLE = yes
\ No newline at end of file
diff --git a/keyboards/handwired/space_oddity/keymaps/default/keymap.c b/keyboards/handwired/space_oddity/keymaps/default/keymap.c
index e7836353ecb6..8adb15cfdb50 100644
--- a/keyboards/handwired/space_oddity/keymaps/default/keymap.c
+++ b/keyboards/handwired/space_oddity/keymaps/default/keymap.c
@@ -24,9 +24,7 @@ enum custom_keycodes {
PAIR_PR,
PAIR_BR,
PAIR_CB,
- LAMBDA,
- DYNAMIC_MACRO_RANGE,
-
+ LAMBDA
};
// Tap Dance initializer.
@@ -36,8 +34,6 @@ enum {
};
-#include "dynamic_macro.h"
-
// Tap dance actions - double tap for Caps Lock.
qk_tap_dance_action_t tap_dance_actions[] = {
@@ -71,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[0] = LAYOUT( \
- PAIR_PR, PAIR_BR, PAIR_CB, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, \
+ PAIR_PR, PAIR_BR, PAIR_CB, XXXXXXX, XXXXXXX, DM_PLY1, DM_PLY2, \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
@@ -105,8 +101,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[1] = LAYOUT( \
- LAMBDA, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, \
- DYN_REC_STOP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LBRC, KC_P7, KC_P8, KC_P9, KC_ASTR, KC_DEL, \
+ LAMBDA, _______, _______, _______, _______, DM_REC1, DM_REC2, \
+ DM_RSTP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LBRC, KC_P7, KC_P8, KC_P9, KC_ASTR, KC_DEL, \
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_EQL, \
KC_BSLS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_PIPE, \
_______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_RCBR, KC_P0, KC_COMM, KC_DOT, KC_SLSH, _______, \
@@ -160,11 +156,6 @@ void matrix_scan_user(void) {
//
// Customize to your heart's content!
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
-
- if (!process_record_dynamic_macro(keycode, record)) {
- return false;
- }
-
switch (keycode) {
case PAIR_PR:
diff --git a/keyboards/handwired/space_oddity/rules.mk b/keyboards/handwired/space_oddity/rules.mk
index 43fc1f34a3dc..a2e63690bd36 100644
--- a/keyboards/handwired/space_oddity/rules.mk
+++ b/keyboards/handwired/space_oddity/rules.mk
@@ -25,3 +25,4 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = no
TAP_DANCE_ENABLE = yes
+DYNAMIC_MACRO_ENABLE = yes
\ No newline at end of file
From 66177aa5e04bd4fbde758907412ce2c902430367 Mon Sep 17 00:00:00 2001
From: Brandon Schlack
Date: Thu, 13 Feb 2020 22:22:31 -0800
Subject: [PATCH 035/108] Add community layout support to Mysterium (#8164)
---
keyboards/coseyfannitutti/mysterium/rules.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/keyboards/coseyfannitutti/mysterium/rules.mk b/keyboards/coseyfannitutti/mysterium/rules.mk
index 9c518e938dce..453aef8ab6e7 100644
--- a/keyboards/coseyfannitutti/mysterium/rules.mk
+++ b/keyboards/coseyfannitutti/mysterium/rules.mk
@@ -37,3 +37,5 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
+
+LAYOUTS = tkl_ansi
From 4eed0331bf0876db0d557f86c7d4ef599ff0e6c4 Mon Sep 17 00:00:00 2001
From: James Young <18669334+noroadsleft@users.noreply.github.com>
Date: Fri, 14 Feb 2020 00:42:57 -0800
Subject: [PATCH 036/108] Just60 Configurator layout support and thinxer keymap
(#7761)
* Just60 Configurator layout support
* adds thinxer keymap, which is the default keymap with QMK DFU bootloader
---
keyboards/just60/info.json | 77 ++++++++++++++++++++++
keyboards/just60/keymaps/thinxer/keymap.c | 50 ++++++++++++++
keyboards/just60/keymaps/thinxer/readme.md | 19 ++++++
keyboards/just60/keymaps/thinxer/rules.mk | 1 +
4 files changed, 147 insertions(+)
create mode 100644 keyboards/just60/info.json
create mode 100644 keyboards/just60/keymaps/thinxer/keymap.c
create mode 100644 keyboards/just60/keymaps/thinxer/readme.md
create mode 100644 keyboards/just60/keymaps/thinxer/rules.mk
diff --git a/keyboards/just60/info.json b/keyboards/just60/info.json
new file mode 100644
index 000000000000..6b42a2d58f98
--- /dev/null
+++ b/keyboards/just60/info.json
@@ -0,0 +1,77 @@
+{
+ "keyboard_name": "Just60",
+ "url": "",
+ "maintainer": "thinxer",
+ "width": 15,
+ "height": 5,
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ {"label":"Esc/`", "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":"Fn", "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.75},
+ {"label":"Alt", "x":1.75, "y":4, "w":1.25},
+ {"label":"GUI", "x":3, "y":4, "w":1.25},
+ {"label":"Fn/Space", "x":4.25, "y":4, "w":1.25},
+ {"label":"Space", "x":5.5, "y":4, "w":3},
+ {"label":"GUI", "x":8.5, "y":4, "w":1.25},
+ {"label":"Alt", "x":9.75, "y":4, "w":1.25},
+ {"label":"Left", "x":11, "y":4},
+ {"label":"Down", "x":12, "y":4},
+ {"label":"Up", "x":13, "y":4},
+ {"label":"Right", "x":14, "y":4}
+ ]
+ }
+ }
+}
diff --git a/keyboards/just60/keymaps/thinxer/keymap.c b/keyboards/just60/keymaps/thinxer/keymap.c
new file mode 100644
index 000000000000..da034e0e447e
--- /dev/null
+++ b/keyboards/just60/keymaps/thinxer/keymap.c
@@ -0,0 +1,50 @@
+/* Copyright 2019 Jianfei Wang
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+// Defines names for use in layer keycodes and the keymap
+enum layer_names {
+ _BASE,
+ _FN,
+ _COMMAND
+};
+
+#define FN_SPC LT(_FN, KC_SPC)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /* Base */
+ [_BASE] = LAYOUT(
+ KC_GESC, 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,
+ 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,
+ MO(_FN), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_LCTL, KC_LALT, KC_LGUI, FN_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
+ ),
+ [_FN] = 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_CAPS, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
+ _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, MO(_COMMAND),
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END
+ ),
+ [_COMMAND] = LAYOUT(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, RESET,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ )
+};
diff --git a/keyboards/just60/keymaps/thinxer/readme.md b/keyboards/just60/keymaps/thinxer/readme.md
new file mode 100644
index 000000000000..9cd12c192f6c
--- /dev/null
+++ b/keyboards/just60/keymaps/thinxer/readme.md
@@ -0,0 +1,19 @@
+# thinxer keymap for Just60
+
+This is a duplicate of the default keymap, but for a Just60 with the QMK DFU bootloader.
+
+This layout is an ANSI layout with a Minila spacebar row.
+
+```
+ +-------------------------------------------------------------------------+
+ | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP |
+ +-------------------------------------------------------------------------+
+ | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
+ +-------------------------------------------------------------------------+
+ | FN | A | S | D | F | G | H | J | K | L | ; | ' | RETURN |
+ +-------------------------------------------------------------------------+
+ | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT |
+ +-------------------------------------------------------------------------+
+ | LCMD | LALT | LGUI | FN | SPACE | RGUI | RALT | LEFT | DOWN | UP | RGHT |
+ +-------------------------------------------------------------------------+
+```
diff --git a/keyboards/just60/keymaps/thinxer/rules.mk b/keyboards/just60/keymaps/thinxer/rules.mk
new file mode 100644
index 000000000000..0613ea8667c0
--- /dev/null
+++ b/keyboards/just60/keymaps/thinxer/rules.mk
@@ -0,0 +1 @@
+BOOTLOADER = qmk-dfu
From eb1f99c5f971ce939d18e236ac85edaf0de00401 Mon Sep 17 00:00:00 2001
From: Yan-Fa Li
Date: Fri, 14 Feb 2020 11:03:35 -0800
Subject: [PATCH 037/108] [keymap] Update audio controls on community (#8163)
* Update audio controls on community
* Add rules for various boards
* TKL support
---
.../60_ansi_split_bs_rshift/yanfali/keymap.c | 2 +-
layouts/community/60_hhkb/yanfali/keymap.c | 2 +-
.../60_tsangan_hhkb/yanfali/keymap.c | 2 +-
layouts/community/75_ansi/yanfali/keymap.c | 2 +-
layouts/community/tkl_ansi/yanfali/keymap.c | 25 +++++++++++++++++++
users/yanfali/rules.mk | 15 +++++++++--
6 files changed, 42 insertions(+), 6 deletions(-)
create mode 100644 layouts/community/tkl_ansi/yanfali/keymap.c
diff --git a/layouts/community/60_ansi_split_bs_rshift/yanfali/keymap.c b/layouts/community/60_ansi_split_bs_rshift/yanfali/keymap.c
index 5e5d16390923..49a906c273a0 100644
--- a/layouts/community/60_ansi_split_bs_rshift/yanfali/keymap.c
+++ b/layouts/community/60_ansi_split_bs_rshift/yanfali/keymap.c
@@ -26,6 +26,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, RESET, \
KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______),
};
diff --git a/layouts/community/60_hhkb/yanfali/keymap.c b/layouts/community/60_hhkb/yanfali/keymap.c
index 98649ca4b9f6..798f581e9621 100644
--- a/layouts/community/60_hhkb/yanfali/keymap.c
+++ b/layouts/community/60_hhkb/yanfali/keymap.c
@@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_PWR, 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_INS, KC_DEL, \
_______, RGB_TOG, KC_UP, RGB_RMOD, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, RESET, \
KC_CAPS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
- KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \
+ KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
};
diff --git a/layouts/community/60_tsangan_hhkb/yanfali/keymap.c b/layouts/community/60_tsangan_hhkb/yanfali/keymap.c
index a6cd15f4e2e5..31f0a66f291e 100644
--- a/layouts/community/60_tsangan_hhkb/yanfali/keymap.c
+++ b/layouts/community/60_tsangan_hhkb/yanfali/keymap.c
@@ -18,7 +18,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, 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_INS, KC_DEL,
_______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, RESET,
KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______
),
diff --git a/layouts/community/75_ansi/yanfali/keymap.c b/layouts/community/75_ansi/yanfali/keymap.c
index 729e7d6acade..f63da237c157 100644
--- a/layouts/community/75_ansi/yanfali/keymap.c
+++ b/layouts/community/75_ansi/yanfali/keymap.c
@@ -20,6 +20,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
BL_TOGG, BL_INC, BL_DEC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, RESET, _______,
RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, _______, _______, _______, _______, _______, _______, _______, _______,
- VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_PGUP, _______,
+ VLK_TOG, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_PGUP, _______,
_______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END)
};
diff --git a/layouts/community/tkl_ansi/yanfali/keymap.c b/layouts/community/tkl_ansi/yanfali/keymap.c
new file mode 100644
index 000000000000..06c9507aff24
--- /dev/null
+++ b/layouts/community/tkl_ansi/yanfali/keymap.c
@@ -0,0 +1,25 @@
+#include QMK_KEYBOARD_H
+
+enum _layer {
+ BASE,
+ FN
+};
+
+// clang-format off
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [BASE] = LAYOUT_tkl_ansi( \
+ KC_ESC, 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_PSCR,KC_SLCK,KC_PAUS, \
+ 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, KC_INS, KC_HOME,KC_PGUP, \
+ 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, KC_DEL, KC_END, KC_PGDN, \
+ MT(MOD_LCTL, KC_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, \
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
+ KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RGUI,KC_RGUI,MO(FN) ,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT),
+ [FN] = LAYOUT_tkl_ansi( \
+ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \
+ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,EEP_RST, _______,_______,KC_VOLU, \
+ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RESET, _______,_______,KC_VOLD, \
+ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \
+ _______,_______,_______,_______,_______,_______,_______,KC_MUTE,KC_VOLD,KC_VOLU,_______, _______, KC_MPLY, \
+ _______,_______,_______, _______, _______,_______,MO(FN) ,_______, KC_MPRV,KC_MSTP,KC_MNXT)
+};
+// clang-format on
diff --git a/users/yanfali/rules.mk b/users/yanfali/rules.mk
index c43f298588cb..a4f1092d0c74 100644
--- a/users/yanfali/rules.mk
+++ b/users/yanfali/rules.mk
@@ -3,14 +3,25 @@ DYNAMIC_KEYMAP_ENABLE = no
CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
LINK_TIME_OPTIMIZATION_ENABLE = yes
+AUDIO_ENABLE = no
# only enable audio on specific boards
ifeq ($(strip $(KEYBOARD)), maartenwut/plain60)
AUDIO_ENABLE = yes
-else
- AUDIO_ENABLE = no
+endif
+
+ifeq ($(strip $(KEYBOARD)), clueboard/60)
+ AUDIO_ENABLE = yes
+endif
+
+ifeq ($(strip $(KEYBOARD)), hadron/ver3)
+ AUDIO_ENABLE = yes
endif
ifeq ($(strip $(KEYBOARD)), fruity60)
COMMAND_ENABLE = no
endif
+
+ifeq ($(strip $(KEYBOARD)), kbdfans/kbd75/rev1)
+ COMMAND_ENABLE = no
+endif
From 348266bd5b6c6c79c292e3df9442a19d99873b5c Mon Sep 17 00:00:00 2001
From: morbetter <60626808+morbetter@users.noreply.github.com>
Date: Fri, 14 Feb 2020 11:31:48 -0800
Subject: [PATCH 038/108] Adding VIA support for 40percentclub/luddite (#8158)
* Adding VIA support for 40percentclub/luddite
* Update config.h
* Update rules.mk
* Delete config.h
config.h was created to override the "default" of RGBLED_NUM 8
deleting the file to keep with defaults
* Removing block and comment as suggested
* Update PRODUCT_ID
Changing from:
#define PRODUCT_ID 0x0A0C
To:
#define PRODUCT_ID 0x4C55 // "LU"
* Changing Vendor ID
Changing Vendor ID from:
#define VENDOR_ID 0xFEED
To:
#define VENDOR_ID 0x3430 // "40"
---
keyboards/40percentclub/luddite/config.h | 4 +--
.../luddite/keymaps/via/keymap.c | 35 +++++++++++++++++++
.../luddite/keymaps/via/rules.mk | 2 ++
3 files changed, 39 insertions(+), 2 deletions(-)
create mode 100644 keyboards/40percentclub/luddite/keymaps/via/keymap.c
create mode 100644 keyboards/40percentclub/luddite/keymaps/via/rules.mk
diff --git a/keyboards/40percentclub/luddite/config.h b/keyboards/40percentclub/luddite/config.h
index 005cb7a705e8..63158f6c41fc 100644
--- a/keyboards/40percentclub/luddite/config.h
+++ b/keyboards/40percentclub/luddite/config.h
@@ -3,8 +3,8 @@
#include "config_common.h"
/* USB Device descriptor parameter */
-#define VENDOR_ID 0xFEED
-#define PRODUCT_ID 0x0A0C
+#define VENDOR_ID 0x3430 // "40"
+#define PRODUCT_ID 0x4C55 // "LU"
#define DEVICE_VER 0x1001
#define MANUFACTURER di0ib
#define PRODUCT Luddite
diff --git a/keyboards/40percentclub/luddite/keymaps/via/keymap.c b/keyboards/40percentclub/luddite/keymaps/via/keymap.c
new file mode 100644
index 000000000000..df732befaa62
--- /dev/null
+++ b/keyboards/40percentclub/luddite/keymaps/via/keymap.c
@@ -0,0 +1,35 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_60_ansi(
+ 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,
+ 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,
+ LT(1,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT,KC_UP),
+ KC_LCTL, KC_LGUI, KC_LALT , KC_SPC, KC_RALT, LT(1,KC_LEFT), LT(2,KC_DOWN), MT(MOD_RCTL,KC_RGHT)
+ ),
+
+ [1] = LAYOUT_60_ansi(
+ KC_ESC, 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_DEL,
+ KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_HOME, KC_END, KC_TRNS,
+ KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_TRNS,
+ KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_INS, KC_DEL, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MENU, KC_TRNS
+ ),
+
+ [2] = LAYOUT_60_ansi(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_INC, BL_DEC, KC_TRNS,
+ RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET,
+ KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+
+ [3] = LAYOUT_60_ansi(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ )
+};
diff --git a/keyboards/40percentclub/luddite/keymaps/via/rules.mk b/keyboards/40percentclub/luddite/keymaps/via/rules.mk
new file mode 100644
index 000000000000..36b7ba9cbc98
--- /dev/null
+++ b/keyboards/40percentclub/luddite/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+LTO_ENABLE = yes
From 409c610543ffb62677d1162be868a2e44913a943 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Tue, 8 Oct 2019 21:50:21 +0200
Subject: [PATCH 039/108] CLI: add support for list_keymaps
List all the available keymaps for a given keyboard
---
lib/python/qmk/cli/list/__init__.py | 1 +
lib/python/qmk/cli/list/keymaps.py | 84 +++++++++++++++++++++++++++++
2 files changed, 85 insertions(+)
create mode 100644 lib/python/qmk/cli/list/keymaps.py
diff --git a/lib/python/qmk/cli/list/__init__.py b/lib/python/qmk/cli/list/__init__.py
index c36ba69548ed..d83cd20b5b49 100644
--- a/lib/python/qmk/cli/list/__init__.py
+++ b/lib/python/qmk/cli/list/__init__.py
@@ -1 +1,2 @@
from . import keyboards
+from . import keymaps
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
new file mode 100644
index 000000000000..709a5b9f907c
--- /dev/null
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -0,0 +1,84 @@
+"""List the keymaps for a specific keyboard
+"""
+import os
+import re
+import glob
+from bs4 import UnicodeDammit
+
+from milc import cli
+
+def unicode_text(filename):
+ """Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
+ """
+ with open(filename, 'rb') as fd:
+ text = UnicodeDammit(fd.read())
+
+ if text.contains_replacement_characters:
+ log_warning('%s: Could not determine file encoding, some characters were replaced.' % (filename,))
+
+ return text.unicode_markup or ''
+
+
+def unicode_lines(filename):
+ """Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
+ """
+ return unicode_text(filename).split('\n')
+
+def parse_rules_mk(keyboard):
+ base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
+ rules_mk_path_wildcard = os.path.join(base_path, "**", "rules.mk")
+ paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive=True) if "keymaps" not in path]
+
+ rules_mk = list()
+ for file in paths:
+ rules_mk_content = unicode_lines(file)
+ parsed_file = dict()
+ for line in rules_mk_content:
+ found = re.search(r'^\s*(\w+)\s*=\s*((?:\s*\w+)+)', line)
+ if found:
+ parsed_file[found.group(1)] = found.group(2)
+ rules_mk.append(parsed_file)
+ return rules_mk
+
+@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60hse')
+@cli.subcommand("List the keymaps for a specific keyboard")
+def list_keymaps(cli):
+ """List the keymaps for a specific keyboard
+ """
+ # ask for user input if keyboard was not provided in the command line
+ keyboard = cli.config.list_keymaps.keyboard if cli.config.list_keymaps.keyboard else input("Keyboard Name: ")
+
+ kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
+ km_path_wildcard = os.path.join(kb_base_path, "**", "keymap.c")
+
+ # find everywhere we have rules.mk where keymaps isn't in the path
+ km_paths = [path for path in glob.iglob(km_path_wildcard, recursive=True) if 'keymaps' in path]
+
+ # replace the keyboard directory's path prefix with the keyboard's name and remove the keymap.c suffix
+ km_find_name = lambda path: path.replace(kb_base_path, keyboard + os.path.sep).replace("/keymaps/", ":").replace(os.path.sep + "keymap.c", "")
+ names = list(map(km_find_name, km_paths))
+
+ # get all the rules.mk files for the keyboard
+ rules_mk = parse_rules_mk(keyboard)
+
+ # find all the supported layouts
+ all_supported_layouts = set()
+ for version in rules_mk:
+ if "LAYOUTS" in version:
+ for layout in version["LAYOUTS"].split():
+ all_supported_layouts.add(layout)
+
+ for layout in all_supported_layouts:
+ cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
+ cl_path_wildcard = os.path.join(cl_base_path, "**", "keymap.c")
+ # find all the keymap.c files under the community layouts
+ cl_paths = [path for path in glob.iglob(cl_path_wildcard, recursive=True)]
+ # replace the community layouts directory's path with the keyboard's name and remove the keymap.c suffix
+ cl_find_name = lambda path: path.replace(cl_base_path, keyboard + ":").replace(os.path.sep + "keymap.c", "")
+ names = names + list(map(cl_find_name, cl_paths))
+
+ names.sort()
+
+ for name in names:
+ # We echo instead of cli.log.info to allow easier piping of this output
+ cli.echo(name)
From 1d3271999aa19fbde65ae39f8685511b70b2844d Mon Sep 17 00:00:00 2001
From: Erovia
Date: Wed, 9 Oct 2019 08:10:59 +0200
Subject: [PATCH 040/108] Add bs4 to requirements.txt
UnicodeDammit is needed from bs4 for reading files.
---
requirements.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/requirements.txt b/requirements.txt
index 074b11a8ceed..bf4f411ede6c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,3 +7,4 @@ hjson
nose2
flake8
pep8-naming
+bs4
From 057c7d0ffeae617ef8bf2e4ca083fed30e689f27 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Wed, 9 Oct 2019 10:14:53 +0200
Subject: [PATCH 041/108] Major update to work better with revisions
Find the community keymaps supported by each revision.
---
lib/python/qmk/cli/list/keymaps.py | 45 ++++++++++++++----------------
1 file changed, 21 insertions(+), 24 deletions(-)
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index 709a5b9f907c..d55ff91fc3e3 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -29,7 +29,7 @@ def parse_rules_mk(keyboard):
rules_mk_path_wildcard = os.path.join(base_path, "**", "rules.mk")
paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive=True) if "keymaps" not in path]
- rules_mk = list()
+ rules_mk = dict()
for file in paths:
rules_mk_content = unicode_lines(file)
parsed_file = dict()
@@ -37,9 +37,18 @@ def parse_rules_mk(keyboard):
found = re.search(r'^\s*(\w+)\s*=\s*((?:\s*\w+)+)', line)
if found:
parsed_file[found.group(1)] = found.group(2)
- rules_mk.append(parsed_file)
+ version = file.replace(base_path, "").replace(os.path.sep, "").replace("rules.mk", "")
+ rules_mk[version if version else "base"] = parsed_file
return rules_mk
+def find_keymaps(base_path, name_finder, community = False):
+ path_wildcard = os.path.join(base_path, "**", "keymap.c")
+ if community:
+ paths = [path for path in glob.iglob(path_wildcard, recursive=True)]
+ else:
+ paths = [path for path in glob.iglob(path_wildcard, recursive=True) if 'keymaps' in path]
+ return list(map(name_finder, paths))
+
@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60hse')
@cli.subcommand("List the keymaps for a specific keyboard")
def list_keymaps(cli):
@@ -49,33 +58,21 @@ def list_keymaps(cli):
keyboard = cli.config.list_keymaps.keyboard if cli.config.list_keymaps.keyboard else input("Keyboard Name: ")
kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
- km_path_wildcard = os.path.join(kb_base_path, "**", "keymap.c")
-
- # find everywhere we have rules.mk where keymaps isn't in the path
- km_paths = [path for path in glob.iglob(km_path_wildcard, recursive=True) if 'keymaps' in path]
-
- # replace the keyboard directory's path prefix with the keyboard's name and remove the keymap.c suffix
km_find_name = lambda path: path.replace(kb_base_path, keyboard + os.path.sep).replace("/keymaps/", ":").replace(os.path.sep + "keymap.c", "")
- names = list(map(km_find_name, km_paths))
+ names = find_keymaps(kb_base_path, km_find_name)
# get all the rules.mk files for the keyboard
rules_mk = parse_rules_mk(keyboard)
- # find all the supported layouts
- all_supported_layouts = set()
- for version in rules_mk:
- if "LAYOUTS" in version:
- for layout in version["LAYOUTS"].split():
- all_supported_layouts.add(layout)
-
- for layout in all_supported_layouts:
- cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
- cl_path_wildcard = os.path.join(cl_base_path, "**", "keymap.c")
- # find all the keymap.c files under the community layouts
- cl_paths = [path for path in glob.iglob(cl_path_wildcard, recursive=True)]
- # replace the community layouts directory's path with the keyboard's name and remove the keymap.c suffix
- cl_find_name = lambda path: path.replace(cl_base_path, keyboard + ":").replace(os.path.sep + "keymap.c", "")
- names = names + list(map(cl_find_name, cl_paths))
+ for version, data in rules_mk.items():
+ if "LAYOUTS" in data:
+ if version == "base":
+ cl_find_name = lambda path: path.replace(cl_base_path, keyboard + ":").replace(os.path.sep + "keymap.c", "")
+ else:
+ cl_find_name = lambda path: path.replace(cl_base_path, keyboard + os.path.sep + version + ":").replace(os.path.sep + "keymap.c", "")
+ for layout in data["LAYOUTS"].split():
+ cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
+ names = names + find_keymaps(cl_base_path, cl_find_name, community = True)
names.sort()
From 62c1bcba71245e64be9a4813d749c0f04805fbcb Mon Sep 17 00:00:00 2001
From: Erovia
Date: Wed, 9 Oct 2019 20:53:18 +0200
Subject: [PATCH 042/108] Get all buildable keymaps for each revision
The command now return all keymaps that's buildable for a
keyboard/revision. If the base directory of a keyboard does not contain
a 'rules.mk' file, nothing is returned. If the base directory contains a
'keymaps' directory, those keycaps will be returned for every revision.
---
lib/python/qmk/cli/list/keymaps.py | 59 ++++++++++++++++--------------
1 file changed, 32 insertions(+), 27 deletions(-)
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index d55ff91fc3e3..2f3014f46463 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -10,72 +10,77 @@
def unicode_text(filename):
"""Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
"""
- with open(filename, 'rb') as fd:
+ with open(filename, "rb") as fd:
text = UnicodeDammit(fd.read())
if text.contains_replacement_characters:
- log_warning('%s: Could not determine file encoding, some characters were replaced.' % (filename,))
+ log_warning("%s: Could not determine file encoding, some characters were replaced." % (filename,))
- return text.unicode_markup or ''
+ return text.unicode_markup or ""
def unicode_lines(filename):
"""Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
"""
- return unicode_text(filename).split('\n')
+ return unicode_text(filename).split("\n")
-def parse_rules_mk(keyboard):
+def parse_rules_mk(keyboard, revision = ""):
base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
rules_mk_path_wildcard = os.path.join(base_path, "**", "rules.mk")
- paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive=True) if "keymaps" not in path]
+ rules_mk_regex = re.compile(r"^" + base_path + "(?:" + revision + os.path.sep + ")?rules.mk")
+ paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive = True) if rules_mk_regex.search(path)]
rules_mk = dict()
- for file in paths:
- rules_mk_content = unicode_lines(file)
+ config_regex = re.compile(r"^\s*(\S+)\s*=\s*((?:\s*\S+)+)")
+ for file_path in paths:
+ rules_mk_content = unicode_lines(file_path)
parsed_file = dict()
for line in rules_mk_content:
- found = re.search(r'^\s*(\w+)\s*=\s*((?:\s*\w+)+)', line)
+ found = config_regex.search(line)
if found:
parsed_file[found.group(1)] = found.group(2)
- version = file.replace(base_path, "").replace(os.path.sep, "").replace("rules.mk", "")
+ version = file_path.replace(base_path, "").replace(os.path.sep, "").replace("rules.mk", "")
rules_mk[version if version else "base"] = parsed_file
return rules_mk
-def find_keymaps(base_path, name_finder, community = False):
+def find_keymaps(base_path, revision = "", community = False):
path_wildcard = os.path.join(base_path, "**", "keymap.c")
if community:
- paths = [path for path in glob.iglob(path_wildcard, recursive=True)]
+ path_regex = re.compile(r"^" + re.escape(base_path) + "(\S+)" + os.path.sep + "keymap\.c")
+ names = [revision + os.path.sep + path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True)]
else:
- paths = [path for path in glob.iglob(path_wildcard, recursive=True) if 'keymaps' in path]
- return list(map(name_finder, paths))
+ path_regex = re.compile(r"^" + re.escape(base_path) + "(?:" + re.escape(revision) + os.path.sep + ")?keymaps" + os.path.sep + "(\S+)" + os.path.sep + "keymap\.c")
+ names = [revision + os.path.sep + path_regex.sub(lambda name: name.group(1), path) if revision else path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True) if path_regex.search(path)]
+ return names
-@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60hse')
+@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
+@cli.argument("-rv", "--revision", help="Specify the revison name. All revision if not specified. Example: rev6")
@cli.subcommand("List the keymaps for a specific keyboard")
def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
# ask for user input if keyboard was not provided in the command line
keyboard = cli.config.list_keymaps.keyboard if cli.config.list_keymaps.keyboard else input("Keyboard Name: ")
-
- kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
- km_find_name = lambda path: path.replace(kb_base_path, keyboard + os.path.sep).replace("/keymaps/", ":").replace(os.path.sep + "keymap.c", "")
- names = find_keymaps(kb_base_path, km_find_name)
+ revision = cli.config.list_keymaps.revision if cli.config.list_keymaps.revision else ""
# get all the rules.mk files for the keyboard
- rules_mk = parse_rules_mk(keyboard)
+ rules_mk = parse_rules_mk(keyboard, revision)
+
+ if "base" in rules_mk or revision:
+ keyboard_name = keyboard + os.path.sep + revision
+ kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
+ names = find_keymaps(kb_base_path, revision)
+ else:
+ names = list()
- for version, data in rules_mk.items():
+ for rev, data in rules_mk.items():
if "LAYOUTS" in data:
- if version == "base":
- cl_find_name = lambda path: path.replace(cl_base_path, keyboard + ":").replace(os.path.sep + "keymap.c", "")
- else:
- cl_find_name = lambda path: path.replace(cl_base_path, keyboard + os.path.sep + version + ":").replace(os.path.sep + "keymap.c", "")
for layout in data["LAYOUTS"].split():
cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
- names = names + find_keymaps(cl_base_path, cl_find_name, community = True)
+ names = names + find_keymaps(cl_base_path, rev, community = True)
names.sort()
for name in names:
# We echo instead of cli.log.info to allow easier piping of this output
- cli.echo(name)
+ cli.echo(keyboard + os.path.sep + name)
From c3b168e6fd8d414f95401dba471bdf6c12240d89 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Thu, 10 Oct 2019 18:54:12 +0200
Subject: [PATCH 043/108] Fix help message.
---
lib/python/qmk/cli/list/keymaps.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index 2f3014f46463..6cb21593f4d6 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -54,7 +54,7 @@ def find_keymaps(base_path, revision = "", community = False):
return names
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
-@cli.argument("-rv", "--revision", help="Specify the revison name. All revision if not specified. Example: rev6")
+@cli.argument("-rv", "--revision", help="Specify the revison name. Example: rev6")
@cli.subcommand("List the keymaps for a specific keyboard")
def list_keymaps(cli):
"""List the keymaps for a specific keyboard
From e46cc2db8c4668b05ed873f57a54785ed56e2415 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Thu, 10 Oct 2019 22:58:52 +0200
Subject: [PATCH 044/108] Try to figure out revision, drop -rv/--revision
argument
---
lib/python/qmk/cli/list/keymaps.py | 66 +++++++++++++++---------------
1 file changed, 34 insertions(+), 32 deletions(-)
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index 6cb21593f4d6..f3a1f2a50f72 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -26,61 +26,63 @@ def unicode_lines(filename):
def parse_rules_mk(keyboard, revision = ""):
base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
- rules_mk_path_wildcard = os.path.join(base_path, "**", "rules.mk")
- rules_mk_regex = re.compile(r"^" + base_path + "(?:" + revision + os.path.sep + ")?rules.mk")
- paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive = True) if rules_mk_regex.search(path)]
-
rules_mk = dict()
- config_regex = re.compile(r"^\s*(\S+)\s*=\s*((?:\s*\S+)+)")
- for file_path in paths:
- rules_mk_content = unicode_lines(file_path)
- parsed_file = dict()
- for line in rules_mk_content:
- found = config_regex.search(line)
- if found:
- parsed_file[found.group(1)] = found.group(2)
- version = file_path.replace(base_path, "").replace(os.path.sep, "").replace("rules.mk", "")
- rules_mk[version if version else "base"] = parsed_file
+ if os.path.exists(base_path + os.path.sep + revision):
+ rules_mk_path_wildcard = os.path.join(base_path, "**", "rules.mk")
+ rules_mk_regex = re.compile(r"^" + base_path + "(?:" + revision + os.path.sep + ")?rules.mk")
+ paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive = True) if rules_mk_regex.search(path)]
+
+ config_regex = re.compile(r"^\s*(\S+)\s*=\s*((?:\s*\S+)+)")
+ for file_path in paths:
+ rules_mk_content = unicode_lines(file_path)
+ parsed_file = dict()
+ for line in rules_mk_content:
+ found = config_regex.search(line)
+ if found:
+ parsed_file[found.group(1)] = found.group(2)
+ version = file_path.replace(base_path, "").replace(os.path.sep, "").replace("rules.mk", "")
+ rules_mk[version if version else "base"] = parsed_file
return rules_mk
def find_keymaps(base_path, revision = "", community = False):
path_wildcard = os.path.join(base_path, "**", "keymap.c")
if community:
path_regex = re.compile(r"^" + re.escape(base_path) + "(\S+)" + os.path.sep + "keymap\.c")
- names = [revision + os.path.sep + path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True)]
else:
path_regex = re.compile(r"^" + re.escape(base_path) + "(?:" + re.escape(revision) + os.path.sep + ")?keymaps" + os.path.sep + "(\S+)" + os.path.sep + "keymap\.c")
- names = [revision + os.path.sep + path_regex.sub(lambda name: name.group(1), path) if revision else path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True) if path_regex.search(path)]
+ names = [path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True) if path_regex.search(path)]
return names
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
-@cli.argument("-rv", "--revision", help="Specify the revison name. Example: rev6")
@cli.subcommand("List the keymaps for a specific keyboard")
def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
# ask for user input if keyboard was not provided in the command line
- keyboard = cli.config.list_keymaps.keyboard if cli.config.list_keymaps.keyboard else input("Keyboard Name: ")
- revision = cli.config.list_keymaps.revision if cli.config.list_keymaps.revision else ""
+ keyboard_name = cli.config.list_keymaps.keyboard if cli.config.list_keymaps.keyboard else input("Keyboard Name: ")
+ if os.path.sep in keyboard_name:
+ keyboard, revision = os.path.split(os.path.normpath(keyboard_name))
+ else:
+ keyboard = keyboard_name
+ revision = ""
# get all the rules.mk files for the keyboard
rules_mk = parse_rules_mk(keyboard, revision)
+ names = list()
- if "base" in rules_mk or revision:
- keyboard_name = keyboard + os.path.sep + revision
- kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
- names = find_keymaps(kb_base_path, revision)
- else:
- names = list()
+ if rules_mk:
+ if "base" in rules_mk or revision:
+ kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
+ names = find_keymaps(kb_base_path, revision)
- for rev, data in rules_mk.items():
- if "LAYOUTS" in data:
- for layout in data["LAYOUTS"].split():
- cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
- names = names + find_keymaps(cl_base_path, rev, community = True)
+ for rev, data in rules_mk.items():
+ if "LAYOUTS" in data:
+ for layout in data["LAYOUTS"].split():
+ cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
+ names = names + find_keymaps(cl_base_path, rev, community = True)
- names.sort()
+ names.sort()
for name in names:
# We echo instead of cli.log.info to allow easier piping of this output
- cli.echo(keyboard + os.path.sep + name)
+ cli.echo(keyboard_name + os.path.sep + name)
From f96085af3877a8c42d0767d13d47c239ce08ef0f Mon Sep 17 00:00:00 2001
From: Erovia
Date: Fri, 11 Oct 2019 17:15:29 +0200
Subject: [PATCH 045/108] Fix output format
---
lib/python/qmk/cli/list/keymaps.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index f3a1f2a50f72..5aed37b817b5 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -85,4 +85,4 @@ def list_keymaps(cli):
for name in names:
# We echo instead of cli.log.info to allow easier piping of this output
- cli.echo(keyboard_name + os.path.sep + name)
+ cli.echo(keyboard_name + ":" + name)
From 26f53d38d932a21be9edfc3d55e585c21050c3a2 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Sun, 13 Oct 2019 19:07:22 +0200
Subject: [PATCH 046/108] Another major refactoring, add documentation
Move all useful functions to the qmk module and use the cli subcommand
as a wrapper around it.
Add both inline comments and documentation.
---
docs/cli.md | 10 ++++
lib/python/qmk/cli/list/keymaps.py | 84 +++---------------------------
lib/python/qmk/keymap.py | 59 +++++++++++++++++++++
lib/python/qmk/makefile.py | 77 +++++++++++++++++++++++++++
lib/python/qmk/path.py | 18 +++++++
5 files changed, 172 insertions(+), 76 deletions(-)
create mode 100644 lib/python/qmk/makefile.py
diff --git a/docs/cli.md b/docs/cli.md
index f1c158af44c3..f2b433fbbfdf 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -252,6 +252,16 @@ This command lists all the keyboards currently defined in `qmk_firmware`
qmk list-keyboards
```
+## `qmk list_keymaps`
+
+This command lists all the keymaps for a specified keyboard (and revision).
+
+**Usage**:
+
+```
+qmk list_keymaps -kb planck/ez
+```
+
## `qmk new-keymap`
This command creates a new keymap based on a keyboard's existing default keymap.
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index 5aed37b817b5..494fe66a1214 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -1,57 +1,8 @@
"""List the keymaps for a specific keyboard
"""
-import os
-import re
-import glob
-from bs4 import UnicodeDammit
-
from milc import cli
-
-def unicode_text(filename):
- """Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
- """
- with open(filename, "rb") as fd:
- text = UnicodeDammit(fd.read())
-
- if text.contains_replacement_characters:
- log_warning("%s: Could not determine file encoding, some characters were replaced." % (filename,))
-
- return text.unicode_markup or ""
-
-
-def unicode_lines(filename):
- """Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
- """
- return unicode_text(filename).split("\n")
-
-def parse_rules_mk(keyboard, revision = ""):
- base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
- rules_mk = dict()
- if os.path.exists(base_path + os.path.sep + revision):
- rules_mk_path_wildcard = os.path.join(base_path, "**", "rules.mk")
- rules_mk_regex = re.compile(r"^" + base_path + "(?:" + revision + os.path.sep + ")?rules.mk")
- paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive = True) if rules_mk_regex.search(path)]
-
- config_regex = re.compile(r"^\s*(\S+)\s*=\s*((?:\s*\S+)+)")
- for file_path in paths:
- rules_mk_content = unicode_lines(file_path)
- parsed_file = dict()
- for line in rules_mk_content:
- found = config_regex.search(line)
- if found:
- parsed_file[found.group(1)] = found.group(2)
- version = file_path.replace(base_path, "").replace(os.path.sep, "").replace("rules.mk", "")
- rules_mk[version if version else "base"] = parsed_file
- return rules_mk
-
-def find_keymaps(base_path, revision = "", community = False):
- path_wildcard = os.path.join(base_path, "**", "keymap.c")
- if community:
- path_regex = re.compile(r"^" + re.escape(base_path) + "(\S+)" + os.path.sep + "keymap\.c")
- else:
- path_regex = re.compile(r"^" + re.escape(base_path) + "(?:" + re.escape(revision) + os.path.sep + ")?keymaps" + os.path.sep + "(\S+)" + os.path.sep + "keymap\.c")
- names = [path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True) if path_regex.search(path)]
- return names
+import qmk.keymap
+from qmk.errors import NoSuchKeyboardError
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
@cli.subcommand("List the keymaps for a specific keyboard")
@@ -60,29 +11,10 @@ def list_keymaps(cli):
"""
# ask for user input if keyboard was not provided in the command line
keyboard_name = cli.config.list_keymaps.keyboard if cli.config.list_keymaps.keyboard else input("Keyboard Name: ")
- if os.path.sep in keyboard_name:
- keyboard, revision = os.path.split(os.path.normpath(keyboard_name))
- else:
- keyboard = keyboard_name
- revision = ""
-
- # get all the rules.mk files for the keyboard
- rules_mk = parse_rules_mk(keyboard, revision)
- names = list()
-
- if rules_mk:
- if "base" in rules_mk or revision:
- kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
- names = find_keymaps(kb_base_path, revision)
-
- for rev, data in rules_mk.items():
- if "LAYOUTS" in data:
- for layout in data["LAYOUTS"].split():
- cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
- names = names + find_keymaps(cl_base_path, rev, community = True)
-
- names.sort()
- for name in names:
- # We echo instead of cli.log.info to allow easier piping of this output
- cli.echo(keyboard_name + ":" + name)
+ try:
+ for name in qmk.keymap.list_keymaps(keyboard_name):
+ # We echo instead of cli.log.info to allow easier piping of this output
+ cli.echo(keyboard_name + ":" + name)
+ except NoSuchKeyboardError as e:
+ cli.echo("{fg_red}" + e.message)
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index f4a2893f3855..3927f791a6bd 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -1,8 +1,13 @@
"""Functions that help you work with QMK keymaps.
"""
import os
+from traceback import format_exc
+import re
+import glob
import qmk.path
+import qmk.makefile
+from qmk.errors import NoSuchKeyboardError
# The `keymap.c` template to use when a keyboard doesn't have its own
DEFAULT_KEYMAP_C = """#include QMK_KEYBOARD_H
@@ -94,3 +99,57 @@ def write(keyboard, keymap, layout, layers):
keymap_fd.write(keymap_c)
return keymap_file
+
+def find_keymaps(base_path, revision = "", community = False):
+ """ Find the available keymaps for a keyboard and revision pair.
+
+ Args:
+ base_path: The base path of the keyboard.
+
+ revision: The keyboard's revision.
+
+ community: Set to True for the layouts under layouts/community.
+
+ Returns:
+ a list with whe keymaps's names
+ """
+ path_wildcard = os.path.join(base_path, "**", "keymap.c")
+ if community:
+ path_regex = re.compile(r"^" + re.escape(base_path) + "(\S+)" + os.path.sep + "keymap\.c")
+ else:
+ path_regex = re.compile(r"^" + re.escape(base_path) + "(?:" + re.escape(revision) + os.path.sep + ")?keymaps" + os.path.sep + "(\S+)" + os.path.sep + "keymap\.c")
+ names = [path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True) if path_regex.search(path)]
+ return names
+
+def list_keymaps(keyboard_name):
+ """ List the available keymaps for a keyboard.
+
+ Args:
+ keyboard_name: the keyboards full name with vendor and revision if necessary, example: clueboard/66/rev3
+
+ Returns:
+ a list with the names of the available keymaps
+ """
+ if os.path.sep in keyboard_name:
+ keyboard, revision = os.path.split(os.path.normpath(keyboard_name))
+ else:
+ keyboard = keyboard_name
+ revision = ""
+
+ # parse all the rules.mk files for the keyboard
+ rules_mk = qmk.makefile.get_rules_mk(keyboard, revision)
+ names = list()
+
+ if rules_mk:
+ # get the keymaps from the keyboard's directory
+ kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
+ names = find_keymaps(kb_base_path, revision)
+
+ # if community layouts are supported, get them
+ if "LAYOUTS" in rules_mk:
+ for layout in rules_mk["LAYOUTS"]["value"].split():
+ cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
+ names = names + find_keymaps(cl_base_path, revision, community = True)
+
+ names.sort()
+ return names
diff --git a/lib/python/qmk/makefile.py b/lib/python/qmk/makefile.py
new file mode 100644
index 000000000000..ce64431f96f4
--- /dev/null
+++ b/lib/python/qmk/makefile.py
@@ -0,0 +1,77 @@
+""" Functions for working with Makefiles
+"""
+import os
+import glob
+import re
+
+import qmk.path
+from qmk.errors import NoSuchKeyboardError
+
+def parse_rules_mk(file_path):
+ """ Parse a rules.mk file
+
+ Args:
+ file_path: path to the rules.mk file
+
+ Returns:
+ a dictionary with the file's content
+ """
+ # regex to match lines with comment at the end
+ # group(1) = option's name
+ # group(2) = operator (eg.: '=', '+=')
+ # group(3) = value(s)
+ commented_regex = re.compile(r"^\s*(\w+)\s*([\:\+\-]?=)\s*(.*?)(?=\s*\#)")
+ # regex to match lines without comment at the end
+ # group(1) = option's name
+ # group(2) = operator (eg.: '=', '+=')
+ # group(3) = value(s)
+ uncommented_regex = re.compile(r"^\s*(\w+)\s*([\:\+\-]?=)\s*(.*?)(?=\s*$)")
+ mk_content = qmk.path.unicode_lines(file_path)
+ parsed_file = dict()
+ for line in mk_content:
+ found = commented_regex.search(line) if "#" in line else uncommented_regex.search(line)
+ if found:
+ parsed_file[found.group(1)] = dict(operator = found.group(2), value = found.group(3))
+ return parsed_file
+
+def merge_rules_mk_files(base, revision):
+ """ Merge a keyboard revision's rules.mk file with
+ the 'base' rules.mk file
+
+ Args:
+ base: the base rules.mk file's content as dictionary
+ revision: the revision's rules.mk file's content as dictionary
+
+ Returns:
+ a dictionary with the merged content
+ """
+ return {**base, **revision}
+
+def get_rules_mk(keyboard, revision = ""):
+ """ Get a rules.mk for a keyboard
+
+ Args:
+ keyboard: name of the keyboard
+ revision: revision of the keyboard
+
+ Returns:
+ a dictionary with the content of the rules.mk file
+ """
+ base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
+ rules_mk = dict()
+ if os.path.exists(base_path + os.path.sep + revision):
+ rules_mk_path_wildcard = os.path.join(base_path, "**", "rules.mk")
+ rules_mk_regex = re.compile(r"^" + base_path + "(?:" + revision + os.path.sep + ")?rules.mk")
+ paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive = True) if rules_mk_regex.search(path)]
+ for file_path in paths:
+ rules_mk[revision if revision in file_path else "base"] = parse_rules_mk(file_path)
+ else:
+ raise NoSuchKeyboardError("The requested keyboard and/or revision does not exist.")
+
+ # if the base or the revision directory does not contain a rules.mk
+ if len(rules_mk) == 1:
+ rules_mk = rules_mk[revision]
+ # if both directories contain rules.mk files
+ elif len(rules_mk) == 2:
+ rules_mk = merge_rules_mk_files(rules_mk["base"], rules_mk[revision])
+ return rules_mk
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py
index cf087265fbf8..e7e3ec53fa79 100644
--- a/lib/python/qmk/path.py
+++ b/lib/python/qmk/path.py
@@ -5,6 +5,7 @@
from qmk.errors import NoSuchKeyboardError
+from bs4 import UnicodeDammit
def keymap(keyboard):
"""Locate the correct directory for storing a keymap.
@@ -33,3 +34,20 @@ def normpath(path):
return os.path.normpath(path)
return os.path.normpath(os.path.join(os.environ['ORIG_CWD'], path))
+
+def unicode_text(filename):
+ """Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
+ """
+ with open(filename, "rb") as fd:
+ text = UnicodeDammit(fd.read())
+
+ if text.contains_replacement_characters:
+ log_warning("%s: Could not determine file encoding, some characters were replaced." % (filename,))
+
+ return text.unicode_markup or ""
+
+
+def unicode_lines(filename):
+ """Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
+ """
+ return unicode_text(filename).split("\n")
From f8002828cac83272e5804bf705e20d07ac64e7a0 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Sun, 13 Oct 2019 19:16:19 +0200
Subject: [PATCH 047/108] Add test for list_keymaps
---
lib/python/qmk/tests/test_cli_commands.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index f1a92d9a310d..7dc51d247097 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -54,3 +54,8 @@ def test_list_keyboards():
# check to see if a known keyboard is returned
# this will fail if handwired/onekey/pytest is removed
assert 'handwired/onekey/pytest' in result.stdout
+
+def test_list_keymaps():
+ result = check_subcommand("list_keymaps", "-kb", "planck/ez")
+ assert result.returncode == 0
+ assert "planck/ez:default" and "planck/ez:drashna" in result.stdout
From d257a98cb80a90f116072c882753039b10a5e042 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Mon, 14 Oct 2019 18:35:12 +0200
Subject: [PATCH 048/108] Fix regex for parsing rules.mk files
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
I don't know why it couldn't put it together before... ¯\_(ツ)_/¯
---
lib/python/qmk/makefile.py | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/lib/python/qmk/makefile.py b/lib/python/qmk/makefile.py
index ce64431f96f4..dc498adc8fba 100644
--- a/lib/python/qmk/makefile.py
+++ b/lib/python/qmk/makefile.py
@@ -16,20 +16,15 @@ def parse_rules_mk(file_path):
Returns:
a dictionary with the file's content
"""
- # regex to match lines with comment at the end
+ # regex to match lines uncommented lines and get the data
# group(1) = option's name
# group(2) = operator (eg.: '=', '+=')
# group(3) = value(s)
- commented_regex = re.compile(r"^\s*(\w+)\s*([\:\+\-]?=)\s*(.*?)(?=\s*\#)")
- # regex to match lines without comment at the end
- # group(1) = option's name
- # group(2) = operator (eg.: '=', '+=')
- # group(3) = value(s)
- uncommented_regex = re.compile(r"^\s*(\w+)\s*([\:\+\-]?=)\s*(.*?)(?=\s*$)")
+ rules_mk_regex = re.compile(r"^\s*(\w+)\s*([\?\:\+\-]?=)\s*(\S.*?)(?=\s*(\#|$))")
mk_content = qmk.path.unicode_lines(file_path)
parsed_file = dict()
for line in mk_content:
- found = commented_regex.search(line) if "#" in line else uncommented_regex.search(line)
+ found = rules_mk_regex.search(line)
if found:
parsed_file[found.group(1)] = dict(operator = found.group(2), value = found.group(3))
return parsed_file
From 3ed1223678d3ec40f4cceecd320dd1112cdfb157 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Thu, 24 Oct 2019 20:33:58 +0200
Subject: [PATCH 049/108] Drop bs4 dependency, update docs, minor improvements
---
docs/cli.md | 4 ++--
lib/python/qmk/cli/list/keymaps.py | 11 +++++++----
lib/python/qmk/makefile.py | 2 +-
lib/python/qmk/path.py | 23 ++++++++---------------
requirements.txt | 1 -
5 files changed, 18 insertions(+), 23 deletions(-)
diff --git a/docs/cli.md b/docs/cli.md
index f2b433fbbfdf..8ee8ab0e8449 100644
--- a/docs/cli.md
+++ b/docs/cli.md
@@ -252,14 +252,14 @@ This command lists all the keyboards currently defined in `qmk_firmware`
qmk list-keyboards
```
-## `qmk list_keymaps`
+## `qmk list-keymaps`
This command lists all the keymaps for a specified keyboard (and revision).
**Usage**:
```
-qmk list_keymaps -kb planck/ez
+qmk list-keymaps -kb planck/ez
```
## `qmk new-keymap`
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index 494fe66a1214..a17c6a913070 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -10,11 +10,14 @@ def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
# ask for user input if keyboard was not provided in the command line
- keyboard_name = cli.config.list_keymaps.keyboard if cli.config.list_keymaps.keyboard else input("Keyboard Name: ")
+ if not cli.config.list_keymaps.keyboard:
+ cli.config.list_keymaps.keyboard = input("Keyboard Name: ")
try:
- for name in qmk.keymap.list_keymaps(keyboard_name):
+ for name in qmk.keymap.list_keymaps(cli.config.list_keymaps.keyboard):
# We echo instead of cli.log.info to allow easier piping of this output
- cli.echo(keyboard_name + ":" + name)
+ cli.echo('%s:%s', cli.config.list_keymaps.keyboard, name)
except NoSuchKeyboardError as e:
- cli.echo("{fg_red}" + e.message)
+ cli.echo("{fg_red}%s: %s", cli.config.list_keymaps.keyboard, e.message)
+ except (FileNotFoundError, PermissionError) as e:
+ cli.echo("{fg_red}%s: %s", cli.config.list_keymaps.keyboard, e)
diff --git a/lib/python/qmk/makefile.py b/lib/python/qmk/makefile.py
index dc498adc8fba..6ed6b4b7023a 100644
--- a/lib/python/qmk/makefile.py
+++ b/lib/python/qmk/makefile.py
@@ -21,8 +21,8 @@ def parse_rules_mk(file_path):
# group(2) = operator (eg.: '=', '+=')
# group(3) = value(s)
rules_mk_regex = re.compile(r"^\s*(\w+)\s*([\?\:\+\-]?=)\s*(\S.*?)(?=\s*(\#|$))")
- mk_content = qmk.path.unicode_lines(file_path)
parsed_file = dict()
+ mk_content = qmk.path.file_lines(file_path)
for line in mk_content:
found = rules_mk_regex.search(line)
if found:
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py
index e7e3ec53fa79..0cdfe353c59d 100644
--- a/lib/python/qmk/path.py
+++ b/lib/python/qmk/path.py
@@ -5,8 +5,6 @@
from qmk.errors import NoSuchKeyboardError
-from bs4 import UnicodeDammit
-
def keymap(keyboard):
"""Locate the correct directory for storing a keymap.
@@ -35,19 +33,14 @@ def normpath(path):
return os.path.normpath(os.path.join(os.environ['ORIG_CWD'], path))
-def unicode_text(filename):
- """Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
- """
- with open(filename, "rb") as fd:
- text = UnicodeDammit(fd.read())
-
- if text.contains_replacement_characters:
- log_warning("%s: Could not determine file encoding, some characters were replaced." % (filename,))
-
- return text.unicode_markup or ""
+def file_lines(filename):
+ """ Return a files content, line by line
+ Args:
+ filename: path to the file
-def unicode_lines(filename):
- """Returns the contents of filename as a UTF-8 string. Tries to DTRT when it comes to encoding.
+ Returns:
+ an list, in which each item is a line of the file
"""
- return unicode_text(filename).split("\n")
+ with open(filename, "r") as fd:
+ return fd.readlines()
diff --git a/requirements.txt b/requirements.txt
index bf4f411ede6c..074b11a8ceed 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -7,4 +7,3 @@ hjson
nose2
flake8
pep8-naming
-bs4
From 4445e0a459ce891d6e51a252030f665fea355b41 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Thu, 24 Oct 2019 22:22:44 +0200
Subject: [PATCH 050/108] Return only the unique keymaps
---
lib/python/qmk/keymap.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index 3927f791a6bd..6ee60b8be16c 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -111,7 +111,7 @@ def find_keymaps(base_path, revision = "", community = False):
community: Set to True for the layouts under layouts/community.
Returns:
- a list with whe keymaps's names
+ a set with the keymaps's names
"""
path_wildcard = os.path.join(base_path, "**", "keymap.c")
if community:
@@ -119,7 +119,7 @@ def find_keymaps(base_path, revision = "", community = False):
else:
path_regex = re.compile(r"^" + re.escape(base_path) + "(?:" + re.escape(revision) + os.path.sep + ")?keymaps" + os.path.sep + "(\S+)" + os.path.sep + "keymap\.c")
names = [path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True) if path_regex.search(path)]
- return names
+ return set(names)
def list_keymaps(keyboard_name):
""" List the available keymaps for a keyboard.
@@ -128,7 +128,7 @@ def list_keymaps(keyboard_name):
keyboard_name: the keyboards full name with vendor and revision if necessary, example: clueboard/66/rev3
Returns:
- a list with the names of the available keymaps
+ a set with the names of the available keymaps
"""
if os.path.sep in keyboard_name:
keyboard, revision = os.path.split(os.path.normpath(keyboard_name))
@@ -138,7 +138,7 @@ def list_keymaps(keyboard_name):
# parse all the rules.mk files for the keyboard
rules_mk = qmk.makefile.get_rules_mk(keyboard, revision)
- names = list()
+ names = set()
if rules_mk:
# get the keymaps from the keyboard's directory
@@ -151,5 +151,4 @@ def list_keymaps(keyboard_name):
cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
names = names + find_keymaps(cl_base_path, revision, community = True)
- names.sort()
- return names
+ return sorted(names)
From 8ff72d9517132fe82c6e2d1dc8fc56f7cab4b6a0 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Sun, 27 Oct 2019 19:38:17 +0100
Subject: [PATCH 051/108] Fix merging community and base keymaps
---
lib/python/qmk/keymap.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index 6ee60b8be16c..1024f8fc6e7b 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -149,6 +149,6 @@ def list_keymaps(keyboard_name):
if "LAYOUTS" in rules_mk:
for layout in rules_mk["LAYOUTS"]["value"].split():
cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
- names = names + find_keymaps(cl_base_path, revision, community = True)
+ names = names.union(find_keymaps(cl_base_path, revision, community = True))
return sorted(names)
From 988bfffca2715df3f227c462533d350ecbeac6c0 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Mon, 28 Oct 2019 09:23:06 +0100
Subject: [PATCH 052/108] Major rework, no regex/globbing, more walking
Instead of using regexes and globbing to find the rules.mk and keymap.c
files, walk the directory tree to find them.
Also, do away with the concept of revision.
---
lib/python/qmk/keymap.py | 52 +++++++--------------
lib/python/qmk/makefile.py | 94 +++++++++++++++++++++-----------------
2 files changed, 67 insertions(+), 79 deletions(-)
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index 1024f8fc6e7b..113b885de320 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -2,8 +2,6 @@
"""
import os
from traceback import format_exc
-import re
-import glob
import qmk.path
import qmk.makefile
@@ -100,27 +98,6 @@ def write(keyboard, keymap, layout, layers):
return keymap_file
-def find_keymaps(base_path, revision = "", community = False):
- """ Find the available keymaps for a keyboard and revision pair.
-
- Args:
- base_path: The base path of the keyboard.
-
- revision: The keyboard's revision.
-
- community: Set to True for the layouts under layouts/community.
-
- Returns:
- a set with the keymaps's names
- """
- path_wildcard = os.path.join(base_path, "**", "keymap.c")
- if community:
- path_regex = re.compile(r"^" + re.escape(base_path) + "(\S+)" + os.path.sep + "keymap\.c")
- else:
- path_regex = re.compile(r"^" + re.escape(base_path) + "(?:" + re.escape(revision) + os.path.sep + ")?keymaps" + os.path.sep + "(\S+)" + os.path.sep + "keymap\.c")
- names = [path_regex.sub(lambda name: name.group(1), path) for path in glob.iglob(path_wildcard, recursive = True) if path_regex.search(path)]
- return set(names)
-
def list_keymaps(keyboard_name):
""" List the available keymaps for a keyboard.
@@ -130,25 +107,28 @@ def list_keymaps(keyboard_name):
Returns:
a set with the names of the available keymaps
"""
- if os.path.sep in keyboard_name:
- keyboard, revision = os.path.split(os.path.normpath(keyboard_name))
- else:
- keyboard = keyboard_name
- revision = ""
-
# parse all the rules.mk files for the keyboard
- rules_mk = qmk.makefile.get_rules_mk(keyboard, revision)
+ rules_mk = qmk.makefile.get_rules_mk(keyboard_name)
names = set()
if rules_mk:
- # get the keymaps from the keyboard's directory
- kb_base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
- names = find_keymaps(kb_base_path, revision)
+ # qmk_firmware/keyboards
+ keyboards_dir = os.path.join(os.getcwd(), "keyboards")
+ # path to the keyboard's directory
+ kb_path = os.path.join(keyboards_dir, keyboard_name)
+ # walk up the directory tree until keyboards_dir
+ # and collect all directories' name with keymap.c file in it
+ while kb_path != keyboards_dir:
+ keymaps_dir = os.path.join(kb_path, "keymaps")
+ if os.path.exists(keymaps_dir):
+ names = names.union([keymap for keymap in os.listdir(keymaps_dir) if os.path.isfile(os.path.join(keymaps_dir, keymap, "keymap.c"))])
+ kb_path = os.path.dirname(kb_path)
# if community layouts are supported, get them
if "LAYOUTS" in rules_mk:
- for layout in rules_mk["LAYOUTS"]["value"].split():
- cl_base_path = os.path.join(os.getcwd(), "layouts", "community", layout) + os.path.sep
- names = names.union(find_keymaps(cl_base_path, revision, community = True))
+ for layout in rules_mk["LAYOUTS"].split():
+ cl_path = os.path.join(os.getcwd(), "layouts", "community", layout)
+ if os.path.exists(cl_path):
+ names = names.union([keymap for keymap in os.listdir(cl_path) if os.path.isfile(os.path.join(cl_path, keymap, "keymap.c"))])
return sorted(names)
diff --git a/lib/python/qmk/makefile.py b/lib/python/qmk/makefile.py
index 6ed6b4b7023a..c53f12ac75e4 100644
--- a/lib/python/qmk/makefile.py
+++ b/lib/python/qmk/makefile.py
@@ -1,72 +1,80 @@
""" Functions for working with Makefiles
"""
import os
-import glob
-import re
import qmk.path
from qmk.errors import NoSuchKeyboardError
-def parse_rules_mk(file_path):
- """ Parse a rules.mk file
+def parse_rules_mk_file(file, rules_mk=None):
+ """Turn a rules.mk file into a dictionary.
Args:
- file_path: path to the rules.mk file
+ file: path to the rules.mk file
+ rules_mk: already parsed rules.mk the new file should be merged with
Returns:
a dictionary with the file's content
"""
- # regex to match lines uncommented lines and get the data
- # group(1) = option's name
- # group(2) = operator (eg.: '=', '+=')
- # group(3) = value(s)
- rules_mk_regex = re.compile(r"^\s*(\w+)\s*([\?\:\+\-]?=)\s*(\S.*?)(?=\s*(\#|$))")
- parsed_file = dict()
- mk_content = qmk.path.file_lines(file_path)
- for line in mk_content:
- found = rules_mk_regex.search(line)
- if found:
- parsed_file[found.group(1)] = dict(operator = found.group(2), value = found.group(3))
- return parsed_file
+ if not rules_mk:
+ rules_mk = {}
-def merge_rules_mk_files(base, revision):
- """ Merge a keyboard revision's rules.mk file with
- the 'base' rules.mk file
+ if os.path.exists(file):
+ rules_mk_lines = qmk.path.file_lines(file)
- Args:
- base: the base rules.mk file's content as dictionary
- revision: the revision's rules.mk file's content as dictionary
+ for line in rules_mk_lines:
+ # Filter out comments
+ if line.strip().startswith("#"):
+ continue
- Returns:
- a dictionary with the merged content
- """
- return {**base, **revision}
+ # Strip in-line comments
+ if '#' in line:
+ line = line[:line.index('#')].strip()
+
+ if '=' in line:
+ # Append
+ if '+=' in line:
+ key, value = line.split('+=', 1)
+ if key.strip() not in rules_mk:
+ rules_mk[key.strip()] = value.strip()
+ else:
+ rules_mk[key.strip()] += ' ' + value.strip()
+ # Set if absent
+ elif "?=" in line:
+ key, value = line.split('?=', 1)
+ if key.strip() not in rules_mk:
+ rules_mk[key.strip()] = value.strip()
+ else:
+ if ":=" in line:
+ line.replace(":","")
+ key, value = line.split('=', 1)
+ rules_mk[key.strip()] = value.strip()
-def get_rules_mk(keyboard, revision = ""):
+ return rules_mk
+
+def get_rules_mk(keyboard):
""" Get a rules.mk for a keyboard
Args:
keyboard: name of the keyboard
- revision: revision of the keyboard
+
+ Raises:
+ NoSuchKeyboardError: when the keyboard does not exists
Returns:
a dictionary with the content of the rules.mk file
"""
- base_path = os.path.join(os.getcwd(), "keyboards", keyboard) + os.path.sep
- rules_mk = dict()
- if os.path.exists(base_path + os.path.sep + revision):
- rules_mk_path_wildcard = os.path.join(base_path, "**", "rules.mk")
- rules_mk_regex = re.compile(r"^" + base_path + "(?:" + revision + os.path.sep + ")?rules.mk")
- paths = [path for path in glob.iglob(rules_mk_path_wildcard, recursive = True) if rules_mk_regex.search(path)]
- for file_path in paths:
- rules_mk[revision if revision in file_path else "base"] = parse_rules_mk(file_path)
+ # Start with qmk_firmware/keyboards
+ kb_path = os.path.join(os.getcwd(), "keyboards")
+ # walk down the directory tree
+ # and collect all rules.mk files
+ if os.path.exists(os.path.join(kb_path, keyboard)):
+ rules_mk = dict()
+ for directory in keyboard.split(os.path.sep):
+ kb_path = os.path.join(kb_path, directory)
+ rules_mk_path = os.path.join(kb_path, "rules.mk")
+ if os.path.exists(rules_mk_path):
+ rules_mk = parse_rules_mk_file(rules_mk_path, rules_mk)
else:
raise NoSuchKeyboardError("The requested keyboard and/or revision does not exist.")
- # if the base or the revision directory does not contain a rules.mk
- if len(rules_mk) == 1:
- rules_mk = rules_mk[revision]
- # if both directories contain rules.mk files
- elif len(rules_mk) == 2:
- rules_mk = merge_rules_mk_files(rules_mk["base"], rules_mk[revision])
return rules_mk
From 8eeab1112aa1ca7336f88867a9a2ab680ae94b53 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Tue, 7 Jan 2020 21:54:21 +0100
Subject: [PATCH 053/108] Fix commandline parsing and flake8 findings, rebase
Fixed commandline and config parsing. Thx @xplusplus.
Rebased on master and fixed merge conflicts.
---
lib/python/qmk/cli/list/keymaps.py | 5 ++++-
lib/python/qmk/keymap.py | 3 +--
lib/python/qmk/makefile.py | 4 +++-
lib/python/qmk/path.py | 2 ++
lib/python/qmk/tests/test_cli_commands.py | 9 ++++++++-
5 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index a17c6a913070..aab97314059e 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -4,13 +4,16 @@
import qmk.keymap
from qmk.errors import NoSuchKeyboardError
+
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
@cli.subcommand("List the keymaps for a specific keyboard")
def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
# ask for user input if keyboard was not provided in the command line
- if not cli.config.list_keymaps.keyboard:
+ if cli.args.keyboard:
+ cli.config.list_keymaps.keyboard = cli.args.keyboard
+ elif not cli.config.list_keymaps.keyboard:
cli.config.list_keymaps.keyboard = input("Keyboard Name: ")
try:
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index 113b885de320..afb001f3e0e9 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -1,11 +1,9 @@
"""Functions that help you work with QMK keymaps.
"""
import os
-from traceback import format_exc
import qmk.path
import qmk.makefile
-from qmk.errors import NoSuchKeyboardError
# The `keymap.c` template to use when a keyboard doesn't have its own
DEFAULT_KEYMAP_C = """#include QMK_KEYBOARD_H
@@ -98,6 +96,7 @@ def write(keyboard, keymap, layout, layers):
return keymap_file
+
def list_keymaps(keyboard_name):
""" List the available keymaps for a keyboard.
diff --git a/lib/python/qmk/makefile.py b/lib/python/qmk/makefile.py
index c53f12ac75e4..89494bbc02dd 100644
--- a/lib/python/qmk/makefile.py
+++ b/lib/python/qmk/makefile.py
@@ -5,6 +5,7 @@
import qmk.path
from qmk.errors import NoSuchKeyboardError
+
def parse_rules_mk_file(file, rules_mk=None):
"""Turn a rules.mk file into a dictionary.
@@ -45,12 +46,13 @@ def parse_rules_mk_file(file, rules_mk=None):
rules_mk[key.strip()] = value.strip()
else:
if ":=" in line:
- line.replace(":","")
+ line.replace(":", "")
key, value = line.split('=', 1)
rules_mk[key.strip()] = value.strip()
return rules_mk
+
def get_rules_mk(keyboard):
""" Get a rules.mk for a keyboard
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py
index 0cdfe353c59d..bb28049b9dbb 100644
--- a/lib/python/qmk/path.py
+++ b/lib/python/qmk/path.py
@@ -5,6 +5,7 @@
from qmk.errors import NoSuchKeyboardError
+
def keymap(keyboard):
"""Locate the correct directory for storing a keymap.
@@ -33,6 +34,7 @@ def normpath(path):
return os.path.normpath(os.path.join(os.environ['ORIG_CWD'], path))
+
def file_lines(filename):
""" Return a files content, line by line
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index 7dc51d247097..d8843790350c 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -55,7 +55,14 @@ def test_list_keyboards():
# this will fail if handwired/onekey/pytest is removed
assert 'handwired/onekey/pytest' in result.stdout
+
def test_list_keymaps():
- result = check_subcommand("list_keymaps", "-kb", "planck/ez")
+ result = check_subcommand("list-keymaps", "-kb", "planck/ez")
assert result.returncode == 0
assert "planck/ez:default" and "planck/ez:drashna" in result.stdout
+
+
+def test_list_keymaps_no_keyboard_found():
+ result = check_subcommand("list-keymaps", "-kb", "asdfghjkl")
+ assert result.returncode == 0
+ assert "does not exist" in result.stdout
From 3db41817e0aa72e1406e29a4fb5f82db0c2a6cf1 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Sun, 12 Jan 2020 12:36:41 +0100
Subject: [PATCH 054/108] Code cleanup, use pathlib, use pytest keyboard
Clean up checks and logics that are unnecessary due to MILC updates.
Use pathlib instead of os.path for readability.
Use the 'pytest' keyboard for the tests.
Add community layout for 'handwired/onekey/pytest' so we can test
community layouts.
---
keyboards/handwired/onekey/rules.mk | 1 +
layouts/community/ortho_1x1/layout.json | 1 +
layouts/community/ortho_1x1/test/keymap.c | 12 ++++++++++++
lib/python/qmk/cli/list/keymaps.py | 10 +++-------
lib/python/qmk/makefile.py | 21 +++++++++++----------
lib/python/qmk/path.py | 13 -------------
lib/python/qmk/tests/test_cli_commands.py | 4 ++--
7 files changed, 30 insertions(+), 32 deletions(-)
create mode 100644 layouts/community/ortho_1x1/layout.json
create mode 100644 layouts/community/ortho_1x1/test/keymap.c
diff --git a/keyboards/handwired/onekey/rules.mk b/keyboards/handwired/onekey/rules.mk
index 245f9025d77e..8ed255768383 100644
--- a/keyboards/handwired/onekey/rules.mk
+++ b/keyboards/handwired/onekey/rules.mk
@@ -20,3 +20,4 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
DEFAULT_FOLDER = handwired/onekey/promicro
+LAYOUTS = ortho_1x1
diff --git a/layouts/community/ortho_1x1/layout.json b/layouts/community/ortho_1x1/layout.json
new file mode 100644
index 000000000000..66a1e1856064
--- /dev/null
+++ b/layouts/community/ortho_1x1/layout.json
@@ -0,0 +1 @@
+[""]
diff --git a/layouts/community/ortho_1x1/test/keymap.c b/layouts/community/ortho_1x1/test/keymap.c
new file mode 100644
index 000000000000..6a186669b07e
--- /dev/null
+++ b/layouts/community/ortho_1x1/test/keymap.c
@@ -0,0 +1,12 @@
+#include QMK_KEYBOARD_H
+
+/* This keyboard/layout is used to test community layout discovery/compilation. */
+
+#define _DEFAULT 0
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+[_DEFAULT] = LAYOUT (
+ KC_B
+),
+};
diff --git a/lib/python/qmk/cli/list/keymaps.py b/lib/python/qmk/cli/list/keymaps.py
index aab97314059e..d199d29bc3d4 100644
--- a/lib/python/qmk/cli/list/keymaps.py
+++ b/lib/python/qmk/cli/list/keymaps.py
@@ -10,17 +10,13 @@
def list_keymaps(cli):
"""List the keymaps for a specific keyboard
"""
- # ask for user input if keyboard was not provided in the command line
- if cli.args.keyboard:
- cli.config.list_keymaps.keyboard = cli.args.keyboard
- elif not cli.config.list_keymaps.keyboard:
- cli.config.list_keymaps.keyboard = input("Keyboard Name: ")
-
try:
for name in qmk.keymap.list_keymaps(cli.config.list_keymaps.keyboard):
# We echo instead of cli.log.info to allow easier piping of this output
- cli.echo('%s:%s', cli.config.list_keymaps.keyboard, name)
+ cli.echo('%s', name)
except NoSuchKeyboardError as e:
cli.echo("{fg_red}%s: %s", cli.config.list_keymaps.keyboard, e.message)
except (FileNotFoundError, PermissionError) as e:
cli.echo("{fg_red}%s: %s", cli.config.list_keymaps.keyboard, e)
+ except TypeError:
+ cli.echo("{fg_red}Something went wrong. Did you specify a keyboard?")
diff --git a/lib/python/qmk/makefile.py b/lib/python/qmk/makefile.py
index 89494bbc02dd..8645056d2d31 100644
--- a/lib/python/qmk/makefile.py
+++ b/lib/python/qmk/makefile.py
@@ -1,8 +1,7 @@
""" Functions for working with Makefiles
"""
-import os
+from pathlib import Path
-import qmk.path
from qmk.errors import NoSuchKeyboardError
@@ -19,8 +18,9 @@ def parse_rules_mk_file(file, rules_mk=None):
if not rules_mk:
rules_mk = {}
- if os.path.exists(file):
- rules_mk_lines = qmk.path.file_lines(file)
+ file = Path(file)
+ if file.exists():
+ rules_mk_lines = file.read_text().split("\n")
for line in rules_mk_lines:
# Filter out comments
@@ -66,15 +66,16 @@ def get_rules_mk(keyboard):
a dictionary with the content of the rules.mk file
"""
# Start with qmk_firmware/keyboards
- kb_path = os.path.join(os.getcwd(), "keyboards")
+ kb_path = Path.cwd() / "keyboards"
# walk down the directory tree
# and collect all rules.mk files
- if os.path.exists(os.path.join(kb_path, keyboard)):
+ kb_dir = kb_path / keyboard
+ if kb_dir.exists():
rules_mk = dict()
- for directory in keyboard.split(os.path.sep):
- kb_path = os.path.join(kb_path, directory)
- rules_mk_path = os.path.join(kb_path, "rules.mk")
- if os.path.exists(rules_mk_path):
+ for directory in Path(keyboard).parts:
+ kb_path = kb_path / directory
+ rules_mk_path = kb_path / "rules.mk"
+ if rules_mk_path.exists():
rules_mk = parse_rules_mk_file(rules_mk_path, rules_mk)
else:
raise NoSuchKeyboardError("The requested keyboard and/or revision does not exist.")
diff --git a/lib/python/qmk/path.py b/lib/python/qmk/path.py
index bb28049b9dbb..cf087265fbf8 100644
--- a/lib/python/qmk/path.py
+++ b/lib/python/qmk/path.py
@@ -33,16 +33,3 @@ def normpath(path):
return os.path.normpath(path)
return os.path.normpath(os.path.join(os.environ['ORIG_CWD'], path))
-
-
-def file_lines(filename):
- """ Return a files content, line by line
-
- Args:
- filename: path to the file
-
- Returns:
- an list, in which each item is a line of the file
- """
- with open(filename, "r") as fd:
- return fd.readlines()
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index d8843790350c..bb77952faf68 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -57,9 +57,9 @@ def test_list_keyboards():
def test_list_keymaps():
- result = check_subcommand("list-keymaps", "-kb", "planck/ez")
+ result = check_subcommand("list-keymaps", "-kb", "handwired/onekey/pytest")
assert result.returncode == 0
- assert "planck/ez:default" and "planck/ez:drashna" in result.stdout
+ assert "default" and "test" in result.stdout
def test_list_keymaps_no_keyboard_found():
From 512261b3437820294dc2915dcb837bb488d53253 Mon Sep 17 00:00:00 2001
From: Erovia
Date: Sat, 25 Jan 2020 22:30:57 +0100
Subject: [PATCH 055/108] Pathlib-ify qmk.keymap.list_keymaps()
---
lib/python/qmk/keymap.py | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index afb001f3e0e9..721a0deca056 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -1,6 +1,7 @@
"""Functions that help you work with QMK keymaps.
"""
import os
+from pathlib import Path
import qmk.path
import qmk.makefile
@@ -112,22 +113,22 @@ def list_keymaps(keyboard_name):
if rules_mk:
# qmk_firmware/keyboards
- keyboards_dir = os.path.join(os.getcwd(), "keyboards")
+ keyboards_dir = Path.cwd() / "keyboards"
# path to the keyboard's directory
- kb_path = os.path.join(keyboards_dir, keyboard_name)
+ kb_path = keyboards_dir / keyboard_name
# walk up the directory tree until keyboards_dir
# and collect all directories' name with keymap.c file in it
while kb_path != keyboards_dir:
- keymaps_dir = os.path.join(kb_path, "keymaps")
- if os.path.exists(keymaps_dir):
- names = names.union([keymap for keymap in os.listdir(keymaps_dir) if os.path.isfile(os.path.join(keymaps_dir, keymap, "keymap.c"))])
- kb_path = os.path.dirname(kb_path)
+ keymaps_dir = kb_path / "keymaps"
+ if keymaps_dir.exists():
+ names = names.union([keymap for keymap in os.listdir(keymaps_dir) if (keymaps_dir / keymap / "keymap.c").is_file()])
+ kb_path = kb_path.parent
# if community layouts are supported, get them
if "LAYOUTS" in rules_mk:
for layout in rules_mk["LAYOUTS"].split():
- cl_path = os.path.join(os.getcwd(), "layouts", "community", layout)
- if os.path.exists(cl_path):
- names = names.union([keymap for keymap in os.listdir(cl_path) if os.path.isfile(os.path.join(cl_path, keymap, "keymap.c"))])
+ cl_path = Path.cwd() / "layouts" / "community" / layout
+ if cl_path.exists():
+ names = names.union([keymap for keymap in os.listdir(cl_path) if (cl_path / keymap / "keymap.c").is_file()])
return sorted(names)
From 58101cbb73a16678280d8a0cea275d680b603e58 Mon Sep 17 00:00:00 2001
From: skullY
Date: Sat, 15 Feb 2020 15:05:59 -0800
Subject: [PATCH 056/108] fix list_keymaps for python 3.5
---
lib/python/qmk/keymap.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index 721a0deca056..15a91a276bdf 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -121,7 +121,7 @@ def list_keymaps(keyboard_name):
while kb_path != keyboards_dir:
keymaps_dir = kb_path / "keymaps"
if keymaps_dir.exists():
- names = names.union([keymap for keymap in os.listdir(keymaps_dir) if (keymaps_dir / keymap / "keymap.c").is_file()])
+ names = names.union([keymap for keymap in os.listdir(str(keymaps_dir)) if (keymaps_dir / keymap / "keymap.c").is_file()])
kb_path = kb_path.parent
# if community layouts are supported, get them
@@ -129,6 +129,6 @@ def list_keymaps(keyboard_name):
for layout in rules_mk["LAYOUTS"].split():
cl_path = Path.cwd() / "layouts" / "community" / layout
if cl_path.exists():
- names = names.union([keymap for keymap in os.listdir(cl_path) if (cl_path / keymap / "keymap.c").is_file()])
+ names = names.union([keymap for keymap in os.listdir(str(cl_path)) if (cl_path / keymap / "keymap.c").is_file()])
return sorted(names)
From 89c3355fd8bbdc97f3b5fb67c54661de1e7f2307 Mon Sep 17 00:00:00 2001
From: spe2
Date: Sat, 15 Feb 2020 22:05:20 -0700
Subject: [PATCH 057/108] [Keyboard] Add configs for Centromere keyboard
(#7467)
* Create readme.md
* Add files for Centromere
* Add keymap files for Centromere
* Add default keymap for Centromere
* Create keymap directory
* Add keymap files
* keymap directory cleanup
* Keyboard keymap directory cleanup
* Update keyboards/centromere/config.h
Co-Authored-By: Drashna Jaelre
* Update keyboards/centromere/config.h
Co-Authored-By: Drashna Jaelre
* Update keyboards/centromere/config.h
Co-Authored-By: Drashna Jaelre
* Update keymap.c
* Update keymap.c
* Update centromere.c
Changed LED control to GPIO functions
* Update centromere.h
* Update rules.mk
* Update keyboards/centromere/rules.mk
Co-Authored-By: fauxpark
* Update keyboards/centromere/rules.mk
Co-Authored-By: fauxpark
* Update keyboards/centromere/rules.mk
Co-Authored-By: fauxpark
* Update keyboards/centromere/rules.mk
Co-Authored-By: fauxpark
* Update keyboards/centromere/keymaps/default_u2/keymap.c
Co-Authored-By: fauxpark
* Update keyboards/centromere/rules.mk
Co-Authored-By: fauxpark
* Update keyboards/centromere/keymaps/default/keymap.c
Co-Authored-By: fauxpark
* Update keyboards/centromere/centromere.h
Co-Authored-By: fauxpark
* Update keyboards/centromere/centromere.h
Co-Authored-By: fauxpark
* Update keyboards/centromere/centromere.h
Co-Authored-By: fauxpark
* Update keyboards/centromere/rules.mk
Co-Authored-By: fauxpark
* Update keyboards/centromere/centromere.c
Co-Authored-By: fauxpark
* Update keyboards/centromere/centromere.h
Co-Authored-By: fauxpark
* Update keyboards/centromere/centromere.h
Co-Authored-By: fauxpark
* Update keyboards/centromere/rules.mk
Co-Authored-By: fauxpark
* Apply suggestions from code review
Co-Authored-By: fauxpark
Co-authored-by: Drashna Jaelre
Co-authored-by: fauxpark
---
keyboards/centromere/centromere.c | 48 ++++++
keyboards/centromere/centromere.h | 47 ++++++
keyboards/centromere/config.h | 76 +++++++++
keyboards/centromere/keymaps/default/keymap.c | 69 ++++++++
.../centromere/keymaps/default_u2/keymap.c | 68 ++++++++
.../centromere/keymaps/default_u2/rules.mk | 12 ++
keyboards/centromere/matrix.c | 153 ++++++++++++++++++
keyboards/centromere/readme.md | 1 +
keyboards/centromere/rules.mk | 42 +++++
9 files changed, 516 insertions(+)
create mode 100644 keyboards/centromere/centromere.c
create mode 100644 keyboards/centromere/centromere.h
create mode 100644 keyboards/centromere/config.h
create mode 100644 keyboards/centromere/keymaps/default/keymap.c
create mode 100644 keyboards/centromere/keymaps/default_u2/keymap.c
create mode 100644 keyboards/centromere/keymaps/default_u2/rules.mk
create mode 100644 keyboards/centromere/matrix.c
create mode 100644 keyboards/centromere/readme.md
create mode 100644 keyboards/centromere/rules.mk
diff --git a/keyboards/centromere/centromere.c b/keyboards/centromere/centromere.c
new file mode 100644
index 000000000000..8800e2ce6adc
--- /dev/null
+++ b/keyboards/centromere/centromere.c
@@ -0,0 +1,48 @@
+#include "centromere.h"
+
+void uart_init(void) {
+ SERIAL_UART_INIT();
+}
+
+void led_init(void) {
+#if MCU == atmega32u2
+ setPinOutput(C4); // Set red LED pin as output
+ setPinOutput(C5); // Set blue LED pin as output
+ setPinOutput(D1); // Set green LED pin as output
+
+ writePinHigh(C4); // Turn off red LED pin
+ writePinHigh(C5); // Turn off blue LED pin
+ writePinHigh(D1); // Turn off green LED pin
+
+#else
+
+ setPinOutput(F4); // Set red LED pin as output
+ setPinOutput(F5); // Set blue LED pin as output
+ setPinOutput(D1); // Set green LED pin as output
+
+ writePinHigh(F4); // Turn off red LED pin
+ writePinHigh(F5); // Turn off blue LED pin
+ writePinHigh(D1); // Turn off green LED pin
+
+#endif
+
+}
+
+void matrix_init_kb(void) {
+ // put your keyboard start-up code here
+ // runs once when the firmware starts up
+ matrix_init_user();
+ uart_init();
+ led_init();
+}
+
+#ifdef SWAP_HANDS_ENABLE
+__attribute__ ((weak))
+const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
+{{9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
+{{9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},
+{{9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}},
+{{9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}},
+{{9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}},
+};
+#endif
diff --git a/keyboards/centromere/centromere.h b/keyboards/centromere/centromere.h
new file mode 100644
index 000000000000..826e8dde4481
--- /dev/null
+++ b/keyboards/centromere/centromere.h
@@ -0,0 +1,47 @@
+#pragma once
+
+#include "quantum.h"
+
+#if MCU == atmega32u2
+#define red_led_off writePinHigh(C5)
+#define red_led_on writePinLow(C5)
+#define blu_led_off writePinHigh(C4)
+#define blu_led_on writePinLow(C4)
+
+#else
+#define red_led_off writePinHigh(F5)
+#define red_led_on writePinLow(F5)
+#define blu_led_off writePinHigh(F4)
+#define blu_led_on writePinLow(F4)
+
+#endif
+
+#define grn_led_off writePinHigh(D1)
+#define grn_led_on writePinLow(D1)
+
+#define set_led_off red_led_off; blu_led_off
+#define set_led_red red_led_on; grn_led_off; blu_led_off
+#define set_led_blue red_led_off; grn_led_off; blu_led_on
+#define set_led_green red_led_off; grn_led_on; blu_led_off
+#define set_led_yellow red_led_on; grn_led_on; blu_led_off
+#define set_led_magenta red_led_on; grn_led_off; blu_led_on
+#define set_led_cyan red_led_off; grn_led_on; blu_led_on
+#define set_led_white red_led_on; grn_led_on; blu_led_on
+
+
+// This a shortcut to help you visually see your layout.
+// The first section contains all of the arguments
+// The second converts the arguments into a two-dimensional array
+#define LAYOUT( \
+ k0a, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0b, \
+ k1a, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1b,\
+ k2a, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2b,\
+ k32, k33, k34, k35, k36, k37 \
+) \
+ { \
+ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \
+ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
+ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \
+ { KC_NO, KC_NO, k32, k33, k34, k35, k36, k37, KC_NO, KC_NO }, \
+ { KC_NO, KC_NO, k2a, k1a, k0a, k0b, k1b, k2b, KC_NO, KC_NO } \
+ }
diff --git a/keyboards/centromere/config.h b/keyboards/centromere/config.h
new file mode 100644
index 000000000000..c051843c5013
--- /dev/null
+++ b/keyboards/centromere/config.h
@@ -0,0 +1,76 @@
+/*
+Copyright 2012 Jun Wako
+
+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 .
+*/
+
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x6060
+#define DEVICE_VER 0x0001
+#define MANUFACTURER Southpaw Design
+#define PRODUCT centromere
+#define DESCRIPTION Q.M.K. keyboard firmware for Centromere
+
+/* key matrix size */
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 10
+
+/* define if matrix has ghost */
+//#define MATRIX_HAS_GHOST
+
+/* number of backlight levels */
+//#define BACKLIGHT_LEVELS 3
+
+#define ONESHOT_TIMEOUT 500
+
+/*
+ * Feature disable options
+ * These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+
+//UART settings for communication with the RF microcontroller
+#define SERIAL_UART_BAUD 500000
+#define SERIAL_UART_DATA UDR1
+#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1)
+#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1))
+#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1))
+#define SERIAL_UART_INIT() do { \
+ /* baud rate */ \
+ UBRR1L = SERIAL_UART_UBRR; \
+ /* baud rate */ \
+ UBRR1H = SERIAL_UART_UBRR >> 8; \
+ /* enable TX and RX */ \
+ UCSR1B = _BV(TXEN1) | _BV(RXEN1); \
+ /* 8-bit data */ \
+ UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \
+ } while(0)
diff --git a/keyboards/centromere/keymaps/default/keymap.c b/keyboards/centromere/keymaps/default/keymap.c
new file mode 100644
index 000000000000..ca235f61f5a9
--- /dev/null
+++ b/keyboards/centromere/keymaps/default/keymap.c
@@ -0,0 +1,69 @@
+#include QMK_KEYBOARD_H
+
+enum centromere_layers
+{
+ _STD,
+ _NUM,
+ _FN
+};
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [_STD] = LAYOUT( \
+ //,-----------------------------------------------------. ,-----------------------------------------------------.
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,\
+ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
+ KC_LGUI, MO(_FN), KC_SPC, KC_SPC,MO(_NUM), KC_RALT \
+ //`--------------------------' `--------------------------'
+
+ ),
+
+
+ [_NUM] = LAYOUT( \
+ //,-----------------------------------------------------. ,-----------------------------------------------------.
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ 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_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, KC_ENT,\
+ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
+ KC_LGUI, MO(_FN), KC_SPC, KC_ENT,MO(_NUM), KC_RALT \
+ //`--------------------------' `--------------------------'
+ ),
+
+ [_FN] = LAYOUT( \
+ //,-----------------------------------------------------. ,-----------------------------------------------------.
+ KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ KC_LCTL, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD,\
+
+ KC_LGUI, MO(_FN), KC_SPC, KC_ENT,MO(_NUM), KC_RALT \
+ //`--------------------------' `--------------------------'
+ ),
+
+};
+
+void matrix_scan_user(void) {
+ uint8_t layer = get_highest_layer(layer_state);
+
+ switch (layer) {
+ case _STD:
+ set_led_off;
+ break;
+ case _FN:
+ set_led_blue;
+ break;
+ case _NUM:
+ set_led_red;
+ break;
+ default:
+ break;
+ }
+};
diff --git a/keyboards/centromere/keymaps/default_u2/keymap.c b/keyboards/centromere/keymaps/default_u2/keymap.c
new file mode 100644
index 000000000000..c704adc58cd6
--- /dev/null
+++ b/keyboards/centromere/keymaps/default_u2/keymap.c
@@ -0,0 +1,68 @@
+#include QMK_KEYBOARD_H
+
+enum centromere_layers
+{
+ _STD,
+ _NUM,
+ _FN
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [_STD] = LAYOUT( \
+ //,-----------------------------------------------------. ,-----------------------------------------------------.
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,\
+ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
+ KC_LGUI, MO(_FN), KC_SPC, KC_SPC,MO(_NUM), KC_RALT \
+ //`--------------------------' `--------------------------'
+
+ ),
+
+
+ [_NUM] = LAYOUT( \
+ //,-----------------------------------------------------. ,-----------------------------------------------------.
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ 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_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, KC_ENT,\
+ //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
+ KC_LGUI, MO(_FN), KC_SPC, KC_ENT,MO(_NUM), KC_RALT \
+ //`--------------------------' `--------------------------'
+ ),
+
+ [_FN] = LAYOUT( \
+ //,-----------------------------------------------------. ,-----------------------------------------------------.
+ KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ KC_LCTL, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV,\
+ //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
+ KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_BSLS, KC_TILD,\
+
+ KC_LGUI, MO(_FN), KC_SPC, KC_ENT,MO(_NUM), KC_RALT \
+ //`--------------------------' `--------------------------'
+ ),
+
+};
+
+void matrix_scan_user(void) {
+ uint8_t layer = get_highest_layer(layer_state);
+
+ switch (layer) {
+ case _STD:
+ set_led_off;
+ break;
+ case _FN:
+ set_led_blue;
+ break;
+ case _NUM:
+ set_led_red;
+ break;
+ default:
+ break;
+ }
+};
diff --git a/keyboards/centromere/keymaps/default_u2/rules.mk b/keyboards/centromere/keymaps/default_u2/rules.mk
new file mode 100644
index 000000000000..5fdb02af5ac1
--- /dev/null
+++ b/keyboards/centromere/keymaps/default_u2/rules.mk
@@ -0,0 +1,12 @@
+# MCU name
+MCU = atmega32u2
+
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = atmel-dfu
diff --git a/keyboards/centromere/matrix.c b/keyboards/centromere/matrix.c
new file mode 100644
index 000000000000..c5fc8db6ce94
--- /dev/null
+++ b/keyboards/centromere/matrix.c
@@ -0,0 +1,153 @@
+/*
+Copyright 2012 Jun Wako
+Copyright 2014 Jack Humbert
+
+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 .
+*/
+#include
+#include
+#if defined(__AVR__)
+#include
+#endif
+#include "wait.h"
+#include "print.h"
+#include "debug.h"
+#include "util.h"
+#include "matrix.h"
+#include "timer.h"
+
+#if (MATRIX_COLS <= 8)
+# define print_matrix_header() print("\nr/c 01234567\n")
+# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
+# define matrix_bitpop(i) bitpop(matrix[i])
+# define ROW_SHIFTER ((uint8_t)1)
+#elif (MATRIX_COLS <= 16)
+# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
+# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
+# define matrix_bitpop(i) bitpop16(matrix[i])
+# define ROW_SHIFTER ((uint16_t)1)
+#elif (MATRIX_COLS <= 32)
+# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
+# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
+# define matrix_bitpop(i) bitpop32(matrix[i])
+# define ROW_SHIFTER ((uint32_t)1)
+#endif
+
+/* matrix state(1:on, 0:off) */
+static matrix_row_t matrix[MATRIX_ROWS];
+
+
+__attribute__ ((weak))
+void matrix_init_kb(void) {
+ matrix_init_user();
+}
+
+__attribute__ ((weak))
+void matrix_scan_kb(void) {
+ matrix_scan_user();
+}
+
+__attribute__ ((weak))
+void matrix_init_user(void) {
+}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {
+}
+
+inline
+uint8_t matrix_rows(void) {
+ return MATRIX_ROWS;
+}
+
+inline
+uint8_t matrix_cols(void) {
+ return MATRIX_COLS;
+}
+
+void matrix_init(void) {
+
+ matrix_init_quantum();
+}
+
+uint8_t matrix_scan(void)
+{
+ SERIAL_UART_INIT();
+
+ uint32_t timeout = 0;
+
+ //the s character requests the RF remote slave to send the matrix information
+ SERIAL_UART_DATA = 's';
+
+ //trust the external keystates, erase the last set of data
+ uint8_t uart_data[11] = {0};
+
+ //there are 10 bytes corresponding to 1w columns, and an end byte
+ for (uint8_t i = 0; i < 11; i++) {
+ //wait for the serial data, timeout if it's been too long
+ while(!SERIAL_UART_RXD_PRESENT){
+ timeout++;
+ if (timeout > 10000){
+ break;
+ }
+ }
+ uart_data[i] = SERIAL_UART_DATA;
+ }
+
+ //check for the end packet, the key state bytes use the LSBs, so 0xE0
+ //will only show up here if the correct bytes were recieved
+ if (uart_data[10] == 0xE0)
+ {
+ //shifting and transferring the keystates to the QMK matrix variable
+ for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+ matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 5;
+ }
+ }
+
+
+ matrix_scan_quantum();
+ return 1;
+}
+
+inline
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+ return (matrix[row] & ((matrix_row_t)1<
Date: Sun, 16 Feb 2020 11:29:36 -0800
Subject: [PATCH 058/108] [Keyboard] Correct Chidori Configurator layout data
(#8180)
---
keyboards/chidori/info.json | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/keyboards/chidori/info.json b/keyboards/chidori/info.json
index 49e8c5d40fbb..8a24d1a92687 100644
--- a/keyboards/chidori/info.json
+++ b/keyboards/chidori/info.json
@@ -1,24 +1,25 @@
{
- "keyboard_name": "Chidori",
- "url": "",
- "maintainer": "ka2hiro",
- "width": 12,
- "height": 4,
+ "keyboard_name": "Chidori",
+ "url": "",
+ "maintainer": "ka2hiro",
+ "width": 13,
+ "height": 4,
"layouts": {
"LAYOUT": {
"layout": [
- {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0},
- {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1},
- {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2},
- {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}
+ {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0},
+ {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1},
+ {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2},
+ {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}
]
},
"LAYOUT_extended": {
+ "width": 20,
"layout": [
- {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0},
- {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1},
- {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2},
- {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":15, "y":3}
+ {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":16, "y":0}, {"x":17, "y":0}, {"x":18, "y":0}, {"x":19, "y":0},
+ {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":16, "y":1}, {"x":17, "y":1}, {"x":18, "y":1}, {"x":19, "y":1},
+ {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":14, "y":2}, {"x":15, "y":2}, {"x":16, "y":2}, {"x":17, "y":2}, {"x":18, "y":2}, {"x":19, "y":2},
+ {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":16, "y":3}, {"x":17, "y":3}, {"x":18, "y":3}, {"x":19, "y":3}
]
}
}
From 17ff5512757e05cd3b4e27066c24ac697fa8da9c Mon Sep 17 00:00:00 2001
From: Joel Challis
Date: Sun, 16 Feb 2020 19:37:21 +0000
Subject: [PATCH 059/108] Convert f072 backlight build error to message (#8177)
---
docs/feature_backlight.md | 2 +-
quantum/backlight/backlight_arm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md
index 22abaa60a8fe..e74aab1e378d 100644
--- a/docs/feature_backlight.md
+++ b/docs/feature_backlight.md
@@ -167,7 +167,7 @@ BACKLIGHT_DRIVER = pwm
Currently only hardware PWM is supported, not timer assisted, and does not provide automatic configuration.
-?> STMF072 support is being investigated.
+?> Backlight support for STMF072 has had limited testing, YMMV. If unsure, set `BACKLIGHT_ENABLE = no` in your rules.mk.
### ARM Configuration
diff --git a/quantum/backlight/backlight_arm.c b/quantum/backlight/backlight_arm.c
index f7065906f8b2..397a1ac1a8ab 100644
--- a/quantum/backlight/backlight_arm.c
+++ b/quantum/backlight/backlight_arm.c
@@ -7,7 +7,7 @@
#ifdef BACKLIGHT_PIN
# if defined(STM32F0XX) || defined(STM32F0xx)
-# error "Backlight support for STMF072 is not available. Please disable."
+# pragma message("Backlight support for STMF072 has had limited testing, YMMV. If unsure, set 'BACKLIGHT_ENABLE = no' in your rules.mk")
# endif
// GPIOV2 && GPIOV3
From de462761c996eb83a447fb9f668cd254d4284849 Mon Sep 17 00:00:00 2001
From: MechMerlin <30334081+mechmerlin@users.noreply.github.com>
Date: Sun, 16 Feb 2020 11:42:03 -0800
Subject: [PATCH 060/108] [Keyboard] VIA Support: DZ60RGB ANSI V1/V2 (#8159)
* add dz60 via support
* use the correct DZ vendor id dervied from dz60
* differentiate product ID of v2 board
---
.../dztech/dz60rgb_ansi/keymaps/via/keymap.c | 33 +++++++++++++++++++
.../dztech/dz60rgb_ansi/keymaps/via/rules.mk | 2 ++
keyboards/dztech/dz60rgb_ansi/v1/config.h | 2 +-
keyboards/dztech/dz60rgb_ansi/v2/config.h | 4 +--
4 files changed, 38 insertions(+), 3 deletions(-)
create mode 100644 keyboards/dztech/dz60rgb_ansi/keymaps/via/keymap.c
create mode 100644 keyboards/dztech/dz60rgb_ansi/keymaps/via/rules.mk
diff --git a/keyboards/dztech/dz60rgb_ansi/keymaps/via/keymap.c b/keyboards/dztech/dz60rgb_ansi/keymaps/via/keymap.c
new file mode 100644
index 000000000000..9ad5872d4feb
--- /dev/null
+++ b/keyboards/dztech/dz60rgb_ansi/keymaps/via/keymap.c
@@ -0,0 +1,33 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_60_ansi(
+ KC_GESC, 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,
+ 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,
+ CTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), MO(2), KC_RCTL
+ ),
+ [1] = LAYOUT_60_ansi(
+ KC_GESC, 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_DEL,
+ _______, _______, KC_UP, _______, _______, _______, KC_CALC, _______, KC_INS, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET,
+ _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______,
+ KC_MPRV, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, NK_TOGG, _______, _______, KC_END, KC_PGDN, KC_MNXT,
+ _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+ [2] = LAYOUT_60_ansi(
+ _______, 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_DEL,
+ _______, RGB_TOG, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, _______, _______, _______, RESET,
+ _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPI, RGB_SPD, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+
+ [3] = LAYOUT_60_ansi(
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______
+ )
+};
diff --git a/keyboards/dztech/dz60rgb_ansi/keymaps/via/rules.mk b/keyboards/dztech/dz60rgb_ansi/keymaps/via/rules.mk
new file mode 100644
index 000000000000..36b7ba9cbc98
--- /dev/null
+++ b/keyboards/dztech/dz60rgb_ansi/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+LTO_ENABLE = yes
diff --git a/keyboards/dztech/dz60rgb_ansi/v1/config.h b/keyboards/dztech/dz60rgb_ansi/v1/config.h
index 050f66c6fc7c..fb76ee7df9a8 100644
--- a/keyboards/dztech/dz60rgb_ansi/v1/config.h
+++ b/keyboards/dztech/dz60rgb_ansi/v1/config.h
@@ -1,7 +1,7 @@
#pragma once
/* USB Device descriptor parameter */
-#define VENDOR_ID 0xFEED
+#define VENDOR_ID 0x445A
#define PRODUCT_ID 0x1220
#define DEVICE_VER 0x0001
#define MANUFACTURER DZTECH
diff --git a/keyboards/dztech/dz60rgb_ansi/v2/config.h b/keyboards/dztech/dz60rgb_ansi/v2/config.h
index b357ceefe789..3bd287b5f244 100644
--- a/keyboards/dztech/dz60rgb_ansi/v2/config.h
+++ b/keyboards/dztech/dz60rgb_ansi/v2/config.h
@@ -1,8 +1,8 @@
#pragma once
/* USB Device descriptor parameter */
-#define VENDOR_ID 0xFEED
-#define PRODUCT_ID 0x1220
+#define VENDOR_ID 0x445A
+#define PRODUCT_ID 0x1221
#define DEVICE_VER 0x0002
#define MANUFACTURER DZTECH
#define PRODUCT DZ60RGB_ANSI
From e279b0a1a243638f811184284013288921e1a123 Mon Sep 17 00:00:00 2001
From: fauxpark
Date: Mon, 17 Feb 2020 06:45:42 +1100
Subject: [PATCH 061/108] Clean up some remaining rules.mk bootloader stuff
(#8165)
---
keyboards/dp60/keymaps/allleds/rules.mk | 39 +------------------
keyboards/handwired/dactyl_left/rules.mk | 5 +--
.../minorca/keymaps/ridingqwerty/rules.mk | 4 --
keyboards/handwired/owlet60/rules.mk | 21 +++-------
keyboards/maartenwut/minitomic/rules.mk | 3 +-
5 files changed, 10 insertions(+), 62 deletions(-)
diff --git a/keyboards/dp60/keymaps/allleds/rules.mk b/keyboards/dp60/keymaps/allleds/rules.mk
index 746d0bcb6464..1e3cebb14515 100644
--- a/keyboards/dp60/keymaps/allleds/rules.mk
+++ b/keyboards/dp60/keymaps/allleds/rules.mk
@@ -1,38 +1 @@
-# MCU name
-MCU = atmega32u4
-
-# Bootloader selection
-# Teensy halfkay
-# Pro Micro caterina
-# Atmel DFU atmel-dfu
-# LUFA DFU lufa-dfu
-# QMK DFU qmk-dfu
-# ATmega32A bootloadHID
-# ATmega328P USBasp
-BOOTLOADER = atmel-dfu
-
-# Build Options
-# change yes to no to disable
-#
-BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
-MOUSEKEY_ENABLE = no # Mouse keys
-EXTRAKEY_ENABLE = yes # Audio control and System control
-CONSOLE_ENABLE = no # Console for debug
-COMMAND_ENABLE = no # Commands for debug and configuration
-# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
-# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
-NKRO_ENABLE = no # USB Nkey Rollover
-BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
-MIDI_ENABLE = no # MIDI support
-UNICODE_ENABLE = no # Unicode
-BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
-AUDIO_ENABLE = no # Audio output on port C6
-FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
-RGBLIGHT_ENABLE = yes # Use RGB underglow light
-RGB_MATRIX_ENABLE = yes # Use RGB matrix
-
-LAYOUTS = 60_ansi 60_hhkb 60_iso 60_ansi_split_bs_rshift
-
-CUSTOM_MATRIX = yes
-SRC += matrix.c
+RGBLIGHT_ENABLE = yes
diff --git a/keyboards/handwired/dactyl_left/rules.mk b/keyboards/handwired/dactyl_left/rules.mk
index 61c123d03811..1ea1de18da1d 100644
--- a/keyboards/handwired/dactyl_left/rules.mk
+++ b/keyboards/handwired/dactyl_left/rules.mk
@@ -1,17 +1,16 @@
# MCU name
MCU = atmega32u4
-
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
-# atmega32a bootloadHID
+# ATmega32A bootloadHID
+# ATmega328P USBasp
BOOTLOADER = halfkay
-
# Build Options
# change yes to no to disable
#
diff --git a/keyboards/handwired/minorca/keymaps/ridingqwerty/rules.mk b/keyboards/handwired/minorca/keymaps/ridingqwerty/rules.mk
index ac798576a5d1..c3cea9618ebf 100644
--- a/keyboards/handwired/minorca/keymaps/ridingqwerty/rules.mk
+++ b/keyboards/handwired/minorca/keymaps/ridingqwerty/rules.mk
@@ -1,10 +1,6 @@
-MCU = atmega32u4
-BOOTLOADER = halfkay
-
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
-UNICODE_ENABLE = no # Unicode
UNICODEMAP_ENABLE = yes # Unicode Map
diff --git a/keyboards/handwired/owlet60/rules.mk b/keyboards/handwired/owlet60/rules.mk
index 6d8bdfd1c632..6c81dad09ce8 100644
--- a/keyboards/handwired/owlet60/rules.mk
+++ b/keyboards/handwired/owlet60/rules.mk
@@ -1,29 +1,16 @@
-SRC += matrix.c
-
# MCU name
MCU = atmega32u4
-
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
-# atmega32a bootloadHID
+# ATmega32A bootloadHID
+# ATmega328P USBasp
BOOTLOADER = caterina
-
-# If you don't know the bootloader type, then you can specify the
-# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
-# Teensy halfKay 512
-# Teensy++ halfKay 1024
-# Atmel DFU loader 4096
-# LUFA bootloader 4096
-# USBaspLoader 2048
-# OPT_DEFS += -DBOOTLOADER_SIZE=4096
-
-
# Build Options
# change yes to no to disable
#
@@ -45,4 +32,6 @@ AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
CUSTOM_MATRIX = yes
-OLED_DRIVER_ENABLE = no
\ No newline at end of file
+OLED_DRIVER_ENABLE = no
+
+SRC += matrix.c
\ No newline at end of file
diff --git a/keyboards/maartenwut/minitomic/rules.mk b/keyboards/maartenwut/minitomic/rules.mk
index d483b8db71d3..7af2b187037d 100644
--- a/keyboards/maartenwut/minitomic/rules.mk
+++ b/keyboards/maartenwut/minitomic/rules.mk
@@ -7,7 +7,8 @@ MCU = atmega32u4
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
-# atmega32a bootloadHID
+# ATmega32A bootloadHID
+# ATmega328P USBasp
BOOTLOADER = qmk-dfu
# Build Options
From eabdef3b4d304e668fcd9711c0e661a64cc96ba6 Mon Sep 17 00:00:00 2001
From: James Young <18669334+noroadsleft@users.noreply.github.com>
Date: Sun, 16 Feb 2020 12:14:19 -0800
Subject: [PATCH 062/108] [Keyboard] Add Panc40 by Panc Interactive (#8175)
* Add Panc40 by Panc Interactive
* Fix LAYOUT_sebright macro
---
keyboards/panc40/config.h | 41 +++++
keyboards/panc40/info.json | 152 ++++++++++++++++++
keyboards/panc40/keymaps/default/keymap.c | 20 +++
keyboards/panc40/keymaps/default/readme.md | 33 ++++
.../panc40/keymaps/default_minorca/keymap.c | 19 +++
.../panc40/keymaps/default_minorca/readme.md | 15 ++
.../panc40/keymaps/default_sebright/keymap.c | 20 +++
.../panc40/keymaps/default_sebright/readme.md | 15 ++
keyboards/panc40/panc40.c | 1 +
keyboards/panc40/panc40.h | 39 +++++
keyboards/panc40/readme.md | 15 ++
keyboards/panc40/rules.mk | 32 ++++
12 files changed, 402 insertions(+)
create mode 100644 keyboards/panc40/config.h
create mode 100644 keyboards/panc40/info.json
create mode 100644 keyboards/panc40/keymaps/default/keymap.c
create mode 100644 keyboards/panc40/keymaps/default/readme.md
create mode 100644 keyboards/panc40/keymaps/default_minorca/keymap.c
create mode 100644 keyboards/panc40/keymaps/default_minorca/readme.md
create mode 100644 keyboards/panc40/keymaps/default_sebright/keymap.c
create mode 100644 keyboards/panc40/keymaps/default_sebright/readme.md
create mode 100644 keyboards/panc40/panc40.c
create mode 100644 keyboards/panc40/panc40.h
create mode 100644 keyboards/panc40/readme.md
create mode 100644 keyboards/panc40/rules.mk
diff --git a/keyboards/panc40/config.h b/keyboards/panc40/config.h
new file mode 100644
index 000000000000..8a5243a446dc
--- /dev/null
+++ b/keyboards/panc40/config.h
@@ -0,0 +1,41 @@
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x6060
+#define DEVICE_VER 0x0001
+#define MANUFACTURER Panc Interactive
+#define PRODUCT Panc40
+#define DESCRIPTION QMK Firmware for Panc40
+
+/* key matrix size */
+#define MATRIX_ROWS 4
+#define MATRIX_COLS 12
+
+/* key matrix pins */
+#define MATRIX_ROW_PINS { F0, F1, F4, F5 }
+#define MATRIX_COL_PINS { F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, D0, D1 }
+#define UNUSED_PINS
+
+/* COL2ROW or ROW2COL */
+#define DIODE_DIRECTION COL2ROW
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCE 5
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
+
+#define RGB_DI_PIN D2
+#ifdef RGB_DI_PIN
+#define RGBLIGHT_ANIMATIONS
+#define RGBLED_NUM 8
+#define RGBLIGHT_HUE_STEP 8
+#define RGBLIGHT_SAT_STEP 8
+#define RGBLIGHT_VAL_STEP 8
+#endif
diff --git a/keyboards/panc40/info.json b/keyboards/panc40/info.json
new file mode 100644
index 000000000000..dc6b9e152ffe
--- /dev/null
+++ b/keyboards/panc40/info.json
@@ -0,0 +1,152 @@
+{
+ "keyboard_name": "Panc40",
+ "url": "",
+ "maintainer": "qmk",
+ "width": 12,
+ "height": 4,
+ "layouts": {
+ "LAYOUT_all": {
+ "key_count": 45,
+ "layout": [
+ {"label":"K00", "x":0, "y":0},
+ {"label":"K01", "x":1, "y":0},
+ {"label":"K02", "x":2, "y":0},
+ {"label":"K03", "x":3, "y":0},
+ {"label":"K04", "x":4, "y":0},
+ {"label":"K05", "x":5, "y":0},
+ {"label":"K06", "x":6, "y":0},
+ {"label":"K07", "x":7, "y":0},
+ {"label":"K08", "x":8, "y":0},
+ {"label":"K09", "x":9, "y":0},
+ {"label":"K0A", "x":10, "y":0},
+ {"label":"K0B", "x":11, "y":0},
+ {"label":"K10", "x":0, "y":1, "w":1.25},
+ {"label":"K11", "x":1.25, "y":1},
+ {"label":"K12", "x":2.25, "y":1},
+ {"label":"K13", "x":3.25, "y":1},
+ {"label":"K14", "x":4.25, "y":1},
+ {"label":"K15", "x":5.25, "y":1},
+ {"label":"K16", "x":6.25, "y":1},
+ {"label":"K17", "x":7.25, "y":1},
+ {"label":"K18", "x":8.25, "y":1},
+ {"label":"K19", "x":9.25, "y":1},
+ {"label":"K1A", "x":10.25, "y":1, "w":1.75},
+ {"label":"K20", "x":0, "y":2, "w":1.75},
+ {"label":"K21", "x":1.75, "y":2},
+ {"label":"K22", "x":2.75, "y":2},
+ {"label":"K23", "x":3.75, "y":2},
+ {"label":"K24", "x":4.75, "y":2},
+ {"label":"K25", "x":5.75, "y":2},
+ {"label":"K26", "x":6.75, "y":2},
+ {"label":"K27", "x":7.75, "y":2},
+ {"label":"K28", "x":8.75, "y":2},
+ {"label":"K29", "x":9.75, "y":2},
+ {"label":"K2B", "x":10.75, "y":2, "w":1.25},
+ {"label":"K30", "x":0, "y":3, "w":1.25},
+ {"label":"K31", "x":1.25, "y":3, "w":1.25},
+ {"label":"K32", "x":2.5, "y":3, "w":1.25},
+ {"label":"K33", "x":3.75, "y":3},
+ {"label":"K34", "x":4.75, "y":3},
+ {"label":"K35", "x":5.75, "y":3},
+ {"label":"K36", "x":6.75, "y":3},
+ {"label":"K37", "x":7.75, "y":3},
+ {"label":"K38", "x":8.75, "y":3},
+ {"label":"K39", "x":9.75, "y":3},
+ {"label":"K3B", "x":10.75, "y":3, "w":1.25}
+ ]
+ },
+ "LAYOUT_minorca": {
+ "key_count": 42,
+ "layout": [
+ {"label":"K00", "x":0, "y":0},
+ {"label":"K01", "x":1, "y":0},
+ {"label":"K02", "x":2, "y":0},
+ {"label":"K03", "x":3, "y":0},
+ {"label":"K04", "x":4, "y":0},
+ {"label":"K05", "x":5, "y":0},
+ {"label":"K06", "x":6, "y":0},
+ {"label":"K07", "x":7, "y":0},
+ {"label":"K08", "x":8, "y":0},
+ {"label":"K09", "x":9, "y":0},
+ {"label":"K0A", "x":10, "y":0},
+ {"label":"K0B", "x":11, "y":0},
+ {"label":"K10", "x":0, "y":1, "w":1.25},
+ {"label":"K11", "x":1.25, "y":1},
+ {"label":"K12", "x":2.25, "y":1},
+ {"label":"K13", "x":3.25, "y":1},
+ {"label":"K14", "x":4.25, "y":1},
+ {"label":"K15", "x":5.25, "y":1},
+ {"label":"K16", "x":6.25, "y":1},
+ {"label":"K17", "x":7.25, "y":1},
+ {"label":"K18", "x":8.25, "y":1},
+ {"label":"K19", "x":9.25, "y":1},
+ {"label":"K1A", "x":10.25, "y":1, "w":1.75},
+ {"label":"K20", "x":0, "y":2, "w":1.75},
+ {"label":"K21", "x":1.75, "y":2},
+ {"label":"K22", "x":2.75, "y":2},
+ {"label":"K23", "x":3.75, "y":2},
+ {"label":"K24", "x":4.75, "y":2},
+ {"label":"K25", "x":5.75, "y":2},
+ {"label":"K26", "x":6.75, "y":2},
+ {"label":"K27", "x":7.75, "y":2},
+ {"label":"K28", "x":8.75, "y":2},
+ {"label":"K29", "x":9.75, "y":2},
+ {"label":"K2B", "x":10.75, "y":2, "w":1.25},
+ {"label":"K30", "x":0, "y":3, "w":1.25},
+ {"label":"K31", "x":1.25, "y":3, "w":1.25},
+ {"label":"K32", "x":2.5, "y":3, "w":1.25},
+ {"label":"K34", "x":3.75, "y":3, "w":2.25},
+ {"label":"K36", "x":6, "y":3, "w":2.25},
+ {"label":"K38", "x":8.25, "y":3, "w":1.25},
+ {"label":"K39", "x":9.5, "y":3},
+ {"label":"K3B", "x":10.5, "y":3, "w":1.5}
+ ]
+ },
+ "LAYOUT_sebright": {
+ "key_count": 41,
+ "layout": [
+ {"label":"K00", "x":0, "y":0},
+ {"label":"K01", "x":1, "y":0},
+ {"label":"K02", "x":2, "y":0},
+ {"label":"K03", "x":3, "y":0},
+ {"label":"K04", "x":4, "y":0},
+ {"label":"K05", "x":5, "y":0},
+ {"label":"K06", "x":6, "y":0},
+ {"label":"K07", "x":7, "y":0},
+ {"label":"K08", "x":8, "y":0},
+ {"label":"K09", "x":9, "y":0},
+ {"label":"K0A", "x":10, "y":0},
+ {"label":"K0B", "x":11, "y":0},
+ {"label":"K10", "x":0, "y":1, "w":1.25},
+ {"label":"K11", "x":1.25, "y":1},
+ {"label":"K12", "x":2.25, "y":1},
+ {"label":"K13", "x":3.25, "y":1},
+ {"label":"K14", "x":4.25, "y":1},
+ {"label":"K15", "x":5.25, "y":1},
+ {"label":"K16", "x":6.25, "y":1},
+ {"label":"K17", "x":7.25, "y":1},
+ {"label":"K18", "x":8.25, "y":1},
+ {"label":"K19", "x":9.25, "y":1},
+ {"label":"K1A", "x":10.25, "y":1, "w":1.75},
+ {"label":"K20", "x":0, "y":2, "w":1.75},
+ {"label":"K21", "x":1.75, "y":2},
+ {"label":"K22", "x":2.75, "y":2},
+ {"label":"K23", "x":3.75, "y":2},
+ {"label":"K24", "x":4.75, "y":2},
+ {"label":"K25", "x":5.75, "y":2},
+ {"label":"K26", "x":6.75, "y":2},
+ {"label":"K27", "x":7.75, "y":2},
+ {"label":"K28", "x":8.75, "y":2},
+ {"label":"K29", "x":9.75, "y":2},
+ {"label":"K2B", "x":10.75, "y":2, "w":1.25},
+ {"label":"K31", "x":1.25, "y":3, "w":1.25},
+ {"label":"K32", "x":2.5, "y":3, "w":1.25},
+ {"label":"K33", "x":3.75, "y":3, "w":1.25},
+ {"label":"K35", "x":5, "y":3, "w":2.75},
+ {"label":"K37", "x":7.75, "y":3},
+ {"label":"K38", "x":8.75, "y":3},
+ {"label":"K39", "x":9.75, "y":3}
+ ]
+ }
+ }
+}
diff --git a/keyboards/panc40/keymaps/default/keymap.c b/keyboards/panc40/keymaps/default/keymap.c
new file mode 100644
index 000000000000..95bfa32c75b7
--- /dev/null
+++ b/keyboards/panc40/keymaps/default/keymap.c
@@ -0,0 +1,20 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [0] = LAYOUT_all(
+ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
+ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_BSLS,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MO(1),
+ KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, RGB_TOG
+ ),
+
+ [1] = LAYOUT_all(
+ RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+
+
+};
diff --git a/keyboards/panc40/keymaps/default/readme.md b/keyboards/panc40/keymaps/default/readme.md
new file mode 100644
index 000000000000..619243389e85
--- /dev/null
+++ b/keyboards/panc40/keymaps/default/readme.md
@@ -0,0 +1,33 @@
+# The default keymap for Panc40
+
+Supports both Minorca and Sebright layouts with one firmware.
+
+## Minorca layout
+
+```
+┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
+│Esc| Q | W | E | R | T | Y | U | I | O | P |BS │
+├───┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤
+│Tab │ A | S | D | F | G | H | J | K | L | \ | │
+├────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬────┤
+│Shift │ Z | X | C | V | B | N | M |, <│. >│Fn │
+├────┬─┴──┬┴───┼───┴───┴┬──┴───┴─┬─┴──┬┴──┬┴────┤
+│Ctrl│GUI │Alt │ Space | Space │GUI │Ctl│RGBTg|
+└────┴────┴────┴────────┴────────┴────┴───┴─────┘
+```
+
+## Sebright layout
+
+```
+┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
+│Esc| Q | W | E | R | T | Y | U | I | O | P |BS │
+├───┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤
+│Tab │ A | S | D | F | G | H | J | K | L | \ | │
+├────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬────┤
+│Shift │ Z | X | C | V | B | N | M |, <│. >│Fn │
+└────┬─┴──┬┴───┼───┴┬──┴───┴───┼───┼───┼───┼────┘
+ │GUI │Alt │Ent │ Space │Alt│GUI│Ctl│
+ └────┴────┴────┴──────────┴───┴───┴───┘
+```
+
+Both layouts use `Fn+Esc` to Reset.
diff --git a/keyboards/panc40/keymaps/default_minorca/keymap.c b/keyboards/panc40/keymaps/default_minorca/keymap.c
new file mode 100644
index 000000000000..76889bb7dc84
--- /dev/null
+++ b/keyboards/panc40/keymaps/default_minorca/keymap.c
@@ -0,0 +1,19 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [0] = LAYOUT_minorca(
+ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
+ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_BSLS,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MO(1),
+ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RGUI, KC_RCTL, RGB_TOG
+ ),
+
+ [1] = LAYOUT_minorca(
+ RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______
+ ),
+
+};
diff --git a/keyboards/panc40/keymaps/default_minorca/readme.md b/keyboards/panc40/keymaps/default_minorca/readme.md
new file mode 100644
index 000000000000..224d011c88a8
--- /dev/null
+++ b/keyboards/panc40/keymaps/default_minorca/readme.md
@@ -0,0 +1,15 @@
+# default_minorca
+
+```
+┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
+│Esc| Q | W | E | R | T | Y | U | I | O | P |BS │
+├───┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤
+│Tab │ A | S | D | F | G | H | J | K | L | \ | │
+├────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬────┤
+│Shift │ Z | X | C | V | B | N | M |, <│. >│Fn │
+├────┬─┴──┬┴───┼───┴───┴┬──┴───┴─┬─┴──┬┴──┬┴────┤
+│Ctrl│GUI │Alt │ Space | Space │GUI │Ctl│RGBTg|
+└────┴────┴────┴────────┴────────┴────┴───┴─────┘
+```
+
+`Fn+Esc` = `RESET`
diff --git a/keyboards/panc40/keymaps/default_sebright/keymap.c b/keyboards/panc40/keymaps/default_sebright/keymap.c
new file mode 100644
index 000000000000..f6ab057a9322
--- /dev/null
+++ b/keyboards/panc40/keymaps/default_sebright/keymap.c
@@ -0,0 +1,20 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [0] = LAYOUT_sebright(
+ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
+ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_BSLS,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MO(1),
+ KC_LGUI, KC_LALT, KC_ENT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL
+ ),
+
+ [1] = LAYOUT_sebright(
+ RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
+ _______, _______, _______, _______, _______, _______, _______
+ ),
+
+
+};
diff --git a/keyboards/panc40/keymaps/default_sebright/readme.md b/keyboards/panc40/keymaps/default_sebright/readme.md
new file mode 100644
index 000000000000..8d3de22e14ba
--- /dev/null
+++ b/keyboards/panc40/keymaps/default_sebright/readme.md
@@ -0,0 +1,15 @@
+# default_sebright
+
+```
+┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
+│Esc| Q | W | E | R | T | Y | U | I | O | P |BS │
+├───┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴───┤
+│Tab │ A | S | D | F | G | H | J | K | L | \ | │
+├────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬────┤
+│Shift │ Z | X | C | V | B | N | M |, <│. >│Fn │
+└────┬─┴──┬┴───┼───┴┬──┴───┴───┼───┼───┼───┼────┘
+ │GUI │Alt │Ent │ Space │Alt│GUI│Ctl│
+ └────┴────┴────┴──────────┴───┴───┴───┘
+```
+
+`Fn+Esc` = `RESET`
diff --git a/keyboards/panc40/panc40.c b/keyboards/panc40/panc40.c
new file mode 100644
index 000000000000..8f6bd92dfb4e
--- /dev/null
+++ b/keyboards/panc40/panc40.c
@@ -0,0 +1 @@
+#include "panc40.h"
diff --git a/keyboards/panc40/panc40.h b/keyboards/panc40/panc40.h
new file mode 100644
index 000000000000..f1e317d4944e
--- /dev/null
+++ b/keyboards/panc40/panc40.h
@@ -0,0 +1,39 @@
+#pragma once
+
+#include "quantum.h"
+
+#define LAYOUT_all( \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2B, \
+ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3B \
+) { \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_NO }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_NO, K2B }, \
+ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, KC_NO, K3B } \
+}
+
+#define LAYOUT_minorca( \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2B, \
+ K30, K31, K32, K34, K36, K38, K39, K3B \
+) { \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_NO }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_NO, K2B }, \
+ { K30, K31, K32, KC_NO, K34, KC_NO, K36, KC_NO, K38, K39, KC_NO, K3B } \
+}
+
+#define LAYOUT_sebright( \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2B, \
+ K31, K32, K33, K35, K37, K38, K39 \
+) { \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_NO }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, KC_NO, K2B }, \
+ { KC_NO, K31, K32, K33, KC_NO, K35, KC_NO, K37, K38, K39, KC_NO, KC_NO } \
+}
diff --git a/keyboards/panc40/readme.md b/keyboards/panc40/readme.md
new file mode 100644
index 000000000000..2549906e157a
--- /dev/null
+++ b/keyboards/panc40/readme.md
@@ -0,0 +1,15 @@
+# Panc40
+
+![Panc40](https://www.panc.co/uploads/4/0/3/7/4037410/dsc-1460-orig_orig.jpg)
+
+A 40% keyboard by [Panc Interactive](https://panc.co/) featuring hotswap sockets, RGB underglow and USB-C. Supports the Minorca and Sebright layouts.
+
+* Keyboard Maintainer: [The QMK Community](https://github.com/qmk)
+* Hardware Supported: Panc40 PCB, ATmega32U4
+* Hardware Availability: [Reddit Group Buy](https://www.reddit.com/r/mechmarket/comments/cdi2y2/gb_panc40_40_keyboard_group_buy_update/)
+
+Make example for this keyboard (after setting up your build environment):
+
+ make panc40:default
+
+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).
diff --git a/keyboards/panc40/rules.mk b/keyboards/panc40/rules.mk
new file mode 100644
index 000000000000..e8087f50f37e
--- /dev/null
+++ b/keyboards/panc40/rules.mk
@@ -0,0 +1,32 @@
+# MCU name
+MCU = atmega32u4
+
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = atmel-dfu
+
+# Build Options
+# change yes to no to disable
+#
+BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
+MOUSEKEY_ENABLE = yes # Mouse keys
+EXTRAKEY_ENABLE = yes # Audio control and System control
+CONSOLE_ENABLE = no # Console for debug
+COMMAND_ENABLE = no # Commands for debug and configuration
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+NKRO_ENABLE = yes # USB Nkey Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
+MIDI_ENABLE = no # MIDI support
+BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+AUDIO_ENABLE = no # Audio output on port C6
+FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs
From bbe8180ad904cd432b6f97e9662231fa0548ad0e Mon Sep 17 00:00:00 2001
From: umi <57262844+umi-umi@users.noreply.github.com>
Date: Mon, 17 Feb 2020 17:50:26 +0900
Subject: [PATCH 063/108] [Docs] add japanese translation (detail guide part)
(#7722)
* add detail-guide part
* some updates for easy reading
* some updates for easy reading
* some updates for easy reading
* some updates for easy reading
* some updates for easy reading
* some updates for easy reading
* some updates for easy reading
* some updates for easy reading
* update file based on comment
* update file based on comment
* update file based on comment
* update git command in header
* update files based on comments, and update git command in header
* update file based on comment
* update file based on comment
* update file based on comment
* update file based on comment
* update file based on comment
* update file based on comment
* update file based on comment
* update file based on comment
Co-Authored-By: shela
Co-Authored-By: Takeshi ISHII <2170248+mtei@users.noreply.github.com>
---
docs/ja/custom_quantum_functions.md | 518 +++++++++++++++++++++++++
docs/ja/flashing.md | 247 ++++++++++++
docs/ja/getting_started_build_tools.md | 146 +++++++
docs/ja/getting_started_make_guide.md | 153 ++++++++
docs/ja/getting_started_vagrant.md | 62 +++
docs/ja/keymap.md | 174 +++++++++
6 files changed, 1300 insertions(+)
create mode 100644 docs/ja/custom_quantum_functions.md
create mode 100644 docs/ja/flashing.md
create mode 100644 docs/ja/getting_started_build_tools.md
create mode 100644 docs/ja/getting_started_make_guide.md
create mode 100644 docs/ja/getting_started_vagrant.md
create mode 100644 docs/ja/keymap.md
diff --git a/docs/ja/custom_quantum_functions.md b/docs/ja/custom_quantum_functions.md
new file mode 100644
index 000000000000..f49df8f65b6c
--- /dev/null
+++ b/docs/ja/custom_quantum_functions.md
@@ -0,0 +1,518 @@
+# キーボードの挙動をカスタマイズする方法
+
+
+
+多くの人にとって、カスタムキーボードはボタンの押下をコンピュータに送信するだけではありません。単純なボタンの押下やマクロよりも複雑なことを実行できるようにしたいでしょう。QMK にはコードを挿入したり、機能を上書きしたり、様々な状況でキーボードの挙動をカスタマイズできるフックがあります。
+
+このページでは、QMK に関する特別な知識は想定していませんが、[QMK の理解](ja/understanding_qmk.md)を読むとより根本的なレベルで何が起きているかを理解するのに役立ちます。
+
+## コア、キーボード、キーマップ階層 :id=a-word-on-core-vs-keyboards-vs-keymap
+
+私たちは QMK を階層として構造化しました:
+
+* コア (`_quantum`)
+ * キーボード/リビジョン (`_kb`)
+ * キーマップ (`_user`)
+
+以下で説明される各関数は `_kb()` サフィックスあるいは `_user()` サフィックスを使って定義することができます。`_kb()` サフィックスはキーボード/リビジョンレベルで使うことを意図しており、一方で `_user()` サフィックスはキーマップレベルで使われるべきです。
+
+キーボード/リビジョンレベルで関数を定義する場合、`_kb()` は他の何かを実行する前に `_user()` を呼び出すよう実装することが重要です。そうでなければ、キーマップレベル関数は呼ばれないでしょう。
+
+# カスタムキーコード
+
+最も一般的なタスクは、既存のキーコードの挙動を変更するか、新しいキーコードを作成することです。コードの観点からは、それぞれの仕組みは非常に似ています。
+
+## 新しいキーコードの定義
+
+独自のカスタムキーコードを作成する最初のステップは、それらを列挙することです。これは、カスタムキーコードに名前を付け、そのキーコードにユニークな番号を割り当てることの両方を意味します。QMK は、カスタムキーコードを固定範囲の番号に制限するのではなく、`SAFE_RANGE` マクロを提供します。カスタムキーコードを列挙する時に `SAFE_RANGE` を使うと、ユニークな番号を取得することが保証されます。
+
+
+これは2つのキーコードを列挙する例です。このブロックを `keymap.c` に追加した後で、キーマップの中で `FOO` と `BAR` を使うことができます。
+
+```c
+enum my_keycodes {
+ FOO = SAFE_RANGE,
+ BAR
+};
+```
+
+## 任意のキーコードの挙動のプログラミング
+
+既存のキーの挙動を上書きしたい場合、あるいは新しいキーについて挙動を定義する場合、`process_record_kb()` および `process_record_user()` 関数を使うべきです。これらは実際のキーイベントが処理される前のキー処理中に QMK によって呼び出されます。これらの関数が `true` を返す場合、QMK はキーコードを通常通りに処理します。これは、キーを置き換えるのではなく、キーの機能を拡張するのに便利です。これらの関数が `false` を返す場合、QMK は通常のキー処理をスキップし、必要なキーのアップまたはダウンイベントを送信するのかはユーザ次第です。
+
+これらの関数はキーが押されるか放されるたびに呼び出されます。
+
+### `process_record_user()` の実装例
+
+この例は2つの事を行います。`FOO` と呼ばれるカスタムキーコードの挙動を定義し、Enter キーが押されるたびに音を再生します。
+
+```c
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case FOO:
+ if (record->event.pressed) {
+ // 押された時に何かをします
+ } else {
+ // 放された時に何かをします
+ }
+ return false; // このキーの以降の処理をスキップします
+ case KC_ENTER:
+ // enter が押された時に音を再生します
+ if (record->event.pressed) {
+ PLAY_NOTE_ARRAY(tone_qwerty);
+ }
+ return true; // QMK に enter のプレスまたはリリースイベントを送信させます
+ default:
+ return true; // 他の全てのキーコードを通常通りに処理します
+ }
+}
+```
+
+### `process_record_*` 関数のドキュメント
+
+* キーボード/リビジョン: `bool process_record_kb(uint16_t keycode, keyrecord_t *record)`
+* キーマップ: `bool process_record_user(uint16_t keycode, keyrecord_t *record)`
+
+`keycode` 引数はキーマップで定義されているものです。例えば `MO(1)`、`KC_L` など。これらのイベントを処理するには `switch...case` ブロックを使うべきです。
+
+`record` 引数は実際のプレスに関する情報を含みます:
+
+```c
+keyrecord_t record {
+ keyevent_t event {
+ keypos_t key {
+ uint8_t col
+ uint8_t row
+ }
+ bool pressed
+ uint16_t time
+ }
+}
+```
+
+# LED 制御
+
+QMK は HID 仕様で定義された5つの LED の読み取りメソッドを提供します:
+
+* Num Lock
+* Caps Lock
+* Scroll Lock
+* Compose
+* Kana
+
+ロック LED の状態を取得するには2つの方法があります:
+
+* `bool led_update_kb(led_t led_state)` あるいは `_user(led_t led_state)` を実装する、または
+* `led_t host_keyboard_led_state()` を呼び出す
+
+!> `host_keyboard_led_state()` は `led_update_user()` が呼ばれる前に新しい値を既に反映している場合があります。
+
+LED の状態を `uint8_t` として提供する2つの非推奨の関数があります:
+
+* `uint8_t led_set_kb(uint8_t usb_led)` と `_user(uint8_t usb_led)`
+* `uint8_t host_keyboard_leds()`
+
+## `led_update_user()`
+
+この関数はこれら5つの LED のいずれかの状態が変化すると呼ばれます。LED の状態を構造体のパラメータとして受け取ります。
+
+慣例により、`led_update_kb()` にそのコードを実行するようフックさせるために `led_update_user()` から `true` を返し、`led_update_kb()` でコードを実行したくない場合は `false` を返します。
+
+以下はいくつかの例です:
+
+- レイヤー表示のような何かのために LED を使うために LED を上書きする
+ - `_kb()` 関数を実行したくないので、`false` を返します。これはレイヤーの挙動を上書きするためです。
+- LED がオンあるいはオフになった時に音楽を再生する。
+ - `_kb` 関数を実行したいので、`true` を返します。これはデフォルトの LED の挙動に追加されます。
+
+?> `led_set_*` 関数は `bool` の代わりに `void` を返すため、キーボードの LED 制御を上書きすることができません。従って、代わりに `led_update_*` を使うことをお勧めします。
+
+### `led_update_kb()` の実装例
+
+```c
+bool led_update_kb(led_t led_state) {
+ bool res = led_update_user(led_state);
+ if(res) {
+ // writePin は 1 でピンを high に、0 で low に設定します。
+ // この例では、ピンは反転していて、
+ // low/0 は LED がオンになり、high/1 は LED がオフになります。
+ // この挙動は、LED がピンと VCC の間にあるか、ピンと GND の間にあるかどうかに依存します。
+ writePin(B0, !led_state.num_lock);
+ writePin(B1, !led_state.caps_lock);
+ writePin(B2, !led_state.scroll_lock);
+ writePin(B3, !led_state.compose);
+ writePin(B4, !led_state.kana);
+ }
+ return res;
+}
+```
+
+### `led_update_user()` の実装例
+
+この不完全な例は Caps Lock がオンまたはオフになった場合に音を再生します。また LED の状態を保持する必要があるため、`true` を返します。
+
+```c
+#ifdef AUDIO_ENABLE
+ float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
+ float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);
+#endif
+
+bool led_update_user(led_t led_state) {
+ #ifdef AUDIO_ENABLE
+ static uint8_t caps_state = 0;
+ if (caps_state != led_state.caps_lock) {
+ led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off);
+ caps_state = led_state.caps_lock;
+ }
+ #endif
+ return true;
+}
+```
+
+### `led_update_*` 関数のドキュメント
+
+* キーボード/リビジョン: `bool led_update_kb(led_t led_state)`
+* キーマップ: `bool led_update_user(led_t led_state)`
+
+## `host_keyboard_led_state()`
+
+最後に受信した LED の状態を `led_t` として取得するためにこの関数を呼びます。これは、`led_update_*` の外部から、例えば [`matrix_scan_user()`](#matrix-scanning-code) の中で LED の状態を読み取るのに便利です。
+
+## 物理的な LED の状態の設定
+
+一部のキーボードの実装は、物理的な LED の状態を設定するための便利なメソッドを提供しています。
+
+### Ergodox キーボード
+
+Ergodox の実装は、個々の LED をオンあるいはオフにするために `ergodox_right_led_1`/`2`/`3_on`/`off()` と、インデックスによってそれらをオンあるいはオフにするために `ergodox_right_led_on`/`off(uint8_t led)` を提供します。
+
+さらに、LED の明度を指定することができます。全ての LED に同じ明度を指定するなら `ergodox_led_all_set(uint8_t n)` を使い、個別の LED の明度を指定するなら `ergodox_right_led_1`/`2`/`3_set(uint8_t n)` を使い、LED のインデックスを指定して明度を指定するには `ergodox_right_led_set(uint8_t led, uint8_t n)` を使います。
+
+Ergodox キーボードは、最低の明度として `LED_BRIGHTNESS_LO` を、最高の輝度(これはデフォルトです)として `LED_BRIGHTNESS_HI` も定義しています。
+
+# キーボードの初期化コード
+
+キーボードの初期化プロセスには幾つかのステップがあります。何をしたいかによって、どの関数を使うべきかに影響します。
+
+3つの主な初期化関数があり、呼び出される順番にリストされています。
+
+* `keyboard_pre_init_*` - ほとんどのものが開始される前に起こります。非常に早くに実行したいハードウェアのセットアップに適しています。
+* `matrix_init_*` - ファームウェアのスタートアッププロセスの途中で起こります。ハードウェアは初期化されますが、機能はまだ初期化されていない場合があります。
+* `keyboard_post_init_*` - ファームウェアのスタートアッププロセスの最後に起こります。これはほとんどの場合、 "カスタマイズ"コードを配置する場所です。
+
+!> ほとんどの人にとって、`keyboard_post_init_user` が呼び出したいものです。例えば、ここで RGB アンダーグローのセットアップを行います。
+
+## キーボードの事前初期化コード
+
+これは USB さえ起動する前の、起動中の非常に早い段階で実行されます。
+
+この直後にマトリックスが初期化されます。
+
+これは主にハードウェア向きの初期化のためであるため、ほとんどのユーザは使うべきではありません。
+
+ただし、初期化が必要なハードウェアがある場合には、これが最適な場所です (LED ピンの初期化など)。
+
+### `keyboard_pre_init_user()` の実装例
+
+この例は、キーボードレベルで、LED ピンとして B0、B1、B2、B3 および B4 をセットアップします。
+
+```c
+void keyboard_pre_init_user(void) {
+ // キーボードの事前初期コードを呼び出します。
+
+ // LED ピンを出力として設定します
+ setPinOutput(B0);
+ setPinOutput(B1);
+ setPinOutput(B2);
+ setPinOutput(B3);
+ setPinOutput(B4);
+}
+```
+
+### `keyboard_pre_init_*` 関数のドキュメント
+
+* キーボード/リビジョン: `void keyboard_pre_init_kb(void)`
+* キーマップ: `void keyboard_pre_init_user(void)`
+
+## マトリックスの初期化コード
+
+これは、マトリックスが初期化され、ハードウェアの一部がセットアップされた後で、ただし機能の多くが初期化される前に、呼び出されます。
+
+他の場所で必要になるかもしれないものをセットアップするのに役立ちますが、ハードウェアに関連するものではなく、開始場所に依存するものでもありません。
+
+
+### `matrix_init_*` 関数のドキュメント
+
+* キーボード/リビジョン: `void matrix_init_kb(void)`
+* キーマップ: `void matrix_init_user(void)`
+
+
+## キーボードの事後初期化コード
+
+キーボードの初期化プロセスの極めて最後のタスクとして実行されます。この時点で初期化される必要があるような、特定の機能を変更したい場合に便利です。
+
+
+### `keyboard_post_init_user()` の実装例
+
+この例は、他の全てのものが初期化された後で実行され、rgb アンダーグローの設定をセットアップします。
+
+```c
+void keyboard_post_init_user(void) {
+ // post init コードを呼びます
+ rgblight_enable_noeeprom(); // 設定を保存せずに Rgb を有効にします
+ rgblight_sethsv_noeeprom(180, 255, 255); // 保存せずに色を青緑/シアンに設定します
+ rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); // 保存せずにモードを高速なブリージングに設定します
+}
+```
+
+### `keyboard_post_init_*` 関数のドキュメント
+
+* キーボード/リビジョン: `void keyboard_post_init_kb(void)`
+* キーマップ: `void keyboard_post_init_user(void)`
+
+# マトリックススキャンコード :id=matrix-scanning-code
+
+可能であれば常に `process_record_*()` を使ってキーボードをカスタマイズし、その方法でイベントをフックし、コードがキーボードのパフォーマンスに悪影響を与えないようにします。ただし、まれにマトリックススキャンにフックする必要があります。これらの関数は1秒あたり少なくとも10回は呼び出されるため、これらの関数のコードのパフォーマンスに非常に注意してください。
+
+### `matrix_scan_*` の実装例
+
+この例は意図的に省略されています。このようなパフォーマンスに敏感な領域にフックする前に、例を使わずにこれを書くために、QMK 内部について十分理解する必要があります。助けが必要であれば、[issue を開く](https://github.com/qmk/qmk_firmware/issues/new) か [Discord で会話](https://discord.gg/Uq7gcHh)してください。
+
+### `matrix_scan_*` 関数のドキュメント
+
+* キーボード/リビジョン: `void matrix_scan_kb(void)`
+* キーマップ: `void matrix_scan_user(void)`
+
+この関数はマトリックススキャンのたびに呼び出されます。これは基本的に MCU が処理できる頻度です。大量に実行されるため、ここに何を置くかについては注意してください。
+
+カスタムマトリックススキャンコードが必要な場合は、この関数を使う必要があります。また、カスタムステータス出力 (LED あるいはディスプレイなど)や、ユーザが入力していない場合でも定期的にトリガーするその他の機能のために使うことができます。
+
+
+# キーボードアイドリング/ウェイクコード
+
+キーボードがサポートしている場合、多くの機能を停止することで"アイドル"にすることができます。これの良い例は、RGB ライトあるいはバックライトです。これにより、電力消費を節約できるか、キーボードの動作が改善されるかもしれません。
+
+これは2つの関数によって制御されます: `suspend_power_down_*` および `suspend_wakeup_init_*`。これらはシステムキーボードがアイドルになった時と、起動した時のそれぞれで呼ばれます。
+
+
+### suspend_power_down_user() と suspend_wakeup_init_user() の実装例
+
+
+```c
+void suspend_power_down_user(void) {
+ rgb_matrix_set_suspend_state(true);
+}
+
+void suspend_wakeup_init_user(void) {
+ rgb_matrix_set_suspend_state(false);
+}
+```
+
+### キーボードサスペンド/ウェイク関数のドキュメント
+
+* キーボード/リビジョン : `void suspend_power_down_kb(void)` および `void suspend_wakeup_init_user(void)`
+* キーマップ: `void suspend_power_down_kb(void)` および `void suspend_wakeup_init_user(void)`
+
+# レイヤー切り替えコード
+
+これはレイヤーが切り替えられるたびにコードを実行します。レイヤー表示あるいはカスタムレイヤー処理に役立ちます。
+
+### `layer_state_set_*` の実装例
+
+この例は、レイヤーに基づいて [RGB アンダーグロー](ja/feature_rgblight.md)を設定する方法を示していて、Planck を例として使っています。
+
+```c
+layer_state_t layer_state_set_user(layer_state_t state) {
+ switch (get_highest_layer(state)) {
+ case _RAISE:
+ rgblight_setrgb (0x00, 0x00, 0xFF);
+ break;
+ case _LOWER:
+ rgblight_setrgb (0xFF, 0x00, 0x00);
+ break;
+ case _PLOVER:
+ rgblight_setrgb (0x00, 0xFF, 0x00);
+ break;
+ case _ADJUST:
+ rgblight_setrgb (0x7A, 0x00, 0xFF);
+ break;
+ default: // 他の全てのレイヤーあるいはデフォルトのレイヤー
+ rgblight_setrgb (0x00, 0xFF, 0xFF);
+ break;
+ }
+ return state;
+}
+```
+### `layer_state_set_*` 関数のドキュメント
+
+* キーボード/リビジョン: `layer_state_t layer_state_set_kb(layer_state_t state)`
+* キーマップ: `layer_state_t layer_state_set_user(layer_state_t state)`
+
+
+[キーマップの概要](ja/keymap.md#keymap-layer-status)で説明されるように、`state` はアクティブなレイヤーのビットマスクです。
+
+
+# 永続的な設定 (EEPROM)
+
+これによりキーボードのための永続的な設定を設定することができます。これらの設定はコントローラの EEPROM に保存され、電源が落ちた後であっても保持されます。設定は `eeconfig_read_kb` および `eeconfig_read_user` を使って読み取ることができ、`eeconfig_update_kb` および `eeconfig_update_user` を使って書きこむことができます。これは切り替え可能な機能 (rgb レイヤーの表示の切り替えなど)に役立ちます。さらに、`eeconfig_init_kb` および `eeconfig_init_user` を使って EEPROM のデフォルト値を設定できます。
+
+ここでの複雑な部分は、EEPROM を介してデータを保存およびアクセスできる方法がたくさんあり、これを行うための"正しい"方法が無いということです。ただし、各関数には DWORD (4 バイト)しかありません。
+
+EEPROM の書き込み回数には制限があることに注意してください。これは非常に高い値ですが、EEPROM に書き込むのはこれだけではなく、もし頻繁に書き込むと、MCU の寿命を大幅に短くする可能性があります。
+
+* この例を理解していない場合は、この機能はかなり複雑なため、この機能を使うことを避けても構いません。
+
+### 実装例
+
+これは、設定を追加し、読み書きする例です。この例では、ユーザキーマップを使っています。これは複雑な機能で、多くのことが行われています。実際、動作のために上記の多くの関数を使います!
+
+
+keymap.c ファイルの中で、先頭にこれを追加します:
+```c
+typedef union {
+ uint32_t raw;
+ struct {
+ bool rgb_layer_change :1;
+ };
+} user_config_t;
+
+user_config_t user_config;
+```
+
+これは、設定をメモリ内に保存し、EEPROM に書き込むことができる32ビット構造体をセットアップします。これを使うと、この構造体に変数が定義されるため、変数を定義する必要が無くなります。`bool` (boolean) の値は1ビットを使い、`uint8_t` は8ビットを使い、`uint16_t` は16ビットを使うことに注意してください。組み合わせて使うことができますが、順番の変更は読み書きされる値が変更されるため、問題が発生するかもしれません。
+
+`layer_state_set_*` 関数のために `rgb_layer_change` を使い、全てを設定するために `keyboard_post_init_user` および `process_record_user` を使います。
+
+ここで、上の `keyboard_post_init_user` コードを使って、作成したばかりの構造体を設定するために `eeconfig_read_user()` を追加します。そして、この構造体をすぐに使ってキーマップの機能を制御することができます。それは以下のようになります:
+```c
+void keyboard_post_init_user(void) {
+ // キーマップレベルのマトリックスの初期化処理を呼びます
+
+ // EEPROM からユーザ設定を読み込みます
+ user_config.raw = eeconfig_read_user();
+
+ // 有効な場合はデフォルトレイヤーを設定します
+ if (user_config.rgb_layer_change) {
+ rgblight_enable_noeeprom();
+ rgblight_sethsv_noeeprom_cyan();
+ rgblight_mode_noeeprom(1);
+ }
+}
+```
+上記の関数は読み取ったばかりの EEPROM 設定を使い、デフォルトのレイヤーの RGB 色を設定します。その「生の」値は、上で作成した「共用体」に基づいて使用可能な構造に変換されます。
+
+```c
+layer_state_t layer_state_set_user(layer_state_t state) {
+ switch (get_highest_layer(state)) {
+ case _RAISE:
+ if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
+ break;
+ case _LOWER:
+ if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); }
+ break;
+ case _PLOVER:
+ if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); }
+ break;
+ case _ADJUST:
+ if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); }
+ break;
+ default: // 他の全てのレイヤーあるいはデフォルトのレイヤー
+ if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); }
+ break;
+ }
+ return state;
+}
+```
+これにより、値が有効になっていた場合のみ、RGB アンダーグローが変更されます。この値を設定するために、`RGB_LYR` と呼ばれる `process_record_user` 用の新しいキーコードを作成します。さらに、通常の RGB コードを使う場合、上記の例を使ってオフになることを確認します。以下のようになります:
+```c
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case FOO:
+ if (record->event.pressed) {
+ // 押された時に何かをします
+ } else {
+ // 放された時に何かをします
+ }
+ return false; // このキーの以降の処理をスキップします
+ case KC_ENTER:
+ // enter が押された時に音を再生します
+ if (record->event.pressed) {
+ PLAY_NOTE_ARRAY(tone_qwerty);
+ }
+ return true; // QMK に enter のプレスまたはリリースイベントを送信させます
+ case RGB_LYR: // これにより、アンダーグローをレイヤー表示として、あるいは通常通りに使うことができます。
+ if (record->event.pressed) {
+ user_config.rgb_layer_change ^= 1; // 状態を切り替えます
+ eeconfig_update_user(user_config.raw); // 新しい状態を EEPROM に書き込みます
+ if (user_config.rgb_layer_change) { // レイヤーの状態表示が有効な場合
+ layer_state_set(layer_state); // すぐにレイヤーの色を更新します
+ }
+ }
+ return false; break;
+ case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // 任意の RGB コード に対して(quantum_keycodes.h を見てください。400行目参照)
+ if (record->event.pressed) { // これはレイヤー表示を無効にします。これを変更する場合は、無効にしたいだろうため。
+ if (user_config.rgb_layer_change) { // 有効な場合のみ
+ user_config.rgb_layer_change = false; // 無効にします
+ eeconfig_update_user(user_config.raw); // 設定を EEPROM に書き込みます
+ }
+ }
+ return true; break;
+ default:
+ return true; // 他の全てのキーコードを通常通りに処理します
+ }
+}
+```
+最後に、`eeconfig_init_user` 関数を追加して、EEPROM がリセットされた時にデフォルト値、さらにはカスタムアクションを指定できるようにします。EEPROM を強制的にリセットするには、`EEP_RST` キーコードあるいは[ブートマジック](ja/feature_bootmagic.md)機能を使います。例えば、デフォルトで rgb レイヤー表示を設定し、デフォルト値を保存したい場合。
+
+```c
+void eeconfig_init_user(void) { // EEPROM がリセットされます!
+ user_config.raw = 0;
+ user_config.rgb_layer_change = true; // デフォルトでこれを有効にします
+ eeconfig_update_user(user_config.raw); // デフォルト値を EEPROM に書き込みます
+
+ // これらの値も EEPROM に書き込むためには、noeeprom 以外のバージョンを使います
+ rgblight_enable(); // デフォルトで RGB を有効にします
+ rgblight_sethsv_cyan(); // デフォルトでシアンに設定します
+ rgblight_mode(1); // デフォルトでソリッドに設定します
+}
+```
+
+これで完了です。RGB レイヤー表示は必要な場合にのみ機能します。キーボードを取り外した後でも保存されます。RGB コードのいずれかを使うと、レイヤー表示が無効になり、設定したモードと色がそのままになります。
+
+### 'EECONFIG' 関数のドキュメント
+
+* キーボード/リビジョン: `void eeconfig_init_kb(void)`、`uint32_t eeconfig_read_kb(void)` および `void eeconfig_update_kb(uint32_t val)`
+* キーマップ: `void eeconfig_init_user(void)`、`uint32_t eeconfig_read_user(void)` および `void eeconfig_update_user(uint32_t val)`
+
+`val` は EEPROM に書き込みたいデータの値です。`eeconfig_read_*` 関数は EEPROM から32ビット(DWORD) 値を返します。
+
+# カスタムタッピング期間
+
+デフォルトでは、タッピング期間はグローバルに設定されていて、キーでは設定することができません。ほとんどのユーザにとって、これは全然問題ありません。しかし、場合によっては、`LT` キーとは異なるタイムアウトによって、デュアルファンクションキーが大幅に改善されます。なぜなら、一部のキーは他のキーよりも押し続けやすいためです。それぞれにカスタムキーコードを使う代わりに、キーごとに設定可能な `TAPPING_TERM` を使用できます。
+
+この機能を有効にするには、最初に `config.h` に `#define TAPPING_TERM_PER_KEY` を追加する必要があります。
+
+
+## `get_tapping_term` の実装例
+
+キーコードに基づいて `TAPPING TERM` を変更するには、次のようなものを `keymap.c` ファイルに追加します:
+
+```c
+uint16_t get_tapping_term(uint16_t keycode) {
+ switch (keycode) {
+ case SFT_T(KC_SPC):
+ return TAPPING_TERM + 1250;
+ case LT(1, KC_GRV):
+ return 130;
+ default:
+ return TAPPING_TERM;
+ }
+}
+```
+
+### `get_tapping_term` 関数のドキュメント
+
+ここにある他の多くの関数とは異なり、quantum あるいはキーボードレベルの関数を持つ必要はありません (または理由さえありません)。ここではユーザレベルの関数だけが有用なため、そのようにマークする必要はありません。
diff --git a/docs/ja/flashing.md b/docs/ja/flashing.md
new file mode 100644
index 000000000000..1118fb5e2f5d
--- /dev/null
+++ b/docs/ja/flashing.md
@@ -0,0 +1,247 @@
+# 書き込みの手順とブートローダ情報
+
+
+
+キーボードが使用するブートローダにはかなり多くの種類があり、ほぼ全てが異なる書き込みの方法を使います。幸いなことに、[QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) のようなプロジェクトは、あまり深く考える必要無しに様々なタイプと互換性を持つことを目指していますが、この文章では様々なタイプのブートローダとそれらを書き込むために利用可能な方法について説明します。
+
+`rules.mk` の `BOOTLOADER` 変数で選択されたブートローダがある場合、QMK は .hex ファイルがデバイスに書き込むのに適切なサイズかどうかを自動的に計算し、合計サイズをバイト単位で(最大値とともに)出力します。この処理を手動で実行するには、`check-size` を付けてコンパイルします。例えば、`make planck/rev4:default:check-size`。
+
+## DFU
+
+Atmel の DFU ブートローダはデフォルトで全ての atmega32u4 チップに搭載されており、PCB (旧 OLKB キーボード、Clueboard) に独自の IC を持つ多くのキーボードで使われています。一部のキーボードは、LUFA の DFU ブートローダ(または QMK のフォーク) (新しい OLKB キーボード)を使う場合もあり、そのハードウェアに固有の追加機能が追加されます。
+
+DFU ブートローダとの互換性を確保するために、以下のブロックが `rules.mk` にあることを確認してください(オプションとして代わりに `lufa-dfu` や `qmk-dfu` が使えます):
+
+```make
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = atmel-dfu
+```
+
+互換性のあるフラッシャ:
+
+* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (推奨の GUI)
+* QMK の [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` (推奨のコマンドライン)
+* [Atmel の Flip](http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip) (非推奨)
+
+書き込み手順:
+
+1. `RESET` キーコードを押すか、RESET ボタンをタップします(または RST を GND にショートします)。
+2. OS がデバイスを検知するのを待ちます。
+3. メモリを消去します(自動的に実行されるかもしれません)
+4. .hex ファイルを書き込みます
+5. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません)
+
+あるいは:
+
+ make ::dfu
+
+### QMK DFU
+
+QMK には LUFA DFU ブートローダのフォークがあり、ブートローダを終了してアプリケーションに戻る時に単純なマトリックススキャンを行うことができます。また、何かが起きた時に、LED を点滅したり、スピーカーでカチカチ音をたてたりします。これらの機能を有効にするには、`config.h` で以下のブロックを有効にします (ブートローダを終了するキーは、ここで定義された INPUT と OUTPUT に接続する必要があります):
+
+ #define QMK_ESC_OUTPUT F1 // 通常 COL
+ #define QMK_ESC_INPUT D5 // 通常 ROW
+ #define QMK_LED E6
+ #define QMK_SPEAKER C6
+
+製造元と製品名は `config.h` から自動的に取得され、製品に「Bootloader」が追加されます。
+
+このブートローダを生成するには、`bootloader` ターゲット、例えば `make planck/rev4:default:bootloader` を使います。
+
+実稼働対応の .hex ファイル(アプリケーションおよびブートローダを含む)を生成するには、`production` ターゲット、例えば `make planck/rev4:default:production` を使います。
+
+### DFU コマンド
+
+ファームウェアを DFU デバイスに書き込むために使用できる DFU コマンドがいくつかあります。
+
+* `:dfu` - これが通常のオプションで、DFU デバイスが使用可能になるまで待機したのちファームウェアを書き込みます。5秒ごとに、DFU デバイスが存在するかチェックしています。
+* `:dfu-ee` - 通常の hex ファイルの代わりに `eep` ファイルを書き込みます。これを使用するのはまれです。
+* `:dfu-split-left` - デフォルトオプション (`:dfu`) と同様に、通常のファームウェアが書き込まれます。ただし、分割キーボードの「左側の」 EEPROM ファイルも書き込まれます。_これは、Elite C ベースの分割キーボードに最適です。_
+* `:dfu-split-right` - デフォルトオプション (`:dfu`) と同様に、通常のファームウェアが書き込まれます。ただし、分割キーボードの「右側の」 EEPROM ファイルも書き込まれます。_これは、Elite C ベースの分割キーボードに最適です。_
+
+## Caterina
+
+Arduino ボードとそのクローンは [Caterina ブートローダ](https://github.com/arduino/ArduinoCore-avr/tree/master/bootloaders/caterina) (Pro Micro またはそのクローンで構築されたキーボード)を使用し、avr109 プロトコルを使って仮想シリアルを介して通信します。[A-Star](https://www.pololu.com/docs/0J61/9) のようなブートローダは Caterina に基づいています。
+
+Caterina ブートローダとの互換性を確保するために、以下のブロックが `rules.mk` にあることを確認してください:
+
+```make
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = caterina
+```
+
+互換性のあるフラッシャ:
+
+* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (推奨の GUI)
+* avr109 を使った [avrdude](http://www.nongnu.org/avrdude/) / `:avrdude` (推奨のコマンドライン)
+* [AVRDUDESS](https://github.com/zkemble/AVRDUDESS)
+
+書き込み手順:
+
+1. `RESET` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます)
+2. OS がデバイスを検知するのを待ちます。
+3. .hex ファイルを書き込みます
+4. デバイスが自動的にリセットされるのを待ちます
+
+あるいは
+
+ make ::avrdude
+
+
+#### Caterina コマンド
+
+ファームウェアを DFU デバイスに書き込むために使用できる DFU コマンドがいくつかあります。
+
+* `:avrdude` - これが通常のオプションで、Caterina デバイスが(新しい COM ポートを検出して)使用可能になるまで待機し、ファームウェアを書き込みます。
+* `:avrdude-loop` - これは `:avrdude` と同じコマンドを実行します。ただし書き込みが終了すると再び Caterina デバイスの書き込み待ちに戻ります。これは何台ものデバイスへ書き込むのに便利です。_Ctrl+C を押して、手動でこの繰り返しを終了させる必要があります。_
+* `:avrdude-split-left` - デフォルトオプション (`:avrdude`) と同様に通常のファームウェアが書き込まれます。ただし、分割キーボードの「左側の」 EEPROM ファイルも書き込まれます。_これは、Pro Micro ベースの分割キーボードに最適です。_
+* `:avrdude-split-right` - デフォルトオプション (`:avrdude`) と同様に通常のファームウェアが書き込まれます。ただし、分割キーボードの「右側の」 EEPROM ファイルも書き込まれます。_これは、Pro Micro ベースの分割キーボードに最適です。_
+
+
+
+## Halfkay
+
+Halfkay は PJRC によって開発された超スリムなプロトコルであり、HID を使用し、全ての Teensys (つまり 2.0)に搭載されています。
+
+Halfkay ブートローダとの互換性を確保するために、以下のブロックが `rules.mk` にあることを確認してください:
+
+```make
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = halfkay
+```
+
+互換性のあるフラッシャ:
+
+* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (推奨の GUI)
+* [Teensy ローダー](https://www.pjrc.com/teensy/loader.html)
+* [Teensy ローダーコマンドライン](https://www.pjrc.com/teensy/loader_cli.html) (推奨のコマンドライン)
+
+書き込み手順:
+
+1. `RESET` キーコードを押すか、RST をすばやく GND にショートします (入力後7秒で書き込みます)
+2. OS がデバイスを検知するのを待ちます。
+3. .hex ファイルを書き込みます
+4. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません)
+
+## USBasploader
+
+USBasploader は matrixstorm によって開発されたブートローダです。V-USB を実行する ATmega328P のような非 USB AVR チップで使われます。
+
+USBasploader ブートローダとの互換性を確保するために、以下のブロックが `rules.mk` にあることを確認してください:
+
+```make
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = USBasp
+```
+
+互換性のあるフラッシャ:
+
+* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (推奨の GUI)
+* `usbasp` プログラマを使った [avrdude](http://www.nongnu.org/avrdude/)
+* [AVRDUDESS](https://github.com/zkemble/AVRDUDESS)
+
+書き込み手順:
+
+1. `RESET` キーコードを押すか、RST を GND にすばやくショートしながら、ブートピンを GND にショートしたままにします。
+2. OS がデバイスを検知するのを待ちます。
+3. .hex ファイルを書き込みます
+4. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません)
+
+## BootloadHID
+
+BootloadHID は AVR マイクロコントローラ用の USB ブートローダです。アップローダーツールは Windows でカーネルレベルのドライバを必要としないため、DLL をインストールせずに実行することができます。
+
+bootloadHID ブートローダとの互換性を確保するために、以下のブロックが `rules.mk` にあることを確認してください:
+
+```make
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# ATmega32A bootloadHID
+# ATmega328P USBasp
+BOOTLOADER = bootloadHID
+```
+
+互換性のあるフラッシャ:
+
+* [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash) (推奨の Windows GUI)
+* [bootloadhid コマンドライン](https://www.obdev.at/products/vusb/bootloadhid.html) / QMK の `:BootloadHID` (推奨のコマンドライン)
+
+書き込み手順:
+
+1. 以下のいずれかの方法を使ってブートローダに入ります:
+ * `RESET` キーコードをタップします (全てのデバイスでは動作しないかもしれません)
+ * キーボードを接続しながらソルトキーを押し続けます (通常はキーボードの readme に書かれています)
+2. OS がデバイスを検知するのを待ちます。
+3. .hex ファイルを書き込みます
+4. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません)
+
+あるいは:
+
+ make ::bootloadHID
+
+## STM32
+
+全ての STM32 チップには、変更も削除もできない工場出荷時のブートローダがプリロードされています。一部の STM32 チップには USB プログラミングが付属していないブートローダがありますが(例えば STM32F103)、プロセスは同じです。
+
+現時点では、STM32 の `rules.mk` には、`BOOTLOADER` 変数は不要です。
+
+互換性のあるフラッシャ:
+
+* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (推奨の GUI)
+* [dfu-util](https://github.com/Stefan-Schmidt/dfu-util) / `:dfu-util` (推奨のコマンドライン)
+
+書き込み手順:
+
+1. 以下のいずれかの方法を使ってブートローダに入ります:
+ * `RESET` キーコードをタップします (STM32F042 デバイスでは動作しないかもしれません)
+ * リセット回路が存在する場合、RESET ボタンをタップします
+ * それ以外の場合は、(BOOT0 ボタンあるいはブリッジ経由で)BOOT0 を VCC にブリッジし、(REEST ボタンあるいはブリッジ経由で)RESET を GND にショートし、BOOT0 ブリッジを放す必要があります。
+2. OS がデバイスを検知するのを待ちます。
+3. .bin ファイルを書き込みます
+ * DFU 署名に関する警告が表示されます; 無視してください
+4. デバイスをアプリケーションモードにリセットします(自動的に実行されるかもしれません)
+ * コマンドラインからビルドする場合(例えば、`make planck/rev6:default:dfu-util`)、`rules.mk` の中で `:leave` が `DFU_ARGS` 変数に渡されるようにしてください (例えば、`DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave`)。そうすれば、書き込みの後でデバイスがリセットされます
+
+### STM32 コマンド
+
+ファームウェアを STM32 デバイスに書き込むために使用できる DFU コマンドがいくつかあります。
+
+* `:dfu-util` - STM32 デバイスに書き込むためのデフォルトコマンドで、STM32 ブートローダデバイスが見つかるまで待機します。
+* `:dfu-util-split-left` - デフォルトのオプション (`:dfu-util`) と同様に、通常のファームウェアが書き込まれます。ただし、分割キーボードの「左側の」 EEPROM の設定も行われます。
+* `:dfu-util-split-right` - デフォルトのオプション (`:dfu-util`) と同様に、通常のファームウェアが書き込まれます。ただし、分割キーボードの「右側の」 EEPROM の設定も行われます。
+* `:st-link-cli` - dfu-util ではなく、ST-LINK の CLI ユーティリティを介してファームウェアを書き込めます。
diff --git a/docs/ja/getting_started_build_tools.md b/docs/ja/getting_started_build_tools.md
new file mode 100644
index 000000000000..1f7accb5502a
--- /dev/null
+++ b/docs/ja/getting_started_build_tools.md
@@ -0,0 +1,146 @@
+# ビルドツールのインストール
+
+
+
+このページは QMK のためのビルド環境のセットアップを説明します。これらの手順は (atmega32u4 のような) AVR プロセッサを対象としてします。
+
+
+
+**注意:** ここが初めての場合は、[QMK 初心者ガイド](ja/newbs.md)ページを調べてください。
+
+続ける前に、`make git-submodule` を実行して、サブモジュール(サードパーティライブラリ)が最新であることを再確認してください。
+
+## Linux
+
+常に最新の状態を保つためには、単に `sudo util/qmk_install.sh` を実行してください。全ての必要な依存関係が常にインストールされるはずです。**これは `apt-get upgrade` を実行します。**
+
+手動でインストールすることもできますが、このドキュメントは常に全ての要件を満たしているとは限りません。
+
+現在の要件は以下の通りですが、何をしようとしているかによっては全てが必要とは限りません。また、一部のシステムではパッケージとして全ての依存関係が利用できるとは限らず、あるいは名前が異なる場合があるかもしれません。
+
+```
+build-essential
+gcc
+unzip
+wget
+zip
+gcc-avr
+binutils-avr
+avr-libc
+dfu-programmer
+dfu-util
+gcc-arm-none-eabi
+binutils-arm-none-eabi
+libnewlib-arm-none-eabi
+git
+```
+
+好みのパッケージマネージャを使って依存関係をインストールします。
+
+Debian / Ubuntu の例:
+
+ sudo apt-get update
+ sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi
+
+Fedora / Red Hat の例:
+
+ sudo dnf install gcc unzip wget zip dfu-util dfu-programmer avr-gcc avr-libc binutils-avr32-linux-gnu arm-none-eabi-gcc-cs arm-none-eabi-binutils-cs arm-none-eabi-newlib
+
+Arch / Manjaro の例:
+
+ pacman -S base-devel gcc unzip wget zip avr-gcc avr-binutils avr-libc dfu-util arm-none-eabi-gcc arm-none-eabi-binutils arm-none-eabi-newlib git dfu-programmer dfu-util
+
+## Nix
+
+[NixOS](https://nixos.org/) の場合、あるいは Linux または MacOS に Nix をインストールした場合は、ビルド環境を取得するためにリポジトリのルートで `nix-shell` を実行します。
+
+デフォルトでは、これは AVR と ARM の両方のためのコンパイラをダウンロードします。両方が必要ではない場合は、`avr` あるいは `arm` 引数を無効にします。例えば:
+
+ nix-shell --arg arm false
+
+## macOS
+[Homebrew](http://brew.sh/) を使っている場合は、以下のコマンドを使うことができます:
+
+ brew tap osx-cross/avr
+ brew tap osx-cross/arm
+ brew update
+ brew install avr-gcc@8
+ brew link --force avr-gcc@8
+ brew install dfu-programmer
+ brew install dfu-util
+ brew install arm-gcc-bin@8
+ brew link --force arm-gcc-bin@8
+ brew install avrdude
+
+これはお勧めの方法です。homebrew が無い場合は、[インストールしてください!](http://brew.sh/) コマンドラインで作業する人にとってとても価値があります。`avr-gcc@8` の homebrew でのインストール中、`make` と `make install` 部分は20分以上かかり、CPU使用率が高くなることに注意してください。
+
+## msys2 を使った Windows (推奨) :id=windows-with-msys2-recommended
+
+Windows Vista 以降のバージョン(7および10でテスト済み)について、使用するのに最適な環境は [msys2](http://www.msys2.org) です。
+
+* msys2 をダウンロードし、こちらの指示に従ってインストールしてください: http://www.msys2.org
+* ``MSYS2 MingGW 64-bit`` のショートカットを開きます
+* QMK リポジトリに移動します。例えば、c ドライブのルートにある場合:
+* `$ cd /c/qmk_firmware`
+* `util/qmk_install.sh` を実行し、指示に従います
+
+## Windows 10 (非推奨)
+Windows 10 の古い手順です。[上記の概要のように MSYS2](#windows-with-msys2-recommended) を使うことをお勧めします。
+
+### Creators Update
+Creators Update 以降の Windows 10 の場合、ファームウェアを直接ビルドして書き込むことができます。Creators Update の前は、ビルドだけが可能でした。まだそうではないか、不明な場合は、[これらの指示](https://support.microsoft.com/en-us/instantanswers/d4efb316-79f0-1aa1-9ef3-dcada78f3fa0/get-the-windows-10-creators-update)に従ってください。
+
+### Linux 用の Windows Subsystem
+Creators Update に加えて、Linux 用の Windows 10 Subystem が必要ですので、[これらの指示](http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/)に従ってインストールしてください。Anniversary update からの Linux 用の Windows 10 Subsystem が既にある場合、一部のキーボードは 14.04LTS に含まれるツールチェーンを使ってコンパイルしないため、16.04LTS に[アップグレード](https://betanews.com/2017/04/14/upgrade-windows-subsystem-for-linux/)することをお勧めします。`sudo do-release-upgrade` メソッドを選択した場合は、自分が何をしているかを知る必要があることに注意してください。
+
+### Git
+すでに Windows ファイルシステムにリポジトリをクローンしている場合は、この章を無視することができます。
+
+WSL Git では**なく**、Windows 用の通常の Git を使って Windows ファイルシステムにリポジトリをクローンする必要があります。以前に Git をインストールしたことが無ければ、[ダウンロード](https://git-scm.com/download/win)し、インストールしてください。次に[セットアップします](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup)。特に貢献する予定がある場合は、eメールとユーザ名をセットアップすることが重要です。
+
+Git がインストールされたら、Git Bash コマンドを開き、QMK をクローンしたい場所へディレクトリを変更します: スラッシュを使う必要があり、c ドライブは `/c/path/to/where/you/want/to/go` のようにアクセスされることに注意してください。次に、`git clone --recurse-submodules https://github.com/qmk/qmk_firmware` を実行します。これは現在のフォルダのサブディレクトリとして新しいフォルダ `qmk_firmware` を作成します。
+
+### ツールチェーンのセットアップ
+ツールチェーンのセットアップは Linux 用の Windows サブシステムを介して行われ、手順は完全に自動化されています。全てを手動で行いたい場合は、スクリプト以外の手順はありませんが、常に issue を開いて詳細情報を求めることができます。
+
+1. スタートメニューから "Bash On Ubuntu On Windows" を開いてください。
+2. クローンした `qmk_firmware` ディレクトリに移動します。パスは WSL 内で `/mnt/` から始まることに注意してください。つまり、例えば `cd /mnt/c/path/to/qmk_firmware` と書く必要があります。
+3. `util/wsl_install.sh` を実行し、画面上の手順に従います。
+4. Bash コマンドウィンドウを閉じ、再び開きます。
+5. ファームウェアをコンパイルし書き込む準備ができました!
+
+### 心に留めておくべき幾つかの重要なこと
+* 全ての最新の更新を取得するために `util/wsl_install.sh` を再実行することができます。
+* WSL は外部で実行可能ファイルを実行できないため、QMK リポジトリは Windows ファイルシステム上にある必要があります。
+* WSL Git は Windows の Git と互換性が**無い**ため、全ての Git 操作には、Windows Git Bash あるいは windows Git GUI を使ってください。
+* WSL 内あるいは普通に Windows を使ってファイルを編集できますが、makefile あるいはシェルスクリプトを編集する場合は、行末をUnix形式にしてファイルを保存するエディタを使うようにしてください。そうでなければコンパイルは機能しないかもしれません。
+
+## Docker
+
+これが少し複雑な場合は、Docker があなたが必要とするすぐに使える解決法かもしれません。[Docker CE](https://docs.docker.com/install/#supported-platforms) をインストールした後で、キーボード/キーマップをビルドするために `qmk_firmware` ディレクトリから以下のコマンドを実行します:
+```bash
+util/docker_build.sh keyboard:keymap
+# 例えば: util/docker_build.sh ergodox_ez:steno
+```
+これは目的のキーボード/キーマップをコンパイルし、結果として書き込み用に `.hex` あるいは `.bin` ファイルを QMK ディレクトリの中に残します。`:keymap` が省略された場合は全てのキーマップが使われます。パラメータの形式は、`make` を使ってビルドする時と同じであることに注意してください。
+
+スクリプトをパラメータ無しで開始することもできます。この場合、1つずつビルドパラメータを入力するように求められます。これが使いやすいと思うかもしれません:
+```bash
+util/docker_build.sh
+# パラメータを入力として読み込みます (空白にすると全てのキーボード/キーマップ)
+```
+
+`target` を指定することで Docker から直接キーボードをビルドし_かつ_書き込むためのサポートもあります。
+```bash
+util/docker_build.sh keyboard:keymap:target
+# 例えば: util/docker_build.sh planck/rev6:default:flash
+```
+Linux を使っている場合は、これはそのままで動作するはずです。Windows と macOS では、実行するのに [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) が必要です。これはセットアップが面倒なので、お勧めではありません: 代わりに [QMK Toolbox](https://github.com/qmk/qmk_toolbox) を使ってください。
+
+!> Docker for Windows は[Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) を有効にする必要があります。これは、Windows 7、Windows 8 および **Windows 10 Home** のような Hyper-V を搭載していない Windows のバージョンでは機能しないことを意味します。
+
+## Vagrant
+ファームウェアをビルドするのに問題がある場合は、Vagrant と呼ばれるツールを試してみることができます。それは、ファームウェアをビルドする準備ができた既知の構成を搭載した仮想コンピュータをセットアップします。OLKB はこの仮想コンピュータのためのファイルをホストしません。Vagrant をセットアップする方法の詳細は、[vagrant ガイド](ja/getting_started_vagrant.md)にあります。
diff --git a/docs/ja/getting_started_make_guide.md b/docs/ja/getting_started_make_guide.md
new file mode 100644
index 000000000000..d33485ce1114
--- /dev/null
+++ b/docs/ja/getting_started_make_guide.md
@@ -0,0 +1,153 @@
+# より詳細な `make` 手順
+
+
+
+`make` コマンドの完全な構文は `::` です:
+
+* `` はキーボードのパスです。例えば、`planck`
+ * 全てのキーボードをコンパイルするには `all` を使います。
+ * リビジョンを選択してコンパイルするためのパスを指定します。例えば `planck/rev4` あるいは `planck/rev3`
+ * キーボードにフォルダが無い場合は、省略することができます
+ * デフォルトのフォルダをコンパイルする場合は、省略することができます
+* `` はキーマップの名前です。例えば、`algernon`
+ * 全てのキーマップをコンパイルするには `all` を使います。
+* `` の詳細は以下で説明します。
+
+`` は以下を意味します
+* target が指定されない場合は、以下の `all` と同じです
+* `all` は指定されたキーボード/リビジョン/キーマップの可能な全ての組み合わせのコンパイルを行います。例えば、`make planck/rev4:default` は1つの .hex を生成しますが、`make planck/rev4:all` は planck で利用可能な全てのキーマップについて hex を生成します。
+* `flash`、`dfu`、`teensy`、`avrdude`、`dfu-util` または `bootloadHID` はファームウェアをコンパイルし、キーボードにアップロードします。コンパイルが失敗すると、何もアップロードされません。使用するプログラマはキーボードに依存します。ほとんどのキーボードでは `dfu` ですが、ChibiOS キーボードについては `dfu-util` 、標準的な Teensy については `teensy` を使います。キーボードに使うコマンドを見つけるには、キーボード固有の readme をチェックしてください。
+* **注意**: 一部のオペレーティングシステムではこれらのコマンドが機能するためには root アクセスが必要です。その場合、例えば `sudo make planck/rev4:default:flash` を実行する必要があります。
+* `clean` は、全てをゼロからビルドするためにビルド出力フォルダを掃除します。説明できない問題がある場合は、通常のコンパイルの前にこれを実行してください。
+
+make コマンドの最後、つまり target の後に追加のオプションを追加することもできます
+
+* `make COLOR=false` - カラー出力をオフ
+* `make SILENT=true` - エラー/警告以外の出力をオフ
+* `make VERBOSE=true` - 全ての gcc のものを出力 (デバッグする必要が無い限り面白くありません)
+* `make EXTRAFLAGS=-E` - コンパイルせずにコードを前処理 (#define コマンドをデバッグしようとする場合に便利)
+
+make コマンド自体にもいくつかの追加オプションがあります。詳細は `make --help` を入力してください。最も有用なのはおそらく `-jx` です。これは複数の CPU を使ってコンパイルしたいことを指定し、`x` は使用したい CPU の数を表します。設定すると、特に多くのキーボード/キーマップをコンパイルしている場合は、コンパイル時間を大幅に短縮することができます。通常は、コンパイル中に他の作業を行うための余裕をもたせるために、持っている CPU の数より1つ少ない値に設定します。全てのオペレーティングシステムと make バージョンがオプションをサポートしているわけではないことに注意してください。
+
+コマンドの例を幾つか示します
+
+* `make all:all` は、全てをビルドします (全てのキーボードフォルダ、全てのキーマップ)。`root` から単に `make` を実行すると、これを実行します。
+* `make ergodox_infinity:algernon:clean` は、Ergodox Infinity キーボードのビルド出力を掃除します。
+* `make planck/rev4:default:flash COLOR=false` カラー出力なしでキーマップをビルドしアップロードします。
+
+## `rules.mk` オプション
+
+無効にするにはこれらの変数を `no` に設定します。有効にするには `yes` に設定します。
+
+`BOOTMAGIC_ENABLE`
+
+これにより、1つのキーとソルトキー(デフォルトではスペース)を押し続けることで、電力が失われても持続する様々な EEPROM 設定へアクセスできます。誤って設定が変更されることが多く、デバッグするのが難しい混乱した結果を生成するため、これを無効にしておくことをお勧めします。ヘルプセッションで発生する、より一般的な問題の1つです。
+
+`MOUSEKEY_ENABLE`
+
+これにより、キーコード/カスタム関数を介して、カーソルの動きとクリックを制御することができます。
+
+`EXTRAKEY_ENABLE`
+
+これにより、システムとオーディオ制御キーコードを使うことができます。
+
+`CONSOLE_ENABLE`
+
+これにより、[`hid_listen`](https://www.pjrc.com/teensy/hid_listen.html) を使って読むことができるメッセージを出力することができます。
+
+デフォルトで、全てのデバッグ( *dprint* ) 出力 ( *print*、*xprintf* )、およびユーザ出力 ( *uprint* ) メッセージが有効になります。これにより、フラッシュメモリの大部分が消費され、キーボードの .hex ファイルが大きすぎてプログラムできなくなるかもしれません。
+
+デバッグメッセージ( *dprint* ) を無効にし、.hex ファイルのサイズを小さくするには、`config.h` に `#define NO_DEBUG` を含めます。
+
+出力メッセージ( *print*、*xprintf* )とユーザ出力( *uprint* ) を無効にし、.hex のファイルサイズを小さくするには、`config.h` に `#define NO_PRINT` を含めます。
+
+出力メッセージ ( *print*、*xprintf* ) を無効にし、ユーザメッセージ ( *uprint* )を**そのままにする**には、`config.h` に `#define USER_PRINT` を含めます(この場合は、`#define NO_PRINT` も含めないでください)。
+
+テキストを見るには、`hid_listen` を開き、出力メッセージを見るのを楽しんでください。
+
+**注意:** キーマップコード以外の *uprint* メッセージを含めないでください。QMK システムフレームワーク内で使うべきではありません。さもないと、他の人の .hex ファイルが肥大化します。
+
+`COMMAND_ENABLE`
+
+これはマジックコマンドを有効にし、通常はデフォルトのマジックキーの組み合わせ `LSHIFT+RSHIFT+KEY` で起動されます。マジックコマンドは、デバッグメッセージ (`MAGIC+D`) の有効化や NKRO の一時的な切り替え (`MAGIC+N`) を含みます。
+
+`SLEEP_LED_ENABLE`
+
+コンピュータがスリープの間に LED がブレスできるようにします。ここでは Timer1 が使われます。この機能は大部分が未使用でテストされておらず、更新もしくは抽象化が必要です。
+
+`NKRO_ENABLE`
+
+これにより、キーボードはホスト OS に最大 248 個のキーが同時に押されていることを伝えることができます (NKRO 無しのデフォルトは 6 です)。NKRO は、`NKRO_ENABLE` が設定されていたとしても、デフォルトではオフです。config.h に `#define FORCE_NKRO` を追加するか、`MAGIC_TOGGLE_NKRO` をキーにバインドしてキーを押すことで、NKRO を強制することができます。
+
+`BACKLIGHT_ENABLE`
+
+これはスイッチ内の LED のバックライトを有効にします。`config.h` 内に以下を入れることでバックライトピンを指定することができます:
+
+ #define BACKLIGHT_PIN B7
+
+`MIDI_ENABLE`
+
+キーボードで MIDI の送受信を有効にします。MIDI 送信モードに入るためにキーコード `MI_ON` を使うことができ、オフにするために `MI_OFF` を使うことができます。これはほとんどテストされていない機能ですが、詳細については `quantum/quantum.c` ファイルで見つけることができます。
+
+`UNICODE_ENABLE`
+
+これによりキーマップで `UC()` を使って Unicode 文字を送信することができます。`0x7FFF` までのコードポイントがサポートされます。これはほとんどの現代言語の文字と記号を対象にしますが、絵文字は対象外です。
+
+`UNICODEMAP_ENABLE`
+
+これによりキーマップで `X(