From eb7818344fe9cdd968b0377488e1327633179135 Mon Sep 17 00:00:00 2001 From: Zackarias Montell Date: Sun, 7 Nov 2021 09:23:34 +0100 Subject: [PATCH] Changes according to contribution checklist --- keyboards/handwired/planck/config.h | 42 +++------ keyboards/handwired/planck/info.json | 5 + .../handwired/planck/keymaps/default/config.h | 28 ++++++ .../handwired/planck/keymaps/default/keymap.c | 93 +++++++++++++++++++ .../planck/keymaps/default/readme.md | 3 + .../planck/keymaps/wholteza/README.md | 51 ---------- .../planck/keymaps/wholteza/config.h | 28 ++++++ .../planck/keymaps/wholteza/keymap.c | 4 +- .../planck/keymaps/wholteza/readme.md | 5 + keyboards/handwired/planck/planck.h | 4 +- keyboards/handwired/planck/readme.md | 22 ++++- keyboards/handwired/planck/rules.mk | 39 +------- 12 files changed, 199 insertions(+), 125 deletions(-) create mode 100644 keyboards/handwired/planck/info.json create mode 100644 keyboards/handwired/planck/keymaps/default/config.h create mode 100644 keyboards/handwired/planck/keymaps/default/keymap.c create mode 100644 keyboards/handwired/planck/keymaps/default/readme.md delete mode 100644 keyboards/handwired/planck/keymaps/wholteza/README.md create mode 100644 keyboards/handwired/planck/keymaps/wholteza/config.h create mode 100644 keyboards/handwired/planck/keymaps/wholteza/readme.md diff --git a/keyboards/handwired/planck/config.h b/keyboards/handwired/planck/config.h index 29d96e809aa..f2c2674c428 100644 --- a/keyboards/handwired/planck/config.h +++ b/keyboards/handwired/planck/config.h @@ -13,39 +13,32 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef CONFIG_H +#pragma once #define CONFIG_H #include "config_common.h" /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER qmkbuilder -#define PRODUCT keyboard -#define DESCRIPTION Keyboard +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Handwired +#define PRODUCT Planck /* key matrix size */ #define MATRIX_ROWS 4 #define MATRIX_COLS 12 -/* key matrix pins */ -#define MATRIX_ROW_PINS { E6, B3, D1, D0 } -#define MATRIX_COL_PINS {C7, D6, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0} -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW +/* Row and column pins are defined in keymap config.h since they can be unique per handwireing */ /* number of backlight levels */ #ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 0 +# define BACKLIGHT_LEVELS 0 #endif /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 +#define DEBOUNCE 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -54,20 +47,15 @@ #define LOCKING_RESYNC_ENABLE /* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) /* prevent stuck modifiers */ #define PREVENT_STUCK_MODIFIERS - #ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 0 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - +# define RGBLIGHT_ANIMATIONS +# define RGBLED_NUM 0 +# define RGBLIGHT_HUE_STEP 8 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 #endif diff --git a/keyboards/handwired/planck/info.json b/keyboards/handwired/planck/info.json new file mode 100644 index 00000000000..1687a211e08 --- /dev/null +++ b/keyboards/handwired/planck/info.json @@ -0,0 +1,5 @@ +{ + "keyboard_name": "Planck", + "url": "https://blog.roastpotatoes.co/guide/2015/11/04/how-to-handwire-a-planck/", + "maintainer": "Wholteza " +} diff --git a/keyboards/handwired/planck/keymaps/default/config.h b/keyboards/handwired/planck/keymaps/default/config.h new file mode 100644 index 00000000000..18f28dfa64c --- /dev/null +++ b/keyboards/handwired/planck/keymaps/default/config.h @@ -0,0 +1,28 @@ + +/* Copyright 2021 Wholteza + * + * 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 . + */ +#pragma once +/* Place overrides here */ + +/* key matrix pins */ +#define MATRIX_ROW_PINS \ + { E6, B3, D1, D0 } +#define MATRIX_COL_PINS \ + { C7, D6, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/handwired/planck/keymaps/default/keymap.c b/keyboards/handwired/planck/keymaps/default/keymap.c new file mode 100644 index 00000000000..fa1493fff9b --- /dev/null +++ b/keyboards/handwired/planck/keymaps/default/keymap.c @@ -0,0 +1,93 @@ +/* Copyright 2021 Wholteza + * + * 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 . + */ +#include "planck.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // QWERTY + KEYMAP( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + MO(3), KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + + // LOWER + KEYMAP( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + + // RAISE + KEYMAP( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + // EXTRAS + KEYMAP( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RESET, 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 +) +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/handwired/planck/keymaps/default/readme.md b/keyboards/handwired/planck/keymaps/default/readme.md new file mode 100644 index 00000000000..fdfa831d420 --- /dev/null +++ b/keyboards/handwired/planck/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The Default Planck Layout + +Maintained by [Wholteza](https://github.com/wholteza). diff --git a/keyboards/handwired/planck/keymaps/wholteza/README.md b/keyboards/handwired/planck/keymaps/wholteza/README.md deleted file mode 100644 index 8eb5ce030aa..00000000000 --- a/keyboards/handwired/planck/keymaps/wholteza/README.md +++ /dev/null @@ -1,51 +0,0 @@ -[Wholteza](https://github.com/wholteza)'s handwired planck layout - -This is a swedish layout using [colemak-se](https://github.com/motform/colemak-se) and a symbols layer tailored towards developers. - -In addition to using colemak-se it also has backspace in place of caps lock to reduce the need of moving your hands. - -## LAYERS - -### Base - -``` -| # | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | -| --- | --------- | ---------------- | ---- | ----- | ----------- | ----- | --- | ----------- | ----- | ---- | ---------------- | ------- | -| 1 | Tab | Q | W | F | P | G | J | L | U | Y | Ö | Å | -| 2 | Backspace | A | R | S | T | D | H | N | E | I | O | Ä | -| 3 | L Shift | Z | X | C | V | B | K | M | , | . | - | L Shift | -| 4 | L Ctrl | L Shift + L Ctrl | Meta | L Alt | Layer Lower | SPACE | | Layer Raise | Enter | Meta | L Shift + L Ctrl | L Ctrl | -``` - -### Lower - -``` -| # | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | -| --- | ------ | --- | ---------- | -------- | ---------- | ----------- | ---- | ----------- | --------- | ------- | --- | --- | -| 1 | Escape | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | -| 2 | | | Arrow Left | Arrow Up | Arrow Down | Arrow Right | Home | End | Page Down | Page Up | | F12 | -| 3 | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | -| 4 | | | | | | | | Layer Extra | | | | | -``` - -### Raise - -``` -| # | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | -| --- | ------ | --- | --- | --- | --- | --- | --- | --- | --- | ----------- | --------- | --- | -| 1 | Delete | ! | @ | $ | ~ | ^ | { | [ | ] | } | < | | -| 2 | | | " | # | % | ' | / | ( | ) | = | > | | -| 3 | | | | | | \* | \ | ` | | | | & | -| 4 | | | | | | | | | | Volume Down | Volume Up | \| | -``` - -### Extras - -``` -| # | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | -| --- | ------------ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | -| 1 | | | | | | | | | | | | | -| 2 | Reset Teensy | | | | | | | | | | | | -| 3 | | | | | | | | | | | | | -| 4 | | | | | | | | | | | | | -``` diff --git a/keyboards/handwired/planck/keymaps/wholteza/config.h b/keyboards/handwired/planck/keymaps/wholteza/config.h new file mode 100644 index 00000000000..18f28dfa64c --- /dev/null +++ b/keyboards/handwired/planck/keymaps/wholteza/config.h @@ -0,0 +1,28 @@ + +/* Copyright 2021 Wholteza + * + * 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 . + */ +#pragma once +/* Place overrides here */ + +/* key matrix pins */ +#define MATRIX_ROW_PINS \ + { E6, B3, D1, D0 } +#define MATRIX_COL_PINS \ + { C7, D6, D7, B4, B5, B6, F7, F6, F5, F4, F1, F0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/handwired/planck/keymaps/wholteza/keymap.c b/keyboards/handwired/planck/keymaps/wholteza/keymap.c index 36d7438ded1..b596a853eb2 100644 --- a/keyboards/handwired/planck/keymaps/wholteza/keymap.c +++ b/keyboards/handwired/planck/keymaps/wholteza/keymap.c @@ -19,14 +19,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // COLEMAK KEYMAP( - KC_TAB, SE_Q, SE_W, SE_F, SE_P, SE_G, SE_J, SE_L, SE_U, SE_Y, SE_ODIA, SE_ARNG, + KC_ESC, SE_Q, SE_W, SE_F, SE_P, SE_G, SE_J, SE_L, SE_U, SE_Y, SE_ODIA, SE_ARNG, KC_BSPC, SE_A, SE_R, SE_S, SE_T, SE_D, SE_H, SE_N, SE_E, SE_I, SE_O, SE_ADIA, KC_LSFT, SE_Z, SE_X, SE_C, SE_V, SE_B, SE_K, SE_M, SE_COMM, SE_DOT, SE_MINS, KC_LSFT, KC_LCTL, LCTL(KC_LSFT), KC_LGUI, KC_LALT, MO(1), KC_SPC, MO(2), KC_ENT, KC_LGUI, LCTL(KC_LSFT), KC_LCTL), // LOWER KEYMAP( - KC_ESC, SE_1, SE_2, SE_3, SE_4, SE_5, SE_6, SE_7, SE_8, SE_9, SE_0, SE_PLUS, + KC_TAB, SE_1, SE_2, SE_3, SE_4, SE_5, SE_6, SE_7, SE_8, SE_9, SE_0, SE_PLUS, KC_TRNS, KC_TRNS, KC_LEFT , KC_UP, KC_DOWN, KC_RIGHT, KC_HOME, KC_END, KC_PGDN, KC_PGUP, KC_TRNS, KC_F12, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), diff --git a/keyboards/handwired/planck/keymaps/wholteza/readme.md b/keyboards/handwired/planck/keymaps/wholteza/readme.md new file mode 100644 index 00000000000..5028ac2bdbc --- /dev/null +++ b/keyboards/handwired/planck/keymaps/wholteza/readme.md @@ -0,0 +1,5 @@ +[Wholteza](https://github.com/wholteza)'s handwired planck layout + +This is a swedish layout using [colemak-se](https://github.com/motform/colemak-se) and a symbols layer tailored towards developers. + +In addition to using colemak-se it also has backspace in place of caps lock to reduce the need of moving your hands. diff --git a/keyboards/handwired/planck/planck.h b/keyboards/handwired/planck/planck.h index 72acc315b10..7bd0a9d4f23 100644 --- a/keyboards/handwired/planck/planck.h +++ b/keyboards/handwired/planck/planck.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef PLANCK_H +#pragma once #define PLANCK_H #include "quantum.h" @@ -32,5 +32,3 @@ } #define LAYOUT LAYOUT_planck_1x2uC - -#endif diff --git a/keyboards/handwired/planck/readme.md b/keyboards/handwired/planck/readme.md index 323f857229e..61f42067e31 100644 --- a/keyboards/handwired/planck/readme.md +++ b/keyboards/handwired/planck/readme.md @@ -1,24 +1,36 @@ # Plank Handwired ![plank handwired](https://i.imgur.com/khseWs7.jpeg) -![plank handwired](https://i.imgur.com/Y1XIjRK.jpeg) A compact 40% (12x4) ortholinear keyboard kit sold by OLKB before they developed the rev1 PCB. Keyboard Maintainer: [Wholteza](https://github.com/wholteza) Hardware Supported: [Teensy 2.0](https://www.pjrc.com/store/teensy.html) +Hardware Availability: [PJRC](https://www.pjrc.com/store/teensy.html) Make example for this keyboard (after setting up your build environment): - qmk compile -kb handwired/planck -km wholteza + make planck/rev4:default -See the [newbs build environment setup](https://docs.qmk.fm/#/newbs_getting_started). +Flashing example for this keyboard: + + make planck/rev4: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). + +## Bootloader + +Enter the bootloader in 3 ways: + +- **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +- **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +- **Keycode in layout**: Press the key mapped to `RESET` if it is available ## Teensy pinout Can be changed in the `config.h` -Where `C0` and `R0` is **top left** if looking at the wiring of your keyboard (upside down). +Where `C0` and `R0` is **top left** when looking at the wiring of your keyboard (upside down). | **COL/ROW** | **PIN** | | ----------- | ------- | @@ -38,3 +50,5 @@ Where `C0` and `R0` is **top left** if looking at the wiring of your keyboard (u | **R1** | B3 | | **R2** | D1 | | **R3** | D0 | + +neiorsnteioarstn diff --git a/keyboards/handwired/planck/rules.mk b/keyboards/handwired/planck/rules.mk index 1f8e943be7f..dfde71452bf 100644 --- a/keyboards/handwired/planck/rules.mk +++ b/keyboards/handwired/planck/rules.mk @@ -1,46 +1,9 @@ # MCU name MCU = atmega32u4 -# Processor frequency. -# This will define a symbol, F_CPU, in all source code files equal to the -# processor frequency in Hz. You can then use this symbol in your source code to -# calculate timings. Do NOT tack on a 'UL' at the end, this will be done -# automatically to create a 32-bit value in your source code. -# -# This will be an integer division of F_USB below, as it is sourced by -# F_USB after it has run through any CPU prescalers. Note that this value -# does not *change* the processor frequency - it should merely be updated to -# reflect the processor speed set externally so that the code can use accurate -# software delays. -F_CPU = 16000000 - -# -# LUFA specific -# -# Target architecture (see library "Board Types" documentation). -ARCH = AVR8 - -# Input clock frequency. -# This will define a symbol, F_USB, in all source code files equal to the -# input clock frequency (before any prescaling is performed) in Hz. This value may -# differ from F_CPU if prescaling is used on the latter, and is required as the -# raw input clock is fed directly to the PLL sections of the AVR for high speed -# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' -# at the end, this will be done automatically to create a 32-bit value in your -# source code. -# -# If no clock division is performed on the input clock inside the AVR (via the -# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. -F_USB = $(F_CPU) - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - - # Boot Section Size in *bytes* OPT_DEFS += -DBOOTLOADER_SIZE=4096 - # Build Options # comment out to disable the options. # @@ -53,4 +16,4 @@ SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality AUDIO_ENABLE ?= no -RGBLIGHT_ENABLE ?= no \ No newline at end of file +RGBLIGHT_ENABLE ?= no