astyle with current project style guidelines

pull/389/head
Jesse Vincent 7 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 () {
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();
}

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

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

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

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

@ -22,16 +22,16 @@
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 ()) {
switch (FingerprintUSBHost.guessHostOS()) {
case GuessedHost::WINDOWS:
osType = WINDOWS;
break;

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

Loading…
Cancel
Save