🐮🥛 Butterstick Support 🥛🐮 (#5742)

* Working on chording

* Working on chording

* Got layouts in order

* Initial Georgi support

* forgot to add keymaps

* Updated readme

* Update keyboards/georgi/keymaps/template/readme.md

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/georgi.h

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/keymaps/default/keymap.c

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/keymaps/default/keymap.c

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/rules.mk

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/rules.mk

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/matrix.c

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/georgi.c

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/georgi.c

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/rules.mk

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/keymaps/default/keymap.c

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/keymaps/template/keymap.c

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/matrix.c

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Disabled features, updated info

* Update keyboards/georgi/config.h

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Update keyboards/georgi/config.h

Co-Authored-By: germ <jeremythegeek@gmail.com>

* Fixed info.json

* Split the number button and fixed gaming mode.

* started work on history feature

* Working history/multikeyfuckery

* type

* inital code reduction refactor

* Got multikey patched up, optimizing for size

* Forgot to remove stuff

* fixed key repeat

* Key repeat added.

* Symshift locking

* Midchord Sym shenanigans.

* Added only QWERTY mode

* Split out header

* Added stickybits, minimal layour

* Fixing user layout

* Whitespace fixing

* Fixing Version name

* Starting work on BS

* Fixing default layout and rules

* Updated Butter fw

* Copy-paste rebase

* more fixing from merge. Fuck

* Forgot to roll version

* Added revisions as per @mechmerlin
This commit is contained in:
Jeremy Bernhardt 2019-04-30 09:28:01 -06:00 committed by MechMerlin
parent b09dc19d32
commit 0cde880747
9 changed files with 753 additions and 0 deletions

View File

@ -0,0 +1,56 @@
/* Copyright 2019 Jeremy Bernhardt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "butterstick.h"
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
/*
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
*/
void matrix_scan_kb(void) {
#ifdef DEBUG_MATRIX
for (uint8_t c = 0; c < MATRIX_COLS; c++)
for (uint8_t r = 0; r < MATRIX_ROWS; r++)
if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c);
#endif
matrix_scan_user();
}
/*
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
*/

View File

@ -0,0 +1,11 @@
#pragma once
#include "quantum.h"
#define LAYOUT_butter( \
k09, k08, k07, k06, k05, k04, k03, k02, k01, k00, \
k19, k18, k17, k16, k15, k14, k13, k12, k11, k10 \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09}, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19}, \
}

View File

@ -0,0 +1,26 @@
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x1337
#define DEVICE_VER 0x0001
#define MANUFACTURER g Heavy Industries
#define PRODUCT Butter Stick
#define DESCRIPTION Its a stick of butter
#define VERSION "Paula Deen"
#define DEBOUNCING_DELAY 5
#define FORCE_NKRO
/* key matrix size */
#define MATRIX_ROWS 2
#define MATRIX_COLS 10
#define MATRIX_ROW_PINS { F4, F5 }
#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7, C6, C7}
#define UNUSED_PINS
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION ROW2COL

View File

@ -0,0 +1,183 @@
#include QMK_KEYBOARD_H
#include "sten.h"
/*
* Key names are inherited from steno machines
* .-----------------------------------------------------.
* | LSU | LFT | LP | LH | ST1 | RF | RP | RL | RT | RD |
* |-----------------------------------------------------|
* | LSD | LK | LW | LR | ST2 | RR | RB | RG | RS | RZ |
* '-----------------------------------------------------'
*/
// Function prefixes
#define MEDIA (LSD | LK | LW | LR)
#define FUNCT (LSD | LK | LP | LH)
#define MOVE (LSU | LFT | LP | LH)
#define SYMB (RD | RZ)
#define NUMA (LW | LR)
#define NUMB (RR | RB)
// QMK Layer Numbers
#define BASE 0
#define GAME 1
// Do not change QMK Layer 0! This is your main keyboard.
// Make your QMK modifications to the later layers, to add
// keys/customize on the first layer modify processQwerty():
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT_butter(
STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR
),
// I don't game don't roast me thanks
[GAME] = LAYOUT_butter(
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_ENT,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TO(BASE)
)
};
// Note: You can only use basic keycodes here!
// P() is just a wrapper to make your life easier, any C code can be executed.
// Only the longest matched chord is run!
//
// http://docs.gboards.ca
uint32_t processQwerty(bool lookup) {
// SECRET AGENT CHORDS
P( LSU | LK | RS | RD, SEND_STRING(VERSION); SEND_STRING(__DATE__));
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( 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));
// Function Layer
P( FUNCT | RF, SEND(KC_F1));
P( FUNCT | RP, SEND(KC_F2));
P( FUNCT | RL, SEND(KC_F3));
P( FUNCT | RT, SEND(KC_F4));
P( FUNCT | RF | RR, SEND(KC_F5));
P( FUNCT | RP | RB, SEND(KC_F6));
P( FUNCT | RL | RG, SEND(KC_F7));
P( FUNCT | RT | RS, SEND(KC_F8));
P( FUNCT | RR, SEND(KC_F9));
P( FUNCT | RB, SEND(KC_F10));
P( FUNCT | RG, SEND(KC_F11));
P( FUNCT | RS, SEND(KC_F12));
// Movement Layer
P( MOVE | RF, SEND(KC_LEFT));
P( MOVE | RP, SEND(KC_DOWN));
P( MOVE | RL, SEND(KC_UP));
P( MOVE | RT, SEND(KC_RIGHT));
P( MOVE | ST1, SEND(KC_PGUP));
P( MOVE | ST2, SEND(KC_PGDN));
// Media Layer
P( MEDIA | RF, SEND(KC_MPRV));
P( MEDIA | RP, SEND(KC_MPLY));
P( MEDIA | RL, SEND(KC_MPLY));
P( MEDIA | RT, SEND(KC_MNXT));
P( MEDIA | RG, SEND(KC_VOLU));
P( MEDIA | RB, SEND(KC_VOLD));
P( MEDIA | RS, SEND(KC_MUTE));
// Number Row, Right
P( NUMB | LSU, SEND(KC_1));
P( NUMB | LFT, SEND(KC_2));
P( NUMB | LP, SEND(KC_3));
P( NUMB | LH, SEND(KC_4));
P( NUMB | ST1, SEND(KC_5));
P( NUMB | RF, SEND(KC_6));
P( NUMB | RP, SEND(KC_7));
P( NUMB | RL, SEND(KC_8));
P( NUMB | RT, SEND(KC_9));
P( NUMB | RD, SEND(KC_0));
// Number Row, Left
P( NUMA | LSU, SEND(KC_1));
P( NUMA | LFT, SEND(KC_2));
P( NUMA | LP, SEND(KC_3));
P( NUMA | LH, SEND(KC_4));
P( NUMA | ST1, SEND(KC_5));
P( NUMA | RF, SEND(KC_6));
P( NUMA | RP, SEND(KC_7));
P( NUMA | RL, SEND(KC_8));
P( NUMA | RT, SEND(KC_9));
P( NUMA | RD, SEND(KC_0));
// Symbols and Numbers
P( SYMB | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
P( SYMB | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
P( SYMB | ST1 | ST2, SEND(KC_GRV)); // `
P( SYMB | RR | RF, SEND(KC_LSFT); SEND(KC_3)); // #
P( SYMB | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
P( SYMB | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
P( SYMB | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
P( SYMB | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
P( SYMB | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
P( SYMB | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
P( SYMB | LW, SEND(KC_LBRC));
P( SYMB | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
P( SYMB | LR, SEND(KC_RBRC));
P( SYMB | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
P( SYMB | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
P( SYMB | RP | RB, SEND(KC_QUOT));
P( SYMB | RP | RG, SEND(KC_LSFT); SEND(KC_QUOT)); // "
P( SYMB | RF, SEND(KC_KP_PLUS));
P( SYMB | RR, SEND(KC_LSFT); SEND(KC_7)); // &
P( SYMB | RP, SEND(KC_MINS));
P( SYMB | RB, SEND(KC_EQL));
P( SYMB | RL, SEND(KC_SLSH));
P( SYMB | RG, SEND(KC_COMM));
P( SYMB | RT, SEND(KC_PAST));
P( SYMB | RS, SEND(KC_DOT));
// Letters
P( LSU | LSD, SEND(KC_A));
P( LFT | LK, SEND(KC_S));
P( LP | LW, SEND(KC_D));
P( LH | LR, SEND(KC_F));
P( ST1 | ST2, SEND(KC_G));
P( RF | RR, SEND(KC_H));
P( RT | RS, SEND(KC_L));
P( RD | RZ, SEND(KC_SCLN));
P( RG | RL, SEND(KC_K));
P( RP | RB, SEND(KC_J));
P( LSU, SEND(KC_Q));
P( LSD, SEND(KC_Z));
P( LFT, SEND(KC_W));
P( LK, SEND(KC_X));
P( LP, SEND(KC_E));
P( LW, SEND(KC_C));
P( LH, SEND(KC_R));
P( LR, SEND(KC_V));
P( ST1, SEND(KC_T));
P( ST2, SEND(KC_B));
P( RF, SEND(KC_Y));
P( RR, SEND(KC_N));
P( RP, SEND(KC_U));
P( RB, SEND(KC_M));
P( RL, SEND(KC_I));
P( RG, SEND(KC_COMM));
P( RT, SEND(KC_O));
P( RS, SEND(KC_DOT));
P( RD, SEND(KC_P));
P( RZ, SEND(KC_SLSH));
return 0;
}
// Don't fuck with this, thanks.
size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]);

View File

@ -0,0 +1,14 @@
# Butter Stick
![Butter Stick](https://i.redd.it/mvteaomko7s21.jpg)
A chorded 20% keyboard packing full sized useage into your pocket. More info on [gboards.ca](http://docs.gboards.ca/Meet-Butter-Stick)!
Keyboard Maintainer: [Germ](https://github.com/germ)
Hardware Availability: [g Heavy Industries](https://www.gboards.ca/product/butter-stick-limited-edition)
Make example for this keyboard (after setting up your build environment):
make butterstick:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

View File

@ -0,0 +1,19 @@
# MCU name
MCU = atmega32u4
F_CPU = 16000000
ARCH = AVR8
F_USB = $(F_CPU)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -DONLYQWERTY -DDEBUG_MATRIX
SRC += sten.c
EXTRAFLAGS += -flto
BOOTLOADER = atmel-dfu
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover
STENO_ENABLE = yes # Needed for chording

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,77 @@
// 2019, g Heavy Industries
// Blessed mother of Christ, please keep this readable
// and protect us from segfaults. For thine is the clock,
// the slave and the master. Until we return from main.
//
// Amen.
#include QMK_KEYBOARD_H
#include "mousekey.h"
#include "keymap.h"
#include "keymap_steno.h"
#include "wait.h"
extern size_t keymapsCount; // Total keymaps
extern uint32_t cChord; // Current Chord
// Function defs
void processChord(bool useFakeSteno);
uint32_t processQwerty(bool lookup);
uint32_t processFakeSteno(bool lookup);
void saveState(uint32_t cChord);
void restoreState(void);
// Macros for use in keymap.c
void SEND(uint8_t kc);
void REPEAT(void);
void SET_STICKY(uint32_t);
void SWITCH_LAYER(int);
void CLICK_MOUSE(uint8_t);
// Keymap helper
#define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;}
// Shift to internal representation
// i.e) S(teno)R(ight)F
#define STN(n) (1L<<n)
enum ORDER {
SFN = 0, SPWR, SST1, SST2, SST3, SST4, SNUML, SNUMR,
SLSU, SLSD, SLT, SLK, SLP, SLW, SLH, SLR, SLA, SLO,
SRE, SRU, SRF, SRR, SRP, SRB, SRL, SRG, SRT, SRS, SRD, SRZ, SRES1, SRES2
};
// Break it all out
#define FN STN(SFN)
#define PWR STN(SPWR)
#define ST1 STN(SST1)
#define ST2 STN(SST2)
#define ST3 STN(SST3)
#define ST4 STN(SST4)
#define LNO STN(SNUML) // STN1-6
#define RNO STN(SNUMR) // STN7-C
#define RES1 STN(SRES1) // Use reserved for sticky state
#define RES2 STN(SRES2)
#define LSU STN(SLSU)
#define LSD STN(SLSD)
#define LFT STN(SLT) // (L)e(F)t (T), preprocessor conflict
#define LK STN(SLK)
#define LP STN(SLP)
#define LW STN(SLW)
#define LH STN(SLH)
#define LR STN(SLR)
#define LA STN(SLA)
#define LO STN(SLO)
#define RE STN(SRE)
#define RU STN(SRU)
#define RF STN(SRF)
#define RR STN(SRR)
#define RP STN(SRP)
#define RB STN(SRB)
#define RL STN(SRL)
#define RG STN(SRG)
#define RT STN(SRT)
#define RS STN(SRS)
#define RD STN(SRD)
#define RZ STN(SRZ)