Skip to content

Commit

Permalink
Gherkin: Refactor and Configurator support [resolved] (qmk#3140)
Browse files Browse the repository at this point in the history
* Refactor KEYMAP to LAYOUT_ortho_3x10

* Configurator support

* Renamed @Talljoe's keymap folder

* Renamed matrix_init_user to matrix_init_keymap
  • Loading branch information
noroadsleft authored and yamad committed Mar 21, 2019
1 parent 092f9d1 commit 59fc06d
Show file tree
Hide file tree
Showing 12 changed files with 287 additions and 363 deletions.
2 changes: 1 addition & 1 deletion keyboards/gherkin/gherkin.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "quantum.h"

#define KEYMAP( \
#define LAYOUT_ortho_3x10( \
K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \
K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \
K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \
Expand Down
13 changes: 13 additions & 0 deletions keyboards/gherkin/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"keyboard_name": "Gherkin",
"url": "",
"maintainer": "qmk",
"width": 10,
"height": 3,
"layouts": {
"LAYOUT_ortho_3x10": {
"key_count": 30,
"layout": [{"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":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}]
}
}
}
6 changes: 3 additions & 3 deletions keyboards/gherkin/keymaps/bbaserdem/keymap.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is a game-pad gherkin layout with RGB and LED lights

#include "gherkin.h"
#include QMK_KEYBOARD_H

backlight_config_t backlight_config;

Expand All @@ -14,14 +14,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Shf | A | S | D | F | <-- | |v| | --> | , | . |
* `-----------------------------------------------------------'
*/
KEYMAP(
LAYOUT_ortho_3x10(
KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_LCTRL, KC_LALT, KC_GRAVE,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_UP, KC_SCLN, KC_QUOTE, KC_SLASH,
KC_LSHIFT, KC_A, KC_S, KC_D, KC_F, KC_LEFT, KC_DOWN, KC_RIGHT, KC_COMMA, KC_DOT
)
};

void matrix_init_user(void) {
void matrix_init_keymap(void) {
// Set LED's to max
_delay_us(300);
backlight_config.level = 2;
Expand Down
195 changes: 49 additions & 146 deletions keyboards/gherkin/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -1,129 +1,32 @@
#include "gherkin.h"
#include QMK_KEYBOARD_H

#define _______ KC_TRNS
#define FN1_Q LT(1, KC_Q)

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

KEYMAP(
LT(1, KC_Q), KC_W, KC_E, KC_R, KC_T, KC_Y,
KC_U, KC_I, KC_O, KC_P, KC_A, KC_S,
KC_D, KC_F, KC_G, KC_H, KC_J, KC_K,
KC_L, KC_ESC, KC_Z, KC_X, KC_C, KC_V,
KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT),

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,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, BL_DEC),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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),

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,
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)
[0] = LAYOUT_ortho_3x10(
FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC,
KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT
),

[1] = LAYOUT_ortho_3x10(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, BL_INC,
_______, _______, _______, _______, _______, _______, RESET, _______, _______, BL_DEC
),

};

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
keyevent_t event = record->event;
keyevent_t event = record->event;
(void)event;

switch (id) {
switch (id) {

}
return MACRO_NONE;
}
return MACRO_NONE;
}

void matrix_init_user(void) {
Expand All @@ -133,39 +36,39 @@ void matrix_scan_user(void) {
}

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true;
return true;
}

void led_set_user(uint8_t usb_led) {

if (usb_led & (1 << USB_LED_NUM_LOCK)) {
DDRD |= (1 << 5); PORTD &= ~(1 << 5);
} else {
DDRD &= ~(1 << 5); PORTD &= ~(1 << 5);
}

if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 0); PORTB &= ~(1 << 0);
} else {
DDRB &= ~(1 << 0); PORTB &= ~(1 << 0);
}

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 {
}
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
DDRD |= (1 << 5); PORTD &= ~(1 << 5);
} else {
DDRD &= ~(1 << 5); PORTD &= ~(1 << 5);
}

if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
DDRB |= (1 << 0); PORTB &= ~(1 << 0);
} else {
DDRB &= ~(1 << 0); PORTB &= ~(1 << 0);
}

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 {

}

}
Loading

0 comments on commit 59fc06d

Please sign in to comment.