From 69f244b43bf8b87cf65efae02cf3ad8c31b48607 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 26 May 2017 16:20:22 -0700 Subject: [PATCH] make astyle --- examples/HostOS/HostOS.ino | 48 +++++++++++++------------- src/Kaleidoscope/HostOS-Base.cpp | 44 ++++++++++++------------ src/Kaleidoscope/HostOS-Base.h | 52 ++++++++++++++--------------- src/Kaleidoscope/HostOS-Focus.cpp | 22 ++++++------ src/Kaleidoscope/HostOS-Focus.h | 6 ++-- src/Kaleidoscope/HostOS-Guesser.cpp | 28 ++++++++-------- src/Kaleidoscope/HostOS-Guesser.h | 16 ++++----- 7 files changed, 108 insertions(+), 108 deletions(-) diff --git a/examples/HostOS/HostOS.ino b/examples/HostOS/HostOS.ino index 2ed0d48d..870f0170 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); + 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 (); + Kaleidoscope.loop (); } diff --git a/src/Kaleidoscope/HostOS-Base.cpp b/src/Kaleidoscope/HostOS-Base.cpp index 67980733..d03b512c 100644 --- a/src/Kaleidoscope/HostOS-Base.cpp +++ b/src/Kaleidoscope/HostOS-Base.cpp @@ -22,38 +22,38 @@ #include namespace KaleidoscopePlugins { - namespace HostOS { - void - Base::begin (void) { - if (isConfigured) +namespace HostOS { +void +Base::begin (void) { + if (isConfigured) return; - eepromSlice = ::EEPROMSettings.requestSlice (sizeof (osType)); + eepromSlice = ::EEPROMSettings.requestSlice (sizeof (osType)); - isConfigured = true; + isConfigured = true; - if (osType != AUTO) { + if (osType != AUTO) { return; - } + } - if ((osType = (Type)EEPROM.read (eepromSlice)) != AUTO) + if ((osType = (Type)EEPROM.read (eepromSlice)) != AUTO) return; - autoDetect (); - } + autoDetect (); +} - HostOS::Type - Base::os (void) { - if (osType == AUTO) +HostOS::Type +Base::os (void) { + if (osType == AUTO) autoDetect (); - return osType; - } + return osType; +} - void - Base::os (HostOS::Type osType_) { - osType = osType_; - EEPROM.update (eepromSlice, osType); - } - }; +void +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 6ef48216..1972d708 100644 --- a/src/Kaleidoscope/HostOS-Base.h +++ b/src/Kaleidoscope/HostOS-Base.h @@ -21,32 +21,32 @@ #include namespace KaleidoscopePlugins { - namespace HostOS { - typedef enum { - LINUX, - OSX, - WINDOWS, - OTHER, - - AUTO = 0xff, - } Type; - - class Base : public KaleidoscopePlugin { - public: - virtual void begin (void) final; - - Type os (void); - void os (Type osType); - - protected: - virtual void autoDetect (void) {}; - Type osType; - - private: - uint16_t eepromSlice; - bool isConfigured = false; - }; - }; +namespace HostOS { +typedef enum { + LINUX, + OSX, + WINDOWS, + OTHER, + + AUTO = 0xff, +} Type; + +class Base : public KaleidoscopePlugin { + public: + virtual void begin (void) final; + + Type os (void); + void os (Type osType); + + protected: + virtual void autoDetect (void) {}; + Type osType; + + private: + uint16_t eepromSlice; + bool isConfigured = false; +}; +}; }; extern KaleidoscopePlugins::HostOS::Base HostOS; diff --git a/src/Kaleidoscope/HostOS-Focus.cpp b/src/Kaleidoscope/HostOS-Focus.cpp index 2321e0b7..9b68ef64 100644 --- a/src/Kaleidoscope/HostOS-Focus.cpp +++ b/src/Kaleidoscope/HostOS-Focus.cpp @@ -20,21 +20,21 @@ #include namespace KaleidoscopePlugins { - namespace HostOS { - bool - Focus (const char *command) { - if (strcmp_P (command, PSTR ("hostos.type")) != 0) +namespace HostOS { +bool +Focus (const char *command) { + if (strcmp_P (command, PSTR ("hostos.type")) != 0) return false; - if (Serial.peek () == '\n') { + if (Serial.peek () == '\n') { Serial.println (::HostOS.os ()); - } else { + } 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 be312054..70a6dd40 100644 --- a/src/Kaleidoscope/HostOS-Focus.h +++ b/src/Kaleidoscope/HostOS-Focus.h @@ -21,9 +21,9 @@ #include namespace KaleidoscopePlugins { - namespace HostOS { - bool Focus (const char *command); - }; +namespace HostOS { +bool Focus (const char *command); +}; }; #define FOCUS_HOOK_HOSTOS \ diff --git a/src/Kaleidoscope/HostOS-Guesser.cpp b/src/Kaleidoscope/HostOS-Guesser.cpp index f9c01184..240ec80f 100644 --- a/src/Kaleidoscope/HostOS-Guesser.cpp +++ b/src/Kaleidoscope/HostOS-Guesser.cpp @@ -21,30 +21,30 @@ #include namespace KaleidoscopePlugins { - namespace HostOS { - Guesser::Guesser (void) { - } +namespace HostOS { +Guesser::Guesser (void) { +} - void - Guesser::autoDetect (void) { - Serial.begin (9600); +void +Guesser::autoDetect (void) { + Serial.begin (9600); - delay (15000); + delay (15000); - switch (FingerprintUSBHost.guessHostOS ()) { - case GuessedHost::WINDOWS: + switch (FingerprintUSBHost.guessHostOS ()) { + case GuessedHost::WINDOWS: osType = WINDOWS; break; - case GuessedHost::LINUX: + case GuessedHost::LINUX: osType = LINUX; break; - case GuessedHost::MACOS: + case GuessedHost::MACOS: osType = OSX; break; - default: + default: osType = OTHER; break; - } } - }; +} +}; }; diff --git a/src/Kaleidoscope/HostOS-Guesser.h b/src/Kaleidoscope/HostOS-Guesser.h index c529024a..dc293e96 100644 --- a/src/Kaleidoscope/HostOS-Guesser.h +++ b/src/Kaleidoscope/HostOS-Guesser.h @@ -21,13 +21,13 @@ #include namespace KaleidoscopePlugins { - namespace HostOS { - class Guesser : public Base { - public: - Guesser (void); +namespace HostOS { +class Guesser : public Base { + public: + Guesser (void); - protected: - virtual void autoDetect (void) final; - }; - } + protected: + virtual void autoDetect (void) final; +}; +} };