From 07bdc8f4b7268f69a789bfe7656e8384bfcfed57 Mon Sep 17 00:00:00 2001 From: Jeremy Bernhardt Date: Tue, 6 Aug 2019 11:20:48 -0600 Subject: [PATCH] [Keyboard] Added little fixes and bootmagic for gBoard keebs (#6477) * Added little fixes and bootmagic * Update keyboards/gergo/keymaps/oled/rules.mk Co-Authored-By: Drashna Jaelre * whacked out quantum_libs --- .../butterstick/keymaps/default/keymap.c | 15 +- keyboards/butterstick/sten.c | 61 ++++- keyboards/butterstick/sten.h | 12 +- keyboards/gergo/config.h | 3 + keyboards/gergo/keymaps/oled/config.h | 4 + keyboards/gergo/keymaps/oled/glcdfont.c | 232 ++++++++++++++++++ keyboards/gergo/keymaps/oled/keymap.c | 145 +++++++++++ keyboards/gergo/keymaps/oled/readme.md | 10 + keyboards/gergo/keymaps/oled/rules.mk | 38 +++ keyboards/gergo/rules.mk | 4 +- 10 files changed, 508 insertions(+), 16 deletions(-) create mode 100644 keyboards/gergo/keymaps/oled/config.h create mode 100644 keyboards/gergo/keymaps/oled/glcdfont.c create mode 100644 keyboards/gergo/keymaps/oled/keymap.c create mode 100644 keyboards/gergo/keymaps/oled/readme.md create mode 100644 keyboards/gergo/keymaps/oled/rules.mk diff --git a/keyboards/butterstick/keymaps/default/keymap.c b/keyboards/butterstick/keymaps/default/keymap.c index e4d1ea91f3..749e9ba071 100644 --- a/keyboards/butterstick/keymaps/default/keymap.c +++ b/keyboards/butterstick/keymaps/default/keymap.c @@ -45,21 +45,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { uint32_t processQwerty(bool lookup) { // SECRET AGENT CHORDS P( LSU | LK | RS | RD, SEND_STRING(VERSION); SEND_STRING(__DATE__)); - P( LR | ST2| RR | RB, SEND(KC_BSPC)); + P( LR | ST2| RR | RB, SEND(KC_BSPC)); P( LSD | RZ, SEND(KC_SPC)); // Dual chords P( LP | LH, CLICK_MOUSE(KC_MS_BTN2)); P( ST1 | RF, CLICK_MOUSE(KC_MS_BTN1)); - P( LSU | LFT, SEND(KC_ESC)); - P( LSD | LK, SEND(KC_LSFT)); - P( RZ | RS, SEND(KC_LSFT)); - P( ST2 | RR, SEND(KC_SPC)); + P( LSU | LFT, SEND(KC_ESC)); + P( LSD | LK, SEND(KC_LSFT)); + P( RZ | RS, SEND(KC_LSFT)); + P( ST2 | RR, SEND(KC_SPC)); P( RP | RL, SEND(KC_LGUI)); P( RT | RD, SEND(KC_LCTL)); P( RL | RT, SEND(KC_LALT)); - P( LSU | LSD | LFT | LK, SEND(KC_LCTL)); - P( RS | RT | RD | RZ, SEND(KC_ENT)); + P( LSU | LSD | LFT | LK, SEND(KC_LCTL)); + P( RS | RT | RD | RZ, SEND(KC_ENT)); // Function Layer P( FUNCT | RF, SEND(KC_F1)); @@ -179,6 +179,5 @@ uint32_t processQwerty(bool lookup) { return 0; } - // Don't fuck with this, thanks. size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]); diff --git a/keyboards/butterstick/sten.c b/keyboards/butterstick/sten.c index a239e38842..197abaf92f 100644 --- a/keyboards/butterstick/sten.c +++ b/keyboards/butterstick/sten.c @@ -11,6 +11,18 @@ uint32_t pChord = 0; // Previous Chord int pChordIndex = 0; // Keys in previousachord uint32_t pChordState[32]; // Previous chord sate uint32_t stickyBits = 0; // Or'd with every incoming press +#ifndef NO_DEBUG +char debugMsg[32]; +#endif + +// StenoLayer +uint32_t releasedChord = 0; // Keys released from current chord +uint32_t tChord = 0; // Protects state of cChord + +#ifndef STENOLAYERS +uint32_t stenoLayers[] = { PWR }; +size_t stenoLayerCount = sizeof(stenoLayers)/sizeof(stenoLayers[0]); +#endif // Mode state enum MODE { STENO = 0, QWERTY, COMMAND }; @@ -39,7 +51,6 @@ bool inMouse = false; int8_t mousePress; // All processing done at chordUp goes through here -// Note, this is a gutted version of the Georgi sten.h bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { // Check for mousekeys, this is release #ifdef MOUSEKEY_ENABLE @@ -50,8 +61,21 @@ bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { } #endif + // Toggle Serial/QWERTY steno + if (cChord == (PWR | FN | ST1 | ST2)) { +#ifndef NO_DEBUG + uprintf("Fallback Toggle\n"); +#endif + QWERSTENO = !QWERSTENO; + + goto out; + } + // handle command mode - if (cChord == (LSU | LSD | RD | RZ)) { + if (cChord == (PWR | FN | RD | RZ)) { +#ifndef NO_DEBUG + uprintf("COMMAND Toggle\n"); +#endif if (cMode != COMMAND) { // Entering Command Mode CMDLEN = 0; pMode = cMode; @@ -70,7 +94,7 @@ bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { } // Handle Gaming Toggle, - if (cChord == (LSU | LSD | LFT | LK | RT | RS | RD | RZ) && keymapsCount > 1) { + if (cChord == (PWR | FN | ST4 | ST3) && keymapsCount > 1) { #ifndef NO_DEBUG uprintf("Switching to QMK\n"); #endif @@ -78,11 +102,38 @@ bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) { goto out; } + // Lone FN press, toggle QWERTY +#ifndef ONLYQWERTY + if (cChord == FN) { + (cMode == STENO) ? (cMode = QWERTY) : (cMode = STENO); + goto out; + } +#endif + + // Check for Plover momentary + if (cMode == QWERTY && (cChord & FN)) { + cChord ^= FN; + goto steno; + } + // Do QWERTY and Momentary QWERTY - if (cMode == QWERTY || (cMode == COMMAND)) { + if (cMode == QWERTY || (cMode == COMMAND) || (cChord & (FN | PWR))) { processChord(false); goto out; - } + } + + // Fallback NKRO Steno + if (cMode == STENO && QWERSTENO) { + processChord(true); + goto out; + } + +steno: + // Hey that's a steno chord! + inChord = false; + chordIndex = 0; + cChord = 0; + return true; out: cChord = 0; diff --git a/keyboards/butterstick/sten.h b/keyboards/butterstick/sten.h index 5a9771d9a0..84635a554c 100644 --- a/keyboards/butterstick/sten.h +++ b/keyboards/butterstick/sten.h @@ -13,11 +13,14 @@ extern size_t keymapsCount; // Total keymaps extern uint32_t cChord; // Current Chord +extern uint32_t stenoLayers[]; // Chords that simulate QMK layers +extern size_t stenoLayerCount; // Number of simulated layers +uint32_t refChord; // Reference chord for PC macro // Function defs void processChord(bool useFakeSteno); -uint32_t processQwerty(bool lookup); -uint32_t processFakeSteno(bool lookup); +uint32_t processQwerty(bool lookup); +uint32_t processFakeSteno(bool lookup); void saveState(uint32_t cChord); void restoreState(void); @@ -30,6 +33,11 @@ void CLICK_MOUSE(uint8_t); // Keymap helper #define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;} +#define PC(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;} \ + for(int i = 0; i < stenoLayerCount; i++) { \ + refChord = stenoLayers[i] | chord; \ + if (cChord == (refChord)) { if (!lookup) {act;} return refChord;}; \ +} // Shift to internal representation // i.e) S(teno)R(ight)F diff --git a/keyboards/gergo/config.h b/keyboards/gergo/config.h index e4c61ecb07..f8738f0956 100644 --- a/keyboards/gergo/config.h +++ b/keyboards/gergo/config.h @@ -21,6 +21,9 @@ along with this program. If not, see . #pragma once #include "config_common.h" +#define BOOTMAGIC_LITE_ROW 13 +#define BOOTMAGIC_LITE_COLUMN 2 + /* Defaults */ #ifndef BALLSTEP #define BALLSTEP 20 diff --git a/keyboards/gergo/keymaps/oled/config.h b/keyboards/gergo/keymaps/oled/config.h new file mode 100644 index 0000000000..b186080681 --- /dev/null +++ b/keyboards/gergo/keymaps/oled/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT +#define OLED_FONT_H "keyboards/gergo/keymaps/oled/glcdfont.c" diff --git a/keyboards/gergo/keymaps/oled/glcdfont.c b/keyboards/gergo/keymaps/oled/glcdfont.c new file mode 100644 index 0000000000..cf189e6e5a --- /dev/null +++ b/keyboards/gergo/keymaps/oled/glcdfont.c @@ -0,0 +1,232 @@ +// 'loveLain', 128x32px + +#include +#include + +static const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, +0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, +0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, +0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, +0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, +0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, +0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, +0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, +0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, +0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, +0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, +0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, +0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, +0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, +0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, +0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, +0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, +0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, +0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, +0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, +0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, +0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, +0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, +0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, +0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, +0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, +0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, +0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, +0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, +0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, +0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, +0x00, 0x00, 0x00, 0x00, 0x40, 0x28, +0x00, 0x48, 0xC2, 0x24, 0x10, 0x12, +0x24, 0x10, 0x12, 0x29, 0x10, 0x22, +0x58, 0x44, 0x90, 0x20, 0x80, 0x00, +0x00, 0x04, 0x10, 0x88, 0x40, 0x20, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xE8, +0x00, 0x20, 0x00, 0x10, 0x08, 0x08, +0x00, 0x08, 0x10, 0x00, 0x10, 0x20, +0x40, 0x40, 0x80, 0x00, 0x00, 0x00, +0x00, 0x14, 0x42, 0x01, 0x00, 0x01, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x40, 0x40, 0x00, 0x40, 0x40, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x40, +0x10, 0x08, 0x00, 0x00, 0x00, 0x40, +0x10, 0x80, 0x50, 0x22, 0xA4, 0x10, +0x52, 0x24, 0x10, 0x32, 0x08, 0x44, +0x64, 0x20, 0x90, 0x80, 0x40, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, +0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, +0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, +0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, +0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, +0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, +0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x82, 0x11, 0x48, 0x00, +0x37, 0xC0, 0x00, 0x00, 0x08, 0x10, +0x02, 0x48, 0x14, 0x00, 0x00, 0x00, +0x41, 0x42, 0xA2, 0x81, 0x42, 0x61, +0x04, 0x22, 0x00, 0x40, 0x82, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xDE, +0x00, 0x49, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x02, 0x04, +0x08, 0x00, 0x08, 0x15, 0x20, 0x40, +0x00, 0x40, 0x00, 0x00, 0x00, 0x00, +0x00, 0x2C, 0x03, 0x60, 0x20, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x02, 0x00, +0x85, 0x20, 0x00, 0x42, 0x42, 0x42, +0x85, 0x44, 0xC2, 0x01, 0x00, 0x00, +0x48, 0x10, 0x04, 0x48, 0x10, 0x00, +0x00, 0x01, 0xA0, 0x5E, 0x00, 0xA2, +0x14, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, +0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, +0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, +0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, +0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, +0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x00, 0x09, +0x12, 0x20, 0x89, 0x12, 0x42, 0x24, +0x04, 0x48, 0x0C, 0x90, 0x06, 0x21, +0x4A, 0x05, 0x84, 0x00, 0x02, 0x00, +0x00, 0x00, 0x08, 0x04, 0x00, 0x02, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xAD, +0x00, 0x2A, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x20, 0x00, 0x20, +0x00, 0x40, 0x00, 0x00, 0x40, 0x00, +0x40, 0x00, 0x40, 0x40, 0x00, 0x40, +0x00, 0x40, 0x20, 0x00, 0x90, 0x48, +0x03, 0x10, 0x08, 0x03, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x02, 0x09, +0x10, 0x20, 0x08, 0x00, 0x00, 0x02, +0x00, 0x02, 0x48, 0x15, 0x02, 0xA4, +0x08, 0x44, 0x88, 0x24, 0x48, 0x04, +0xA2, 0x15, 0x00, 0x0A, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +static const unsigned int fontLen = 512; diff --git a/keyboards/gergo/keymaps/oled/keymap.c b/keyboards/gergo/keymaps/oled/keymap.c new file mode 100644 index 0000000000..c348a2b96d --- /dev/null +++ b/keyboards/gergo/keymaps/oled/keymap.c @@ -0,0 +1,145 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define NUMB 2 // numbers/motion + +// Blank template at the bottom +enum customKeycodes { + URL = 1 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | L1/ESC | Q | W | E | R | T | | Y | U | I | O | P | | \ | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * |Ctrl/BS | A | S | D | F | G | RMB | | | H | J | K | L | ; : | ' " | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | LMB | | | N | M | , < | . > | / ? | - _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .----------. .-------. .------. .-----. + * | Super/Del| |Ent/ALT| | Tab | |BKSP | + * '----------' '-------' `------. '-----' + * ,-------. ,-------. + * | MMB | | PgDn | + * ,------|-------| |-------|------. + * | SYMB | NUMB | | SYMB | NUMB | + * | Space| Escape| | Mod |Space | + * | | | | | | + * `--------------' `--------------' + */ +[BASE] = LAYOUT_gergo( + LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BTN3, KC_PGDN, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC), KC_TAB, KC_BSPC + ), +/* Keymap 1: Symbols layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | ! | @ | { | } | | | | | | | | | \ | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` | | | | + | - | / | * | % | ' " | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | = | , | . | / ? | - _ | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | DEL | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | PgUp | + * ,------|-------| |-------|------. + * | | | | | | + * | ; | = | | = | ; | + * | | | | | | + * `--------------' `--------------' + */ +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_TRNS, KC_TRNS, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_PGUP, KC_DEL + ), +/* Keymap 2: Pad/Function layer + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | F1 | F2 | F3 | F4 | F5 | F6 | BTN1 | | | LEFT | DOWN | UP | RIGHT|VolDn | VolUp | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | F7 | F8 | F9 | F10 | F11 | F12 | BTN2 | | | MLFT | MDWN | MUP | MRGHT|Ply/Pa| Skip | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | PgUp | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' + */ +[NUMB] = LAYOUT_gergo( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +/* Keymap template + * + * ,-------------------------------------------. ,-------------------------------------------. + * | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * .------. .------. .------. .-----. + * | | | | | | | | + * '------' '------' `------. '-----' + * ,-------. ,-------. + * | | | | + * ,------|-------| |-------|------. + * | | | | | | + * | | | | | | + * | | | | | | + * `--------------' `--------------' +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) + */ + +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} + +void oled_task_user(void) { + static const char PROGMEM font_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(font_logo, false); + +} + //for (int i = 0; i < fontLen; i++) { + //oled_write_char(pgm_read_byte(lain+i), false); + //oled_write_char((char)i, false); + //} +#endif diff --git a/keyboards/gergo/keymaps/oled/readme.md b/keyboards/gergo/keymaps/oled/readme.md new file mode 100644 index 0000000000..471a20fbdf --- /dev/null +++ b/keyboards/gergo/keymaps/oled/readme.md @@ -0,0 +1,10 @@ +# [Gergo! By g Heavy Industries](http://gboards.ca) + +![Gergo image](https://4.bp.blogspot.com/-889nMXxgSM0/XCNxwnO5kUI/AAAAAAAA6mI/tZbWgZVCBW0dyZOCGJDkjN06DVax7j8XwCLcBGAs/s1600/48422820_967732713413298_485744639215665152_n.jpg) + +This is the default keymap for Gergo, it's based heavily off of the naps62 ErgoDox layout and is aimed at a programmer friendly keymap. + +## Settings +To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk + +Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR! diff --git a/keyboards/gergo/keymaps/oled/rules.mk b/keyboards/gergo/keymaps/oled/rules.mk new file mode 100644 index 0000000000..fae936effb --- /dev/null +++ b/keyboards/gergo/keymaps/oled/rules.mk @@ -0,0 +1,38 @@ +#---------------------------------------------------------------------------- +# make gergo:germ:dfu +# Make sure you have dfu-programmer installed! +#---------------------------------------------------------------------------- +# Firmware options +BALLER = no # Enable to ball out +BALLSTEP = 20 # Multiple in px to move, multiplied by layer number +SCROLLSTEP = 1 # Lines to scroll with ball +MOUSEKEY_ENABLE = yes # Mouse keys(+4700), needed for baller +OLED_DRIVER_ENABLE = yes +LOCAL_GLCDFONT = yes + +#Debug options +VERBOSE = yes +DEBUG_MATRIX_SCAN_RATE = no +DEBUG_BALLER = no +DEBUG_MATRIX = yes + +# A bunch of stuff that you shouldn't touch unless you +# know what you're doing. +# +# No touchy, capiche? +ifneq ($(strip $(BALLSTEP)),) + OPT_DEFS += -DTRKSTEP=$(strip $(BALLSTEP)) +endif +ifneq ($(strip $(SCROLLSTEP)),) + OPT_DEFS += -DSCROLLSTEP=$(strip $(SCROLLSTEP)) +endif +ifeq ($(strip $(BALLER)), yes) + POINTING_DEVICE_ENABLE = yes + OPT_DEFS += -DBALLER +endif +ifeq ($(strip $(DEBUG_BALLER)), yes) + OPT_DEFS += -DDEBUG_BALLER +endif +ifeq ($(strip $(DEBUG_MATRIX)), yes) + OPT_DEFS += -DDEBUG_MATRIX +endif diff --git a/keyboards/gergo/rules.mk b/keyboards/gergo/rules.mk index a33bfcec8d..2b5d62988e 100644 --- a/keyboards/gergo/rules.mk +++ b/keyboards/gergo/rules.mk @@ -4,7 +4,8 @@ # Do not edit this file! Make a copy of keymaps/default and modify that! #---------------------------------------------------------------------------- # Source includes -SRC += matrix.c i2c_master.c +SRC += matrix.c +QUANTUM_LIB_SRC += i2c_master.c # Hardware info MCU = atmega32u4 @@ -17,5 +18,6 @@ CUSTOM_MATRIX = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes +BOOTMAGIC_ENABLE = lite DEBOUNCE_TYPE = eager_pr