TKC M0lly refactor (#12227)

This commit is contained in:
Ryan 2021-03-17 15:56:45 +11:00 committed by GitHub
parent 4e8a218d17
commit e527b375e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 307 additions and 332 deletions

View file

@ -30,16 +30,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_ROWS 5
#define MATRIX_COLS 19
// ROWS: Top to bottom, COLS: Left to right
/* Row pin configuration
*/
#define MATRIX_ROW_PINS { F2, F1, F0, E1, E0 }
/* Column pin configuration
/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#define MATRIX_ROW_PINS { F2, F1, F0, E1, E0 }
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, C1, C0, F5, F6, F7 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
/* COL2ROW, ROW2COL */
#define DIODE_DIRECTION COL2ROW
#define LED_NUM_LOCK_PIN D2
@ -47,24 +52,44 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define LED_SCROLL_LOCK_PIN D4
#define BACKLIGHT_PIN B6
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 3
#define BACKLIGHT_BREATHING
/* Underlight configuration
*/
#define RGB_DI_PIN D7
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 30 // Number of LEDs
#define RGBLIGHT_HUE_STEP 5
#define RGBLIGHT_SAT_STEP 10
#define RGBLIGHT_VAL_STEP 10
#ifdef RGB_DI_PIN
# define RGBLED_NUM 30
# define RGBLIGHT_HUE_STEP 5
# define RGBLIGHT_SAT_STEP 10
# define RGBLIGHT_VAL_STEP 10
//# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
//# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
/*== all animations enable ==*/
# define RGBLIGHT_ANIMATIONS
/*== or choose animations ==*/
//# define RGBLIGHT_EFFECT_BREATHING
//# define RGBLIGHT_EFFECT_RAINBOW_MOOD
//# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
//# define RGBLIGHT_EFFECT_SNAKE
//# define RGBLIGHT_EFFECT_KNIGHT
//# define RGBLIGHT_EFFECT_CHRISTMAS
//# define RGBLIGHT_EFFECT_STATIC_GRADIENT
//# define RGBLIGHT_EFFECT_RGB_TEST
//# define RGBLIGHT_EFFECT_ALTERNATING
/*== customize breathing effect ==*/
/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
/*==== use exp() and sin() ====*/
//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
#endif
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Set 0 if debouncing isn't needed */
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
/* define if matrix has ghost (lacks anti-ghosting diodes) */
//#define MATRIX_HAS_GHOST
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
@ -75,6 +100,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define QMK_LED D2 // NumLock on M0lly
//#define QMK_SPEAKER C6
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
* This is useful for the Windows task manager shortcut (ctrl+shift+esc).
*/
//#define GRAVE_ESC_CTRL_OVERRIDE
/*
* Force NKRO
*
@ -96,54 +126,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//#define FORCE_NKRO
/*
* Magic Key Options
*
* Magic keys are hotkey commands that allow control over firmware functions of
* the keyboard. They are best used in combination with the HID Listen program,
* found here: https://www.pjrc.com/teensy/hid_listen.html
*
* The options below allow the magic key functionality to be changed. This is
* useful if your keyboard/keypad is missing keys and you want magic key support.
*
*/
/* control how magic key switches layers */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
/* override magic key keymap */
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
//#define MAGIC_KEY_HELP1 H
//#define MAGIC_KEY_HELP2 SLASH
//#define MAGIC_KEY_DEBUG D
//#define MAGIC_KEY_DEBUG_MATRIX X
//#define MAGIC_KEY_DEBUG_KBD K
//#define MAGIC_KEY_DEBUG_MOUSE M
//#define MAGIC_KEY_VERSION V
//#define MAGIC_KEY_STATUS S
//#define MAGIC_KEY_CONSOLE C
//#define MAGIC_KEY_LAYER0_ALT1 ESC
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
//#define MAGIC_KEY_LAYER0 0
//#define MAGIC_KEY_LAYER1 1
//#define MAGIC_KEY_LAYER2 2
//#define MAGIC_KEY_LAYER3 3
//#define MAGIC_KEY_LAYER4 4
//#define MAGIC_KEY_LAYER5 5
//#define MAGIC_KEY_LAYER6 6
//#define MAGIC_KEY_LAYER7 7
//#define MAGIC_KEY_LAYER8 8
//#define MAGIC_KEY_LAYER9 9
//#define MAGIC_KEY_BOOTLOADER PAUSE
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_NKRO N
//#define MAGIC_KEY_SLEEP_LED Z
/*
* Feature disable options
* These options are also useful to firmware size reduction.
@ -159,25 +141,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
/*
* MIDI options
*/
/* disable these deprecated features by default */
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
//#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 1
/* Bootmagic Lite key configuration */
//#define BOOTMAGIC_LITE_ROW 0
//#define BOOTMAGIC_LITE_COLUMN 0

View file

@ -1,97 +1,107 @@
{
"keyboard_name": "TKC M0LLY",
"url": "",
"maintainer": "qmk",
"width": 19.5,
"height": 5,
"keyboard_name": "TKC M0LLY",
"url": "",
"maintainer": "qmk",
"width": 19.5,
"height": 5,
"layouts": {
"LAYOUT_all": {
"layout": [
{"label":"~", "x":0, "y":0},
{"label":"!", "x":1, "y":0},
{"label":"@", "x":2, "y":0},
{"label":"#", "x":3, "y":0},
{"label":"$", "x":4, "y":0},
{"label":"%", "x":5, "y":0},
{"label":"^", "x":6, "y":0},
{"label":"&", "x":7, "y":0},
{"label":"*", "x":8, "y":0},
{"label":"(", "x":9, "y":0},
{"label":")", "x":10, "y":0},
{"label":"_", "x":11, "y":0},
{"label":"+", "x":12, "y":0},
{"label":"Bksp", "x":13, "y":0},
{"x":14, "y":0},
{"label":"Num", "x":15.5, "y":0},
{"label":"/", "x":16.5, "y":0},
{"label":"*", "x":17.5, "y":0},
{"label":"-", "x":18.5, "y":0},
{"label":"Tab", "x":0, "y":1, "w":1.5},
{"label":"Q", "x":1.5, "y":1},
{"label":"W", "x":2.5, "y":1},
{"label":"E", "x":3.5, "y":1},
{"label":"R", "x":4.5, "y":1},
{"label":"T", "x":5.5, "y":1},
{"label":"Y", "x":6.5, "y":1},
{"label":"U", "x":7.5, "y":1},
{"label":"I", "x":8.5, "y":1},
{"label":"O", "x":9.5, "y":1},
{"label":"P", "x":10.5, "y":1},
{"label":"{", "x":11.5, "y":1},
{"label":"}", "x":12.5, "y":1},
{"label":"|", "x":13.5, "y":1, "w":1.5},
{"label":"7", "x":15.5, "y":1},
{"label":"8", "x":16.5, "y":1},
{"label":"9", "x":17.5, "y":1},
{"x":18.5, "y":1},
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
{"label":"A", "x":1.75, "y":2},
{"label":"S", "x":2.75, "y":2},
{"label":"D", "x":3.75, "y":2},
{"label":"F", "x":4.75, "y":2},
{"label":"G", "x":5.75, "y":2},
{"label":"H", "x":6.75, "y":2},
{"label":"J", "x":7.75, "y":2},
{"label":"K", "x":8.75, "y":2},
{"label":"L", "x":9.75, "y":2},
{"label":":", "x":10.75, "y":2},
{"label":"\"", "x":11.75, "y":2},
{"label":"ISO ~", "x":12.75, "y":2},
{"label":"Enter", "x":13.75, "y":2, "w":1.25},
{"label":"4", "x":15.5, "y":2},
{"label":"5", "x":16.5, "y":2},
{"label":"6", "x":17.5, "y":2},
{"label":"+", "x":18.5, "y":2},
{"label":"Shift", "x":0, "y":3, "w":1.25},
{"x":1.25, "y":3},
{"label":"Z", "x":2.25, "y":3},
{"label":"X", "x":3.25, "y":3},
{"label":"C", "x":4.25, "y":3},
{"label":"V", "x":5.25, "y":3},
{"label":"B", "x":6.25, "y":3},
{"label":"N", "x":7.25, "y":3},
{"label":"M", "x":8.25, "y":3},
{"label":"<", "x":9.25, "y":3},
{"label":">", "x":10.25, "y":3},
{"label":"?", "x":11.25, "y":3},
{"label":"Shift", "x":12.25, "y":3, "w":1.75},
{"x":14, "y":3},
{"label":"1", "x":15.5, "y":3},
{"label":"2", "x":16.5, "y":3},
{"label":"3", "x":17.5, "y":3},
{"x":18.5, "y":3},
{"label":"Ctrl", "x":0, "y":4, "w":1.25},
{"label":"Win", "x":1.25, "y":4, "w":1.25},
{"label":"Alt", "x":2.5, "y":4, "w":1.25},
{"x":3.75, "y":4, "w":6.25},
{"label":"Alt", "x":10, "y":4, "w":1.25},
{"label":"Win", "x":11.25, "y":4, "w":1.25},
{"label":"FN", "x":12.5, "y":4, "w":1.25},
{"label":"Ctrl", "x":13.75, "y":4, "w":1.25},
{"label":"0", "x":15.5, "y":4},
{"x":16.5, "y":4},
{"label":".", "x":17.5, "y":4},
{"label":"Ent", "x":18.5, "y":4}]
{"x": 0, "y": 0},
{"x": 1, "y": 0},
{"x": 2, "y": 0},
{"x": 3, "y": 0},
{"x": 4, "y": 0},
{"x": 5, "y": 0},
{"x": 6, "y": 0},
{"x": 7, "y": 0},
{"x": 8, "y": 0},
{"x": 9, "y": 0},
{"x": 10, "y": 0},
{"x": 11, "y": 0},
{"x": 12, "y": 0},
{"x": 13, "y": 0},
{"x": 14, "y": 0},
{"x": 15.5, "y": 0},
{"x": 16.5, "y": 0},
{"x": 17.5, "y": 0},
{"x": 18.5, "y": 0},
{"x": 0, "y": 1, "w": 1.5},
{"x": 1.5, "y": 1},
{"x": 2.5, "y": 1},
{"x": 3.5, "y": 1},
{"x": 4.5, "y": 1},
{"x": 5.5, "y": 1},
{"x": 6.5, "y": 1},
{"x": 7.5, "y": 1},
{"x": 8.5, "y": 1},
{"x": 9.5, "y": 1},
{"x": 10.5, "y": 1},
{"x": 11.5, "y": 1},
{"x": 12.5, "y": 1},
{"x": 13.5, "y": 1, "w": 1.5},
{"x": 15.5, "y": 1},
{"x": 16.5, "y": 1},
{"x": 17.5, "y": 1},
{"x": 18.5, "y": 1},
{"x": 0, "y": 2, "w": 1.75},
{"x": 1.75, "y": 2},
{"x": 2.75, "y": 2},
{"x": 3.75, "y": 2},
{"x": 4.75, "y": 2},
{"x": 5.75, "y": 2},
{"x": 6.75, "y": 2},
{"x": 7.75, "y": 2},
{"x": 8.75, "y": 2},
{"x": 9.75, "y": 2},
{"x": 10.75, "y": 2},
{"x": 11.75, "y": 2},
{"x": 12.75, "y": 2},
{"x": 13.75, "y": 2, "w": 1.25},
{"x": 15.5, "y": 2},
{"x": 16.5, "y": 2},
{"x": 17.5, "y": 2},
{"x": 18.5, "y": 2},
{"x": 0, "y": 3, "w": 1.25},
{"x": 1.25, "y": 3},
{"x": 2.25, "y": 3},
{"x": 3.25, "y": 3},
{"x": 4.25, "y": 3},
{"x": 5.25, "y": 3},
{"x": 6.25, "y": 3},
{"x": 7.25, "y": 3},
{"x": 8.25, "y": 3},
{"x": 9.25, "y": 3},
{"x": 10.25, "y": 3},
{"x": 11.25, "y": 3},
{"x": 12.25, "y": 3, "w": 1.75},
{"x": 14, "y": 3},
{"x": 15.5, "y": 3},
{"x": 16.5, "y": 3},
{"x": 17.5, "y": 3},
{"x": 18.5, "y": 3},
{"x": 0, "y": 4, "w": 1.25},
{"x": 1.25, "y": 4, "w": 1.25},
{"x": 2.5, "y": 4, "w": 1.25},
{"x": 3.75, "y": 4, "w": 6.25},
{"x": 10, "y": 4, "w": 1.25},
{"x": 11.25, "y": 4, "w": 1.25},
{"x": 12.5, "y": 4, "w": 1.25},
{"x": 13.75, "y": 4, "w": 1.25},
{"x": 15.5, "y": 4},
{"x": 16.5, "y": 4},
{"x": 17.5, "y": 4},
{"x": 18.5, "y": 4}
]
}
}
}

View file

@ -13,79 +13,80 @@
* 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 QMK_KEYBOARD_H
//Layers
enum {
BASE = 0,
FUNCTION,
enum layer_names {
_BASE,
_FUNC,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap BASE: (Base Layer) Default Layer
*
* ,-----------------------------------------------------------. .-------------------.
* | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NumL| / | * | - |
* |-----------------------------------------------------------| |-------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | 7 | 8 | 9 | |
* |-----------------------------------------------------------| |--------------| + |
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 4 | 5 | 6 | |
* |-----------------------------------------------------------| |-------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | 1 | 2 | 3 | Ent|
* |-----------------------------------------------------------| |--------------| |
* |Ctrl|Gui |Alt | Space | Alt | Win |FN |Ctr | | 0 | . | |
* `-----------------------------------------------------------' '-------------------'
*/
[BASE] = LAYOUT_all(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, XXXXXXX, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \
KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_P1, KC_P2, KC_P3, XXXXXXX, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, MO(FUNCTION), KC_RCTL, KC_P0, XXXXXXX, KC_PDOT, KC_PENT \
),
/* Keymap FUNCTION: (Function Layer)
*
* ,-----------------------------------------------------------. .-------------------.
* | | | | | | | | | | | | | | RESET | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | | | | | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | | | | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | |Tog|Mod|Hu+|Hu-|Sa+|Sa-|Va+|Va-|Stp| | | | | | | |
* |-----------------------------------------------------------| |--------------| |
* | | | | | | | | | | | | |
* `-----------------------------------------------------------' '-------------------'
*/
[FUNCTION] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, \
_______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX, \
_______, _______, _______, _______, _______, _______, MO(FUNCTION), _______, _______, XXXXXXX, _______, _______ \
),
/* Base Layer
*
* ,-----------------------------------------------------------. .-------------------.
* | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NumL| / | * | - |
* |-----------------------------------------------------------| |-------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | 7 | 8 | 9 | |
* |-----------------------------------------------------------| |--------------| + |
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 4 | 5 | 6 | |
* |-----------------------------------------------------------| |-------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | 1 | 2 | 3 | Ent|
* |-----------------------------------------------------------| |--------------| |
* |Ctrl|Gui |Alt | Space | Alt | Win |FN |Ctr | | 0 | . | |
* `-----------------------------------------------------------' '-------------------'
*/
[_BASE] = LAYOUT_all(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, XXXXXXX,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_P1, KC_P2, KC_P3, XXXXXXX,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, MO(_FUNC), KC_RCTL, KC_P0, XXXXXXX, KC_PDOT, KC_PENT
),
/* Function Layer
*
* ,-----------------------------------------------------------. .-------------------.
* | | | | | | | | | | | | | | RESET | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | | | | | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | | | | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | |Tog|Mod|Hu+|Hu-|Sa+|Sa-|Va+|Va-|Stp| | | | | | | |
* |-----------------------------------------------------------| |--------------| |
* | | | | | | | | | | | | |
* `-----------------------------------------------------------' '-------------------'
*/
[_FUNC] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______,
_______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______
)
};
#ifdef OLED_DRIVER_ENABLE
void oled_task_user(void) {
oled_write_P(PSTR("M0lly\n"),false);
// Host Keyboard Layer Status
// Layer status
oled_write_P(PSTR("Layer: "), false);
switch (get_highest_layer(layer_state)) {
case BASE:
case _BASE:
oled_write_P(PSTR("Base\n"), false);
break;
case FUNCTION:
case _FUNC:
oled_write_P(PSTR("Function\n"), false);
break;
default:
// Or use the write_ln shortcut over adding '\n' to the end of your string
oled_write_ln_P(PSTR("Undefined"), false);
}
// Host Keyboard LED Status
// Indicators
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);

View file

@ -13,101 +13,104 @@
* 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 QMK_KEYBOARD_H
//Layers
enum {
BASE = 0,
FUNCTION,
ALTERNATE,
LAST,
enum layer_names {
_BASE,
_FUNC1,
_FUNC2,
_FUNC3
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap BASE: (Base Layer) Default Layer
*
* ,-----------------------------------------------------------. .-------------------.
* | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NumL| / | * | - |
* |-----------------------------------------------------------| |-------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | 7 | 8 | 9 | |
* |-----------------------------------------------------------| |--------------| + |
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 4 | 5 | 6 | |
* |-----------------------------------------------------------| |-------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | 1 | 2 | 3 | Ent|
* |-----------------------------------------------------------| |--------------| |
* |Ctrl|Gui |Alt | Space | Alt | Win |FN |Ctr | | 0 | . | |
* `-----------------------------------------------------------' '-------------------'
*/
[BASE] = LAYOUT_all(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, XXXXXXX,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_P1, KC_P2, KC_P3, XXXXXXX,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, MO(FUNCTION), KC_RCTL, KC_P0, XXXXXXX, KC_PDOT, KC_PENT
),
/* Keymap FUNCTION: (Function Layer)
*
* ,-----------------------------------------------------------. .-------------------.
* | | | | | | | | | | | | | | RESET | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | | | | | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | | | | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | |Tog|Mod|Hu+|Hu-|Sa+|Sa-|Va+|Va-|Stp| | | | | | | |
* |-----------------------------------------------------------| |--------------| |
* | | | | | | | | | | | | |
* `-----------------------------------------------------------' '-------------------'
*/
[FUNCTION] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______,
_______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, MO(FUNCTION), _______, _______, XXXXXXX, _______, _______
),
[ALTERNATE] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______,
_______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, MO(FUNCTION), _______, _______, XXXXXXX, _______, _______
),
[LAST] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______,
_______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, MO(FUNCTION), _______, _______, XXXXXXX, _______, _______
),
/* Base Layer
*
* ,-----------------------------------------------------------. .-------------------.
* | ~ | 1 | 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |NumL| / | * | - |
* |-----------------------------------------------------------| |-------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | | 7 | 8 | 9 | |
* |-----------------------------------------------------------| |--------------| + |
* |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | | 4 | 5 | 6 | |
* |-----------------------------------------------------------| |-------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | 1 | 2 | 3 | Ent|
* |-----------------------------------------------------------| |--------------| |
* |Ctrl|Gui |Alt | Space | Alt | Win |FN |Ctr | | 0 | . | |
* `-----------------------------------------------------------' '-------------------'
*/
[_BASE] = LAYOUT_all(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, XXXXXXX, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, XXXXXXX,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, KC_P1, KC_P2, KC_P3, XXXXXXX,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RWIN, MO(_FUNC1), KC_RCTL, KC_P0, XXXXXXX, KC_PDOT, KC_PENT
),
/* Function Layer
*
* ,-----------------------------------------------------------. .-------------------.
* | | | | | | | | | | | | | | RESET | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | | | | | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | | | | | | | | | | | | | | | | | | |
* |-----------------------------------------------------------| |-------------------|
* | |Tog|Mod|Hu+|Hu-|Sa+|Sa-|Va+|Va-|Stp| | | | | | | |
* |-----------------------------------------------------------| |--------------| |
* | | | | | | | | | | | | |
* `-----------------------------------------------------------' '-------------------'
*/
[_FUNC1] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______,
_______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______
),
[_FUNC2] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______,
_______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______
),
[_FUNC3] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, XXXXXXX, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______,
_______, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_STEP, _______, _______, XXXXXXX, _______, _______, _______, XXXXXXX,
_______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______
)
};
#ifdef OLED_DRIVER_ENABLE
void oled_task_user(void) {
oled_write_P(PSTR("M0lly\n"),false);
// Host Keyboard Layer Status
// Layer Status
oled_write_P(PSTR("Layer: "), false);
switch (get_highest_layer(layer_state)) {
case BASE:
case _BASE:
oled_write_P(PSTR("Base\n"), false);
break;
case FUNCTION:
oled_write_P(PSTR("Function\n"), false);
case _FUNC1:
oled_write_P(PSTR("Func 1\n"), false);
break;
case ALTERNATE:
oled_write_P(PSTR("Alternate\n"), false);
case _FUNC2:
oled_write_P(PSTR("Func 2\n"), false);
break;
case LAST:
oled_write_P(PSTR("Last\n"), false);
case _FUNC3:
oled_write_P(PSTR("Func 3\n"), false);
break;
default:
// Or use the write_ln shortcut over adding '\n' to the end of your string
oled_write_ln_P(PSTR("Undefined"), false);
}
// Host Keyboard LED Status
// Indicators
led_t led_state = host_keyboard_led_state();
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);

View file

@ -13,6 +13,7 @@
* 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 "m0lly.h"
void keyboard_pre_init_kb(void) {

View file

@ -13,20 +13,23 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"
#define XXX KC_NO
#define LAYOUT_all( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1F, K1G, K1H, K1I, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, K2G, K2H, K2I, \
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, K3G, K3H, K3I, \
K40, K41, K42, K45, K49, K4B, K4C, K4D, K4F, K4G, K4H, K4I \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1F, k1G, k1H, k1I, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, k2G, k2H, k2I, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, k3G, k3H, k3I, \
k40, k41, k42, k45, k49, k4B, k4C, k4D, k4F, k4G, k4H, k4I \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1F, K1G, K1H, K1I }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F, K2G, K2H, K2I }, \
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F, K3G, K3H, K3I }, \
{ K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, KC_NO, K4B, K4C, K4D, KC_NO, K4F, K4G, K4H, K4I } \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, XXX, k1F, k1G, k1H, k1I }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, XXX, k2F, k2G, k2H, k2I }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, XXX, k3F, k3G, k3H, k3I }, \
{ k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, XXX, k4B, k4C, k4D, XXX, k4F, k4G, k4H, k4I } \
}

View file

@ -1,14 +1,12 @@
The Key Company M0LLY
# The Key Company M0LLY
[TKC M0LLY](https://cdn.shopify.com/s/files/1/1679/2319/files/Molly_Terminal_1024x1024.jpg?v=1529067702)
The Key Company's M0LLY keyboard is inspired by the Apple Macintosh M0110A, and utilizes the AT90USB1286 microcontroller.
Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/)
Hardware Supported: TKC M0LLY
Hardware Availability: [TheKey.Company](https://thekey.company)
* Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/)
* Hardware Supported: TKC M0LLY
* Hardware Availability: [TheKey.Company](https://thekey.company)
Make example for this keyboard (after setting up your build environment):

View file

@ -2,19 +2,12 @@
MCU = at90usb1286
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
BOOTLOADER = qmk-dfu
# Build Options
# change yes to no to disable
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
@ -23,10 +16,8 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
MIDI_ENABLE = no # MIDI controls
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
OLED_DRIVER_ENABLE = yes
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
BLUETOOTH_ENABLE = no # Enable Bluetooth
AUDIO_ENABLE = no # Audio output
OLED_DRIVER_ENABLE = yes