Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent clang-format messing up placeholder tokens within keyboard templates #6790

Merged
merged 3 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use .template file extension for keyboard template files
  • Loading branch information
fauxpark committed Sep 22, 2019
commit a523fd2013151482480000f8c9ed05e03004bbe6
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x0000
#define DEVICE_VER 0x0001
#define MANUFACTURER % YOUR_NAME %
#define PRODUCT % KEYBOARD %
#define MANUFACTURER %YOUR_NAME%
#define PRODUCT %KEYBOARD%
#define DESCRIPTION A custom keyboard

/* key matrix size */
Expand All @@ -41,10 +41,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS \
{ D0, D5 }
#define MATRIX_COL_PINS \
{ F1, F0, B0 }
#define MATRIX_ROW_PINS { D0, D5 }
#define MATRIX_COL_PINS { F1, F0, B0 }
#define UNUSED_PINS

/* COL2ROW, ROW2COL*/
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,11 @@
* The second converts the arguments into a two-dimensional array which
* represents the switch matrix.
*/
#define LAYOUT(k00, k01, k02, k10, k11) \
{ {k00, k01, k02}, {k10, KC_NO, k11}, }
#define LAYOUT( \
k00, k01, k02, \
k10, k11 \
) \
{ \
{ k00, k01, k02 }, \
{ k10, KC_NO, k11 }, \
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@
#include QMK_KEYBOARD_H

// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes { QMKBEST = SAFE_RANGE, QMKURL };
enum custom_keycodes {
QMKBEST = SAFE_RANGE,
QMKURL
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(/* Base */
KC_A, KC_1, KC_H, KC_TAB, KC_SPC),
[0] = LAYOUT( /* Base */
KC_A, KC_1, KC_H,
KC_TAB, KC_SPC
),
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
Expand All @@ -45,8 +50,14 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
}

void matrix_init_user(void) {}
void matrix_init_user(void) {

}

void matrix_scan_user(void) {}
void matrix_scan_user(void) {

void led_set_user(uint8_t usb_led) {}
}

void led_set_user(uint8_t usb_led) {

}
1 change: 0 additions & 1 deletion quantum/template/base/keymaps/default/readme.md

This file was deleted.

1 change: 1 addition & 0 deletions quantum/template/base/keymaps/default/readme.md.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# The default keymap for %KEYBOARD%
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PRODUCT_ID 0x422D
#define DEVICE_VER 0x0001
#define MANUFACTURER You
#define PRODUCT % KEYBOARD %
#define PRODUCT %KEYBOARD%
#define DESCRIPTION A custom keyboard

#define RGBLED_NUM 16

#define MATRIX_ROWS 8
#define MATRIX_COLS 11

#define MATRIX_ROW_PINS \
{ B0, B1, B2, B3, B4, B5, B6, B7 }
#define MATRIX_COL_PINS \
{ A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 }
#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 }
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 }
// #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, C1, C0, D7 }
#define UNUSED_PINS \
{}
#define UNUSED_PINS {}

#define DIODE_DIRECTION COL2ROW
#define DEBOUNCE 5
Expand Down
5 changes: 3 additions & 2 deletions util/new_keyboard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ copy_templates() {
echo " done"

echo -n "Renaming keyboard files..."
mv "${keyboard_dir}/template.c" "${keyboard_dir}/${keyboard_name}.c"
mv "${keyboard_dir}/template.h" "${keyboard_dir}/${keyboard_name}.h"
find "${keyboard_dir}" -type f -name "*.template" -print0 | while read -d $'\0' f; do mv "$f" "${f%.template}"; done
mv "${keyboard_dir}/keyboard.c" "${keyboard_dir}/${keyboard_name}.c"
mv "${keyboard_dir}/keyboard.h" "${keyboard_dir}/${keyboard_name}.h"
echo " done"
}

Expand Down