Skip to content

Commit

Permalink
Change keyboard level include guards to pragma once (qmk#14248)
Browse files Browse the repository at this point in the history
* Change keyboard level include guards to `pragma once`

And clean up a lot of layout macros

* Oops

* Remove dangling endif
  • Loading branch information
fauxpark authored and ptrxyz committed Nov 6, 2021
1 parent a91b244 commit 9f09ed6
Show file tree
Hide file tree
Showing 308 changed files with 3,548 additions and 4,517 deletions.
16 changes: 6 additions & 10 deletions keyboards/6ball/6ball.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
#ifndef SIXBALL_H
#define SIXBALL_H
#pragma once

#include "quantum.h"

#define LAYOUT( \
k01, k02, k03, \
k04, k05, k06 \
) \
{ \
{ k02, k03, k06, k05, k04, k01 } \
}

#endif
k05, k00, k01, \
k04, k03, k02 \
) { \
{ k00, k01, k02, k03, k04, k05 } \
}
5 changes: 1 addition & 4 deletions keyboards/6ball/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H
#pragma once

#include "config_common.h"

Expand Down Expand Up @@ -46,5 +45,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DIODE_DIRECTION COL2ROW

#define TAPPING_TERM 200

#endif
16 changes: 6 additions & 10 deletions keyboards/9key/9key.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
#ifndef NINEKEY_H
#define NINEKEY_H
#pragma once

#include "quantum.h"

#define LAYOUT( \
k00, k01, k02, \
k10, k11, k12, \
k20, k21, k22 \
) \
{ \
k00, k01, k02, \
k10, k11, k12, \
k20, k21, k22 \
) { \
{ k00, k01, k02 }, \
{ k10, k11, k12 }, \
{ k20, k21, k22 } \
}

#endif
}
5 changes: 1 addition & 4 deletions keyboards/9key/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef CONFIG_H
#define CONFIG_H
#pragma once

#include "config_common.h"

Expand Down Expand Up @@ -45,5 +44,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DIODE_DIRECTION COL2ROW

#define TAPPING_TERM 200

#endif
36 changes: 17 additions & 19 deletions keyboards/ai03/orbit/orbit.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ORBIT_H
#define ORBIT_H

#pragma once

#include "quantum.h"

Expand All @@ -35,29 +35,27 @@
#endif
#endif

#define XXX KC_NO

#define LAYOUT( \
L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \
L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \
L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \
L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \
L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \
L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \
L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \
L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45 \
) \
{ \
{ L00, L01, L02, L03, L04, L05, L06 }, \
{ L10, L11, L12, L13, L14, L15, L16 }, \
{ L20, L21, L22, L23, L24, L25, L26 }, \
{ L30, L31, L32, L33, L34, L35, L36 }, \
{ KC_NO, L41, L42, L43, L44, L45, L46 }, \
{ R00, R01, R02, R03, R04, R05, R06 }, \
{ R10, R11, R12, R13, R14, R15, R16 }, \
{ R20, R21, R22, R23, R24, R25, R26 }, \
{ R30, R31, R32, R33, R34, R35, R36 }, \
{ R40, R41, R42, R43, R44, R45, KC_NO } \
) { \
{ L00, L01, L02, L03, L04, L05, L06 }, \
{ L10, L11, L12, L13, L14, L15, L16 }, \
{ L20, L21, L22, L23, L24, L25, L26 }, \
{ L30, L31, L32, L33, L34, L35, L36 }, \
{ XXX, L41, L42, L43, L44, L45, L46 }, \
{ R00, R01, R02, R03, R04, R05, R06 }, \
{ R10, R11, R12, R13, R14, R15, R16 }, \
{ R20, R21, R22, R23, R24, R25, R26 }, \
{ R30, R31, R32, R33, R34, R35, R36 }, \
{ R40, R41, R42, R43, R44, R45, XXX } \
}

extern void led_toggle(int id, bool on);
void set_all_leds(bool leds[6]);
extern void set_layer_indicators(uint8_t layer);

#endif
31 changes: 15 additions & 16 deletions keyboards/alf/dc60/dc60.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,29 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DC60_H
#define DC60_H

#pragma once

#include "quantum.h"

#define XXX KC_NO

// This a shortcut to help you visually see your layout.
// The following is an example using the Planck MIT 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( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE, \
K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
K40, K42, K43, K45, K47, K48, K4A, K4B, K4C, K4D, K4E \
) \
{ \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE }, \
{ 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, KC_NO, K42, K43, KC_NO, K45, KC_NO, K47, K48, KC_NO, K4A, K4B, K4C, K4D, K4E }, \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \
k40, k42, k43, k45, k47, k48, k4A, k4B, k4C, k4D, k4E \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \
{ k10, XXX, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
{ k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, XXX }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \
{ k40, XXX, k42, k43, XXX, k45, XXX, k47, k48, XXX, k4A, k4B, k4C, k4D, k4E } \
}

#endif
16 changes: 0 additions & 16 deletions keyboards/alf/x2/config.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
/* Copyright 2018-2021 @fixed, MechMerlin, QMK
*
* 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "config_common.h"
Expand Down
119 changes: 89 additions & 30 deletions keyboards/alf/x2/x2.h
Original file line number Diff line number Diff line change
@@ -1,38 +1,97 @@
/* Copyright 2018-2021 @fixed, MechMerlin, QMK
*
* 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 <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "quantum.h"

#define ___ KC_NO
#define XXX KC_NO

// k44 and k48 are the microswitches at the top of the PCB

#define LAYOUT( \
k44, k48, \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, 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, k0D, k0E }, \
{ k10, XXX, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
{ k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, XXX }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \
{ k40, k41, XXX, k43, k44, XXX, k46, XXX, k48, XXX, k4A, k4B, k4C, k4D, k4E } \
}

#define LAYOUT_std_ansi( \
k44, k48, \
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, k1E, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, \
k40, k41, k43, k46, k4A, k4B, k4D, k4E \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, XXX, k0E }, \
{ k10, XXX, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
{ k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, XXX }, \
{ k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, XXX, k3D, XXX }, \
{ k40, k41, XXX, k43, k44, XXX, k46, XXX, k48, XXX, k4A, k4B, XXX, k4D, k4E } \
}

#define LAYOUT_std_splits( \
k44, k48, \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, k3E, \
k40, k41, k43, k46, k4A, k4B, k4D, k4E \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \
{ k10, XXX, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
{ k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, XXX }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, XXX, k3D, k3E }, \
{ k40, k41, XXX, k43, k44, XXX, k46, XXX, k48, XXX, k4A, k4B, XXX, k4D, k4E } \
}

#define LAYOUT_hhkb( \
k44, k48, \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, k3E, \
k41, k43, k46, k4A, k4B \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \
{ k10, XXX, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
{ k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, XXX }, \
{ k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, XXX, k3D, k3E }, \
{ XXX, k41, XXX, k43, k44, XXX, k46, XXX, k48, XXX, k4A, k4B, XXX, XXX, XXX } \
}

// K44 and K48 are the microswitches at the top of the PCB
#define LAYOUT_2u_split_arrows( \
k44, k48, \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, 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, k0D, k0E }, \
{ k10, XXX, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
{ k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, XXX }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \
{ k40, k41, XXX, k43, k44, XXX, k46, XXX, k48, XXX, k4A, k4B, k4C, k4D, k4E } \
}

#define LAYOUT_all( \
K44, K48, \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, 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 \
#define LAYOUT_split_arrows( \
k44, k48, \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, k3E, \
k40, k41, k43, k46, k4A, k4B, k4C, k4D, k4E \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \
{ K10, ___, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \
{ K20, ___, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, ___ }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
{ K40, K41, ___, K43, K44, ___, K46, ___, K48, ___, K4A, K4B, K4C, K4D, K4E } \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \
{ k10, XXX, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
{ k20, XXX, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, XXX }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, XXX, k3D, k3E }, \
{ k40, k41, XXX, k43, k44, XXX, k46, XXX, k48, XXX, k4A, k4B, k4C, k4D, k4E } \
}
19 changes: 9 additions & 10 deletions keyboards/alpha/alpha.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#ifndef KB_H
#define KB_H
#pragma once

#include "quantum.h"

#define XXX KC_NO

#define LAYOUT( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, \
K200, K201, K202, K203, K205, K207, K208, K209 \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
k20, k21, k22, k23, k25, k27, k28, k29 \
) { \
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009 }, \
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109 }, \
{ K200, K201, K202, K203, KC_NO, K205, KC_NO, K207, K208, K209 } \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \
{ k20, k21, k22, k23, XXX, k25, XXX, k27, k28, k29 } \
}

#endif
5 changes: 1 addition & 4 deletions keyboards/alpha/config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef CONFIG_H
#define CONFIG_H
#pragma once

#include "config_common.h"

Expand Down Expand Up @@ -45,5 +44,3 @@
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif

#endif

0 comments on commit 9f09ed6

Please sign in to comment.