Added Makefile and crkbd keymap

This commit is contained in:
Leopold 2024-01-19 16:38:13 +01:00 committed by Ingwerpold
parent 9b8052074b
commit 0f99a50fb2
7 changed files with 275 additions and 0 deletions

5
.gitignore vendored Normal file
View file

@ -0,0 +1,5 @@
obj_*
*.hex
*.elf
*.map
*.uf2

45
Makefile Normal file
View file

@ -0,0 +1,45 @@
USER = ingwerpold
KEYBOARDS = crkbd
PATH_crkbd = crkbd
all: $(KEYBOARDS)
.PHONY: $(KEYBOARDS)
$(KEYBOARDS):
# init submodule
git submodule update --init --recursive
# cleanup old symlinks
for f in $(KEYBOARDS); do rm -rf qmk_firmware/keyboards/$(PATH_$@)/keymaps/$(USER); done
rm -rf qmk_firmware/users/$(USER)
# add new symlinks
ln -s $(shell pwd)/user qmk_firmware/users/$(USER)
ln -s $(shell pwd)/$@ qmk_firmware/keyboards/$(PATH_$@)/keymaps/$(USER)
# run lint check
cd qmk_firmware
#qmk lint -km $(USER) -kb $(PATH_$@) --strict
# run build
#make BUILD_DIR=$(shell pwd) -j1 -C qmk_firmware $(PATH_$@):$(USER)
QMK_HOME=$(shell pwd)/qmk_firmware BUILD_DIR=$(shell pwd) qmk compile -km $(USER) -kb $(PATH_$@)
# run rp2040 build
QMK_HOME=$(shell pwd)/qmk_firmware BUILD_DIR=$(shell pwd) qmk compile -km $(USER) -kb $(PATH_$@) -e CONVERT_TO=rp2040_ce
# cleanup symlinks
for f in $(KEYBOARDS); do rm -rf qmk_firmware/keyboards/$(PATH_$@)/keymaps/$(USER); done
rm -rf qmk_firmware/users/$(USER)
cp qmk_firmware/*.hex ./
cp qmk_firmware/*.uf2 ./
#cp qmk_firmware/*.map ./
#cp qmk_firmware/*.elf ./
clean:
rm -rf obj_*
rm -f *.elf
rm -f *.map
rm -f *.hex
rm -f *.uf2

52
crkbd/config.h Normal file
View file

@ -0,0 +1,52 @@
/*
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 TAPPING_FORCE_HOLD
#define TAPPING_TERM 100
#define QUICK_TAP_TERM 0
//#ifdef RGBLIGHT_ENABLE
// #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
// #define RGBLIGHT_EFFECT_TWINKLE
// #define RGBLIGHT_LIMIT_VAL 120
// #define RGBLIGHT_HUE_STEP 10
// #define RGBLIGHT_SAT_STEP 17
// #define RGBLIGHT_VAL_STEP 17
//#endif
#define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c"

163
crkbd/keymap.c Normal file
View file

@ -0,0 +1,163 @@
/*
Copyright 2019 @foostan
Copyright 2020 Drashna Jaelre <@drashna>
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/>.
*/
#include QMK_KEYBOARD_H
//include KEYMAP.GERMAN.h
#include <stdio.h>
// Left-hand home row mods
#define GUI_A LGUI_T(KC_A)
#define ALT_S LALT_T(KC_S)
#define SFT_D LSFT_T(KC_D)
#define CTL_F LCTL_T(KC_F)
// Right-hand home row mods
#define CTL_J RCTL_T(KC_J)
#define SHFT_K RSFT_T(KC_K)
#define ALT_L LALT_T(KC_L)
#define GUI_SCLN RGUI_T(KC_SCLN)
#define _NORMAL 0
#define _HMOD 1
#define _GAMING 2
#define _LEFT 3
#define _RIGHT 4
#define _ADJUST 5
enum my_keycodes {
LEFT = SAFE_RANGE,
RIGHT,
HMODS,
GAME
};
const uint16_t PROGMEM backspace_combo[] = {KC_J,KC_K,COMBO_END};
combo_t key_combos[] = {
COMBO(backspace_combo, KC_BSPC),
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_NORMAL] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
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_LCTL, 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_ESC,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LGUI, KC_SPC, LEFT, KC_ENT, RIGHT, KC_LALT
//`--------------------------' `--------------------------'
),
[_HMOD] = LAYOUT_split_3x6_3( //HOMEROW MODS
//,-----------------------------------------------------. ,-----------------------------------------------------.
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_LCTL, GUI_A, ALT_S, SFT_D, CTL_F, KC_G, KC_H, CTL_J, SHFT_K, ALT_L,GUI_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_ESC,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______,_______
//`--------------------------' `--------------------------'
),
[_GAMING] = LAYOUT_split_3x6_3( //GAMING
//,-----------------------------------------------------. ,-----------------------------------------------------.
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_LCTL, 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_ESC,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
KC_LALT, KC_SPC, KC_3 , KC_ENT, MO(1), MO(2)
//`--------------------------' `--------------------------'
),
[_LEFT] = LAYOUT_split_3x6_3(
//,-------------------------------------------------------------------------------------. ,-----------------------------------------------------------------------------------.
KC_TAB, KC_EXLM, KC_AT, KC_HASH , KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR , KC_LPRN , KC_RPRN , KC_BSPC ,
//|--------+--------+--------+----------+------------------------+---------------------| |--------+--------+----------+----------+---------------------+----------------------|
KC_LCTL, KC_SLASH,KC_RBRC,S(KC_RBRC),RALT(KC_NONUS_BACKSLASH), RALT(KC_Q) , KC_MINS, KC_EQL,RALT(KC_7),RALT(KC_0), KC_PIPE , KC_GRV ,\
//|--------+--------+--------+----------+------------------------+---------------------| |--------+--------+----------+----------+---------------------+----------------------|
XXXXXXX,S(KC_SLASH),KC_BSLS,S(KC_PLUS),RALT(KC_MINUS) ,S(KC_NONUS_BACKSLASH), KC_UNDS, KC_PLUS,RALT(KC_8),RALT(KC_9), KC_NONUS_BACKSLASH, S(KC_NONUS_BACKSLASH),
//|--------+--------+--------+----------+------+--------+----------------------------------------| |--------+--------+--------+---------+----------+---------------------+----------------------|
KC_LGUI, KC_SPC , MO(2) , KC_ENT, _______, KC_LALT
//`--------------------------' `--------------------------'
),
[_RIGHT] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_PGUP, KC_END , XXXXXXX, XXXXXXX,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______,_______
//`--------------------------' `--------------------------'
),
[_ADJUST] = LAYOUT_split_3x6_3(
//,-----------------------------------------------------. ,-----------------------------------------------------.
KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 ,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
TG(_HMOD), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TG(_GAMING),
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, CM_TOGG,
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
_______, _______, _______, _______, _______,_______
//`--------------------------' `--------------------------'
)
};
void keyboard_post_init_user_vars(void) {
// set_tri_layer_layers(_LEFT, _RIGHT, _ADJUST);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case LEFT:
if (record->event.pressed) {
layer_on(_LEFT);
if(IS_LAYER_ON(_RIGHT)){
layer_on(_ADJUST);
}
} else {
layer_off(_LEFT);
layer_off(_ADJUST);
}
return false; // Skip all further processing of this key
case RIGHT:
if (record->event.pressed) {
layer_on(_RIGHT);
if(IS_LAYER_ON(_LEFT)){
layer_on(_ADJUST);
}
} else {
layer_off(_RIGHT);
layer_off(_ADJUST);
}
return false;
default:
return true; // Process all other keycodes normally
}
}

8
crkbd/rules.mk Normal file
View file

@ -0,0 +1,8 @@
MOUSEKEY_ENABLE = yes # Mouse keys
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
OLED_ENABLE = no
OLED_DRIVER = SSD1306
LTO_ENABLE = yes
TAPPING_TERM = 150
COMBO_ENABLE = yes
TRI_LAYER_ENABLE = yes

1
user/config.h Normal file
View file

@ -0,0 +1 @@

1
user/rules.mk Normal file
View file

@ -0,0 +1 @@