Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Pinky(https://github.com/tamanishi/Pinky3) keyboard #4748

Merged
merged 6 commits into from
Jan 5, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions keyboards/pinky/3/3.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "pinky.h"
drashna marked this conversation as resolved.
Show resolved Hide resolved

#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif

void matrix_init_kb(void) {

#ifdef AUDIO_ENABLE
_delay_ms(20); // gets rid of tick
PLAY_SONG(tone_startup);
#endif

matrix_init_user();
};

void shutdown_kb(void) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
#endif
}
46 changes: 46 additions & 0 deletions keyboards/pinky/3/3.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#pragma once

#include "../pinky.h"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't actually need the ".." here.

When compiling, both the subfolder and main folder (eg, pinky, and 3 in this case) are added to the "common path". So, you can call "pinky.h" directly, without having to use it's relative path.

It's fin to do this, but "for the future"... it's something to keep in mind.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood. I'll keep that in mind.


//void promicro_bootloader_jmp(bool program);
#include "quantum.h"

#ifdef USE_I2C
#include <stddef.h>
#ifdef __AVR__
#include <avr/io.h>
#include <avr/interrupt.h>
#endif
#endif

//void promicro_bootloader_jmp(bool program);

#define LAYOUT( \
L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \
L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \
L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \
L30, L31, L32, L33, R30, R31, R32, R33 \
) \
{ \
{ L00, L01, L02, L03, L04, L05, L06 }, \
{ L10, L11, L12, L13, L14, L15, L16 }, \
{ L20, L21, L22, L23, L24, L25, L26 }, \
{ KC_NO, KC_NO, KC_NO, L30, L31, L32, L33 }, \
{ R06, R05, R04, R03, R02, R01, R00 }, \
{ R16, R15, R14, R13, R12, R11, R10 }, \
{ R26, R25, R24, R23, R22, R21, R20 }, \
{ KC_NO, KC_NO, KC_NO, R33, R32, R31, R30 } \
}

#define LAYOUT_kc( \
L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \
L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \
L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \
L30, L31, L32, L33, R30, R31, R32, R33 \
) \
LAYOUT( \
KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \
KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \
KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \
KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##R30, KC_##R31, KC_##R32, KC_##R33 \
)
74 changes: 74 additions & 0 deletions keyboards/pinky/3/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert

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/>.
*/

#pragma once

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x3060
#define DEVICE_VER 0x0001
#define MANUFACTURER tamanishi
#define PRODUCT Pinky
#define DESCRIPTION A split keyboard with 3 or 4 x7 vertically staggered keys and 4 thumb keys

/* key matrix size */
// Rows are doubled-up
#define MATRIX_ROWS 8
#define MATRIX_COLS 7
#define MATRIX_ROW_PINS { D4, C6, D7, E6 }

// wiring of each half
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 }
// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order

drashna marked this conversation as resolved.
Show resolved Hide resolved
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* number of backlight levels */
// #define BACKLIGHT_LEVELS 3

/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5

/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
//#define LOCKING_RESYNC_ENABLE

/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)

/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/

/* disable debug print */
// #define NO_DEBUG

/* disable print */
// #define NO_PRINT

/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
35 changes: 35 additions & 0 deletions keyboards/pinky/3/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
This is the c configuration file for the keymap

Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert

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/>.
*/

#pragma once

//#define USE_MATRIX_I2C

/* Select hand configuration */

#define MASTER_LEFT
// #define MASTER_RIGHT
// #define EE_HANDS

#define USE_SERIAL_PD2

#define TAPPING_FORCE_HOLD
#define TAPPING_TERM 200
#define RETRO_TAPPPING
145 changes: 145 additions & 0 deletions keyboards/pinky/3/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
#include QMK_KEYBOARD_H
#include "bootloader.h"
#ifdef PROTOCOL_LUFA
#include "lufa.h"
#include "split_util.h"
#endif

extern keymap_config_t keymap_config;

extern uint8_t is_master;

// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _QWERTY 0
#define _LOWER 3
#define _RAISE 4
#define _ADJUST 16

enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE,
ADJUST
};

enum macro_keycodes {
KC_SAMPLEMACRO,
};

#define KC______ KC_TRNS
#define KC_XXXXX KC_NO
#define KC_LOWER LOWER
#define KC_RAISE RAISE
#define KC_ADJ ADJUST
#define KC_RST RESET
#define KC_CTLTB CTL_T(KC_TAB)
#define KC_GUIEI GUI_T(KC_LANG2)
#define KC_ALTKN ALT_T(KC_LANG1)


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_kc( \
drashna marked this conversation as resolved.
Show resolved Hide resolved
//,-----------------------------------------+------. ,------------------------------------------------.
ESC, Q, W, E, R, T, LPRN, RPRN, Y, U, I, O, P, BSPC,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
CTLTB, A, S, D, F, G, LBRC, RBRC, H, J, K, L, SCLN, QUOT,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
LSFT, Z, X, C, V, B, ADJ, ADJ, N, M, COMM, DOT, SLSH, ENT,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
LALT, LOWER, LGUI, SPC, SPC, RGUI, RAISE, RALT \
//`---------------------------' `---------------------------'
),

[_LOWER] = LAYOUT_kc( \
//,-----------------------------------------+------. ,------------------------------------------------.
GRV, 1, 2, 3, 4, 5, _____, _____, 6, 7, 8, 9, 0, BSLS,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, MINS, EQL, _____,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, _____, _____, _____, _____, _____, _____, _____ \
//`---------------------------' `---------------------------'
),

[_RAISE] = LAYOUT_kc( \
//,-----------------------------------------+------. ,------------------------------------------------.
GRV, 1, 2, 3, 4, 5, _____, _____, 6, 7, 8, 9, 0, BSLS,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, MINS, EQL, _____,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, _____, _____, _____, _____, _____, _____, _____ \
//`---------------------------' `---------------------------'
),

[_ADJUST] = LAYOUT_kc( \
//,-----------------------------------------+------. ,------------------------------------------------.
_____, F1, F2, F3, F4, F5, LCBR, RCBR, F6, F7, F8, F9, F10, _____,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, F11, F12, _____, _____, _____, LCBR, RCBR, HOME, PGDN, PGUP, END, _____, _____,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
_____, _____, _____, _____, _____, _____, _____, _____ \
//`---------------------------' `---------------------------'
)
};

void persistent_default_layer_set(uint16_t default_layer) {
drashna marked this conversation as resolved.
Show resolved Hide resolved
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
}

void matrix_init_user(void) {
//
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
// set_timelog();
}

switch (keycode) {
case QWERTY:
if (record->event.pressed) {
persistent_default_layer_set(1UL<<_QWERTY);
drashna marked this conversation as resolved.
Show resolved Hide resolved
}
return false;
break;
case LOWER:
if (record->event.pressed) {
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else {
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case ADJUST:
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
break;
}
return true;
}

18 changes: 18 additions & 0 deletions keyboards/pinky/3/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = no # 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
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
SWAP_HANDS_ENABLE = no # Enable one-hand typing
1 change: 1 addition & 0 deletions keyboards/pinky/3/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# empty
24 changes: 24 additions & 0 deletions keyboards/pinky/4/4.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "pinky.h"
drashna marked this conversation as resolved.
Show resolved Hide resolved

#ifdef AUDIO_ENABLE
float tone_startup[][2] = SONG(STARTUP_SOUND);
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
#endif

void matrix_init_kb(void) {

#ifdef AUDIO_ENABLE
_delay_ms(20); // gets rid of tick
PLAY_SONG(tone_startup);
#endif

matrix_init_user();
};

void shutdown_kb(void) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_goodbye);
_delay_ms(150);
stop_all_notes();
#endif
}
Loading