From ed1bf3afa25d7e7674df7e8618dfaf243de3058b Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 10 Oct 2019 21:48:37 +1100 Subject: Prevent clang-format messing up placeholder tokens within keyboard templates (#6790) * Use .template file extension for keyboard template files * Filter out .template files completely before passing to clang-format * Undo file extension stuff; just ignore quantum/template dir --- quantum/template/avr/config.h | 10 ++++---- quantum/template/avr/keyboard.c | 51 +++++++++++++++++++++++++++++++++++++++++ quantum/template/avr/template.c | 51 ----------------------------------------- 3 files changed, 55 insertions(+), 57 deletions(-) create mode 100644 quantum/template/avr/keyboard.c delete mode 100644 quantum/template/avr/template.c (limited to 'quantum/template/avr') diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 713d6be3a5..304a54ae59 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -23,8 +23,8 @@ along with this program. If not, see . #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 */ @@ -41,10 +41,8 @@ along with this program. If not, see . * 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*/ diff --git a/quantum/template/avr/keyboard.c b/quantum/template/avr/keyboard.c new file mode 100644 index 0000000000..e852a42c40 --- /dev/null +++ b/quantum/template/avr/keyboard.c @@ -0,0 +1,51 @@ +/* Copyright %YEAR% %YOUR_NAME% + * + * 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 "%KEYBOARD%.h" + +// Optional override functions below. +// You can leave any or all of these undefined. +// These are only required if you want to perform custom actions. + +/* + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +*/ diff --git a/quantum/template/avr/template.c b/quantum/template/avr/template.c deleted file mode 100644 index e852a42c40..0000000000 --- a/quantum/template/avr/template.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright %YEAR% %YOUR_NAME% - * - * 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 "%KEYBOARD%.h" - -// Optional override functions below. -// You can leave any or all of these undefined. -// These are only required if you want to perform custom actions. - -/* - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} - -*/ -- cgit v1.2.3