astyle with current project style guidelines

pull/389/head
Jesse Vincent 7 years ago
parent c069df3919
commit 7ec1fe2908
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -43,13 +43,13 @@ const Key keymaps[][ROWS][COLS] PROGMEM = {
),
};
static Key eventDropper (Key mappedKey, byte row, byte col, uint8_t keyState) {
static Key eventDropper(Key mappedKey, byte row, byte col, uint8_t keyState) {
return Key_NoKey;
}
const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
if (macroIndex == 0 && key_toggled_on (keyState))
GhostInTheFirmware.activate ();
if (macroIndex == 0 && key_toggled_on(keyState))
GhostInTheFirmware.activate();
return MACRO_NONE;
}
@ -123,19 +123,19 @@ static const KaleidoscopePlugins::GhostInTheFirmware::GhostKey ghostKeys[] PROGM
{0, 0, 0, 0}
};
void setup () {
Serial.begin (9600);
void setup() {
Serial.begin(9600);
Kaleidoscope.setup (KEYMAP_SIZE);
Kaleidoscope.setup(KEYMAP_SIZE);
GhostInTheFirmware.configure (ghostKeys);
StalkerEffect.configure (STALKER (BlazingTrail, NULL));
GhostInTheFirmware.configure(ghostKeys);
StalkerEffect.configure(STALKER(BlazingTrail, NULL));
Kaleidoscope.use (&LEDControl, &GhostInTheFirmware, &StalkerEffect, &Macros,
Kaleidoscope.use(&LEDControl, &GhostInTheFirmware, &StalkerEffect, &Macros,
NULL);
event_handler_hook_use (eventDropper);
event_handler_hook_use(eventDropper);
}
void loop () {
Kaleidoscope.loop ();
void loop() {
Kaleidoscope.loop();
}

@ -28,32 +28,32 @@ uint32_t GhostInTheFirmware::startTime;
uint16_t GhostInTheFirmware::pressTimeOut;
uint16_t GhostInTheFirmware::delayTimeOut;
GhostInTheFirmware::GhostInTheFirmware (void) {
GhostInTheFirmware::GhostInTheFirmware(void) {
}
void
GhostInTheFirmware::begin (void) {
loop_hook_use (this->loopHook);
GhostInTheFirmware::begin(void) {
loop_hook_use(this->loopHook);
}
void
GhostInTheFirmware::activate (void) {
GhostInTheFirmware::activate(void) {
isActive = true;
}
void
GhostInTheFirmware::configure (const GhostKey ghostKeys_[]) {
GhostInTheFirmware::configure(const GhostKey ghostKeys_[]) {
ghostKeys = (GhostKey *)ghostKeys_;
}
void
GhostInTheFirmware::loopHook (bool postClear) {
GhostInTheFirmware::loopHook(bool postClear) {
if (postClear || !isActive)
return;
if (pressTimeOut == 0) {
pressTimeOut = pgm_read_word (&(ghostKeys[currentPos].pressTime));
delayTimeOut = pgm_read_word (&(ghostKeys[currentPos].delay));
pressTimeOut = pgm_read_word(&(ghostKeys[currentPos].pressTime));
delayTimeOut = pgm_read_word(&(ghostKeys[currentPos].delay));
if (pressTimeOut == 0) {
currentPos = 0;
@ -61,22 +61,22 @@ GhostInTheFirmware::loopHook (bool postClear) {
return;
}
isPressed = true;
startTime = millis ();
startTime = millis();
} else {
if (isPressed && ((millis () - startTime) > pressTimeOut)) {
if (isPressed && ((millis() - startTime) > pressTimeOut)) {
isPressed = false;
startTime = millis ();
startTime = millis();
byte row = pgm_read_byte (&(ghostKeys[currentPos].row));
byte col = pgm_read_byte (&(ghostKeys[currentPos].col));
byte row = pgm_read_byte(&(ghostKeys[currentPos].row));
byte col = pgm_read_byte(&(ghostKeys[currentPos].col));
handle_keyswitch_event (Key_NoKey, row, col, WAS_PRESSED);
handle_keyswitch_event(Key_NoKey, row, col, WAS_PRESSED);
} else if (isPressed) {
byte row = pgm_read_byte (&(ghostKeys[currentPos].row));
byte col = pgm_read_byte (&(ghostKeys[currentPos].col));
byte row = pgm_read_byte(&(ghostKeys[currentPos].row));
byte col = pgm_read_byte(&(ghostKeys[currentPos].col));
handle_keyswitch_event (Key_NoKey, row, col, IS_PRESSED);
} else if ((millis () - startTime) > delayTimeOut) {
handle_keyswitch_event(Key_NoKey, row, col, IS_PRESSED);
} else if ((millis() - startTime) > delayTimeOut) {
currentPos++;
pressTimeOut = 0;
}

@ -30,11 +30,11 @@ class GhostInTheFirmware : public KaleidoscopePlugin {
uint16_t delay;
} GhostKey;
GhostInTheFirmware (void);
GhostInTheFirmware(void);
virtual void begin (void) final;
static void configure (const GhostKey ghostKeys[]);
static void activate (void);
virtual void begin(void) final;
static void configure(const GhostKey ghostKeys[]);
static void activate(void);
private:
static GhostKey *ghostKeys;
@ -45,7 +45,7 @@ class GhostInTheFirmware : public KaleidoscopePlugin {
static uint16_t pressTimeOut;
static uint16_t delayTimeOut;
static void loopHook (bool postClear);
static void loopHook(bool postClear);
};
};

Loading…
Cancel
Save