From f9697e25f388880ce147229dd648dfc82fa1572a Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Mon, 4 Apr 2022 00:30:49 -0500 Subject: [PATCH] Apply `clang-format` to example sketches Signed-off-by: Michael Richters --- examples/Devices/Keyboardio/Atreus/Atreus.ino | 20 +++-- examples/Devices/Keyboardio/Imago/Imago.ino | 78 ++++++++++--------- .../Devices/Keyboardio/Model01/Model01.ino | 35 ++++++--- .../Devices/Keyboardio/Model100/Model100.ino | 37 +++++---- examples/Devices/OLKB/Planck/Planck.ino | 17 ++-- .../Devices/Technomancy/Atreus/Atreus.ino | 12 +-- .../EEPROM/DynamicMacros/DynamicMacros.ino | 3 +- examples/Features/FocusSerial/FocusSerial.ino | 2 +- .../GhostInTheFirmware/GhostInTheFirmware.ino | 10 +-- examples/Features/Layers/Layers.ino | 10 ++- .../Features/ShiftBlocker/ShiftBlocker.ino | 5 +- .../Sketch_Exploration/Sketch_Exploration.ino | 13 ++-- examples/Keystrokes/AutoShift/AutoShift.ino | 4 +- examples/Keystrokes/CharShift/CharShift.ino | 6 +- examples/Keystrokes/Leader/Leader.ino | 4 +- .../Keystrokes/LeaderPrefix/LeaderPrefix.ino | 24 ++++-- examples/Keystrokes/Macros/Macros.ino | 6 +- examples/Keystrokes/SpaceCadet/SpaceCadet.ino | 16 ++-- .../Keystrokes/WinKeyToggle/WinKeyToggle.ino | 5 +- examples/LEDs/IdleLEDs/IdleLEDs.ino | 2 +- .../LED-ActiveLayerColor.ino | 3 +- .../LEDs/LED-AlphaSquare/LED-AlphaSquare.ino | 10 +-- .../LED-Palette-Theme/LED-Palette-Theme.ino | 8 +- examples/LEDs/LED-Wavepool/LED-Wavepool.ino | 2 +- 24 files changed, 181 insertions(+), 151 deletions(-) diff --git a/examples/Devices/Keyboardio/Atreus/Atreus.ino b/examples/Devices/Keyboardio/Atreus/Atreus.ino index e036466b..9215fa20 100644 --- a/examples/Devices/Keyboardio/Atreus/Atreus.ino +++ b/examples/Devices/Keyboardio/Atreus/Atreus.ino @@ -32,7 +32,6 @@ #include "Kaleidoscope-SpaceCadet.h" - #define MO(n) ShiftToLayer(n) #define TG(n) LockLayer(n) @@ -42,14 +41,14 @@ enum { }; #define Key_Exclamation LSHIFT(Key_1) -#define Key_At LSHIFT(Key_2) -#define Key_Hash LSHIFT(Key_3) -#define Key_Dollar LSHIFT(Key_4) -#define Key_Percent LSHIFT(Key_5) -#define Key_Caret LSHIFT(Key_6) -#define Key_And LSHIFT(Key_7) -#define Key_Star LSHIFT(Key_8) -#define Key_Plus LSHIFT(Key_Equals) +#define Key_At LSHIFT(Key_2) +#define Key_Hash LSHIFT(Key_3) +#define Key_Dollar LSHIFT(Key_4) +#define Key_Percent LSHIFT(Key_5) +#define Key_Caret LSHIFT(Key_6) +#define Key_And LSHIFT(Key_7) +#define Key_Star LSHIFT(Key_8) +#define Key_Plus LSHIFT(Key_Equals) enum { QWERTY, @@ -110,8 +109,7 @@ KALEIDOSCOPE_INIT_PLUGINS( SpaceCadet, OneShot, Macros, - MouseKeys -); + MouseKeys); const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { if (keyToggledOn(event.state)) { diff --git a/examples/Devices/Keyboardio/Imago/Imago.ino b/examples/Devices/Keyboardio/Imago/Imago.ino index 9813eece..b36acdb2 100644 --- a/examples/Devices/Keyboardio/Imago/Imago.ino +++ b/examples/Devices/Keyboardio/Imago/Imago.ino @@ -50,8 +50,9 @@ #include "Kaleidoscope-USB-Quirks.h" -enum { _QWERTY, - }; +enum { + _QWERTY, +}; // clang-format off @@ -70,7 +71,6 @@ Key_F5, Key_LeftControl,Key_LeftAlt, Key_LeftGui, Key_Backspace, Key_LeftAr // clang-format on - // These 'solid' color effect definitions define a rainbow of // LED color modes calibrated to draw 500mA or less on the // Keyboardio Model 01. @@ -133,51 +133,57 @@ static void toggleKeyboardProtocol(uint8_t combo_index) { /** Magic combo list, a list of key combo and action pairs the firmware should * recognise. */ -USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol, - // Left Fn + Esc + Shift - .keys = { R3C6, R2C6, R3C7 } - }); +USE_MAGIC_COMBOS( + {.action = toggleKeyboardProtocol, + // Left Fn + Esc + Shift + .keys = {R3C6, R2C6, R3C7}}); -KALEIDOSCOPE_INIT_PLUGINS(Macros, +KALEIDOSCOPE_INIT_PLUGINS( + Macros, - // LEDControl provides support for other LED modes - LEDControl, + // LEDControl provides support for other LED modes + LEDControl, - // The rainbow effect changes the color of all of the keyboard's keys at the same time - // running through all the colors of the rainbow. - LEDRainbowEffect, + // The rainbow effect changes the color of all of the keyboard's keys at the same time + // running through all the colors of the rainbow. + LEDRainbowEffect, - // The rainbow wave effect lights up your keyboard with all the colors of a rainbow - // and slowly moves the rainbow across your keyboard - LEDRainbowWaveEffect, + // The rainbow wave effect lights up your keyboard with all the colors of a rainbow + // and slowly moves the rainbow across your keyboard + LEDRainbowWaveEffect, - // The chase effect follows the adventure of a blue pixel which chases a red pixel across - // your keyboard. Spoiler: the blue pixel never catches the red pixel - LEDChaseEffect, + // The chase effect follows the adventure of a blue pixel which chases a red pixel across + // your keyboard. Spoiler: the blue pixel never catches the red pixel + LEDChaseEffect, - // These static effects turn your keyboard's LEDs a variety of colors - solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet, + // These static effects turn your keyboard's LEDs a variety of colors + solidRed, + solidOrange, + solidYellow, + solidGreen, + solidBlue, + solidIndigo, + solidViolet, - // The breathe effect slowly pulses all of the LEDs on your keyboard - LEDBreatheEffect, + // The breathe effect slowly pulses all of the LEDs on your keyboard + LEDBreatheEffect, - // The HostPowerManagement plugin allows us to turn LEDs off when then host - // goes to sleep, and resume them when it wakes up. - HostPowerManagement, + // The HostPowerManagement plugin allows us to turn LEDs off when then host + // goes to sleep, and resume them when it wakes up. + HostPowerManagement, - // The MagicCombo plugin lets you use key combinations to trigger custom - // actions - a bit like Macros, but triggered by pressing multiple keys at the - // same time. - MagicCombo, + // The MagicCombo plugin lets you use key combinations to trigger custom + // actions - a bit like Macros, but triggered by pressing multiple keys at the + // same time. + MagicCombo, - // The USBQuirks plugin lets you do some things with USB that we aren't - // comfortable - or able - to do automatically, but can be useful - // nevertheless. Such as toggling the key report protocol between Boot (used - // by BIOSes) and Report (NKRO). - USBQuirks - ); + // The USBQuirks plugin lets you do some things with USB that we aren't + // comfortable - or able - to do automatically, but can be useful + // nevertheless. Such as toggling the key report protocol between Boot (used + // by BIOSes) and Report (NKRO). + USBQuirks); void setup() { Kaleidoscope.setup(); diff --git a/examples/Devices/Keyboardio/Model01/Model01.ino b/examples/Devices/Keyboardio/Model01/Model01.ino index d8aef7ab..b66cc0d2 100644 --- a/examples/Devices/Keyboardio/Model01/Model01.ino +++ b/examples/Devices/Keyboardio/Model01/Model01.ino @@ -86,10 +86,17 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { if (macro_id == 1 && keyToggledOn(event.state)) { Kaleidoscope.serialPort().print("Keyboard.IO keyboard driver v0.00"); return MACRO(I(25), - D(LeftShift), T(M), U(LeftShift), T(O), T(D), T(E), T(L), + D(LeftShift), + T(M), + U(LeftShift), + T(O), + T(D), + T(E), + T(L), T(Spacebar), W(100), - T(0), T(1)); + T(0), + T(1)); } return MACRO_NONE; } @@ -105,16 +112,24 @@ static void enterHardwareTestMode(uint8_t combo_index) { /** Magic combo list, a list of key combo and action pairs the firmware should * recognise. */ -USE_MAGIC_COMBOS({ - .action = enterHardwareTestMode, - // Left Fn + Prog + LED - .keys = { R3C6, R0C0, R0C6 } -}); +USE_MAGIC_COMBOS({.action = enterHardwareTestMode, + // Left Fn + Prog + LED + .keys = {R3C6, R0C0, R0C6}}); KALEIDOSCOPE_INIT_PLUGINS(HardwareTestMode, - LEDControl, LEDOff, - solidRed, solidOrange, solidYellow, solidGreen, solidBlue, solidIndigo, solidViolet, - LEDBreatheEffect, LEDRainbowEffect, LEDChaseEffect, NumPad, + LEDControl, + LEDOff, + solidRed, + solidOrange, + solidYellow, + solidGreen, + solidBlue, + solidIndigo, + solidViolet, + LEDBreatheEffect, + LEDRainbowEffect, + LEDChaseEffect, + NumPad, Macros, MouseKeys, MagicCombo); diff --git a/examples/Devices/Keyboardio/Model100/Model100.ino b/examples/Devices/Keyboardio/Model100/Model100.ino index 7311780d..2a720a17 100644 --- a/examples/Devices/Keyboardio/Model100/Model100.ino +++ b/examples/Devices/Keyboardio/Model100/Model100.ino @@ -88,10 +88,10 @@ * a macro key is pressed. */ -enum { MACRO_VERSION_INFO, - MACRO_ANY - }; - +enum { + MACRO_VERSION_INFO, + MACRO_ANY, +}; /** The Model 100's key layouts are defined as 'keymaps'. By default, there are three @@ -142,7 +142,11 @@ enum { MACRO_VERSION_INFO, * */ -enum { PRIMARY, NUMPAD, FUNCTION }; // layers +enum { + PRIMARY, + NUMPAD, + FUNCTION, +}; // layers /** @@ -164,7 +168,6 @@ enum { PRIMARY, NUMPAD, FUNCTION }; // layers // #define PRIMARY_KEYMAP_CUSTOM - /* This comment temporarily turns off astyle's indent enforcement * so we can make the keymaps actually resemble the physical key layout better */ @@ -336,7 +339,6 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { } - // These 'solid' color effect definitions define a rainbow of // LED color modes calibrated to draw 500mA or less on the // Keyboardio Model 100. @@ -412,12 +414,10 @@ static void enterHardwareTestMode(uint8_t combo_index) { */ USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol, // Left Fn + Esc + Shift - .keys = { R3C6, R2C6, R3C7 } -}, { - .action = enterHardwareTestMode, - // Left Fn + Prog + LED - .keys = { R3C6, R0C0, R0C6 } -}); + .keys = {R3C6, R2C6, R3C7}}, + {.action = enterHardwareTestMode, + // Left Fn + Prog + LED + .keys = {R3C6, R0C0, R0C6}}); // First, tell Kaleidoscope which plugins you want to use. // The order can be important. For example, LED effects are @@ -468,7 +468,13 @@ KALEIDOSCOPE_INIT_PLUGINS( LEDChaseEffect, // 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 LEDBreatheEffect, @@ -510,8 +516,7 @@ KALEIDOSCOPE_INIT_PLUGINS( // comfortable - or able - to do automatically, but can be useful // nevertheless. Such as toggling the key report protocol between Boot (used // by BIOSes) and Report (NKRO). - USBQuirks -); + USBQuirks); /** 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 diff --git a/examples/Devices/OLKB/Planck/Planck.ino b/examples/Devices/OLKB/Planck/Planck.ino index a6c2f46a..18f17a69 100644 --- a/examples/Devices/OLKB/Planck/Planck.ino +++ b/examples/Devices/OLKB/Planck/Planck.ino @@ -20,14 +20,15 @@ #include "Kaleidoscope.h" #include "Kaleidoscope-Macros.h" -enum { _QWERTY, - _COLEMAK, - _DVORAK, - _LOWER, - _RAISE, - _PLOVER, - _ADJUST - }; +enum { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; // clang-format off diff --git a/examples/Devices/Technomancy/Atreus/Atreus.ino b/examples/Devices/Technomancy/Atreus/Atreus.ino index 004e6389..51c302b5 100644 --- a/examples/Devices/Technomancy/Atreus/Atreus.ino +++ b/examples/Devices/Technomancy/Atreus/Atreus.ino @@ -30,12 +30,12 @@ enum { }; #define Key_Exclamation LSHIFT(Key_1) -#define Key_At LSHIFT(Key_2) -#define Key_Hash LSHIFT(Key_3) -#define Key_Dollar LSHIFT(Key_4) -#define Key_And LSHIFT(Key_7) -#define Key_Star LSHIFT(Key_8) -#define Key_Plus LSHIFT(Key_Equals) +#define Key_At LSHIFT(Key_2) +#define Key_Hash LSHIFT(Key_3) +#define Key_Dollar LSHIFT(Key_4) +#define Key_And LSHIFT(Key_7) +#define Key_Star LSHIFT(Key_8) +#define Key_Plus LSHIFT(Key_Equals) // clang-format off KEYMAPS( diff --git a/examples/Features/EEPROM/DynamicMacros/DynamicMacros.ino b/examples/Features/EEPROM/DynamicMacros/DynamicMacros.ino index b2c7fa60..1a6267c0 100644 --- a/examples/Features/EEPROM/DynamicMacros/DynamicMacros.ino +++ b/examples/Features/EEPROM/DynamicMacros/DynamicMacros.ino @@ -46,8 +46,7 @@ KALEIDOSCOPE_INIT_PLUGINS( EEPROMSettings, EEPROMKeymap, DynamicMacros, - Focus -); + Focus); void setup() { Kaleidoscope.setup(); diff --git a/examples/Features/FocusSerial/FocusSerial.ino b/examples/Features/FocusSerial/FocusSerial.ino index ce11cbae..dd6c00d7 100644 --- a/examples/Features/FocusSerial/FocusSerial.ino +++ b/examples/Features/FocusSerial/FocusSerial.ino @@ -70,7 +70,7 @@ class FocusHelpCommand : public Plugin { } }; -} +} // namespace kaleidoscope kaleidoscope::FocusTestCommand FocusTestCommand; kaleidoscope::FocusHelpCommand FocusHelpCommand; diff --git a/examples/Features/GhostInTheFirmware/GhostInTheFirmware.ino b/examples/Features/GhostInTheFirmware/GhostInTheFirmware.ino index 9c9b6544..2236c728 100644 --- a/examples/Features/GhostInTheFirmware/GhostInTheFirmware.ino +++ b/examples/Features/GhostInTheFirmware/GhostInTheFirmware.ino @@ -61,12 +61,13 @@ class EventDropper : public Plugin { void toggle() { active_ = !active_; } + private: bool active_ = false; }; -} // namespace plugin -} // namespace kaleidoscope +} // namespace plugin +} // namespace kaleidoscope kaleidoscope::plugin::EventDropper EventDropper; @@ -95,8 +96,7 @@ static const kaleidoscope::plugin::GhostInTheFirmware::GhostKey ghost_keys[] PRO {KeyAddr(3, 14), 200, 50}, {KeyAddr(3, 15), 200, 50}, - {KeyAddr::none(), 0, 0} -}; + {KeyAddr::none(), 0, 0}}; KALEIDOSCOPE_INIT_PLUGINS(GhostInTheFirmware, LEDControl, @@ -107,7 +107,7 @@ KALEIDOSCOPE_INIT_PLUGINS(GhostInTheFirmware, void setup() { Kaleidoscope.setup(); - StalkerEffect.variant = STALKER(BlazingTrail); + StalkerEffect.variant = STALKER(BlazingTrail); GhostInTheFirmware.ghost_keys = ghost_keys; } diff --git a/examples/Features/Layers/Layers.ino b/examples/Features/Layers/Layers.ino index 0dece439..b5cfd177 100644 --- a/examples/Features/Layers/Layers.ino +++ b/examples/Features/Layers/Layers.ino @@ -19,7 +19,11 @@ #include #include -enum { PRIMARY, NUMPAD, FUNCTION }; // layers +enum { + PRIMARY, + NUMPAD, + FUNCTION, +}; // layers // clang-format off KEYMAPS( @@ -71,7 +75,7 @@ KEYMAPS( // clang-format on namespace kaleidoscope { -class LayerDumper: public Plugin { +class LayerDumper : public Plugin { public: LayerDumper() {} @@ -89,7 +93,7 @@ class LayerDumper: public Plugin { } }; -} +} // namespace kaleidoscope kaleidoscope::LayerDumper LayerDumper; diff --git a/examples/Features/ShiftBlocker/ShiftBlocker.ino b/examples/Features/ShiftBlocker/ShiftBlocker.ino index 23a5113d..02400dbd 100644 --- a/examples/Features/ShiftBlocker/ShiftBlocker.ino +++ b/examples/Features/ShiftBlocker/ShiftBlocker.ino @@ -64,11 +64,10 @@ class ShiftBlocker : public Plugin { private: bool active_{false}; - }; -} // namespace plugin -} // namespace kaleidoscope +} // namespace plugin +} // namespace kaleidoscope kaleidoscope::plugin::ShiftBlocker ShiftBlocker; diff --git a/examples/Internal/Sketch_Exploration/Sketch_Exploration.ino b/examples/Internal/Sketch_Exploration/Sketch_Exploration.ino index 4027e8fc..91c3ef2c 100644 --- a/examples/Internal/Sketch_Exploration/Sketch_Exploration.ino +++ b/examples/Internal/Sketch_Exploration/Sketch_Exploration.ino @@ -44,7 +44,7 @@ KEYMAPS( ) // clang-format on -using namespace kaleidoscope::sketch_exploration; // NOLINT(build/namespaces) +using namespace kaleidoscope::sketch_exploration; // NOLINT(build/namespaces) class BPlugin : public kaleidoscope::Plugin {}; class CPlugin : public kaleidoscope::Plugin {}; @@ -54,7 +54,8 @@ class CPlugin : public kaleidoscope::Plugin {}; class APlugin : public kaleidoscope::Plugin { public: - APlugin() : has_key_1_{false} {} + APlugin() + : has_key_1_{false} {} template kaleidoscope::EventHandlerResult exploreSketch() { @@ -72,7 +73,7 @@ class APlugin : public kaleidoscope::Plugin { constexpr bool has_key_1 = K::collect(HasKey{Key_1}); static_assert(has_key_1, "Error querying key existence"); - has_key_1_ = has_key_1; // Assign the temporary that was computed + has_key_1_ = has_key_1; // Assign the temporary that was computed // at compile time. constexpr Key max_key = K::collect(MaxKeyRaw{}); @@ -81,7 +82,7 @@ class APlugin : public kaleidoscope::Plugin { static_assert(K::getKey(0 /*layer*/, KeyAddr{2, 3}) == Key_D, "Key lookup failed"); - constexpr auto n_layers = K::nLayers(); + constexpr auto n_layers = K::nLayers(); constexpr auto layer_size = K::layerSize(); // Plugin exploration @@ -117,7 +118,6 @@ class APlugin : public kaleidoscope::Plugin { } private: - bool has_key_1_; }; @@ -127,8 +127,7 @@ BPlugin b_plugin; KALEIDOSCOPE_INIT_PLUGINS( a_plugin1, b_plugin, - a_plugin2 -) + a_plugin2) void setup() { Kaleidoscope.setup(); diff --git a/examples/Keystrokes/AutoShift/AutoShift.ino b/examples/Keystrokes/AutoShift/AutoShift.ino index 2997508f..4b6cbc35 100644 --- a/examples/Keystrokes/AutoShift/AutoShift.ino +++ b/examples/Keystrokes/AutoShift/AutoShift.ino @@ -56,8 +56,8 @@ KALEIDOSCOPE_INIT_PLUGINS( FocusEEPROMCommand, // for AutoShiftConfig FocusSettingsCommand, // for AutoShiftConfig AutoShift, - AutoShiftConfig, // for AutoShiftConfig - Macros // for toggle AutoShift Macro + AutoShiftConfig, // for AutoShiftConfig + Macros // for toggle AutoShift Macro ); void setup() { diff --git a/examples/Keystrokes/CharShift/CharShift.ino b/examples/Keystrokes/CharShift/CharShift.ino index ff6c9a83..ac3ad49c 100644 --- a/examples/Keystrokes/CharShift/CharShift.ino +++ b/examples/Keystrokes/CharShift/CharShift.ino @@ -31,9 +31,9 @@ KALEIDOSCOPE_INIT_PLUGINS(CharShift); void setup() { CS_KEYS( - kaleidoscope::plugin::CharShift::KeyPair(Key_Comma, Key_Semicolon), // CS(0) - kaleidoscope::plugin::CharShift::KeyPair(Key_Period, LSHIFT(Key_Semicolon)), // CS(1) - kaleidoscope::plugin::CharShift::KeyPair(LSHIFT(Key_Comma), LSHIFT(Key_Period)), // CS(2) + kaleidoscope::plugin::CharShift::KeyPair(Key_Comma, Key_Semicolon), // CS(0) + kaleidoscope::plugin::CharShift::KeyPair(Key_Period, LSHIFT(Key_Semicolon)), // CS(1) + kaleidoscope::plugin::CharShift::KeyPair(LSHIFT(Key_Comma), LSHIFT(Key_Period)), // CS(2) ); Kaleidoscope.setup(); } diff --git a/examples/Keystrokes/Leader/Leader.ino b/examples/Keystrokes/Leader/Leader.ino index c2ea13a2..b1c1163d 100644 --- a/examples/Keystrokes/Leader/Leader.ino +++ b/examples/Keystrokes/Leader/Leader.ino @@ -50,8 +50,8 @@ static void leaderTestAA(uint8_t seq_index) { } static const kaleidoscope::plugin::Leader::dictionary_t leader_dictionary[] PROGMEM = -LEADER_DICT({LEADER_SEQ(LEAD(0), Key_A), leaderTestA}, -{LEADER_SEQ(LEAD(0), Key_A, Key_A), leaderTestAA}); + LEADER_DICT({LEADER_SEQ(LEAD(0), Key_A), leaderTestA}, + {LEADER_SEQ(LEAD(0), Key_A, Key_A), leaderTestAA}); KALEIDOSCOPE_INIT_PLUGINS(Leader); diff --git a/examples/Keystrokes/LeaderPrefix/LeaderPrefix.ino b/examples/Keystrokes/LeaderPrefix/LeaderPrefix.ino index 8aa6a129..14ee4a33 100644 --- a/examples/Keystrokes/LeaderPrefix/LeaderPrefix.ino +++ b/examples/Keystrokes/LeaderPrefix/LeaderPrefix.ino @@ -74,7 +74,7 @@ class LeaderPrefix : public Plugin { if (keyToggledOn(event.state) && isLeaderKey(event.key)) { // A Leader key toggled on, so we set our state to "active", and set the // arg value to zero. - active_ = true; + active_ = true; leader_arg_ = 0; } // Whether or not the plugin just became active, there's nothing more to @@ -122,8 +122,16 @@ class LeaderPrefix : public Plugin { private: // The "digit keys": these are the keys on the number row of the Model01. KeyAddr digit_addrs_[10] = { - KeyAddr(0, 14), KeyAddr(0, 1), KeyAddr(0, 2), KeyAddr(0, 3), KeyAddr(0, 4), - KeyAddr(0, 5), KeyAddr(0, 10), KeyAddr(0, 11), KeyAddr(0, 12), KeyAddr(0, 13), + KeyAddr(0, 14), + KeyAddr(0, 1), + KeyAddr(0, 2), + KeyAddr(0, 3), + KeyAddr(0, 4), + KeyAddr(0, 5), + KeyAddr(0, 10), + KeyAddr(0, 11), + KeyAddr(0, 12), + KeyAddr(0, 13), }; // This event tracker is necessary to prevent re-processing events. Any @@ -144,8 +152,8 @@ class LeaderPrefix : public Plugin { } }; -} // namespace plugin -} // namespace kaleidoscope +} // namespace plugin +} // namespace kaleidoscope // This creates our plugin object. kaleidoscope::plugin::LeaderPrefix LeaderPrefix; @@ -172,9 +180,9 @@ void leaderTestPrefix(uint8_t seq_index) { } static const kaleidoscope::plugin::Leader::dictionary_t leader_dictionary[] PROGMEM = -LEADER_DICT({LEADER_SEQ(LEAD(0), Key_X), leaderTestX}, -{LEADER_SEQ(LEAD(0), Key_X, Key_X), leaderTestXX}, -{LEADER_SEQ(LEAD(0), Key_Z), leaderTestPrefix}); + LEADER_DICT({LEADER_SEQ(LEAD(0), Key_X), leaderTestX}, + {LEADER_SEQ(LEAD(0), Key_X, Key_X), leaderTestXX}, + {LEADER_SEQ(LEAD(0), Key_Z), leaderTestPrefix}); // The order matters here; LeaderPrefix won't work unless it precedes Leader in // this list. If there are other plugins in the list, these two should ideally diff --git a/examples/Keystrokes/Macros/Macros.ino b/examples/Keystrokes/Macros/Macros.ino index ae5a6609..c7fba475 100644 --- a/examples/Keystrokes/Macros/Macros.ino +++ b/examples/Keystrokes/Macros/Macros.ino @@ -71,7 +71,7 @@ void macroTypeString(KeyEvent &event) { } // Example macro for macro step sequence. -const macro_t* macroSteps(KeyEvent &event) { +const macro_t *macroSteps(KeyEvent &event) { if (keyToggledOn(event.state)) { // Note that the following sequence leaves two keys down (`Key_RightAlt` and // `Key_C`). These virtual keys will remain in effect until the Macros key @@ -82,7 +82,7 @@ const macro_t* macroSteps(KeyEvent &event) { } // Example macro that sets `event.key`. -const macro_t* macroNewSentence1(KeyEvent &event) { +const macro_t *macroNewSentence1(KeyEvent &event) { if (keyToggledOn(event.state)) { event.key = OSM(LeftShift); return MACRO(Tc(Period), Tc(Spacebar), Tc(Spacebar)); @@ -114,7 +114,7 @@ void macroNewSentence3(KeyEvent &event) { // Macro that auto-repeats? -const macro_t* macroAction(uint8_t macro_id, KeyEvent &event) { +const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { switch (macro_id) { case 0: diff --git a/examples/Keystrokes/SpaceCadet/SpaceCadet.ino b/examples/Keystrokes/SpaceCadet/SpaceCadet.ino index bffacbde..c9b983ca 100644 --- a/examples/Keystrokes/SpaceCadet/SpaceCadet.ino +++ b/examples/Keystrokes/SpaceCadet/SpaceCadet.ino @@ -49,14 +49,14 @@ void setup() { //Setting is {KeyThatWasPressed, AlternativeKeyToSend, TimeoutInMS} //Note: must end with the SPACECADET_MAP_END delimiter static kaleidoscope::plugin::SpaceCadet::KeyBinding spacecadetmap[] = { - {Key_LeftShift, Key_LeftParen, 250} - , {Key_RightShift, Key_RightParen, 250} - , {Key_LeftGui, Key_LeftCurlyBracket, 250} - , {Key_RightAlt, Key_RightCurlyBracket, 250} - , {Key_LeftAlt, Key_RightCurlyBracket, 250} - , {Key_LeftControl, Key_LeftBracket, 250} - , {Key_RightControl, Key_RightBracket, 250} - , SPACECADET_MAP_END + {Key_LeftShift, Key_LeftParen, 250}, + {Key_RightShift, Key_RightParen, 250}, + {Key_LeftGui, Key_LeftCurlyBracket, 250}, + {Key_RightAlt, Key_RightCurlyBracket, 250}, + {Key_LeftAlt, Key_RightCurlyBracket, 250}, + {Key_LeftControl, Key_LeftBracket, 250}, + {Key_RightControl, Key_RightBracket, 250}, + SPACECADET_MAP_END, }; //Set the map. SpaceCadet.map = spacecadetmap; diff --git a/examples/Keystrokes/WinKeyToggle/WinKeyToggle.ino b/examples/Keystrokes/WinKeyToggle/WinKeyToggle.ino index 35e03c06..c4a69b9b 100644 --- a/examples/Keystrokes/WinKeyToggle/WinKeyToggle.ino +++ b/examples/Keystrokes/WinKeyToggle/WinKeyToggle.ino @@ -28,9 +28,8 @@ void toggleWinKey(uint8_t index) { } USE_MAGIC_COMBOS([WINKEYTOGGLE] = { - .action = toggleWinKey, - .keys = {R3C6, R3C9} -}); + .action = toggleWinKey, + .keys = {R3C6, R3C9}}); // clang-format off KEYMAPS( diff --git a/examples/LEDs/IdleLEDs/IdleLEDs.ino b/examples/LEDs/IdleLEDs/IdleLEDs.ino index ca33b35e..55018e51 100644 --- a/examples/LEDs/IdleLEDs/IdleLEDs.ino +++ b/examples/LEDs/IdleLEDs/IdleLEDs.ino @@ -56,7 +56,7 @@ void setup() { Kaleidoscope.setup(); - PersistentIdleLEDs.setIdleTimeoutSeconds(300); // 5 minutes + PersistentIdleLEDs.setIdleTimeoutSeconds(300); // 5 minutes LEDRainbowWaveEffect.activate(); } diff --git a/examples/LEDs/LED-ActiveLayerColor/LED-ActiveLayerColor.ino b/examples/LEDs/LED-ActiveLayerColor/LED-ActiveLayerColor.ino index e65ab57d..fcd36c5e 100644 --- a/examples/LEDs/LED-ActiveLayerColor/LED-ActiveLayerColor.ino +++ b/examples/LEDs/LED-ActiveLayerColor/LED-ActiveLayerColor.ino @@ -66,8 +66,7 @@ KALEIDOSCOPE_INIT_PLUGINS(LEDControl, void setup() { static const cRGB layerColormap[] PROGMEM = { CRGB(128, 0, 0), - CRGB(0, 128, 0) - }; + CRGB(0, 128, 0)}; Kaleidoscope.setup(); LEDActiveLayerColorEffect.setColormap(layerColormap); diff --git a/examples/LEDs/LED-AlphaSquare/LED-AlphaSquare.ino b/examples/LEDs/LED-AlphaSquare/LED-AlphaSquare.ino index 57d8c958..2a46ba8e 100644 --- a/examples/LEDs/LED-AlphaSquare/LED-AlphaSquare.ino +++ b/examples/LEDs/LED-AlphaSquare/LED-AlphaSquare.ino @@ -57,12 +57,12 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { col = 10; for (uint8_t step = 0; step <= 0xf0; step += 8) { - AlphaSquare.color = { step, step, step }; + AlphaSquare.color = {step, step, step}; AlphaSquare.display({i, 0}, col); delay(10); } for (uint8_t step = 0xff; step >= 8; step -= 8) { - AlphaSquare.color = { step, step, step }; + AlphaSquare.color = {step, step, step}; AlphaSquare.display({i, 0}, col); delay(10); } @@ -74,14 +74,14 @@ const macro_t *macroAction(uint8_t macro_id, KeyEvent &event) { delay(100); for (uint8_t step = 0; step <= 0xf0; step += 8) { - AlphaSquare.color = { step, step, step }; + AlphaSquare.color = {step, step, step}; AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 2); AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 10); delay(10); } for (uint8_t step = 0xff; step >= 8; step -= 8) { - AlphaSquare.color = { step, step, step }; + AlphaSquare.color = {step, step, step}; AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 2); AlphaSquare.display(kaleidoscope::plugin::alpha_square::symbols::Lambda, 10); delay(10); @@ -102,7 +102,7 @@ KALEIDOSCOPE_INIT_PLUGINS(LEDControl, void setup() { Kaleidoscope.setup(); - AlphaSquare.color = { 0xcb, 0xc0, 0xff }; + AlphaSquare.color = {0xcb, 0xc0, 0xff}; } void loop() { diff --git a/examples/LEDs/LED-Palette-Theme/LED-Palette-Theme.ino b/examples/LEDs/LED-Palette-Theme/LED-Palette-Theme.ino index a9ec1d58..25e0e2ea 100644 --- a/examples/LEDs/LED-Palette-Theme/LED-Palette-Theme.ino +++ b/examples/LEDs/LED-Palette-Theme/LED-Palette-Theme.ino @@ -39,13 +39,11 @@ class TestLEDMode : public kaleidoscope::plugin::LEDMode { uint16_t TestLEDMode::map_base_; -void -TestLEDMode::setup() { +void TestLEDMode::setup() { map_base_ = LEDPaletteTheme.reserveThemes(1); } -void -TestLEDMode::update(void) { +void TestLEDMode::update(void) { LEDPaletteTheme.updateHandler(map_base_, 0); } @@ -54,7 +52,7 @@ TestLEDMode::onFocusEvent(const char *command) { return LEDPaletteTheme.themeFocusEvent(command, PSTR("testLedMode.map"), map_base_, 1); } -} +} // namespace example example::TestLEDMode TestLEDMode; diff --git a/examples/LEDs/LED-Wavepool/LED-Wavepool.ino b/examples/LEDs/LED-Wavepool/LED-Wavepool.ino index 581fa84b..3cd8486e 100644 --- a/examples/LEDs/LED-Wavepool/LED-Wavepool.ino +++ b/examples/LEDs/LED-Wavepool/LED-Wavepool.ino @@ -53,7 +53,7 @@ void setup() { Kaleidoscope.setup(); WavepoolEffect.idle_timeout = 5000; // 5 seconds - WavepoolEffect.ripple_hue = WavepoolEffect.rainbow_hue; + WavepoolEffect.ripple_hue = WavepoolEffect.rainbow_hue; WavepoolEffect.activate(); }