astyle with current project style guidelines

pull/389/head
Jesse Vincent 8 years ago
parent 69f244b43b
commit e597957ab9
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -40,16 +40,16 @@ const Key keymaps[][ROWS][COLS] PROGMEM = {
), ),
}; };
void setup () { void setup() {
Serial.begin (9600); Serial.begin(9600);
Kaleidoscope.setup (KEYMAP_SIZE); Kaleidoscope.setup(KEYMAP_SIZE);
Kaleidoscope.use (&HostOS, NULL); Kaleidoscope.use(&HostOS, NULL);
Serial.print ("Host OS id is: "); Serial.print("Host OS id is: ");
Serial.println (HostOS.os (), DEC); Serial.println(HostOS.os(), DEC);
} }
void loop () { void loop() {
Kaleidoscope.loop (); Kaleidoscope.loop();
} }

@ -24,11 +24,11 @@
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
namespace HostOS { namespace HostOS {
void void
Base::begin (void) { Base::begin(void) {
if (isConfigured) if (isConfigured)
return; return;
eepromSlice = ::EEPROMSettings.requestSlice (sizeof (osType)); eepromSlice = ::EEPROMSettings.requestSlice(sizeof(osType));
isConfigured = true; isConfigured = true;
@ -36,24 +36,24 @@ Base::begin (void) {
return; return;
} }
if ((osType = (Type)EEPROM.read (eepromSlice)) != AUTO) if ((osType = (Type)EEPROM.read(eepromSlice)) != AUTO)
return; return;
autoDetect (); autoDetect();
} }
HostOS::Type HostOS::Type
Base::os (void) { Base::os(void) {
if (osType == AUTO) if (osType == AUTO)
autoDetect (); autoDetect();
return osType; return osType;
} }
void void
Base::os (HostOS::Type osType_) { Base::os(HostOS::Type osType_) {
osType = osType_; osType = osType_;
EEPROM.update (eepromSlice, osType); EEPROM.update(eepromSlice, osType);
} }
}; };
}; };

@ -33,13 +33,13 @@ typedef enum {
class Base : public KaleidoscopePlugin { class Base : public KaleidoscopePlugin {
public: public:
virtual void begin (void) final; virtual void begin(void) final;
Type os (void); Type os(void);
void os (Type osType); void os(Type osType);
protected: protected:
virtual void autoDetect (void) {}; virtual void autoDetect(void) {};
Type osType; Type osType;
private: private:

@ -22,18 +22,18 @@
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
namespace HostOS { namespace HostOS {
bool bool
Focus (const char *command) { Focus(const char *command) {
if (strcmp_P (command, PSTR ("hostos.type")) != 0) if (strcmp_P(command, PSTR("hostos.type")) != 0)
return false; return false;
if (Serial.peek () == '\n') { if (Serial.peek() == '\n') {
Serial.println (::HostOS.os ()); Serial.println(::HostOS.os());
} else { } else {
uint8_t os = Serial.parseInt (); uint8_t os = Serial.parseInt();
::HostOS.os ((KaleidoscopePlugins::HostOS::Type) os); ::HostOS.os((KaleidoscopePlugins::HostOS::Type) os);
} }
Serial.read (); Serial.read();
return true; return true;
} }
} }

@ -22,7 +22,7 @@
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
namespace HostOS { namespace HostOS {
bool Focus (const char *command); bool Focus(const char *command);
}; };
}; };

@ -22,16 +22,16 @@
namespace KaleidoscopePlugins { namespace KaleidoscopePlugins {
namespace HostOS { namespace HostOS {
Guesser::Guesser (void) { Guesser::Guesser(void) {
} }
void void
Guesser::autoDetect (void) { Guesser::autoDetect(void) {
Serial.begin (9600); Serial.begin(9600);
delay (15000); delay(15000);
switch (FingerprintUSBHost.guessHostOS ()) { switch (FingerprintUSBHost.guessHostOS()) {
case GuessedHost::WINDOWS: case GuessedHost::WINDOWS:
osType = WINDOWS; osType = WINDOWS;
break; break;

@ -24,10 +24,10 @@ namespace KaleidoscopePlugins {
namespace HostOS { namespace HostOS {
class Guesser : public Base { class Guesser : public Base {
public: public:
Guesser (void); Guesser(void);
protected: protected:
virtual void autoDetect (void) final; virtual void autoDetect(void) final;
}; };
} }
}; };

Loading…
Cancel
Save