Reformat the factory firmware sketches with clang-format

Also replaced the old astyle `IDENT-OFF`/`INDENT-ON` comment pairs with
`clang-format off`/`clang-format on`, respectively.

No functional changes, just formatting.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
examples/factory-firmware
Gergely Nagy 3 years ago
parent 87c360716a
commit e857491953
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -30,7 +30,7 @@
#include "Kaleidoscope-MouseKeys.h" #include "Kaleidoscope-MouseKeys.h"
#include "Kaleidoscope-Qukeys.h" #include "Kaleidoscope-Qukeys.h"
/* *INDENT-OFF* */ // clang-format off
KEYMAPS( KEYMAPS(
[0] = KEYMAP_STACKED [0] = KEYMAP_STACKED
( (
@ -105,7 +105,7 @@ KEYMAPS(
XXX, XXX, XXX XXX, XXX, XXX
), ),
) )
/* *INDENT-ON* */ // clang-format on
KALEIDOSCOPE_INIT_PLUGINS( KALEIDOSCOPE_INIT_PLUGINS(
EEPROMSettings, EEPROMSettings,
@ -114,8 +114,7 @@ KALEIDOSCOPE_INIT_PLUGINS(
FocusEEPROMCommand, FocusEEPROMCommand,
FocusSettingsCommand, FocusSettingsCommand,
Qukeys, Qukeys,
MouseKeys MouseKeys);
);
void blinkAllStatusLEDs() { void blinkAllStatusLEDs() {
for (auto i = 0; i <= 3; i++) { for (auto i = 0; i <= 3; i++) {

@ -93,7 +93,6 @@ enum { MACRO_VERSION_INFO,
}; };
/** The Model 01's key layouts are defined as 'keymaps'. By default, there are three /** The Model 01's key layouts are defined as 'keymaps'. By default, there are three
* keymaps: The standard QWERTY keymap, the "Function layer" keymap and the "Numpad" * keymaps: The standard QWERTY keymap, the "Function layer" keymap and the "Numpad"
* keymap. * keymap.
@ -142,7 +141,9 @@ enum { MACRO_VERSION_INFO,
* *
*/ */
enum { PRIMARY, NUMPAD, FUNCTION }; // layers enum { PRIMARY,
NUMPAD,
FUNCTION }; // layers
/** /**
@ -164,11 +165,10 @@ enum { PRIMARY, NUMPAD, FUNCTION }; // layers
// #define PRIMARY_KEYMAP_CUSTOM // #define PRIMARY_KEYMAP_CUSTOM
/* This comment temporarily turns off astyle's indent enforcement /* This comment temporarily turns off astyle's indent enforcement
* so we can make the keymaps actually resemble the physical key layout better * so we can make the keymaps actually resemble the physical key layout better
*/ */
// *INDENT-OFF* // clang-format off
KEYMAPS( KEYMAPS(
@ -279,7 +279,7 @@ KEYMAPS(
) // KEYMAPS( ) // KEYMAPS(
/* Re-enable astyle's indent enforcement */ /* Re-enable astyle's indent enforcement */
// *INDENT-ON* // clang-format on
/** versionInfoMacro handles the 'firmware version info' macro /** versionInfoMacro handles the 'firmware version info' macro
* When a key bound to the macro is pressed, this macro * When a key bound to the macro is pressed, this macro
@ -336,7 +336,6 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
} }
// These 'solid' color effect definitions define a rainbow of // These 'solid' color effect definitions define a rainbow of
// LED color modes calibrated to draw 500mA or less on the // LED color modes calibrated to draw 500mA or less on the
// Keyboardio Model 01. // Keyboardio Model 01.
@ -412,12 +411,10 @@ static void enterHardwareTestMode(uint8_t combo_index) {
*/ */
USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol, USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol,
// Left Fn + Esc + Shift // Left Fn + Esc + Shift
.keys = { R3C6, R2C6, R3C7 } .keys = {R3C6, R2C6, R3C7}},
}, { {.action = enterHardwareTestMode,
.action = enterHardwareTestMode,
// Left Fn + Prog + LED // Left Fn + Prog + LED
.keys = { R3C6, R0C0, R0C6 } .keys = {R3C6, R0C0, R0C6}});
});
// First, tell Kaleidoscope which plugins you want to use. // First, tell Kaleidoscope which plugins you want to use.
// The order can be important. For example, LED effects are // The order can be important. For example, LED effects are
@ -468,7 +465,13 @@ KALEIDOSCOPE_INIT_PLUGINS(
LEDChaseEffect, LEDChaseEffect,
// These static effects turn your keyboard's LEDs a variety of colors // These static effects turn your keyboard's LEDs a variety of colors
solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet, solidRed,
solidOrange,
solidYellow,
solidGreen,
solidBlue,
solidIndigo,
solidViolet,
// The breathe effect slowly pulses all of the LEDs on your keyboard // The breathe effect slowly pulses all of the LEDs on your keyboard
LEDBreatheEffect, LEDBreatheEffect,
@ -510,8 +513,7 @@ KALEIDOSCOPE_INIT_PLUGINS(
// comfortable - or able - to do automatically, but can be useful // comfortable - or able - to do automatically, but can be useful
// nevertheless. Such as toggling the key report protocol between Boot (used // nevertheless. Such as toggling the key report protocol between Boot (used
// by BIOSes) and Report (NKRO). // by BIOSes) and Report (NKRO).
USBQuirks USBQuirks);
);
/** The 'setup' function is one of the two standard Arduino sketch functions. /** The 'setup' function is one of the two standard Arduino sketch functions.
* It's called when your keyboard first powers up. This is where you set up * It's called when your keyboard first powers up. This is where you set up

@ -92,7 +92,7 @@ enum {
#define KP_STR Key_KeypadMultiply #define KP_STR Key_KeypadMultiply
#define Key_Plus Key_KeypadAdd #define Key_Plus Key_KeypadAdd
/* *INDENT-OFF* */ // clang-format off
KEYMAPS( KEYMAPS(
/* QWERTY /* QWERTY
* ,-------------------------. ,--------------------------. * ,-------------------------. ,--------------------------.
@ -203,7 +203,7 @@ KEYMAPS(
,Key_C ,Key_V ,Key_N ,Key_M ,Key_C ,Key_V ,Key_N ,Key_M
) )
); );
/* *INDENT-ON* */ // clang-format on
namespace kaleidoscope { namespace kaleidoscope {
namespace plugin { namespace plugin {
@ -233,8 +233,8 @@ class MultiSwitcher : public kaleidoscope::Plugin {
private: private:
uint8_t switch_state_ = 0; uint8_t switch_state_ = 0;
}; };
} } // namespace plugin
} } // namespace kaleidoscope
kaleidoscope::plugin::MultiSwitcher MultiSwitcher; kaleidoscope::plugin::MultiSwitcher MultiSwitcher;
@ -245,8 +245,7 @@ KALEIDOSCOPE_INIT_PLUGINS(
EEPROMSettings, EEPROMSettings,
EEPROMKeymap, EEPROMKeymap,
FocusEEPROMCommand, FocusEEPROMCommand,
FocusSettingsCommand FocusSettingsCommand);
);
void setup() { void setup() {
Kaleidoscope.setup(); Kaleidoscope.setup();

@ -45,7 +45,7 @@ enum {
_LW _LW
}; };
/* *INDENT-OFF* */ // clang-format off
KEYMAPS( KEYMAPS(
[_QW] = KEYMAP_STACKED [_QW] = KEYMAP_STACKED
( (
@ -86,7 +86,7 @@ KEYMAPS(
,___ ,___ ,M(QW) ,Key_PrintScreen ,Key_ScrollLock ,Consumer_PlaySlashPause ,___ ,___ ,M(QW) ,Key_PrintScreen ,Key_ScrollLock ,Consumer_PlaySlashPause
) )
) )
/* *INDENT-ON* */ // clang-format on
KALEIDOSCOPE_INIT_PLUGINS( KALEIDOSCOPE_INIT_PLUGINS(
EEPROMSettings, EEPROMSettings,
@ -94,8 +94,7 @@ KALEIDOSCOPE_INIT_PLUGINS(
Focus, Focus,
FocusEEPROMCommand, FocusEEPROMCommand,
FocusSettingsCommand, FocusSettingsCommand,
Macros Macros);
);
const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) {
switch (macro_id) { switch (macro_id) {

Loading…
Cancel
Save