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

Split HHKB to ANSI and JP layouts and Add VIA support for each #8582

Merged
merged 32 commits into from
May 11, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2714311
VIA Support created for HHKB Hasu Controller config.h keymap.c rules.mk
diegomsong Mar 24, 2020
8aa1f21
Add VIA support for HHKB JP with Hasu controller - define distinct PR…
diegomsong Mar 26, 2020
5dd0264
Split HHKB into ANSI and JP. Tested VIA for ANSI and JP. Hex compilat…
diegomsong Mar 27, 2020
bda175a
Keeping branch up to date with master
diegomsong Apr 14, 2020
43c115d
Resolve jp.h erroneous diff from git merge from master
diegomsong Apr 14, 2020
6da25b7
Resolve ansi.h diff merge
diegomsong Apr 14, 2020
e1323f9
Define rules.mk for dynamic macro to rid of warning for ansi/keymaps/…
diegomsong Apr 14, 2020
b97dcd9
Moved rn42 directory up, got rid of #define HHKB_JP lines
diegomsong May 5, 2020
c667f6f
Update keyboards/hhkb/jp/readme.md
diegomsong May 5, 2020
e81a82f
Update keyboards/hhkb/jp/keymaps/via/keymap.c
diegomsong May 5, 2020
0325781
Replace with #pragma once and remove ending #endif
diegomsong May 5, 2020
064d137
Merge branch 'feature/hhkb_via' of https://github.com/diegomsong/qmk_…
diegomsong May 5, 2020
8fc0bec
Remove old style guards #define... for #pragma once
diegomsong May 6, 2020
b78e7d3
Update keyboards/hhkb/jp/keymaps/via/rules.mk
diegomsong May 11, 2020
e4e678d
Update keyboards/hhkb/ansi/rules.mk
diegomsong May 11, 2020
05791b1
Update keyboards/hhkb/jp/rules.mk
diegomsong May 11, 2020
4558b74
Updated hhkb/ansi/readme.md compiling instructions
diegomsong May 11, 2020
da63221
VIA Support created for HHKB Hasu Controller config.h keymap.c rules.mk
diegomsong Mar 24, 2020
2c54f77
Add VIA support for HHKB JP with Hasu controller - define distinct PR…
diegomsong Mar 26, 2020
8caa3ee
Split HHKB into ANSI and JP. Tested VIA for ANSI and JP. Hex compilat…
diegomsong Mar 27, 2020
e52b084
Resolve ansi.h diff merge
diegomsong Apr 14, 2020
9e7d638
Define rules.mk for dynamic macro to rid of warning for ansi/keymaps/…
diegomsong Apr 14, 2020
34bd68b
Moved rn42 directory up, got rid of #define HHKB_JP lines
diegomsong May 5, 2020
c796f64
Replace with #pragma once and remove ending #endif
diegomsong May 5, 2020
85ae5f1
Update keyboards/hhkb/jp/readme.md
diegomsong May 5, 2020
5d11676
Update keyboards/hhkb/jp/keymaps/via/keymap.c
diegomsong May 5, 2020
0f099bb
Remove old style guards #define... for #pragma once
diegomsong May 6, 2020
d797908
Update keyboards/hhkb/jp/keymaps/via/rules.mk
diegomsong May 11, 2020
c6a037c
Update keyboards/hhkb/ansi/rules.mk
diegomsong May 11, 2020
bf14a8a
Update keyboards/hhkb/jp/rules.mk
diegomsong May 11, 2020
a13e6c4
Updated hhkb/ansi/readme.md compiling instructions
diegomsong May 11, 2020
86400eb
Merge branch 'feature/hhkb_via' of https://github.com/diegomsong/qmk_…
diegomsong May 11, 2020
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
1 change: 1 addition & 0 deletions keyboards/hhkb/ansi/ansi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "ansi.h"
26 changes: 26 additions & 0 deletions keyboards/hhkb/ansi/ansi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef ANSI_H
diegomsong marked this conversation as resolved.
Show resolved Hide resolved
#define ANSI_H

#include "quantum.h"

#define LAYOUT( \
K31, K30, K00, K10, K11, K20, K21, K40, K41, K60, K61, K70, K71, K50, K51, \
K32, K01, K02, K13, K12, K23, K22, K42, K43, K62, K63, K73, K72, K52, \
K33, K04, K03, K14, K15, K24, K25, K45, K44, K65, K64, K74, K53, \
K34, K05, K06, K07, K16, K17, K26, K46, K66, K76, K75, K55, K54, \
K35, K36, K37, K57, K56) \
\
{ \
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
{ K20, K21, K22, K23, K24, K25, K26, KC_NO }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K40, K41, K42, K43, K44, K45, K46, KC_NO }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ K60, K61, K62, K63, K64, K65, K66, KC_NO }, \
{ K70, K71, K72, K73, K74, K75, K76, KC_NO } \
}

#define LAYOUT_60_hhkb LAYOUT

#endif
8 changes: 6 additions & 2 deletions keyboards/hhkb/config.h → keyboards/hhkb/ansi/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0xCAFE
#define VENDOR_ID 0x4848 // HH = happy hacking
#ifdef HHKB_JP
#define PRODUCT_ID 0x0002 // to differentiate from HHKB (ANSI)
#else
#define PRODUCT_ID 0x0001 // ANSI HHKB
#endif
#define DEVICE_VER 0x0104
#define MANUFACTURER q.m.k
#define PRODUCT HHKB mod
Expand Down
File renamed without changes.
73 changes: 73 additions & 0 deletions keyboards/hhkb/ansi/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"keyboard_name": "HHKB",
"url": "",
"maintainer": "qmk",
"width": 15,
"height": 5,
"layouts": {
"LAYOUT": {
"layout": [
{ "label": "Esc", "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": "|", "x": 13, "y": 0 },
{ "label": "~", "x": 14, "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": "Delete", "x": 13.5, "y": 1, "w": 1.5 },
{ "label": "Control", "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": "Return", "x": 12.75, "y": 2, "w": 2.25 },
{ "label": "Shift", "x": 0, "y": 3, "w": 2.25 },
{ "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 },
{ "label": "Fn", "x": 14, "y": 3 },
{ "label": "", "x": 1.5, "y": 4 },
{ "label": "", "x": 2.5, "y": 4, "w": 1.5 },
{ "x": 4, "y": 4, "w": 6 },
{ "label": "", "x": 10, "y": 4, "w": 1.5 },
{ "label": "", "x": 11.5, "y": 4 }
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ enum hhkb_keycodes
DYNAMIC_MACRO_RANGE,
};

#include "dynamic_macro.h"

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

Expand Down Expand Up @@ -104,7 +103,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
uint16_t macro_kc = (keycode == MO(DYN) ? DYN_REC_STOP : keycode);
if (!process_record_dynamic_macro(macro_kc, record))
if (!process_dynamic_macro(macro_kc, record))
{
return false;
}
Expand Down
1 change: 1 addition & 0 deletions keyboards/hhkb/ansi/keymaps/mjt/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DYNAMIC_MACRO_ENABLE = yes
68 changes: 68 additions & 0 deletions keyboards/hhkb/ansi/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#include QMK_KEYBOARD_H


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

/* BASE Level: Default Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | S | D | F | G | H | J | K | L | ; | ' | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/

[0] = LAYOUT( // default layer
KC_ESC, 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_BSLS, KC_GRV,
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_BSPC,
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT
),

/* Layer HHKB: HHKB mode (HHKB Fn)
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| | | | | | | + | - | End | PgD | Dow | | | | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
|------+------+----------------------+------+------+
| **** | **** | ******************** | **** | **** |
|------+------+----------------------+------+------+
*/

[1] = LAYOUT(
KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC,
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[2] = LAYOUT(
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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
),
[3] = LAYOUT(
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, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
)
};
1 change: 1 addition & 0 deletions keyboards/hhkb/ansi/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VIA_ENABLE = yes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion keyboards/hhkb/hhkb.c

This file was deleted.

115 changes: 115 additions & 0 deletions keyboards/hhkb/jp/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>

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

#ifndef CONFIG_H
diegomsong marked this conversation as resolved.
Show resolved Hide resolved
#define CONFIG_H

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x4848 // HH = happy hacking
#ifdef HHKB_JP
#define PRODUCT_ID 0x0002 // to differentiate from HHKB (ANSI)
#else
#define PRODUCT_ID 0x0001 // ANSI HHKB
#endif
#define DEVICE_VER 0x0104
#define MANUFACTURER q.m.k
#define PRODUCT HHKB mod
#define DESCRIPTION q.m.k keyboard firmware for HHKB

/* key matrix size */
#ifdef HHKB_JP
# define MATRIX_ROWS 16
#else
# define MATRIX_ROWS 8
#endif
#define MATRIX_COLS 8

#define TAPPING_TERM 200

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

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 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

#ifdef HHKB_RN42_ENABLE
// rn42 support -- acquired from the tmk repo. This is almost certainly not
// integrated with qmk in the correct way.

#define SUART_OUT_PORT PORTD
#define SUART_OUT_BIT 0
#define SUART_IN_PIN PIND
#define SUART_IN_BIT 1

#ifdef __AVR_ATmega32U4__
/* iom32u4.h has no definition of UCSR1D. copy from iom32u2.h */
#define UCSR1D _SFR_MEM8(0xCB)
#define RTSEN 0
#define CTSEN 1

#define SERIAL_UART_BAUD 115200
#define SERIAL_UART_DATA UDR1
#define SERIAL_UART_UBRR ((F_CPU/(16.0*SERIAL_UART_BAUD)-1+0.5))
#define SERIAL_UART_RXD_VECT USART1_RX_vect
#define SERIAL_UART_TXD_READY (UCSR1A&(1<<UDRE1))
#define SERIAL_UART_INIT() do { \
UBRR1L = (uint8_t) SERIAL_UART_UBRR; /* baud rate */ \
UBRR1H = ((uint16_t)SERIAL_UART_UBRR>>8); /* baud rate */ \
UCSR1B |= (1<<RXCIE1) | (1<<RXEN1); /* RX interrupt, RX: enable */ \
UCSR1B |= (0<<TXCIE1) | (1<<TXEN1); /* TX interrupt, TX: enable */ \
UCSR1C |= (0<<UPM11) | (0<<UPM10); /* parity: none(00), even(01), odd(11) */ \
UCSR1D |= (0<<RTSEN) | (0<<CTSEN); /* RTS, CTS(no flow control by hardware) */ \
DDRD |= (1<<5); PORTD &= ~(1<<5); /* RTS for flow control by firmware */ \
sei(); \
} while(0)
#define SERIAL_UART_RTS_LO() do { PORTD &= ~(1<<5); } while (0)
#define SERIAL_UART_RTS_HI() do { PORTD |= (1<<5); } while (0)
#else
#error "USART configuration is needed."
#endif

/* power control of key switch board */
#define HHKB_POWER_SAVING

#endif

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

#endif
Loading