From e597957ab9c2d2bb8c5f4b5332156223f44cf94e Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sat, 3 Jun 2017 22:55:26 -0700 Subject: [PATCH] astyle with current project style guidelines --- examples/HostOS/HostOS.ino | 52 ++++++++++++++--------------- src/Kaleidoscope/HostOS-Base.cpp | 36 ++++++++++---------- src/Kaleidoscope/HostOS-Base.h | 30 ++++++++--------- src/Kaleidoscope/HostOS-Focus.cpp | 22 ++++++------ src/Kaleidoscope/HostOS-Focus.h | 2 +- src/Kaleidoscope/HostOS-Guesser.cpp | 36 ++++++++++---------- src/Kaleidoscope/HostOS-Guesser.h | 8 ++--- 7 files changed, 93 insertions(+), 93 deletions(-) diff --git a/examples/HostOS/HostOS.ino b/examples/HostOS/HostOS.ino index 870f0170..8f77f88b 100644 --- a/examples/HostOS/HostOS.ino +++ b/examples/HostOS/HostOS.ino @@ -20,36 +20,36 @@ #include const Key keymaps[][ROWS][COLS] PROGMEM = { - [0] = KEYMAP_STACKED - ( - Key_NoKey, Key_1, Key_2, Key_3, Key_4, Key_5, Key_NoKey, - Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab, - Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, - Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape, - - Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift, - Key_skip, - - Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, - Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, - Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, - Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, - - Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, - Key_skip - ), + [0] = KEYMAP_STACKED + ( + Key_NoKey, Key_1, Key_2, Key_3, Key_4, Key_5, Key_NoKey, + Key_Backtick, Key_Q, Key_W, Key_E, Key_R, Key_T, Key_Tab, + Key_PageUp, Key_A, Key_S, Key_D, Key_F, Key_G, + Key_PageDown, Key_Z, Key_X, Key_C, Key_V, Key_B, Key_Escape, + + Key_LeftControl, Key_Backspace, Key_LeftGui, Key_LeftShift, + Key_skip, + + Key_skip, Key_6, Key_7, Key_8, Key_9, Key_0, Key_skip, + Key_Enter, Key_Y, Key_U, Key_I, Key_O, Key_P, Key_Equals, + Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Quote, + Key_skip, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash, Key_Minus, + + Key_RightShift, Key_RightAlt, Key_Spacebar, Key_RightControl, + Key_skip + ), }; -void setup () { - Serial.begin (9600); +void setup() { + Serial.begin(9600); - Kaleidoscope.setup (KEYMAP_SIZE); - Kaleidoscope.use (&HostOS, NULL); + Kaleidoscope.setup(KEYMAP_SIZE); + Kaleidoscope.use(&HostOS, NULL); - Serial.print ("Host OS id is: "); - Serial.println (HostOS.os (), DEC); + Serial.print("Host OS id is: "); + Serial.println(HostOS.os(), DEC); } -void loop () { - Kaleidoscope.loop (); +void loop() { + Kaleidoscope.loop(); } diff --git a/src/Kaleidoscope/HostOS-Base.cpp b/src/Kaleidoscope/HostOS-Base.cpp index d03b512c..1e8cc58b 100644 --- a/src/Kaleidoscope/HostOS-Base.cpp +++ b/src/Kaleidoscope/HostOS-Base.cpp @@ -24,36 +24,36 @@ namespace KaleidoscopePlugins { namespace HostOS { void -Base::begin (void) { - if (isConfigured) - return; +Base::begin(void) { + if (isConfigured) + return; - eepromSlice = ::EEPROMSettings.requestSlice (sizeof (osType)); + eepromSlice = ::EEPROMSettings.requestSlice(sizeof(osType)); - isConfigured = true; + isConfigured = true; - if (osType != AUTO) { - return; - } + if (osType != AUTO) { + return; + } - if ((osType = (Type)EEPROM.read (eepromSlice)) != AUTO) - return; + if ((osType = (Type)EEPROM.read(eepromSlice)) != AUTO) + return; - autoDetect (); + autoDetect(); } HostOS::Type -Base::os (void) { - if (osType == AUTO) - autoDetect (); +Base::os(void) { + if (osType == AUTO) + autoDetect(); - return osType; + return osType; } void -Base::os (HostOS::Type osType_) { - osType = osType_; - EEPROM.update (eepromSlice, osType); +Base::os(HostOS::Type osType_) { + osType = osType_; + EEPROM.update(eepromSlice, osType); } }; }; diff --git a/src/Kaleidoscope/HostOS-Base.h b/src/Kaleidoscope/HostOS-Base.h index 1972d708..c3bce54e 100644 --- a/src/Kaleidoscope/HostOS-Base.h +++ b/src/Kaleidoscope/HostOS-Base.h @@ -23,28 +23,28 @@ namespace KaleidoscopePlugins { namespace HostOS { typedef enum { - LINUX, - OSX, - WINDOWS, - OTHER, + LINUX, + OSX, + WINDOWS, + OTHER, - AUTO = 0xff, + AUTO = 0xff, } Type; class Base : public KaleidoscopePlugin { - public: - virtual void begin (void) final; + public: + virtual void begin(void) final; - Type os (void); - void os (Type osType); + Type os(void); + void os(Type osType); - protected: - virtual void autoDetect (void) {}; - Type osType; + protected: + virtual void autoDetect(void) {}; + Type osType; - private: - uint16_t eepromSlice; - bool isConfigured = false; + private: + uint16_t eepromSlice; + bool isConfigured = false; }; }; }; diff --git a/src/Kaleidoscope/HostOS-Focus.cpp b/src/Kaleidoscope/HostOS-Focus.cpp index 9b68ef64..6bfce4f1 100644 --- a/src/Kaleidoscope/HostOS-Focus.cpp +++ b/src/Kaleidoscope/HostOS-Focus.cpp @@ -22,19 +22,19 @@ namespace KaleidoscopePlugins { namespace HostOS { bool -Focus (const char *command) { - if (strcmp_P (command, PSTR ("hostos.type")) != 0) - return false; +Focus(const char *command) { + if (strcmp_P(command, PSTR("hostos.type")) != 0) + return false; - if (Serial.peek () == '\n') { - Serial.println (::HostOS.os ()); - } else { - uint8_t os = Serial.parseInt (); - ::HostOS.os ((KaleidoscopePlugins::HostOS::Type) os); - } + if (Serial.peek() == '\n') { + Serial.println(::HostOS.os()); + } else { + uint8_t os = Serial.parseInt(); + ::HostOS.os((KaleidoscopePlugins::HostOS::Type) os); + } - Serial.read (); - return true; + Serial.read(); + return true; } } } diff --git a/src/Kaleidoscope/HostOS-Focus.h b/src/Kaleidoscope/HostOS-Focus.h index 70a6dd40..032c6076 100644 --- a/src/Kaleidoscope/HostOS-Focus.h +++ b/src/Kaleidoscope/HostOS-Focus.h @@ -22,7 +22,7 @@ namespace KaleidoscopePlugins { namespace HostOS { -bool Focus (const char *command); +bool Focus(const char *command); }; }; diff --git a/src/Kaleidoscope/HostOS-Guesser.cpp b/src/Kaleidoscope/HostOS-Guesser.cpp index 240ec80f..25af7b21 100644 --- a/src/Kaleidoscope/HostOS-Guesser.cpp +++ b/src/Kaleidoscope/HostOS-Guesser.cpp @@ -22,29 +22,29 @@ namespace KaleidoscopePlugins { namespace HostOS { -Guesser::Guesser (void) { +Guesser::Guesser(void) { } void -Guesser::autoDetect (void) { - Serial.begin (9600); +Guesser::autoDetect(void) { + Serial.begin(9600); - delay (15000); + delay(15000); - switch (FingerprintUSBHost.guessHostOS ()) { - case GuessedHost::WINDOWS: - osType = WINDOWS; - break; - case GuessedHost::LINUX: - osType = LINUX; - break; - case GuessedHost::MACOS: - osType = OSX; - break; - default: - osType = OTHER; - break; - } + switch (FingerprintUSBHost.guessHostOS()) { + case GuessedHost::WINDOWS: + osType = WINDOWS; + break; + case GuessedHost::LINUX: + osType = LINUX; + break; + case GuessedHost::MACOS: + osType = OSX; + break; + default: + osType = OTHER; + break; + } } }; }; diff --git a/src/Kaleidoscope/HostOS-Guesser.h b/src/Kaleidoscope/HostOS-Guesser.h index dc293e96..0d1e410c 100644 --- a/src/Kaleidoscope/HostOS-Guesser.h +++ b/src/Kaleidoscope/HostOS-Guesser.h @@ -23,11 +23,11 @@ namespace KaleidoscopePlugins { namespace HostOS { class Guesser : public Base { - public: - Guesser (void); + public: + Guesser(void); - protected: - virtual void autoDetect (void) final; + protected: + virtual void autoDetect(void) final; }; } };