From 0f71227e9e392001ad64419fa80b2230d91a977b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 17:01:04 -0400 Subject: [PATCH 01/94] Removed obsolete code --- .../gherkin/keymaps/bbaserdem/README.md | 11 - .../gherkin/keymaps/bbaserdem/config.h | 9 - .../gherkin/keymaps/bbaserdem/keymap.c | 36 - .../gherkin/keymaps/bbaserdem/rules.mk | 13 - .../lets_split/keymaps/bbaserdem/README.md | 27 - .../lets_split/keymaps/bbaserdem/config.h | 27 - .../lets_split/keymaps/bbaserdem/keymap.c | 35 - .../lets_split/keymaps/bbaserdem/rules.mk | 8 - .../keymaps/bbaserdem_right/README.md | 5 - .../keymaps/bbaserdem_right/config.h | 9 - .../keymaps/bbaserdem_right/keymap.c | 31 - .../keymaps/bbaserdem_right/rules.mk | 19 - .../lets_split_eh/keymaps/bbaserdem/README.md | 7 - .../lets_split_eh/keymaps/bbaserdem/config.h | 4 - .../lets_split_eh/keymaps/bbaserdem/keymap.c | 27 - .../lets_split_eh/keymaps/bbaserdem/rules.mk | 8 - keyboards/planck/keymaps/bbaserdem/README.md | 15 - keyboards/planck/keymaps/bbaserdem/config.h | 24 - keyboards/planck/keymaps/bbaserdem/keymap.c | 28 - keyboards/planck/keymaps/bbaserdem/rules.mk | 7 - .../xiudi/xd75/keymaps/bbaserdem/config.h | 3 - .../xiudi/xd75/keymaps/bbaserdem/keymap.c | 21 - .../xiudi/xd75/keymaps/bbaserdem/readme.md | 14 - .../xiudi/xd75/keymaps/bbaserdem/rules.mk | 7 - users/bbaserdem/README.md | 51 -- users/bbaserdem/bbaserdem.c | 633 ------------------ users/bbaserdem/bbaserdem.h | 268 -------- users/bbaserdem/config.h | 9 - users/bbaserdem/rules.mk | 21 - 29 files changed, 1377 deletions(-) delete mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md delete mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h delete mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c delete mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/lets_split/keymaps/bbaserdem/README.md delete mode 100755 keyboards/lets_split/keymaps/bbaserdem/config.h delete mode 100755 keyboards/lets_split/keymaps/bbaserdem/keymap.c delete mode 100755 keyboards/lets_split/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/lets_split/keymaps/bbaserdem_right/README.md delete mode 100755 keyboards/lets_split/keymaps/bbaserdem_right/config.h delete mode 100755 keyboards/lets_split/keymaps/bbaserdem_right/keymap.c delete mode 100755 keyboards/lets_split/keymaps/bbaserdem_right/rules.mk delete mode 100644 keyboards/lets_split_eh/keymaps/bbaserdem/README.md delete mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/config.h delete mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c delete mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/planck/keymaps/bbaserdem/README.md delete mode 100755 keyboards/planck/keymaps/bbaserdem/config.h delete mode 100755 keyboards/planck/keymaps/bbaserdem/keymap.c delete mode 100755 keyboards/planck/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/xiudi/xd75/keymaps/bbaserdem/config.h delete mode 100644 keyboards/xiudi/xd75/keymaps/bbaserdem/keymap.c delete mode 100644 keyboards/xiudi/xd75/keymaps/bbaserdem/readme.md delete mode 100644 keyboards/xiudi/xd75/keymaps/bbaserdem/rules.mk delete mode 100644 users/bbaserdem/README.md delete mode 100644 users/bbaserdem/bbaserdem.c delete mode 100644 users/bbaserdem/bbaserdem.h delete mode 100644 users/bbaserdem/config.h delete mode 100644 users/bbaserdem/rules.mk diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md deleted file mode 100644 index 3c9a5e98b37..00000000000 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Gherkin Layout -This is my gherkin layout. -It is used as a game pad, and key layout is inspired by spare keys I had lying around. -The firmware is very simple, and only includes one layer keymap, and RGB effects. - -# Flashing -The following command should be used from the main qmk directory. -``` -make gherkin:bbaserdem -sudo avrdude -p atmgea34u4 -P `ls /dev/ttyACM*` -c avr109 -U flash:.build/gherkin_bbaserdem.hex -``` diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h deleted file mode 100644 index 5c9ca52d750..00000000000 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#define RGB_DI_PIN F6 -#define RGBLED_NUM 10 -#define RGBLIGHT_ANIMATIONS -#ifdef BACKLIGHT_LEVELS -#undef BACKLIGHT_LEVELS -#endif -#define BACKLIGHT_LEVELS 3 diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c deleted file mode 100644 index 0d3c8557c5c..00000000000 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,36 +0,0 @@ -// This is a game-pad gherkin layout with RGB and LED lights - -#include QMK_KEYBOARD_H - -backlight_config_t backlight_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Game pad - * ,-----------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | Ctl | Alt | ~ | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Tab | Q | W | E | R | T | |^| | ; | ' | / | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Shf | A | S | D | F | <-- | |v| | --> | , | . | - * `-----------------------------------------------------------' - */ - 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) { - // Set LED's to max - _delay_us(300); - backlight_config.level = 2; - backlight_config.enable = 1; - eeconfig_update_backlight(backlight_config.raw); - backlight_set(backlight_config.level); - // Set RGB to rainbow mood light - rgblight_enable(); - rgblight_mode(1); - rgblight_sethsv(120,255,255); - rgblight_mode(6); -} diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk deleted file mode 100644 index 07a20a42172..00000000000 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -USER_NAME := bbaserdem-nouserspace - -STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER -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 -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -AUDIO_ENABLE = no # Enable audio output from keyboard - -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable RBG light strips -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/lets_split/keymaps/bbaserdem/README.md b/keyboards/lets_split/keymaps/bbaserdem/README.md deleted file mode 100644 index 4b37d735552..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Lets Split Layout - -Check out [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Usage - -**These commands depend on there being no other arduino connected!** -Also udev rules can be set instead of using sudo. -Please unplug all other usb devices. - -To make the hex files; -``` -make lets_split/rev2:bbaserdem -make lets_split/rev2:bbaserdem_right -``` - -For the left half, after plugging in and resetting; (from repo main directory) -``` -sudo avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.build/lets_split_rev2_bbaserdem.hex -sudo avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -U eeprom:w:keyboards/lets_split/eeprom-lefthand.eep -``` - -For the right half; -``` -sudo avrdude -p atmgea34u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.build/lets_split_rev2_bbaserdem_right.hex -sudo avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -U eeprom:w:keyboards/lets_split/eeprom-righhand.eep -``` diff --git a/keyboards/lets_split/keymaps/bbaserdem/config.h b/keyboards/lets_split/keymaps/bbaserdem/config.h deleted file mode 100755 index 6a90e1c356d..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H - -#include "../../config.h" - -#define USE_SERIAL -#define EE_HANDS - -// LED strip stuff -#ifdef RGBLIGHT_ENABLE - -// Who thought it was a good idea to predefine these in the rev2/config.h ??? -#ifdef RGBLED_NUM -#undef RGBLED_NUM -#endif -#define RGBLED_NUM 12 - -#define RGBLIGHT_HUE_STEP 6 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 20 -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 6 -#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 2000 -#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 -#endif - -#endif diff --git a/keyboards/lets_split/keymaps/bbaserdem/keymap.c b/keyboards/lets_split/keymaps/bbaserdem/keymap.c deleted file mode 100755 index f9eab059ef1..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Let's Split - Dvorak turkish - * Keymap by @bbaserdem - * Dvorak layout with multiple features - * Most of the code is in the "user" directory. - * Check qmk_firmware/users/bbaserdem for the main part of the code - */ - -#include "lets_split.h" -#include "bbaserdem.h" - - -void matrix_init_keymap (void) { -} - -uint32_t layer_state_set_keymap(uint32_t state) { - return state; -} - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Main Dvorak layer - [_DV] = LAYOUT_letssplit_wrapper(DVORAK), - // Turkish and special character overlay - [_AL] = LAYOUT_letssplit_wrapper(ALTCHAR), - // Gaming layer - [_GA] = LAYOUT_letssplit_wrapper(GAME), - // Numbers layer - [_NU] = LAYOUT_letssplit_wrapper(NUMBERS), - // Settings layer - [_SE] = LAYOUT_letssplit_wrapper(SETTINGS), - // Mouse emulation layer - [_MO] = LAYOUT_letssplit_wrapper(MOUSE), - // Music layer - [_MU] = LAYOUT_letssplit_wrapper(MUSIC), -}; diff --git a/keyboards/lets_split/keymaps/bbaserdem/rules.mk b/keyboards/lets_split/keymaps/bbaserdem/rules.mk deleted file mode 100755 index 7a37e989d87..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Build options - -BACKLIGHT_ENABLE = no # Switch LEDs -MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = yes # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff - diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/README.md b/keyboards/lets_split/keymaps/bbaserdem_right/README.md deleted file mode 100644 index 8608f23f79b..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem_right/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Lets Split - Right Half - -Keymap for my right half, to be used as a numpad. -Check [main readme](../bbaserdem/README.md) for flashing info. - diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/config.h b/keyboards/lets_split/keymaps/bbaserdem_right/config.h deleted file mode 100755 index 47545a059be..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem_right/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H - -#include "../../config.h" - -#define USE_SERIAL -#define EE_HANDS - -#endif diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c b/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c deleted file mode 100755 index 2dcae0dca5a..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Let's Split - Dvorak turkish - * Keymap by @bbaserdem - * Dvorak layout with multiple features - * Most of the code is in the "user" directory. - * Check qmk_firmware/users/bbaserdem for the main part of the code - */ - -#include "lets_split.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Navigation All Supered) Numpad - * ,-----------------------. ,-----------------------. - * | F4| ` | Q |Alt| L | > | | ) | - | + | = |Ent|Bkp| - * |---+---+---+---+---+---| |---+---+---+---+---+---| - * | F3| M |Ent|Ctl| K | ^ | | ( | * | 9 | 6 | 3 | . | - * |---+---+---+---+---+---| |---+---+---+---+---+---| - * | F2| T |Spc|Shf| J | v | | % | / | 8 | 5 | 2 | , | - * |---+---+---+---+---+---| |---+---+---+---+---+---| - * | F1| F | P |Tab| H | < | |Nlc|Tab| 7 | 4 | 1 | 0 | - * `-----------------------' `-----------------------' - */ - // Main Dvorak layer - [0] = LAYOUT_ortho_4x12( - LCTL(LALT(KC_DEL)), LGUI(KC_GRV), LGUI(KC_Q), LGUI(KC_LALT), LGUI(KC_L), LGUI(KC_RGHT), KC_RPRN, KC_PMNS, KC_PPLS, KC_PEQL, KC_PENT, KC_BSPC, \ - LGUI(KC_F3), LGUI(KC_M), LGUI(KC_ENT), LGUI(KC_LCTL), LGUI(KC_K), LGUI(KC_UP), KC_LPRN, KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, \ - LGUI(KC_F2), LGUI(KC_T), LGUI(KC_SPC), LGUI(KC_LSFT), LGUI(KC_J), LGUI(KC_DOWN), KC_PERC, KC_PSLS, KC_P8, KC_P5, KC_P2, KC_PCMM, \ - LGUI(KC_F1), LGUI(KC_F), LGUI(KC_P), LGUI(KC_TAB), LGUI(KC_H), LGUI(KC_LEFT), KC_NLCK, KC_TAB, KC_P7, KC_P4, KC_P1, KC_P0 \ - ) -}; diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk b/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk deleted file mode 100755 index 6886a320a59..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Build options - -USER_NAME := bbaserdem-without-userspace - -BACKLIGHT_ENABLE = no # Switch LEDs -MOUSEKEY_ENABLE = no # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = no # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff -BLUETOOTH_ENABLE = no # No bluetooth -COMMAND_ENABLE = no # Some bootmagic thing -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -CONSOLE_ENABLE = no # Allows console output with a command -SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. -NKRO_ENABLE = no # Default is 6KRO which is plenty -MIDI_ENABLE = no # Untested feature -KEY_LOCK_ENABLE = no # Allows locking any key. Not used -UNICODE_ENABLE = no # Used for unicode character emulation -EXTRAKEY_ENABLE = no # OS signals like volume control diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/README.md b/keyboards/lets_split_eh/keymaps/bbaserdem/README.md deleted file mode 100644 index fcb70379376..00000000000 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Lets Split Eh Layout - -Check out [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Usage - -Fill in after flashing diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/config.h b/keyboards/lets_split_eh/keymaps/bbaserdem/config.h deleted file mode 100755 index 47be76567e4..00000000000 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H -#include "../../config.h" -#endif diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c b/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c deleted file mode 100755 index 92e72bbf1c8..00000000000 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "lets_split_eh.h" -#include "bbaserdem.h" - - -void matrix_init_keymap (void) { -} - -uint32_t layer_state_set_keymap(uint32_t state) { - return state; -} - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Main Dvorak layer - [_DV] = LAYOUT_letssplit_wrapper(DVORAK), - // Turkish and special character overlay - [_AL] = LAYOUT_letssplit_wrapper(ALTCHAR), - // Gaming layer - [_GA] = LAYOUT_letssplit_wrapper(GAME), - // Numbers layer - [_NU] = LAYOUT_letssplit_wrapper(NUMBERS), - // Settings layer - [_SE] = LAYOUT_letssplit_wrapper(SETTINGS), - // Mouse emulation layer - [_MO] = LAYOUT_letssplit_wrapper(MOUSE), - // Music layer - [_MU] = LAYOUT_letssplit_wrapper(MUSIC), -}; diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk b/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk deleted file mode 100755 index 7a37e989d87..00000000000 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Build options - -BACKLIGHT_ENABLE = no # Switch LEDs -MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = yes # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff - diff --git a/keyboards/planck/keymaps/bbaserdem/README.md b/keyboards/planck/keymaps/bbaserdem/README.md deleted file mode 100644 index c8e8c3963c1..00000000000 --- a/keyboards/planck/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Planck Layout - -Current keymap is for rev4. -Audio is disabled in favor of RGB. -Check out [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Build - -Get keyboard into reset mode, and then; - -``` -make planck/rev4:bbaserdem:dfu -``` - -Either use sudo or set up udev rules. diff --git a/keyboards/planck/keymaps/bbaserdem/config.h b/keyboards/planck/keymaps/bbaserdem/config.h deleted file mode 100755 index ac5460bda60..00000000000 --- a/keyboards/planck/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H - -#include "config_common.h" - -// LED strip stuff -#ifdef RGBLIGHT_ENABLE -#define RGB_DI_PIN B2 -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 6 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 20 -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 6 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 6 -#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 6 -#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 2000 -#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 -#endif - -#define ENCODER_RESOLUTION 4 - -#endif diff --git a/keyboards/planck/keymaps/bbaserdem/keymap.c b/keyboards/planck/keymaps/bbaserdem/keymap.c deleted file mode 100755 index 1fa8132ddbb..00000000000 --- a/keyboards/planck/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * PLANCK - Dvorak turkish - * Keymap by @bbaserdem - * Dvorak layout with multiple features - * Most of the code is in the "user" directory. - * Check qmk_firmware/users/bbaserdem for the main part of the code - */ - -#include "planck.h" -#include "bbaserdem.h" - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Main Dvorak layer - [_DV] = LAYOUT_planck_wrapper(DVORAK), - // Turkish and special character overlay - [_AL] = LAYOUT_planck_wrapper(ALTCHAR), - // Gaming layer - [_GA] = LAYOUT_planck_wrapper(GAME), - // Numbers layer - [_NU] = LAYOUT_planck_wrapper(NUMBERS), - // Settings layer - [_SE] = LAYOUT_planck_wrapper(SETTINGS), - // Mouse emulation layer - [_MO] = LAYOUT_planck_wrapper(MOUSE), - // Music mode - [_MU] = LAYOUT_planck_wrapper(MUSIC), -}; diff --git a/keyboards/planck/keymaps/bbaserdem/rules.mk b/keyboards/planck/keymaps/bbaserdem/rules.mk deleted file mode 100755 index b9b589e8d2d..00000000000 --- a/keyboards/planck/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Build options - -BACKLIGHT_ENABLE = yes # Switch LEDs -MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = yes # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = yes # Audio stuff diff --git a/keyboards/xiudi/xd75/keymaps/bbaserdem/config.h b/keyboards/xiudi/xd75/keymaps/bbaserdem/config.h deleted file mode 100644 index 271f48d0011..00000000000 --- a/keyboards/xiudi/xd75/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -// place overrides here diff --git a/keyboards/xiudi/xd75/keymaps/bbaserdem/keymap.c b/keyboards/xiudi/xd75/keymaps/bbaserdem/keymap.c deleted file mode 100644 index 6f8576b09b4..00000000000 --- a/keyboards/xiudi/xd75/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,21 +0,0 @@ -#include QMK_KEYBOARD_H -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Layout - * ,-----------------------------------------------------------. - * |Blt|Lck| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | - * |---+---+-----------------------------------------------+---| - * |Int|Trm| |Cps| - * |---+---| |---| - * |Clc|Psw| | \ | - * |---+---| PLANCK |---| - * |Rev|Ffw| | [ | - * |---+---| |---| - * |Tog|Mut| | ] | - * `-----------------------------------------------------------' - */ -[0] = KM( FKLAVYE ), -[1] = KM( AYARLAR ), -}; - diff --git a/keyboards/xiudi/xd75/keymaps/bbaserdem/readme.md b/keyboards/xiudi/xd75/keymaps/bbaserdem/readme.md deleted file mode 100644 index f96c8ea976c..00000000000 --- a/keyboards/xiudi/xd75/keymaps/bbaserdem/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -# XD75RE Setup - -(WIP) F keyboard for turkish, using unicode. - -* Write down keymap in userspace -* Figure out LED indicators - -# Make - -Take the board into reset mode, then -``` -make xd75:bbaserdem:dfu -``` -Either sudo it or set permissions in udev. diff --git a/keyboards/xiudi/xd75/keymaps/bbaserdem/rules.mk b/keyboards/xiudi/xd75/keymaps/bbaserdem/rules.mk deleted file mode 100644 index 3e501cd00ee..00000000000 --- a/keyboards/xiudi/xd75/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Build options -BACKLIGHT_ENABLE = yes # Switch LEDs -MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = no # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff - diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md deleted file mode 100644 index eb8f33d422d..00000000000 --- a/users/bbaserdem/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# Overview - -I have mostly ortholinear keyboards, which share a lot of functions. -For this purpose, I collected them here. - -I have the following keymaps: - -* Gherkin (Does not use the user space) -* XD75RE (Uses different keymap) -* Let's Split -* Let's Split It Up -* Planck - -# Layout - -I use DVORAK with an unorthodox Turkish layout. -If you wanna grab my code, and you used a layout with a persistent base -layer change, change it to layer 0 before proceeding. - -# Layers - -* **Dvorak**: Base layer,with dvorak layout. -* **Alternative**: Has alternate characters. -* **Game**: Toggled from *Function*, comfortable for gaming use. -* **Numeric**: Has numericals and symbols. Can be locked. -* **Function**: Layer has media and function keys. -* **Mouse**: Manipulates mouse. Can be locked. -* **Music** Allows playing sounds. - -# Functionality - -* **RGB Backlight**: With layer indication, and ability to change base layer lighting mode. -* **Secrets**: By placing a secrets.h, and not tracking it, passwords can be stored. -* **Mouse**: Mouse emulation, complete with diagonal keys. -* **Turkish**: An AltGr-like overlay that allows some non-common letters, in unicode. - -I suggest checking out how I enabled Turkish keys, -how I planned out RGB lighting, -and my mouse implementation; -they might offer some insight into fringe user cases. - -# Issues - -All features are too big for the 32kB bootloader. -Offenders are audio and rgb lights; it comes down to one or the other. - -~The Proton board, and rev 6 might fix that.~ - -# Credits - -I have previously written my keymap by myself before, but I rewrote it here, diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c deleted file mode 100644 index cdacda12ee8..00000000000 --- a/users/bbaserdem/bbaserdem.c +++ /dev/null @@ -1,633 +0,0 @@ -#include "bbaserdem.h" - -/*---------------*\ -|*-----MOUSE-----*| -\*---------------*/ -#ifdef MOUSEKEY_ENABLE -#include "mousekey.h" -#endif - -/*-------------*\ -|*-----RGB-----*| -\*-------------*/ -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - -/*-------------*\ -|*---UNICODE---*| -\*-------------*/ -#ifdef UNICODE_ENABLE -#endif - -/*-----------------*\ -|*-----SECRETS-----*| -\*-----------------*/ -// Enabled by adding a non-tracked secrets.h to this dir. -#if (__has_include("secrets.h")) -#include "secrets.h" -#endif - -/*---------------*\ -|*-----MUSIC-----*| -\*---------------*/ -#ifdef AUDIO_ENABLE -float tone_game[][2] = SONG(ZELDA_PUZZLE); -float tone_return[][2] = SONG(ZELDA_TREASURE); -float tone_linux[][2] = SONG(UNICODE_LINUX); -float tone_windows[][2] = SONG(UNICODE_WINDOWS); -#endif - -/*-------------------*\ -|*-----TAP-DANCE-----*| -\*-------------------*/ -#ifdef TAP_DANCE_ENABLE -qk_tap_dance_action_t tap_dance_actions[] = { - // Shift on double tap of semicolon - [SCL] = ACTION_TAP_DANCE_DOUBLE( KC_SCLN, KC_COLN ) -}; -#endif - -/* In keymaps, instead of writing _user functions, write _keymap functions - * The __attribute__((weak)) allows for empty definitions here, and during - * compilation, if these functions are defined elsewhere, they are written - * over. This allows to include custom code from keymaps in the generic code - * in this file. - */ -__attribute__ ((weak)) void matrix_init_keymap(void) { } -__attribute__ ((weak)) void matrix_scan_keymap(void) { } -__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__ ((weak)) uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} -__attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) { } - -/* ----------------------- *\ - * -----RGB Functions----- * -\* ----------------------- */ -#ifdef RGBLIGHT_ENABLE -// Storage variables -extern rgblight_config_t rgblight_config; -bool base_sta; // Keeps track if in saveable state -bool base_tog; // Whether base state is active or not -int base_hue; // Hue value of base state -int base_sat; // Saturation value of base state -int base_val; // Brightness value of base state -uint8_t base_mod; // Animation mode of the base state - -// Save the current state of the rgb mode -void rgblight_saveBase(void) { - base_hue = rgblight_config.hue; - base_sat = rgblight_config.sat; - base_val = rgblight_config.val; - base_mod = rgblight_config.mode; - base_tog = rgblight_config.enable; - base_sta = false; // If saving, that means base layer is being left -} - -// Load the base state back -void rgblight_loadBase(void) { - // Don't do anything if not enabled - if ( !base_sta ) { - if ( base_tog ) { - rgblight_enable(); - rgblight_mode( base_mod ); - rgblight_sethsv( base_hue, base_sat, base_val ); - } else { - rgblight_disable(); - } - } - // Mark that base is loaded, and to be saved before leaving - base_sta = true; -} - -// Set to plain HSV color -void rgblight_colorStatic( int hu, int sa, int va ) { - // First, it must be enabled or color change is not written - rgblight_enable(); - rgblight_mode(1); - rgblight_sethsv(hu,sa,va); -} -/* HSV values - * white ( 0, 0, 255) - * red ( 0, 255, 255) - * coral ( 16, 176, 255) - * orange ( 39, 255, 255) - * goldenrod ( 43, 218, 218) - * gold ( 51, 255, 255) - * yellow ( 60, 255, 255) - * chartreuse ( 90, 255, 255) - * green (120, 255, 255) - * springgreen (150, 255, 255) - * turquoise (174, 90, 112) - * teal (180, 255, 128) - * cyan (180, 255, 255) - * azure (186, 102, 255) - * blue (240, 255, 255) - * purple (270, 255, 255) - * magenta (300, 255, 255) - * pink (330, 128, 255) - */ - -// Set RGBLIGHT state depending on layer -void rgblight_change( uint8_t this_layer ) { - // Save state, if saving is requested - if ( base_sta ) { - rgblight_saveBase(); - } - // Change RGB light - switch ( this_layer ) { - case _DV: - // Load base layer - rgblight_loadBase(); - break; - case _AL: - // Do yellow for alternate - rgblight_colorStatic( 60,255,255); - break; - case _GA: - // Do purple for game - rgblight_colorStatic(285,255,255); - break; - case _NU: - // Do azure for number - rgblight_colorStatic(186,200,255); - break; - case _SE: - // Do red for settings - rgblight_colorStatic( 16,255,255); - break; - case _MO: - // Do green for mouse - rgblight_colorStatic(120,255,255); - break; - case _MU: - // Do orange for music - rgblight_colorStatic( 39,255,255); - break; - default: - // Something went wrong - rgblight_colorStatic( 0,255,255); - break; - } -} - -#endif - -/*---------------------*\ -|*-----MATRIX INIT-----*| -\*---------------------*/ -void matrix_init_user (void) { - - // Keymap specific things, do it first thing to allow for delays etc - matrix_init_keymap(); - - // Correct unicode -#ifdef UNICODE_ENABLE - set_unicode_input_mode(UC_LNX); -#endif - - // Make beginning layer DVORAK - set_single_persistent_default_layer(_DV); - -//--RGB light initialize base layer -#ifdef RGBLIGHT_ENABLE - // Base hue is white, and RGB disabled - base_hue = 100; - base_sat = 0; - base_val = 255; - base_mod = 2; - base_tog = false; - rgblight_enable(); - rgblight_mode(base_mod); - rgblight_sethsv(base_hue,base_sat,base_val); - rgblight_disable(); - rgblight_loadBase(); -#endif - -} - -/*---------------------*\ -|*-----MATRIX SCAN-----*| -\*---------------------*/ -void matrix_scan_user (void) { - // Keymap specific, do it first - matrix_scan_keymap(); -} - -/*------------------*\ -|*-----KEYCODES-----*| -\*------------------*/ -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - // Shift check - bool is_capital = ( keyboard_report->mods & (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)) ); - static bool lock_flag = false; - uint8_t layer = biton32 (layer_state); - - switch (keycode) { - // Secrets implementation -#if (__has_include("secrets.h")) - case SECRET1: - if( !record->event.pressed ) { - send_string_P( secret[ keycode - SECRET1 ] ); - } - return false; - break; - case SECRET2: - if( !record->event.pressed ) { - send_string_P( secret[ keycode - SECRET2 ] ); - } - return false; - break; - case SECRET3: - if( !record->event.pressed ) { - send_string_P( secret[ keycode - SECRET3 ] ); - } - return false; - break; -#endif - - // If these keys are pressed, load base layer config, and mark saving -#ifdef RGBLIGHT_ENABLE - case RGB_TOG: - case RGB_MOD: - case RGB_VAI: - case RGB_VAD: - case RGB_SAI: - case RGB_SAD: - case RGB_HUI: - case RGB_HUD: - if ( !base_sta ) { - rgblight_loadBase(); - } - return true; - break; -#endif - - // Lock functionality: These layers are locked if the LOCKED buttons are - // pressed. Otherwise, they are momentary toggles - case K_LOCK: - if (record->event.pressed) { - lock_flag = !lock_flag; - } - return false; - break; - case K_MOUSE: - if (record->event.pressed) { - layer_on(_MO); - lock_flag = false; - } else { - if ( lock_flag ) { - lock_flag = false; - } else { - layer_off(_MO); - } - } - return false; - break; - case K_NUMBR: - if (record->event.pressed) { - layer_on(_NU); - lock_flag = false; - } else { - if ( lock_flag ) { - lock_flag = false; - } else { - layer_off(_NU); - } - } - return false; - break; - - // Layer switches with sound - case K_GAMES: - if (record->event.pressed) { - // On press, turn off layer if active - if ( layer == _GA ) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_return); -#endif - layer_off(_GA); - } - } else { - // After click, turn on layer if accessed from setting - if ( layer == _SE ) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_game); -#endif - layer_on(_GA); - layer_off(_SE); - } - } - return false; - break; - case MU_TOG: - if (record->event.pressed) { - // On press, turn off layer if active - if ( layer == _SE ) { - layer_off(_SE); - layer_on(_MU); - } else { - layer_off(_MU); - } - } - return true; - break; - -//------UNICODE - // Unicode switches with sound -#ifdef UNICODE_ENABLE - case UNI_LI: - if (record->event.pressed) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_linux); -#endif - set_unicode_input_mode(UC_LNX); - } - return false; - break; - case UNI_WN: - if (record->event.pressed) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_windows); -#endif - set_unicode_input_mode(UC_WIN); - } - return false; - break; - - // Turkish letters, with capital functionality - case TUR_A: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x00c2); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x00e2); - unicode_input_finish(); - } - } - return false; - break; - case TUR_O: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x00d6); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x00f6); - unicode_input_finish(); - } - } - return false; - break; - case TUR_U: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x00dc); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x00fc); - unicode_input_finish(); - } - } - return false; - break; - case TUR_I: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x0130); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x0131); - unicode_input_finish(); - } - } - return false; - break; - case TUR_G: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x011e); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x011f); - unicode_input_finish(); - } - } - return false; - break; - case TUR_C: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x00c7); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x00e7); - unicode_input_finish(); - } - } - return false; - break; - case TUR_S: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x015e); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x015f); - unicode_input_finish(); - } - } - return false; - break; -#endif - -//-------Diagonal mouse movements -#ifdef MOUSEKEY_ENABLE - case MO_NE: - if( record->event.pressed ) { - mousekey_on(MO_N); - mousekey_on(MO_E); - mousekey_send(); - } else { - mousekey_off(MO_N); - mousekey_off(MO_E); - mousekey_send(); - } - return false; - break; - case MO_NW: - if( record->event.pressed ) { - mousekey_on(MO_N); - mousekey_on(MO_W); - mousekey_send(); - } else { - mousekey_off(MO_N); - mousekey_off(MO_W); - mousekey_send(); - } - return false; - break; - case MO_SE: - if( record->event.pressed ) { - mousekey_on(MO_S); - mousekey_on(MO_E); - mousekey_send(); - } else { - mousekey_off(MO_S); - mousekey_off(MO_E); - mousekey_send(); - } - return false; - break; - case MO_SW: - if( record->event.pressed ) { - mousekey_on(MO_S); - mousekey_on(MO_W); - mousekey_send(); - } else { - mousekey_off(MO_S); - mousekey_off(MO_W); - mousekey_send(); - } - return false; - break; - case MO_S_NE: - if( record->event.pressed ) { - mousekey_on(MO_S_N); - mousekey_on(MO_S_E); - mousekey_send(); - } else { - mousekey_off(MO_S_N); - mousekey_off(MO_S_E); - mousekey_send(); - } - return false; - break; - case MO_S_NW: - if( record->event.pressed ) { - mousekey_on(MO_S_N); - mousekey_on(MO_S_W); - mousekey_send(); - } else { - mousekey_off(MO_S_N); - mousekey_off(MO_S_W); - mousekey_send(); - } - return false; - break; - case MO_S_SE: - if( record->event.pressed ) { - mousekey_on(MO_S_S); - mousekey_on(MO_S_E); - mousekey_send(); - } else { - mousekey_off(MO_S_S); - mousekey_off(MO_S_E); - mousekey_send(); - } - return false; - break; - case MO_S_SW: - if( record->event.pressed ) { - mousekey_on(MO_S_S); - mousekey_on(MO_S_W); - mousekey_send(); - } else { - mousekey_off(MO_S_S); - mousekey_off(MO_S_W); - mousekey_send(); - } - return false; - break; -#endif - -//------DOUBLE PRESS, with added left navigation - case DBL_SPC: - if( record->event.pressed ) { - SEND_STRING(" "SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_ANG: - if( record->event.pressed ) { - SEND_STRING("<>"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_PAR: - if( record->event.pressed ) { - SEND_STRING("()"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_SQR: - if( record->event.pressed ) { - SEND_STRING("[]"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_BRC: - if( record->event.pressed ) { - SEND_STRING("{}"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_QUO: - if( record->event.pressed ) { - SEND_STRING("\'\'"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_DQT: - if( record->event.pressed ) { - SEND_STRING("\"\""SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_GRV: - if( record->event.pressed ) { - SEND_STRING("``"SS_TAP(X_LEFT)); - } - return false; - break; -// END OF KEYCODES - } - return process_record_keymap(keycode, record); -} - -/*----------------------*\ -|*-----LAYER CHANGE-----*| -\*----------------------*/ - -layer_state_t layer_state_set_user(layer_state_t state) { - - state = layer_state_set_keymap (state); -#ifdef RGBLIGHT_ENABLE - // Change RGB lighting depending on the last layer activated - rgblight_change( biton32(state) ); -#endif - return state; -} diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h deleted file mode 100644 index 3a405f2a47c..00000000000 --- a/users/bbaserdem/bbaserdem.h +++ /dev/null @@ -1,268 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -#define XXX KC_NO - -// Layers -#define _DV 0 // Base layer -#define _AL 1 // Alt char overlay -#define _GA 2 // Game layer -#define _NU 3 // Numbers layer -#define _SE 4 // Settings layer -#define _MO 5 // Mouse emulation -#define _MU 6 // Music mode - -// Define short macros -#define UNDO LCTL(KC_Z) -#define REDO LCTL(KC_Y) -#define COPY LCTL(KC_C) -#define CUT LCTL(KC_X) -#define PASTE LCTL(KC_V) - -// Rename mouse keys with 7 letters -#ifdef MOUSEKEY_ENABLE -#define MO_S_N KC_MS_WH_UP -#define MO_S_S KC_MS_WH_DOWN -#define MO_S_E KC_MS_WH_RIGHT -#define MO_S_W KC_MS_WH_LEFT -#define MO_N KC_MS_UP -#define MO_S KC_MS_DOWN -#define MO_E KC_MS_RIGHT -#define MO_W KC_MS_LEFT -#define MO_CL_L KC_MS_BTN1 -#define MO_CL_R KC_MS_BTN2 -#define MO_CL_M KC_MS_BTN3 -#define MO_CL_4 KC_MS_BTN4 -#define MO_CL_5 KC_MS_BTN5 -#define MO_AC_0 KC_MS_ACCEL0 -#define MO_AC_1 KC_MS_ACCEL1 -#define MO_AC_2 KC_MS_ACCEL2 -#else -#define MO_S_N KC_NO -#define MO_S_S KC_NO -#define MO_S_E KC_NO -#define MO_S_W KC_NO -#define MO_N KC_NO -#define MO_S KC_NO -#define MO_E KC_NO -#define MO_W KC_NO -#define MO_CL_L KC_NO -#define MO_CL_R KC_NO -#define MO_CL_M KC_NO -#define MO_CL_1 KC_NO -#define MO_CL_2 KC_NO -#define MO_AC_0 KC_NO -#define MO_AC_1 KC_NO -#define MO_AC_2 KC_NO -#endif - -// Rename music keys with <8 letters -#ifdef AUDIO_ENABLE -#define MU_REC KC_LCTL -#define MU_STOP KC_LALT -#define MU_PLAY KC_LGUI -#define MU_PLAY KC_LGUI -#define MU_FAST KC_UP -#define MU_SLOW KC_DOWN -#define MU_MASK KC_A -#else -#define MU_REC KC_NO -#define MU_STOP KC_NO -#define MU_PLAY KC_NO -#define MU_PLAY KC_NO -#define MU_FAST KC_NO -#define MU_SLOW KC_NO -#define MU_MASK KC_NO -#endif - -// Define non-capitalized UTF shortcuts here -#ifdef UNICODE_ENABLE -#define PHY_HBR UC(0x0127) -#define PHY_DEG UC(0x00b0) -#define CUR_LIR UC(0x20ba) -#define CUR_BIT UC(0x20bf) -#define CUR_EUR UC(0x20ac) -#define CUR_BPN UC(0x00a3) -#define CUR_YEN UC(0x00a5) -#else -#define PHY_HBR KC_NO -#define PHY_DEG KC_NO -#define CUR_LIR KC_NO -#define CUR_BIT KC_NO -#define CUR_EUR KC_NO -#define CUR_BPN KC_NO -#define CUR_YEN KC_NO -#endif - -// Custom keycodes -enum userspace_custom_keycodes { - // Turkish letters, with shifting - TUR_A = SAFE_RANGE, - TUR_C, - TUR_G, - TUR_I, - TUR_O, - TUR_S, - TUR_U, - // Unicode mode switch - UNI_LI, - UNI_WN, - // Double keys - DBL_SPC, - DBL_ANG, - DBL_PAR, - DBL_SQR, - DBL_BRC, - DBL_QUO, - DBL_DQT, - DBL_GRV, - // Diagonal mouse movements - MO_NE, - MO_NW, - MO_SE, - MO_SW, - MO_S_NE, - MO_S_NW, - MO_S_SE, - MO_S_SW, - // Layer switches and lock functionality - K_MOUSE, - K_NUMBR, - K_LOCK, - K_GAMES, - // Secret macros - SECRET1, - SECRET2, - SECRET3 -}; - -// Do tap dancable semicolon key if available -#ifdef TAP_DANCE_ENABLE -enum { - SCL = 0 -}; -#define MY_SCL TD(SCL) -#else -#define MY_SCL KC_SCLN -#endif - -// Shared keymaps -#define LAYOUT_planck_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) -#define LAYOUT_letssplit_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -/* Dvorak - * ,------------------------------------------------------------------------. - * | Esc | ' " | , | . | P | Y || F | G | C | R | L | Bkp | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | Tab | A | O | E | U | I || D | H | T | N | S | / ? | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | SYM | ; : | Q | J | K | X || B | M | W | V | Z | SET | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | TUR | OS | Ctrl| Alt | Shf | Spc || Ent | Lft | Dwn | Up | Rght| MSE | - * `------------------------------------------------------------------------' */ -#define DVORAK \ - KC_ESC, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - K_NUMBR,MY_SCL, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_SE), \ - MO(_AL),KC_LGUI,KC_LCTL,KC_LALT,KC_LSFT,KC_SPC, KC_ENT, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,K_MOUSE - -/* Alternative character overlay - * ,------------------------------------------------------------------------. - * | | ' ' | Undo| Redo|Pound| Yen || | G | C | |TLira| Del | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | A | O | Euro| U | I ||Degre|Plank| | | S | Ins | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | " " | Cut | Copy|Paste| || BTC | < > | ( ) | [ ] | { } | PgUp| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | | | | | || | Home|PgDwn| PgUp| End | | - * `------------------------------------------------------------------------' */ -#define ALTCHAR \ - _______,DBL_QUO,UNDO, REDO, CUR_BPN,CUR_YEN,_______,TUR_G, TUR_C, _______,CUR_LIR,KC_DEL , \ - _______,TUR_A, TUR_O, CUR_EUR,TUR_U, TUR_I, PHY_DEG,PHY_HBR,_______,_______,TUR_S, KC_INS , \ - _______,DBL_DQT,CUT, COPY, PASTE, DBL_GRV,CUR_BIT,DBL_ANG,DBL_PAR,DBL_SQR,DBL_BRC,_______, \ - _______,_______,_______,_______,_______,DBL_SPC,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END, _______ - -/* Game layer - * ,------------------------------------------------------------------------. - * | OFF | Q | W | E | R | T || Esc | 7 | 8 | 9 |NumLk|Bkspc| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | Tab | A | S | D | F | G || F1 | 4 | 5 | 6 | \ | Ent | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | Z | X | C | V | B || F2 | 1 | 2 | 3 | ^ | | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | / | ` | | | | Spc || Spc | Ent | 0 | < | v | > | - * `------------------------------------------------------------------------' */ -#define GAME \ - K_GAMES,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_P7, KC_P8, KC_P9, KC_NLCK,KC_BSPC, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F1, KC_P4, KC_P5, KC_P6, KC_BSLS,KC_ENT , \ - _______,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_P1, KC_P2, KC_P3, KC_UP, _______, \ - KC_SLSH,KC_GRV, _______,_______,_______,KC_SPC, KC_SPC, KC_ENT, KC_P0, KC_LEFT,KC_DOWN,KC_RGHT - -/* Symbols layer - * ,------------------------------------------------------------------------. - * | OFF | ` | ~ | [ | ] | { || } | - | _ | = | + | | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | \ | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | ! | @ | # | $ | % || ^ | & | * | ( | ) | LCK | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | | | | | | || | | | | | | - * `------------------------------------------------------------------------' */ -#define NUMBERS \ - K_NUMBR,KC_GRV, KC_TILD,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_MINS,KC_UNDS,KC_EQL, KC_PLUS,_______, \ - _______,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ - _______,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,K_LOCK , \ - KC_PIPE,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ - -/* Settings layer - * ,------------------------------------------------------------------------. - * |BLLed| F1 | F2 | F3 | F4 | Lin || Win | Wake| |Hue -|Hue +|Reset| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | F5 | F6 | F7 | F8 | || | |RGBto|Sat -|Sat +| | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | Game| F9 | F10 | F11 | F12 |Vol 0||PrtSc| |RGBan|Bri -|Bri +| | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * |Musir| | | | |Vol -||Vol +| Prev| Stop|TogMu| Next| | - * `------------------------------------------------------------------------' */ -#define SETTINGS \ - BL_STEP,KC_F1, KC_F2, KC_F3, KC_F4, UNI_LI, UNI_WN, KC_WAKE,_______,RGB_HUD,RGB_HUI,RESET , \ - _______,KC_F5, KC_F6, KC_F7, KC_F8, _______,_______,_______,RGB_TOG,RGB_SAD,RGB_SAI,_______, \ - K_GAMES,KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE,KC_PSCR,_______,RGB_MOD,RGB_VAD,RGB_VAI,_______, \ - MU_TOG, _______,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MPRV,KC_MSTP,KC_MPLY,KC_MNXT,_______ - -/* Mouse layer - * ,------------------------------------------------------------------------. - * |Ulock| \ | ^ | / |.....|.....||.....|.....| |\|.| |^| | |/|.| | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | < | Mid | > |Btn 4|.....||.....|Btn 5| <-- | Mid | --> | | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | / | v | \ |.....|.....||.....|.....| |/| | |v| | |\| | LCK | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | | | | | Left||Right| | |Accl0|Accl1|Accl2| - * `------------------------------------------------------------------------' */ -#define MOUSE \ - K_MOUSE,MO_NW, MO_N, MO_NE, XXX, XXX ,XXX, XXX, MO_S_NW,MO_S_N, MO_S_NE,_______, \ - _______,MO_W, MO_CL_M,MO_E, MO_CL_4,XXX ,XXX, MO_CL_5,MO_S_W, MO_CL_M,MO_S_E, _______, \ - _______,MO_SW, MO_S, MO_SE, XXX, XXX ,XXX, XXX, MO_S_SW,MO_S_S, MO_S_SE,K_LOCK , \ - _______,_______,_______,_______,_______,MO_CL_L,MO_CL_R,_______,MO_AC_0,MO_AC_1,MO_AC_2,_______ - -/* Music layer - * ,------------------------------------------------------------------------. - * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | togg| rec | stop| play| slow| fast||modes|.....|.....|.....|.....|.....| - * `------------------------------------------------------------------------' - */ -#define MUSIC \ - MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ - MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ - MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ - MU_TOG, MU_REC, MU_STOP,MU_PLAY,MU_SLOW,MU_FAST,MU_MOD, MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK - -#endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h deleted file mode 100644 index 3dde5772cc0..00000000000 --- a/users/bbaserdem/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H - -#ifdef TAP_DANCE_ENABLE - #define TAPPING_TERM 300 - #define TAPPING_TOGGLE 1 -#endif - -#endif // !USERSPACE_CONFIG_H diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk deleted file mode 100644 index 9c7e78e2f8a..00000000000 --- a/users/bbaserdem/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -SRC += bbaserdem.c -EXTRAFLAGS += -flto # Used to make code smaller - -# ENABLE -UNICODE_ENABLE = yes # Used for unicode character emulation -EXTRAKEY_ENABLE = yes # OS signals like volume control - -# DISABLE -ifndef BLUETOOTH_ENABLE - BLUETOOTH_ENABLE = no # No bluetooth -endif -COMMAND_ENABLE = no # Some bootmagic thing i dont use -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -CONSOLE_ENABLE = no # Allows console output with a command -SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. -NKRO_ENABLE = no # Default is 6KRO which is plenty -MIDI_ENABLE = no # Untested feature -KEY_LOCK_ENABLE = no # Allows locking any key. Not used - -# Disabling this makes it compile, i dont know why -# VARIABLE_TRACE = no # Allows debugging variables From c7f346bef000ef2ffe7612be0c6fc606455a3e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 17:07:13 -0400 Subject: [PATCH 02/94] Added code for the bigseries pcb. --- .../1key/keymaps/bbaserdem/README.md | 18 ++++++++++++ .../bigseries/1key/keymaps/bbaserdem/config.h | 19 +++++++++++++ .../bigseries/1key/keymaps/bbaserdem/keymap.c | 28 +++++++++++++++++++ .../bigseries/1key/keymaps/bbaserdem/rules.mk | 6 ++++ 4 files changed, 71 insertions(+) create mode 100644 keyboards/bigseries/1key/keymaps/bbaserdem/README.md create mode 100644 keyboards/bigseries/1key/keymaps/bbaserdem/config.h create mode 100755 keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c create mode 100755 keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md new file mode 100644 index 00000000000..f68edef54c8 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md @@ -0,0 +1,18 @@ +This file contains my [1x1](../../../default/ortho_1x1) board layouts +Check out the [user readme](../../../../users/sbp/README.md) for more info. + +# Big Series PCB + +Big switch that does tap dance, and works as a fancy light only. +The PCB was sourced from Woodkeys (Cole Markham); +Currently AWOL and scammed people out of their money (me personally for 150$) +Cannot recommend anyone try to obtain one of these PCBs. + +My PCB to USB connector broke; and could not repair it yet. +Managed to obtain a custom glow in the dark keycap for this. + +## Status + +* [x] Layout adapted +* [ ] Have not tested build yet. +* [ ] Have not confirmed on board diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/config.h b/keyboards/bigseries/1key/keymaps/bbaserdem/config.h new file mode 100644 index 00000000000..ba45696ad24 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/config.h @@ -0,0 +1,19 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 500 diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c b/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c new file mode 100755 index 00000000000..2bb2d06e93c --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c @@ -0,0 +1,28 @@ +/* +Copyright 2019 Batuhan Baserdem + +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT(BB_BIGS) +}; + +void matrix_init_keymap(void) { + rgblight_enable(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD); + rgblight_sethsv_noeeprom(0,255,255); +} diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk b/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk new file mode 100755 index 00000000000..89651e991c8 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk @@ -0,0 +1,6 @@ +# Differences from userspace +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes +RGB_MATRIX_ENABLE = no +AUDIO_ENABLE = no +BLUETOOTH_ENABLE = no From 229909a60bf8240124e10e3f7084378481a81895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:04:19 -0400 Subject: [PATCH 03/94] Added Kyria code for bbaserdem. --- .../splitkb/kyria/keymaps/bbaserdem/README.md | 32 ++++++ .../splitkb/kyria/keymaps/bbaserdem/config.h | 53 ++++++++++ .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 98 +++++++++++++++++++ .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 19 ++++ 4 files changed, 202 insertions(+) create mode 100644 keyboards/splitkb/kyria/keymaps/bbaserdem/README.md create mode 100644 keyboards/splitkb/kyria/keymaps/bbaserdem/config.h create mode 100644 keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c create mode 100644 keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md b/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md new file mode 100644 index 00000000000..c05221c6a7a --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md @@ -0,0 +1,32 @@ +This file contains my Kyria board layout. +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Kyria + +I use a rev 1.3 PCB as a daily driver. + +## Hardware + +* Using a modified High-profile case; with metal switch plate. +* Currently using a Pro-Micro and an Elite-C as microcontrollers. +* Using Gateron Silent Black Ink with Progressive springs (100g), lubed. +* Have mill-max sockets for hotswap feature. +* All microcontrollers and OLED's are socketed for easy removal. + +## Features + +* Use two thumb keys in the 2u layout. +* Have rotary encoders in the outermost keys of the thumb cluster. +* Have underglow leds soldered. + +## Issues + +* Stabilizers squiek, and need lubing. +* The double tap buttons (home row; left leader the most) don't contact well. + +## Todo + +* Switch to Proton C conversion with a game plan. +* Lube stabilizers. +* Get tenting puck. +* (Not depending on me) migrate this code to layouts. diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h new file mode 100644 index 00000000000..85d33f61cab --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -0,0 +1,53 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +// Kyria specific +#ifdef KEYBOARD_kyria_rev1 + // Split definition; use the following to flash; + // pro-micro: avrdude-split-left/right + // elite-c: dfu-split-left/right + #define ENCODER_DIRECTION_FLIP + #define EE_HANDS + + #ifdef OLED_DRIVER_ENABLE + #define OLED_DISPLAY_128X64 + #endif + + #ifdef RGBLIGHT_ENABLE + #ifdef RGBLIGHT_LEFT_BEG + #undef RGBLIGHT_LEFT_BEG + #endif + #define RGBLIGHT_LEFT_BEG 0 + + #ifdef RGBLIGHT_LEFT_NUM + #undef RGBLIGHT_LEFT_NUM + #endif + #define RGBLIGHT_LEFT_NUM 10 + + #ifdef RGBLIGHT_RIGHT_BEG + #undef RGBLIGHT_RIGHT_BEG + #endif + #define RGBLIGHT_RIGHT_BEG 10 + + #ifdef RGBLIGHT_RIGHT_NUM + #undef RGBLIGHT_RIGHT_NUM + #endif + #define RGBLIGHT_RIGHT_NUM 10 + #endif + + // If you are using an Elite C rev3 on the slave side, uncomment the lines below: + // #define SPLIT_USB_DETECT + // #define NO_USB_STARTUP_CHECK +#endif diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c new file mode 100644 index 00000000000..8d1358bae8f --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -0,0 +1,98 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" +/* F layout + * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ + * │ W │ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ + * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ + * │ X │ A │ S │ D │ F │ G │        │ T │ K │ M │ L │ Y │ Ş │ + * ├───┼───┼───┼───┼───┼───┼───┬───┐ ┌───┬───┼───┼───┼───┼───┼───┼───┤ + * │* +│ J │ Ö │ V │ C │ Ç │   │   │ │   │   │ Z │ S │ B │. :│, ;│< >│ + * └───┴───┴───┼───┼───┼───┤Esc│Shf│ │Shf│Del├───┼───┼───┼───┴───┴───┘ + *             │En1│Tab│Ent│ │ │ │ │ │Spc│Bsp│En2│ + *             └───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┘ + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_wrapper( + _BL1_1_,_BL1_5_, _BR1_5_,_BR1_1_, + _BL2_1_,_BL2_5_, _BR2_5_,_BR2_1_, + _BL3_1_,_BL3_5_,xxx2xxx,xxx2xxx,_BR3_5_,_BR3_1_, + BB_ENC0, _BL4_3_,KC_LSFT,KC_RSFT,_BR4_3_,BB_ENC1 + ), + [_CHAR] = LAYOUT_wrapper( + XXXXXXX,_CL1_5_, _CR1_5_,XXXXXXX, + XXXXXXX,_CL2_5_, _CR2_5_,XXXXXXX, + XXXXXXX,_CL3_5_,xxx2xxx,xxx2xxx,_CR3_5_,XXXXXXX, + _______,_CL4_3_,_______,_______,_CR4_3_,_______ + ), + [_GAME] = LAYOUT_wrapper( + _GA1_1_,_GA1_5_, ___5___,___1___, + _GA2_1_,_GA2_5_, ___5___,___1___, + _GA3_1_,_GA3_5_,xxx2xxx,xxx2xxx,___5___,___1___, + _______,_GA4_3_,_______,_______,___3___,_______ + ), + [_MEDI] = LAYOUT_wrapper( + ___1___,___5___, _ME1_5_,___1___, + ___1___,___5___, _ME2_5_,___1___, + ___1___,___5___,xxx2xxx,xxx2xxx,_ME3_5_,___1___, + ___1___,___3___,_______,_______,_ME4_3_,___1___ + ), + [_NAVI] = LAYOUT_wrapper( + ___1___,___5___, _NA1_5_,___1___, + ___1___,___5___, _NA2_5_,___1___, + ___1___,___5___,xxx2xxx,xxx2xxx,_NA3_5_,___1___, + ___1___,___3___,_______,_______,_NA4_3_,___1___ + ), + [_SYMB] = LAYOUT_wrapper( + ___1___,___5___, _SY1_5_,___1___, + ___1___,___5___, _SY2_5_,___1___, + ___1___,___5___,xxx2xxx,xxx2xxx,_SY3_5_,___1___, + ___1___,___3___,_______,_______,_SY4_3_,___1___ + ), + [_NUMB] = LAYOUT_wrapper( + ___1___,_NU1_5_, ___5___,___1___, + ___1___,_NU2_5_, ___5___,___1___, + ___1___,_NU3_5_,xxx2xxx,xxx2xxx,___5___,___1___, + ___1___,_NU4_3_,_______,_______,___3___,___1___ + ), + [_FUNC] = LAYOUT_wrapper( + ___1___,_FU1_5_, ___5___,___1___, + ___1___,_FU2_5_, ___5___,___1___, + ___1___,_FU3_5_,xxx2xxx,xxx2xxx,___5___,___1___, + ___1___,_FU4_3_,_______,_______,___3___,___1___ + ), + [_MOUS] = LAYOUT_wrapper( + ___1___,_MO1_5_, ___5___,___1___, + ___1___,_MO2_5_, ___5___,___1___, + ___1___,_MO3_5_,xxx2xxx,xxx2xxx,___5___,___1___, + ___1___,_MO4_3_,_______,_______,___3___,___1___ + ), + [_MUSI] = LAYOUT_wrapper( + _MU_12_,_MU_12_, + _MU_06_,xxx2xxx,xxx2xxx,_MU_06_, + MU_TOG,_MUL_3_,_MU_02_,_MUR_3_,___1___ + ) +}; + +// Kyria specific code +#ifdef KEYBOARD_kyria_rev1 +// Rotate the display on kyria +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} +#endif //OLED_DRIVER_ENABLE +#endif //KEYBOARD_kyria_rev1 diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk new file mode 100644 index 00000000000..f54821f1834 --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -0,0 +1,19 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Kyria hardware +ifneq (,$(findstring kyria/rev1,$(KEYBOARD))) + OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays + ENCODER_ENABLE = yes # Enables the use of one or more encoders + RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much + RGB_MATRIX_ENABLE = no +endif From 7f2e53c427c9296612578a0b4e3bab4c368de373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:08:51 -0400 Subject: [PATCH 04/94] Added 3x10 layout for bbaserdem --- .../community/ortho_3x10/bbaserdem/README.md | 19 ++++ .../community/ortho_3x10/bbaserdem/config.h | 21 ++++ .../community/ortho_3x10/bbaserdem/keymap.c | 99 +++++++++++++++++++ .../community/ortho_3x10/bbaserdem/rules.mk | 22 +++++ 4 files changed, 161 insertions(+) create mode 100644 layouts/community/ortho_3x10/bbaserdem/README.md create mode 100644 layouts/community/ortho_3x10/bbaserdem/config.h create mode 100644 layouts/community/ortho_3x10/bbaserdem/keymap.c create mode 100755 layouts/community/ortho_3x10/bbaserdem/rules.mk diff --git a/layouts/community/ortho_3x10/bbaserdem/README.md b/layouts/community/ortho_3x10/bbaserdem/README.md new file mode 100644 index 00000000000..05749e81927 --- /dev/null +++ b/layouts/community/ortho_3x10/bbaserdem/README.md @@ -0,0 +1,19 @@ +This file contains my [3x10 ortho](../../../default/ortho_3x10) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Gherkin + +I use [Gherkin](../../../../keyboards/40percentclub/gherkin/readme.md). + +It is used as a game pad, and key layout is inspired by spare keys I had lying around. +The firmware is very simple, and only includes one layer keymap, and RGB effects. + +## Status + +* [x] Layout adapted +* [x] Tested build +* [x] Confirmed on board + +## Build + +Build command: `CFLAGS="-Wno-error=deprecated" ` diff --git a/layouts/community/ortho_3x10/bbaserdem/config.h b/layouts/community/ortho_3x10/bbaserdem/config.h new file mode 100644 index 00000000000..d781d344785 --- /dev/null +++ b/layouts/community/ortho_3x10/bbaserdem/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +// Gherkin specific +#ifdef KEYBOARD_40percentclub_gherkin + #define MUSIC_MAP + #define RGB_DI_PIN F6 + #define DRIVER_LED_TOTAL 10 +#endif diff --git a/layouts/community/ortho_3x10/bbaserdem/keymap.c b/layouts/community/ortho_3x10/bbaserdem/keymap.c new file mode 100644 index 00000000000..c094f526a4f --- /dev/null +++ b/layouts/community/ortho_3x10/bbaserdem/keymap.c @@ -0,0 +1,99 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +#ifdef KEYBOARD_40percentclub_gherkin + // Flip it + #undef LAYOUT_ortho_3x10 + #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 \ + ) { \ + { K45, K44, K43, K42, K41, K40 }, \ + { K35, K34, K33, K32, K31, K30 }, \ + { K25, K24, K23, K22, K21, K20 }, \ + { K15, K14, K13, K12, K11, K10 }, \ + { K05, K04, K03, K02, K01, K00 } \ + } +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Game pad + * ,-----------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | F1 | F2 | F3 | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |AdjsL| Q | W | E | R | Ent | Tab | Ctr | |^| | Alt | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Music| A | S | D | F | Spc |Shift| <-- | |v| | --> | + * `-----------------------------------------------------------' + */ + [_BASE] = LAYOUT_ortho_3x10( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F1, KC_F2, KC_F3, + MO(_MEDI), KC_Q, KC_W, KC_E, KC_R, KC_ENT, KC_TAB, KC_LCTL,KC_UP, KC_LALT, + MU_TOG, KC_A, KC_S, KC_D, KC_F, KC_SPC, KC_LSFT,KC_LEFT,KC_DOWN,KC_RGHT + ), +/* Adjust + * ,-----------------------------------------------------------. + * | Esc |RGBTg|HueUp|HueDn|SatUp|SatDn|ValUp|ValDn|ModNx|ModPr| + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | |BltTg|Breth|BriUp|BriDn| | |Veloc|SpdUp|SpdDn| + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Music| | | | | | | |EEprm|Reset| + * `-----------------------------------------------------------' + */ + [_MEDI] = LAYOUT_ortho_3x10( + CK_TOGG,RGB_TOG,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,RGB_MOD,RGB_RMOD, + _______,BL_TOGG,BL_BRTG,BL_INC, BL_DEC, XXXXXXX,XXXXXXX,VLK_TOG,RGB_SPI,RGB_SPD, + AU_TOG, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,EEP_RST,RESET + ), + [_MUSI] = LAYOUT_ortho_3x10_wrapper( + MU_FAST,_MU_08_,MU_REC, + MU_SLOW,_MU_08_,MU_STOP, + MU_TOG, _MU_08_,MU_PLAY + ), +}; + +// Music map, guitar like +#ifdef AUDIO_ENABLE +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_3x10( + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +); +#endif + +// RGB matrix code +#ifdef RGB_MATRIX_ENABLE +// Gherkin +#if defined(KEYBOARD_40percentclub_gherkin) +led_config_t g_led_config = { + { // Key Matrix to LED Index + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED} +}, { // LED Index to Physical Position + {224, 0}, {168, 0}, {112, 0}, { 56, 0}, { 0, 0}, + { 0, 64}, { 56, 64}, {112, 64}, {168, 64}, {224, 64}, +}, { // LED Index to Flag + 2,2,2,2,2,2,2,2,2,2 +}}; +// Disable +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { } +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { } +#endif +#endif diff --git a/layouts/community/ortho_3x10/bbaserdem/rules.mk b/layouts/community/ortho_3x10/bbaserdem/rules.mk new file mode 100755 index 00000000000..0c668c221bf --- /dev/null +++ b/layouts/community/ortho_3x10/bbaserdem/rules.mk @@ -0,0 +1,22 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# This small layout is a macro-pad; does not need userspace + +# Gherkin has both RGB strip and LED lights +ifneq (,$(findstring 40percentclub/gherkin,$(KEYBOARD))) + CONVERT_TO_PROTON_C = yes + RGB_MATRIX_ENABLE = WS2812 + AUDIO_ENABLE = yes + BACKLIGHT_ENABLE = yes + VELOCIKEY_ENABLE = yes +endif From 2cfd3e1c3b1c7c3237359749d74e2e77a237755b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:15:57 -0400 Subject: [PATCH 05/94] Added 4x12 layout for bbaserdem. --- .../community/ortho_4x12/bbaserdem/README.md | 37 ++++ .../community/ortho_4x12/bbaserdem/config.h | 111 ++++++++++ .../community/ortho_4x12/bbaserdem/keymap.c | 198 ++++++++++++++++++ .../community/ortho_4x12/bbaserdem/rules.mk | 24 +++ 4 files changed, 370 insertions(+) create mode 100644 layouts/community/ortho_4x12/bbaserdem/README.md create mode 100755 layouts/community/ortho_4x12/bbaserdem/config.h create mode 100755 layouts/community/ortho_4x12/bbaserdem/keymap.c create mode 100755 layouts/community/ortho_4x12/bbaserdem/rules.mk diff --git a/layouts/community/ortho_4x12/bbaserdem/README.md b/layouts/community/ortho_4x12/bbaserdem/README.md new file mode 100644 index 00000000000..a9ddc339a0a --- /dev/null +++ b/layouts/community/ortho_4x12/bbaserdem/README.md @@ -0,0 +1,37 @@ +This file contains my [4x12 ortho](../../../default/ortho_4x12) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Planck + +I use a couple [planck](../../../../keyboards/planck/readme.md) keyboards. +To sell soon; don't use them anymore. + +* Use the [light](../../../../keyboards/planck/light/readme.md) version. +* Use the [rev6](../../../../keyboards/planck/rev6/readme.md) version. + +I have a daughter board that I'm trying to use for perkey leds. +Originally, in the firmware, the underglow rgb prints are configured both for +`RGBLIGHT` and `RGBMATRIX` code. +I differentiate between these two; and use; + +* `RGBLIGHT` for underglow leds. +* `RGB_MATRIX` for the daughterboard, if I get to it at some point. (Doubtful) + +Enable in rules.mk accordingly. + +# JJ40 + +A planck rev4 replacement; for my acrylic planck case which used to host a now +defunct rev4. + +Enable in rules.mk accordingly. + +## Status + +* [x] Layout adapted +* [ ] Have not tested build yet. +* [ ] Have not confirmed on board + +# Let's Split Eh? + +I have a [let's split eh?](../../../../keyboards/lets_split_eh/README.md), unused, will sell this. diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h new file mode 100755 index 00000000000..81f77c44fb8 --- /dev/null +++ b/layouts/community/ortho_4x12/bbaserdem/config.h @@ -0,0 +1,111 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +// Code pertaining to planck rev6 +#if defined(KEYBOARD_planck_rev6) + // Encoder I use; + #ifdef RGB_DI_PIN + #undef ENCODER_RESOLUTION + #endif + #define ENCODER_RESOLUTION 2 + // Daughter board related utilities + #ifdef RGB_MATRIX_ENABLE + // Reconfigure the RGB DI Pin + #ifdef RGB_DI_PIN + #undef RGB_DI_PIN + #endif + // Change this later + #define RGB_DI_PIN A1 + // Reconfigure number of LEDS + #ifdef DRIVER_LED_TOTAL + #undef DRIVER_LED_TOTAL + #endif + #define DRIVER_LED_TOTAL 48 + #elif RGBLIGHT_ENABLE + // RGB Underglow with on-board SMD footprints + // This is for original planck led locations + // ┌────────────┐ + // │ 6 5 4 3 │ + // │ │ + // │ 0 │ + // │ 7 8 1 2 │ + // └────────────┘ + #ifdef RGBLIGHT_RIGHT_BEG + #undef RGBLIGHT_RIGHT_BEG + #endif + #define RGBLIGHT_RIGHT_BEG 1 + + #ifdef RGBLIGHT_RIGHT_NUM + #undef RGBLIGHT_RIGHT_NUM + #endif + #define RGBLIGHT_RIGHT_NUM 4 + + #ifdef RGBLIGHT_LEFT_BEG + #undef RGBLIGHT_LEFT_BEG + #endif + #define RGBLIGHT_LEFT_BEG 5 + + #ifdef RGBLIGHT_LEFT_NUM + #undef RGBLIGHT_LEFT_NUM + #endif + #define RGBLIGHT_LEFT_NUM 4 + #endif +#endif + +// Let's Split Eh! specific +#ifdef KEYBOARD_lets_split_eh_eh + #ifdef RGBLIGHT_LEFT_BEG + #undef RGBLIGHT_LEFT_BEG + #endif + #define RGBLIGHT_LEFT_BEG 0 + + #ifdef RGBLIGHT_LEFT_NUM + #undef RGBLIGHT_LEFT_NUM + #endif + #define RGBLIGHT_LEFT_NUM 6 + + #ifdef RGBLIGHT_RIGHT_BEG + #undef RGBLIGHT_RIGHT_BEG + #endif + #define RGBLIGHT_RIGHT_BEG 6 + + #ifdef RGBLIGHT_RIGHT_NUM + #undef RGBLIGHT_RIGHT_NUM + #endif + #define RGBLIGHT_RIGHT_NUM 6 +#endif + +// JJ40 specific +#ifdef KEYBOARD_jj40 + #ifdef RGBLIGHT_LEFT_BEG + #undef RGBLIGHT_LEFT_BEG + #endif + #define RGBLIGHT_LEFT_BEG 0 + + #ifdef RGBLIGHT_LEFT_NUM + #undef RGBLIGHT_LEFT_NUM + #endif + #define RGBLIGHT_LEFT_NUM 2 + + #ifdef RGBLIGHT_RIGHT_BEG + #undef RGBLIGHT_RIGHT_BEG + #endif + #define RGBLIGHT_RIGHT_BEG 3 + + #ifdef RGBLIGHT_RIGHT_NUM + #undef RGBLIGHT_RIGHT_NUM + #endif + #define RGBLIGHT_RIGHT_NUM 2 +#endif diff --git a/layouts/community/ortho_4x12/bbaserdem/keymap.c b/layouts/community/ortho_4x12/bbaserdem/keymap.c new file mode 100755 index 00000000000..654e4bfdeda --- /dev/null +++ b/layouts/community/ortho_4x12/bbaserdem/keymap.c @@ -0,0 +1,198 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Base layer + [_BASE] = LAYOUT_ortho_4x12_wrapper( + _BL1_5_,_BL1_1_,_BR1_1_,_BR1_5_, + _BL2_5_,_BL2_1_,_BR2_1_,_BR2_5_, + _BL3_5_,_BL3_1_,_BR3_1_,_BR3_5_, + BB_ENC0,KC_DOWN,KC_UP, _BL4_3_,_BR4_3_,KC_LEFT,KC_RGHT,RGB_TOG + ), + // Extra characters overlay + [_CHAR] = LAYOUT_ortho_4x12_wrapper( + _CL1_5_,xxx2xxx,_CR1_5_, + _CL2_5_,xxx2xxx,_CR2_5_, + _CL3_5_,xxx2xxx,_CR3_5_, + ___3___,_CL4_3_,_CR4_3_,___3___ + ), + // Game layer: left_half + [_GAME] = LAYOUT_ortho_4x12_wrapper( + _GA1_5_,_GA1_1_,___6___, + _GA2_5_,_GA2_1_,___6___, + _GA3_5_,_GA3_1_,___6___, + ___3___,_GA4_3_,___6___ + ), + // Media layer: right_half + [_MEDI] = LAYOUT_ortho_4x12_wrapper( + ___6___,xxx1xxx,_ME1_5_, + ___6___,xxx1xxx,_ME2_5_, + ___6___,xxx1xxx,_ME3_5_, + ___6___,_ME4_3_,___3___ + ), + // Navigation layer: right_half + [_NAVI] = LAYOUT_ortho_4x12_wrapper( + ___6___,xxx1xxx,_NA1_5_, + ___6___,xxx1xxx,_NA2_5_, + ___6___,xxx1xxx,_NA3_5_, + ___6___,_NA4_3_,___3___ + ), + // Symbol layer: right_half + [_SYMB] = LAYOUT_ortho_4x12_wrapper( + ___6___,xxx1xxx,_SY1_5_, + ___6___,xxx1xxx,_SY2_5_, + ___6___,xxx1xxx,_SY3_5_, + ___6___,_SY4_3_,___3___ + ), + // Number layer: left_half + [_NUMB] = LAYOUT_ortho_4x12_wrapper( + xxx1xxx,_NU1_5_,___6___, + xxx1xxx,_NU2_5_,___6___, + xxx1xxx,_NU3_5_,___6___, + ___3___,_NU4_3_,___6___ + ), + // Function layer: left_half + [_FUNC] = LAYOUT_ortho_4x12_wrapper( + _FU1_5_,xxx1xxx,___6___, + _FU2_5_,xxx1xxx,___6___, + _FU3_5_,xxx1xxx,___6___, + ___3___,_FU4_3_,___6___ + ), + // Mouse layer: left_half + [_MOUS] = LAYOUT_ortho_4x12_wrapper( + _MO1_5_,xxx1xxx,___6___, + _MO2_5_,xxx1xxx,___6___, + _MO3_5_,xxx1xxx,___6___, + ___3___,_MO4_3_,___6___ + ), + // Music layer: everything + [_MUSI] = LAYOUT_ortho_4x12_wrapper( + _MU_12_,_MU_12_,_MU_12_, + ___1___,_MU_02_,_MUL_3_,_MUR_3_,_MU_02_,___1___) +}; + +// RGB Matrix configuration +#ifdef RGB_MATRIX_ENABLE + +// planck:Light +#if defined(KEYBOARD_planck_light) +/* This is left-right for planck light indicator light + * - The LED 42 is for spacebar specifically, leave it out of the matrix + * - This is how it looks like + * ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ + * │00│01│02│03│04│05│06│07│08│09│10│11│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │12│13│14│15│16│17│18│19│20│21│22│23│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │24│25│26│27│28│29│30│31│32│33│34│35│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │36│37│38│39│40│41│43│44│45│46│47│48│ + * └──┴──┴──┴──┴──┴─042─┴──┴──┴──┴──┴──┘ + */ +int board_left[24] = { + 0, 1, 2, 3, 4, 5, + 12, 13, 14, 15, 16, 17, + 24, 25, 26, 27, 28, 29, + 36, 37, 38, 39, 40, 41}; +int board_right[24] = { + 6, 7, 8, 9, 10, 11, + 18, 19, 20, 21, 22, 23, + 30, 31, 32, 33, 34, 35, + 43, 44, 45, 46, 47, 48}; +// Sided color-setting +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(board_left[i], red, green, blue); + } +} +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(board_right[i], red, green, blue); + } +} + +// planck:rev6 +#elif defined(KEYBOARD_planck_rev6) +/* Rev6 has RGB matrix to the bottom LED footprints + * Breakdown of the daughter board layout that I'm planning to use + * ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ + * │35│36│37│38│39│40│41│42│43│44│45│46│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │23│24│25│26│27│28│29│30│31│32│33│34│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │12│13│14│15│16│17│18│19│20│21│22│47│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │00│01│02│03│04│05│06│07│08│09│10│11│ + * └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘ + */ +led_config_t g_led_config = { + { // Key Matrix to LED Index + {35, 36, 37, 38, 39, 40}, // R1: Left + {23, 24, 25, 26, 27, 28}, // R2: Left + {12, 13, 14, 15, 16, 17}, // R3: Left + { 0, 1, 2, 9, 10, 11}, // R4: 1-3, 10-12 + {41, 42, 43, 44, 45, 46}, // R1: Right + {29, 30, 31, 32, 33, 34}, // R2: Right + {18, 19, 20, 21, 22, 47}, // R3: Right + { 6, 7, 8, 3, 4, 5}, // R4: 7-9, 4-6 + }, {// LED Index to Physical Position + // R4: 12 leds + { 0, 64}, { 20, 64}, { 41, 64}, { 61, 64}, { 81, 64}, {102, 64}, + {122, 64}, {143, 64}, {163, 64}, {183, 64}, {204, 64}, {224, 64}, + // R3: 11 leds (last one in this row is the last LED) + { 0, 43}, { 20, 43}, { 41, 43}, { 61, 43}, { 81, 43}, {102, 43}, + {122, 43}, {143, 43}, {163, 43}, {183, 43}, {204, 43}, + // R2: 12 leds + { 0, 21}, { 20, 21}, { 41, 21}, { 61, 21}, { 81, 21}, {102, 21}, + {122, 21}, {143, 21}, {163, 21}, {183, 21}, {204, 21}, {224, 21}, + // R1: 12 leds + { 0, 0}, { 20, 0}, { 41, 0}, { 61, 0}, { 81, 0}, {102, 0}, + { 122, 0}, {143, 0}, {163, 0}, {183, 0}, {204, 0}, {224, 0}, + // Last led: right most R3 + {224, 43} + }, {// LED Index to Flag (4: regular key, 1: modifier) + 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4 + } +}; +int board_left[24] = { + 0, 1, 2, 3, 4, 5, + 12, 13, 14, 15, 16, 17, + 23, 24, 25, 26, 27, 28, + 35, 36, 37, 38, 39, 40}; +int board_right[24] = { + 6, 7, 8, 9, 10, 11, + 18, 19, 20, 21, 22, 47, + 29, 30, 31, 32, 33, 34, + 41, 42, 43, 44, 45, 46}; +// Sided color-setting +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(board_left[i], red, green, blue); + } +} +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(board_right[i], red, green, blue); + } +} +// End of differentiations +#endif + +// End of code for the RGB_MATRIX setup +#endif diff --git a/layouts/community/ortho_4x12/bbaserdem/rules.mk b/layouts/community/ortho_4x12/bbaserdem/rules.mk new file mode 100755 index 00000000000..fddeacc0b79 --- /dev/null +++ b/layouts/community/ortho_4x12/bbaserdem/rules.mk @@ -0,0 +1,24 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Planck rev6 has both RGBLIGHT and RGB_MATRIX enabled +# RGBLIGHT should be enabled for a board with the underglow leds +# RGB_MATRIX_ENABLE should be set to WS2812 for the daughter board +ifneq (,$(findstring planck/rev6,$(KEYBOARD))) + RGBLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = no +endif +# JJ40 here +ifneq (,$(findstring jj40,$(KEYBOARD))) + RGBLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = no +endif From 7638ca0e72892109d4b001a7f82e2a52513f5158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:19:48 -0400 Subject: [PATCH 06/94] Added 5x15 layout for bbaserdem. --- .../1key/keymaps/bbaserdem/README.md | 2 +- .../community/ortho_5x15/bbaserdem/README.md | 16 +++ .../community/ortho_5x15/bbaserdem/config.h | 15 ++ .../community/ortho_5x15/bbaserdem/keymap.c | 128 ++++++++++++++++++ .../community/ortho_5x15/bbaserdem/rules.mk | 17 +++ 5 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 layouts/community/ortho_5x15/bbaserdem/README.md create mode 100644 layouts/community/ortho_5x15/bbaserdem/config.h create mode 100644 layouts/community/ortho_5x15/bbaserdem/keymap.c create mode 100755 layouts/community/ortho_5x15/bbaserdem/rules.mk diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md index f68edef54c8..a4d8715a233 100644 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md @@ -1,5 +1,5 @@ This file contains my [1x1](../../../default/ortho_1x1) board layouts -Check out the [user readme](../../../../users/sbp/README.md) for more info. +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. # Big Series PCB diff --git a/layouts/community/ortho_5x15/bbaserdem/README.md b/layouts/community/ortho_5x15/bbaserdem/README.md new file mode 100644 index 00000000000..e6e15b72605 --- /dev/null +++ b/layouts/community/ortho_5x15/bbaserdem/README.md @@ -0,0 +1,16 @@ +This file contains my [5x15 ortho](../../../default/ortho_5x15) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# XD75RE + +One of my first boards, the [XD75Re](../../../../keyboards/xd75/readme.md). +(At least before the price hike.) +To be sold. + +The board has `RGBLIGHT_ENABLE` leds underneath; but I use a wooden case. +Instead; I hooked up some LED's to the three lock indicators. +I use them for layer indication. + +## Build + +Build command: `CFLAGS="-Wno-error=deprecated" TBF` diff --git a/layouts/community/ortho_5x15/bbaserdem/config.h b/layouts/community/ortho_5x15/bbaserdem/config.h new file mode 100644 index 00000000000..f51237a94d7 --- /dev/null +++ b/layouts/community/ortho_5x15/bbaserdem/config.h @@ -0,0 +1,15 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 diff --git a/layouts/community/ortho_5x15/bbaserdem/keymap.c b/layouts/community/ortho_5x15/bbaserdem/keymap.c new file mode 100644 index 00000000000..8b9b742e192 --- /dev/null +++ b/layouts/community/ortho_5x15/bbaserdem/keymap.c @@ -0,0 +1,128 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_ortho_5x15_wrapper( + xxx6xxx,KC_NLCK,KC_PSLS,KC_PAST,xxx6xxx, + _BL1_1_,_BL1_5_,KC_P7, KC_P8, KC_P9, _BR1_5_,_BR1_1_, + _BL2_1_,_BL2_5_,KC_P4, KC_P5, KC_P6, _BR2_5_,_BR2_1_, + _BL3_1_,_BL3_5_,KC_P1, KC_P2, KC_P3, _BR3_5_,_BR3_1_, + BL_STEP,XXXXXXX,KC_LEFT,KC_RGHT,_BL4_3_,KC_P0, _BL4_3_,KC_DOWN,KC_UP, MU_ON, BL_TOGG + ), + [_CHAR] = LAYOUT_ortho_5x15_wrapper( + xxx6xxx,xxx3xxx,xxx6xxx, + XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, + XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, + XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, + ___4___,_CL4_3_,XXXXXXX,_CL4_3_,___4___ + ), + [_GAME] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + _GA1_1_,_GA1_5_,___3___,___6___, + _GA2_1_,_GA2_5_,___3___,___6___, + _GA3_1_,_GA3_5_,___3___,___6___, + ___4___,_GA4_3_,___1___,___3___,___4___ + ), + [_MEDI] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + xxx1xxx,_ME1_5_,___3___,___6___, + xxx1xxx,_ME2_5_,___3___,___6___, + xxx1xxx,_ME3_5_,___3___,___6___, + ___4___,___3___,___1___,_ME4_3_,___4___ + ), + [_NAVI] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + xxx1xxx,_NA1_5_,___3___,___6___, + xxx1xxx,_NA2_5_,___3___,___6___, + xxx1xxx,_NA3_5_,___3___,___6___, + ___4___,_NA4_3_,___1___,___3___,___4___ + ), + [_SYMB] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + xxx1xxx,_SY1_5_,___3___,___6___, + xxx1xxx,_SY2_5_,___3___,___6___, + xxx1xxx,_SY3_5_,___3___,___6___, + ___4___,_SY4_3_,___1___,___3___,___4___ + ), + [_NUMB] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + ___6___,___3___,_NU1_5_,xxx1xxx, + ___6___,___3___,_NU2_5_,xxx1xxx, + ___6___,___3___,_NU3_5_,xxx1xxx, + ___4___,___3___,___1___,_NU4_3_,___4___ + ), + [_FUNC] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + ___6___,___3___,_FU1_5_,xxx1xxx, + ___6___,___3___,_FU2_5_,xxx1xxx, + ___6___,___3___,_FU3_5_,xxx1xxx, + ___4___,___3___,___1___,_FU4_3_,___4___ + ), + [_MOUS] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + ___6___,___3___,_MO1_5_,xxx1xxx, + ___6___,___3___,_MO2_5_,xxx1xxx, + ___6___,___3___,_MO3_5_,xxx1xxx, + ___4___,___3___,___1___,_MO4_3_,___4___ + ), + [_MUSI] = LAYOUT_ortho_5x15_wrapper( + _MU_06_,_MU_03_,_MU_06_, + _MU_06_,_MU_03_,_MU_06_, + _MU_06_,_MU_03_,_MU_06_, + _MU_06_,_MU_03_,_MU_06_, + _MU_06_,_MU_01_,_MUS_4_,MU_SLOW,MU_FAST,MU_OFF, ___1___ + ) +}; + +layer_state_t layer_state_set_keymap(layer_state_t state) { + // XD75RE layer indicator + #ifdef KEYBOARD_xd75 + if (layer_state_cmp(state, _CHAR)) { + capslock_led_on(); + gp103_led_on(); + gp100_led_on(); + } else if (layer_state_cmp(state, _MEDI)) { + capslock_led_off(); + gp103_led_off(); + gp100_led_on(); + } else if (layer_state_cmp(state, _NAVI)) { + capslock_led_off(); + gp103_led_on(); + gp100_led_off(); + } else if (layer_state_cmp(state, _NUMB)) { + capslock_led_on(); + gp103_led_off(); + gp100_led_off(); + } else if (layer_state_cmp(state, _SYMB)) { + capslock_led_off(); + gp103_led_on(); + gp100_led_on(); + } else if (layer_state_cmp(state, _FUNC)) { + capslock_led_on(); + gp103_led_off(); + gp100_led_on(); + } else if (layer_state_cmp(state, _MOUS)) { + capslock_led_on(); + gp103_led_on(); + gp100_led_off(); + } else { + capslock_led_off(); + gp103_led_off(); + gp100_led_off(); + } + #endif + return state; +}; diff --git a/layouts/community/ortho_5x15/bbaserdem/rules.mk b/layouts/community/ortho_5x15/bbaserdem/rules.mk new file mode 100755 index 00000000000..3a387185fc9 --- /dev/null +++ b/layouts/community/ortho_5x15/bbaserdem/rules.mk @@ -0,0 +1,17 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# XD75RE specific stuff +ifneq (,$(findstring xd75,$(KEYBOARD))) + RGBLIGHT_ENABLE = no + BACKLIGHT_ENABLE = yes +endif From 501bcebd1ad964c7d5f7a2f2e69c4bd5135f1330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:31:13 -0400 Subject: [PATCH 07/94] Added the split 3x5_3 layout. --- .../community/split_3x5_3/bbaserdem/README.md | 18 +++ .../community/split_3x5_3/bbaserdem/config.h | 32 +++++ .../community/split_3x5_3/bbaserdem/keymap.c | 123 ++++++++++++++++++ .../community/split_3x5_3/bbaserdem/rules.mk | 18 +++ 4 files changed, 191 insertions(+) create mode 100644 layouts/community/split_3x5_3/bbaserdem/README.md create mode 100644 layouts/community/split_3x5_3/bbaserdem/config.h create mode 100644 layouts/community/split_3x5_3/bbaserdem/keymap.c create mode 100644 layouts/community/split_3x5_3/bbaserdem/rules.mk diff --git a/layouts/community/split_3x5_3/bbaserdem/README.md b/layouts/community/split_3x5_3/bbaserdem/README.md new file mode 100644 index 00000000000..869b91898ce --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/README.md @@ -0,0 +1,18 @@ +This file contains my [split 3x10](../../../default/split_3x10) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Crkbd + +Using a no 6th column crkbd (rev 2.1 choc) as a mobile keyboard. + +This version uses Elite-C and ProMicro as controllers; hence no RGB and OLED. + +## Build + +Build command: `CFLAGS="-Wno-error=deprecated" TBF` + +## Todo + +* Switch PCB to the Proton-C compatible hotswap switch. +* Or use cable rerouting to make the pcb Proton-C compatible. +* Or find a way to use both OLED and LEDs. diff --git a/layouts/community/split_3x5_3/bbaserdem/config.h b/layouts/community/split_3x5_3/bbaserdem/config.h new file mode 100644 index 00000000000..75e24791eee --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/config.h @@ -0,0 +1,32 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +// Split definition; use the following to flash; +// pro-micro: avrdude-split-left/right +// elite-c: dfu-split-left/right +#define EE_HANDS + +#ifdef KEYBOARD_crkbd_rev1 + // Corne overrides + #include "../../../../keyboards/crkbd/rev1/config.h" + #ifdef RGBLED_NUM + #undef RGBLED_NUM + #endif + #ifdef DRIVER_LED_TOTAL + #undef DRIVER_LED_TOTAL + #endif + #define RGBLED_NUM 48 + #define DRIVER_LED_TOTAL RGBLED_NUM +#endif diff --git a/layouts/community/split_3x5_3/bbaserdem/keymap.c b/layouts/community/split_3x5_3/bbaserdem/keymap.c new file mode 100644 index 00000000000..36a1fa3a52d --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/keymap.c @@ -0,0 +1,123 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +/* D layout + * ┌───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┐ + * │' "│, <│. >│ P │ Y │        │ F │ G │ C │ R │ L │ + * ├───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┤ + * │ A │ O │ E │ U │ I │        │ D │ H │ T │ N │ S │ + * ├───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┤ + * │; :│ Q │ J │ K │ X │        │ B │ M │ W │ V │ Z │ + * └───┴───┴───┼───┼───┼───┐ ┌───┼───┼───┼───┴───┴───┘ + *            │Del│Tab│Spc│ │Ent│Esc│Bsp│ + *            └───┴───┴───┘ └───┴───┴───┘ + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_split_3x5_3_wrapper( + _BL1_5_,_BR1_5_, + _BL2_5_,_BR2_5_, + _BL3_5_,_BR3_5_, + _BL4_3_,_BR4_3_ + ), + [_CHAR] = LAYOUT_split_3x5_3_wrapper( + _CL1_5_,_CR1_5_, + _CL2_5_,_CR2_5_, + _CL3_5_,_CR3_5_, + _CL4_3_,_CR4_3_ + ), + [_GAME] = LAYOUT_split_3x5_3_wrapper( + _GA1_5_,___5___, + _GA2_5_,___5___, + _GA3_5_,___5___, + _GA4_3_,___3___ + ), + [_MEDI] = LAYOUT_split_3x5_3_wrapper( + ___5___,_ME1_5_, + ___5___,_ME2_5_, + ___5___,_ME3_5_, + ___3___,_ME4_3_ + ), + [_NAVI] = LAYOUT_split_3x5_3_wrapper( + ___5___,_NA1_5_, + ___5___,_NA2_5_, + ___5___,_NA3_5_, + ___3___,_NA4_3_ + ), + [_SYMB] = LAYOUT_split_3x5_3_wrapper( + ___5___,_SY1_5_, + ___5___,_SY2_5_, + ___5___,_SY3_5_, + ___3___,_SY4_3_ + ), + [_NUMB] = LAYOUT_split_3x5_3_wrapper( + _NU1_5_,___5___, + _NU2_5_,___5___, + _NU3_5_,___5___, + _NU4_3_,___3___ + ), + [_FUNC] = LAYOUT_split_3x5_3_wrapper( + _FU1_5_,___5___, + _FU2_5_,___5___, + _FU3_5_,___5___, + _FU4_3_,___3___ + ), + [_MOUS] = LAYOUT_split_3x5_3_wrapper( + _MO1_5_,___5___, + _MO2_5_,___5___, + _MO3_5_,___5___, + _MO4_3_,___3___ + ), + [_MUSI] = LAYOUT_split_3x5_3_wrapper( + _MU_10_, + _MU_10_, + _MU_10_, + _MUL_3_,_MUR_3_ + ) +}; + +// RGB Matrix configuration +#ifdef RGB_MATRIX_ENABLE + +// crkbd +#if defined(KEYBOARD_crkbd_rev1) +/* This is left-right for crkbd indicator light + * ┌──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┐ + * │23│18│17│10│09│      │33│34│41│42│47│ + * ├02┼──┼01┼──┼00┤      ├24┼──┼25┼──┼26┤ + * │22│19│16│11│08│     │32│35│40│43│46│ + * ├03┼──┼04┼──┼05┤      ├29┼──┼28┼──┼27┤ + * │21│20│15│12│07│     │31│36│39│44│45│ + * └──┴──┴──┼──┼──┼──┐┌──┼──┼──┼──┴──┴──┘ + *          │14│13│06││30│37│38│ + *          └──┴──┴──┘└──┴──┴──┘ + */ +// Sided color-setting +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(i, red, green, blue); + } +} +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 24; i < 48; i++) { + rgb_matrix_set_color(i, red, green, blue); + } +} +// End of differentiations +#endif + +// End of code for the RGB_MATRIX setup +#endif diff --git a/layouts/community/split_3x5_3/bbaserdem/rules.mk b/layouts/community/split_3x5_3/bbaserdem/rules.mk new file mode 100644 index 00000000000..347894c26b1 --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Corne keyboard +ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) + RGBLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = yes + OLED_DRIVER_ENABLE = no +endif From 4fd38a9da753e9dcc090da0d43d4f8e6cc236a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:32:15 -0400 Subject: [PATCH 08/94] Fixed a typo referance in one of the readme files. --- layouts/community/split_3x5_3/bbaserdem/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/community/split_3x5_3/bbaserdem/README.md b/layouts/community/split_3x5_3/bbaserdem/README.md index 869b91898ce..9086172df88 100644 --- a/layouts/community/split_3x5_3/bbaserdem/README.md +++ b/layouts/community/split_3x5_3/bbaserdem/README.md @@ -1,4 +1,4 @@ -This file contains my [split 3x10](../../../default/split_3x10) board layouts +This file contains my [split 3x10 + 3](../../../default/split_3x10_3) board layouts Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. # Crkbd From d1ab470b24516b58474af7e5be84aa8961f25d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:35:08 -0400 Subject: [PATCH 09/94] Added the last split layout for bbaserdem --- .../community/split_3x6_3/bbaserdem/README.md | 10 ++ .../community/split_3x6_3/bbaserdem/config.h | 24 ++++ .../community/split_3x6_3/bbaserdem/keymap.c | 124 ++++++++++++++++++ .../community/split_3x6_3/bbaserdem/rules.mk | 18 +++ 4 files changed, 176 insertions(+) create mode 100644 layouts/community/split_3x6_3/bbaserdem/README.md create mode 100644 layouts/community/split_3x6_3/bbaserdem/config.h create mode 100644 layouts/community/split_3x6_3/bbaserdem/keymap.c create mode 100644 layouts/community/split_3x6_3/bbaserdem/rules.mk diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem/README.md new file mode 100644 index 00000000000..dd1d0074bd3 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/README.md @@ -0,0 +1,10 @@ +This file contains my [split 3x6 + 3](../../../default/split_3x6_3) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Crkbd + +Using [this](https://github.com/ItsWaffIe/waffle_corne) Proton-C compatible PCB. + +## Build + +Build command: `CFLAGS="-Wno-error=deprecated" TBF` diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h new file mode 100644 index 00000000000..165249ff9af --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -0,0 +1,24 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +// Split definition; use the following to flash; +// pro-micro: avrdude-split-left/right +// elite-c: dfu-split-left/right +#define EE_HANDS + +// Code pertaining to planck rev6 +#ifdef KEYBOARD_crkbd_rev1 + // Corne overrides + #include "../../../../keyboards/crkbd/rev1/config.h" +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c new file mode 100644 index 00000000000..da6583c8b7f --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -0,0 +1,124 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" +/* F layout + * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ + * │+ *│ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ + * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ + * │ X │ A │ S │ D │ F │ G │        │ T │ K │ M │ L │ Y │ Ş │ + * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ + * │< >│ J │ Ö │ V │ C │ Ç │        │ Z │ S │ B │. :│, ;│ W │ + * └───┴───┴───┴───┼───┼───┼───┐ ┌───┼───┼───┼───┴───┴───┴───┘ + *                │Tab│Ent│Esc│ │Del│Spc│Bsp│ + *                └───┴───┴───┘ └───┴───┴───┘ + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_split_3x6_3_wrapper( + _BL1_1_,_BL1_5_,_BR1_5_,_BR1_1_, + _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, + _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, + _BL4_3_,_BR4_3_ + ), + [_CHAR] = LAYOUT_split_3x6_3_wrapper( + XXXXXXX,_CL1_5_,_CR1_5_,XXXXXXX, + XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, + XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, + _CL4_3_,_CR4_3_ + ), + [_GAME] = LAYOUT_split_3x6_3_wrapper( + _GA1_1_,_GA1_5_,___6___, + _GA2_1_,_GA2_5_,___6___, + _GA3_1_,_GA3_5_,___6___, + _GA4_3_,___3___ + ), + [_MEDI] = LAYOUT_split_3x6_3_wrapper( + ___6___,_ME1_5_,xxx1xxx, + ___6___,_ME2_5_,xxx1xxx, + ___6___,_ME3_5_,xxx1xxx, + ___3___,_ME4_3_ + ), + [_NAVI] = LAYOUT_split_3x6_3_wrapper( + ___6___,_NA1_5_,xxx1xxx, + ___6___,_NA2_5_,xxx1xxx, + ___6___,_NA3_5_,xxx1xxx, + ___3___,_NA4_3_ + ), + [_SYMB] = LAYOUT_split_3x6_3_wrapper( + ___6___,_SY1_5_,xxx1xxx, + ___6___,_SY2_5_,xxx1xxx, + ___6___,_SY3_5_,xxx1xxx, + ___3___,_SY4_3_ + ), + [_NUMB] = LAYOUT_split_3x6_3_wrapper( + xxx1xxx,_NU1_5_,___6___, + xxx1xxx,_NU2_5_,___6___, + xxx1xxx,_NU3_5_,___6___, + _NU4_3_,___3___ + ), + [_FUNC] = LAYOUT_split_3x6_3_wrapper( + xxx1xxx,_FU1_5_,___6___, + xxx1xxx,_FU2_5_,___6___, + xxx1xxx,_FU3_5_,___6___, + _FU4_3_,___3___ + ), + [_MOUS] = LAYOUT_split_3x6_3_wrapper( + xxx1xxx,_MO1_5_,___6___, + xxx1xxx,_MO2_5_,___6___, + xxx1xxx,_MO3_5_,___6___, + _MO4_3_,___3___ + ), + [_MUSI] = LAYOUT_split_3x6_3_wrapper( + _MU_12_, + _MU_12_, + _MU_12_, + _MUL_3_,_MUR_3_ + ) +}; + +// RGB Matrix configuration +#ifdef RGB_MATRIX_ENABLE + +// crkbd +#if defined(KEYBOARD_crkbd_rev1) +/* This is left-right for planck light indicator light + * - The LED 42 is for spacebar specifically, leave it out of the matrix + * - This is how it looks like + * ┌──┬──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┬──┐ + * │24│23│18│17│10│09│      │36│37│44│45│50│51│ + * ├──┼02┼──┼01┼──┼00┤      ├27┼──┼28┼──┼29┼──┤ + * │25│22│19│16│11│08│     │35│38│43│46│49│52│ + * ├──┼03┼──┼04┼──┼05┤      ├32┼──┼31┼──┼30┼──┤ + * │26│21│20│15│12│07│     │34│39│42│47│48│53│ + * └──┴──┴──┴──┼──┼──┼──┐┌──┼──┼──┼──┴──┴──┴──┘ + *             │14│13│06││33│40│41│ + *             └──┴──┴──┘└──┴──┴──┘ + */ +// Sided color-setting +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 27; i++) { + rgb_matrix_set_color(i, red, green, blue); + } +} +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 28; i < 54; i++) { + rgb_matrix_set_color(i, red, green, blue); + } +} +// End of differentiations +#endif + +// End of code for the RGB_MATRIX setup +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk new file mode 100644 index 00000000000..347894c26b1 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Corne keyboard +ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) + RGBLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = yes + OLED_DRIVER_ENABLE = no +endif From 86357fd1ece5a5f8fbdee12638be6ae71263335e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:51:28 -0400 Subject: [PATCH 10/94] Added userspace code for user bbaserdem --- users/bbaserdem/.gitignore | 2 + users/bbaserdem/README.md | 220 +++++++++++++++ users/bbaserdem/bb-audio.c | 77 ++++++ users/bbaserdem/bb-audio.h | 24 ++ users/bbaserdem/bb-backlight.c | 26 ++ users/bbaserdem/bb-backlight.h | 19 ++ users/bbaserdem/bb-encoder.c | 467 +++++++++++++++++++++++++++++++ users/bbaserdem/bb-encoder.h | 35 +++ users/bbaserdem/bb-keylight.c | 78 ++++++ users/bbaserdem/bb-keylight.h | 27 ++ users/bbaserdem/bb-macro.c | 183 +++++++++++++ users/bbaserdem/bb-macro.h | 110 ++++++++ users/bbaserdem/bb-oled.c | 162 +++++++++++ users/bbaserdem/bb-oled.h | 18 ++ users/bbaserdem/bb-underglow.c | 113 ++++++++ users/bbaserdem/bb-underglow.h | 24 ++ users/bbaserdem/bbaserdem.c | 224 +++++++++++++++ users/bbaserdem/bbaserdem.h | 484 +++++++++++++++++++++++++++++++++ users/bbaserdem/config.h | 139 ++++++++++ users/bbaserdem/rules.mk | 83 ++++++ 20 files changed, 2515 insertions(+) create mode 100644 users/bbaserdem/.gitignore create mode 100644 users/bbaserdem/README.md create mode 100644 users/bbaserdem/bb-audio.c create mode 100644 users/bbaserdem/bb-audio.h create mode 100644 users/bbaserdem/bb-backlight.c create mode 100644 users/bbaserdem/bb-backlight.h create mode 100644 users/bbaserdem/bb-encoder.c create mode 100644 users/bbaserdem/bb-encoder.h create mode 100644 users/bbaserdem/bb-keylight.c create mode 100644 users/bbaserdem/bb-keylight.h create mode 100644 users/bbaserdem/bb-macro.c create mode 100644 users/bbaserdem/bb-macro.h create mode 100644 users/bbaserdem/bb-oled.c create mode 100644 users/bbaserdem/bb-oled.h create mode 100644 users/bbaserdem/bb-underglow.c create mode 100644 users/bbaserdem/bb-underglow.h create mode 100644 users/bbaserdem/bbaserdem.c create mode 100644 users/bbaserdem/bbaserdem.h create mode 100644 users/bbaserdem/config.h create mode 100644 users/bbaserdem/rules.mk diff --git a/users/bbaserdem/.gitignore b/users/bbaserdem/.gitignore new file mode 100644 index 00000000000..57bd0e43b42 --- /dev/null +++ b/users/bbaserdem/.gitignore @@ -0,0 +1,2 @@ +/secrets.h +/secrets.c diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md new file mode 100644 index 00000000000..74a0488a451 --- /dev/null +++ b/users/bbaserdem/README.md @@ -0,0 +1,220 @@ +# BBASERDEM userspace code for qmk + +My userspace code for my various keyboards; available here. + +# Todo + +- [X] Add OLED support +- [ ] Centralize color definitions for RGB +- [ ] Document all features more extensibly +- [ ] Generate json files to be used with Keyboard-Layout-Editor to produce images. + +# Keyboards + +A list of my code accross the QMK repo accessible here. +(I will sell my built-but-not-using ones.) + +## Builds + +These are my keyboard builds and info, it allows me to plan out my builds. + +### Planck WORK + +* Board: planck/rev6 +* Switches: Zilent +* Case: Planck Hi-Pro Bottom Case: Glossy White +* Plate: Stainless steel with shiny finish (LaserBoost) +* Keycaps: Pudding PBT Doubleshot Keycap Set +* Artisan: B.O.B StoneuCarved Lotus Artisan Keycap +* Artisan: Teamwolf 304 Stainless Steel Transparent Metal Keycaps + +I use this at the workplace to not bother coworkers; focus on silence. + +### Planck HOME + +* Board: planck/rev6 +* Switches: Crystal BOX Navy +* Case: Planck Hi-Pro Bottom Case (MOD version): Matte Black +* Plate: Copper with shiny finish (LaserBoost) +* Keycaps: Buger TH01 XDA Dye-Subbed PBT +* Artisan: Sparkle Loft Reactor Artisan Keycap + +I use this at home. +Has all the extra pinouts exposed to play arounh with. + +### Planck SERVER + +* Board: jj40 +* Switches: BOX Navy +* Case: Clear Acrylic Top and Bottow, with Frosted Acrylic Diffuser (Smashing Acrylics) +* Keycaps: Datamancer Tall Deco Typewriter Keycaps + +I'm using this while I'm in between boards; but very usable. +Long term plan is to use this for the server. +The case was initially designed for planck rev4; +I'm replaced the PCB since my rev4 one was derelict +due to repeated desolderings. + +### Planck CARRY + +* Board: planck/light +* Switches: Choc Low Jade +* Case: Stock Planck light case +* Keycaps: Blanck MKB + +I carry this around; and is one of my favourite boards. +Found a better keycap profile for these as well. + +### XD75RE + +* Board: xd75 +* Switches: Zealios 67g + Silencios +* Case: Npkc 60% Wooden Case (Rosewood) +* Keycaps: Massdrop x MITO XDA Godspeed +* Artisan: Hammer Fidget Spinner Artisan Keycap +* Artisan: Waffle Key Studio Rosette (Sunset) + +My first work board; that is not seing any use due to being big. + +### Gherkin PAD + +* Board: 40percentclub/gherkin +* Case: Acrylic Case (Smashing Acrylics) +* Controller: Proton C +* Switches: Novelkeys Creams +* Keycaps: Random + +The point of this is to act like a game/macro pad. +Other than that; i just use this for bragging points. +I have been planning on using my Proton C to turn into a MIDI controller. + +### Let's Split Eh? + +* Board: lets_split_eh/eh +* Case: Acrylic Case (Smashing Acrylics) +* Switches: Novelkeys BOX Royals +* Keycaps: G20 Semiotics + +I built this; but then I realized that I really don't enjoy ortholinear split. + +### Infinity Ergodox + +* Board: ergodox_infinity +* Case: Datamancer Wooden case +* Switches: Kailh Speed Gold +* Keycaps: None + +I don't like Infinity Ergodox. +Should sell this soon cause really not seeing myself ever using this. +Lucky me got the case for free due to (then) Massdrop shipping errors. + +### Corne + +* Board: [Proton-C Compatible crkbd PCB](https://github.com/ItsWaffIe/waffle_corne) +* Case: IMK Corne Case v2 Polycarbonate +* Switches: Healios V2 +* Keycaps: POM Jelly + +I'm planning on adding a trackpad for this, as detailed +[here](https://github.com/manna-harbour/crkbd/blob/master/trackpoint/readme.org). + +### Corne Lite + +* Board: crkbd/rev1 +* Case: Custom +* Switches: Choc Low Burnt Orange +* Keycaps: [Scooped Choc Keycaps](https://mkultra.click/collections/keycaps/products/scooped-choc-keycaps?variant=31223543365730) + +### Kyria + +* Board: kyria/rev1 +* Case: Matte Black Acrylic High-Profile case +* Switches: Gateron Ink Silent Black +* Keycaps: Oblotzky SA Oblivion + +Want to add a joystick to this board for mouse control. + +### Big Switch + +* Board: bigseries/1key +* Case: WoodKeys (KNOWN SCAMMER: DO NOT RECOMMEND) +* Switches: Big Series Pale Blue +* Keycaps: Idea23 + +Got this before being scammed out of 200$ by Cole Markham: owner of WoodKeys; +The usb port got torn off; and could not fix it. +Expensive paperweight? + +# Firmware building + +## Archlinux + +On archlinux, the package *arm-none-eabi-gcc* is too new. +To fix; add to the environment `CFLAGS="-Wno-error=deprecated"` to compilation commands. +Also; try to run `avr-gcc` version `8.4.0` for smaller firmware. + +## Bootloader + +If I want to flash a new bootloader for a machine; here are steps; + +1. Flash the util/pro_micro_ISP_B6_10.hex to a spare promicro using; +`avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:pro_micro_ISP_B6_10.hex` +2. Wire the pins; (first is the ISP pro micro; second is the target) +``` +Pro Micro 10 (B6) <-> Keyboard RESET +Pro Micro 15 (B1) <-> Keyboard B1 (SCLK) +Pro Micro 16 (B2) <-> Keyboard B2 (MOSI) +Pro Micro 14 (B3) <-> Keyboard B3 (MISO) +Pro Micro VCC <-> Keyboard VCC +Pro Micro GND <-> Keyboard GND +``` +I do have this on hand I believe; from massdrop's planck light firmware updater. +3. Connect the flashed pro micro to my computer and run +`avrdude -c avrisp -P "$(ls /dev/ttyACM*)" -p atmega32u4 -U flash:w:bootloader_atmega32u4_1.0.0.hex:i -U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m` + +The avrisp here refers to the firmware on the ISP flasher pro micro. +The `atmega32u4` refers to the CPU used in the respective breakout boards. +The `avrdude` command interacts with catalina bootloader. +The shell call after the `-P` flag auto finds the port that the pro micro connects to. +The last few arguments are some jumpers apparently. + +# Features + +My userspace has a lot of shared code between different keyboards. +These files are prefixed with `sbp-` to remove any naming clash. + +* [bb-audio](bb-audio.c): Code dealing with audio playback using onboard sound. +Also contains stuff regarding using the devices as MIDI controllers. (WIP) +* [bb-backlight](bb-backlight.c): Controls global key single-channel LED stuff. +* [bb-keylight](bb-keylight.c): Controls per-key RGB LED matrix stuff. +* [bb-underglow](bb-underglow.c): Controls RGB underglow effects. +* [bb-process](bb-macro.c): My custom keycodes; macros, tap dances, etc. +* [bb-rotary](bb-rotary.c): Rotary encoder sutff + +# Layout + +![Corne layout](https://i.imgur.com/6VvQZ2I.png) + +My personal layout is mostly inspired by the +[Miryoku layout](../manna-harbour_miryoku/miryoku.org). +There are some changes to make it friendlier to international keyboards. +My board is compatible with software implementation of Dvorak and Turkish F. + +## Base + +Base layer uses tap-hold functionality to have access to modifiers. +The modifiers are mirrored on each half of the layout; +as to make those modifiers accessible to the keys that overlap them. +Besides the Alt key; each side has the proper L/R version of the modifier. +Since Right Alt key functions as AltGr key; +both the L and R versions are available on each side. + +# Shoutout + +* To [drashna](../drashna/readme.md), for documenting how to use userspace features; +all my code is pretty much inspired from them. +* To [Manna Harbour](../manna-harbour_miryoku/README.org) for their +amazing keymap that inspired me to recreate mine and allowed me to move to +smaller split keyboards. +* To people who taught me C and have me enjoy working with it; +Dr. Mehmet Enis Oğuz and Dr. Veysi Erkcan Özcan. diff --git a/users/bbaserdem/bb-audio.c b/users/bbaserdem/bb-audio.c new file mode 100644 index 00000000000..700e58bd1f8 --- /dev/null +++ b/users/bbaserdem/bb-audio.c @@ -0,0 +1,77 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-audio.h" +/* AUDIO + * This contains some audio related stuff. + * There is no need to wrap this up with preprocessor commands; + * This is only called if audio is enabled + */ + +float tone_game_intro[][2] = GAME_ON_SONG; +float tone_game_outro[][2] = GAME_OFF_SONG; + +// Audio playing when layer changes +uint32_t layer_state_set_audio(uint32_t state) { + // Get this layer + static bool prev_game = false; + + // If entering the game layer; play the intro sound + if (layer_state_cmp(state, _GAME) && (!prev_game)) { + stop_all_notes(); + PLAY_SONG(tone_game_intro); + prev_game = true; + } + // If exiting the game layer; play the outro sound + if ((!layer_state_cmp(state, _GAME)) && prev_game) { + stop_all_notes(); + PLAY_SONG(tone_game_outro); + prev_game = false; + } + return state; +} + +// Audio layer switch; add the music layer on top of this +bool process_record_audio(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MU_TOG: + if (!record->event.pressed) { + // On release, exit music mode if enabled + if (layer_state_is(_MUSI)) { + layer_off(_MUSI); + // If not enabled; turn off all layers and load music layer + } else { + layer_clear(); + layer_on(_MUSI); + } + } + return true; + break; + case MU_ON: + if (!record->event.pressed) { + // On release, enter music mode + layer_clear(); + layer_on(_MUSI); + } + return true; + break; + case MU_OFF: + if (!record->event.pressed) { + // On release, exit music mode + layer_off(_MUSI); + } + return true; + break; + } + return true; +} diff --git a/users/bbaserdem/bb-audio.h b/users/bbaserdem/bb-audio.h new file mode 100644 index 00000000000..53708327536 --- /dev/null +++ b/users/bbaserdem/bb-audio.h @@ -0,0 +1,24 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* AUDIO + * Some functions to hook to some modes + */ + +// Hook to layer change effects +layer_state_t layer_state_set_audio(layer_state_t state); + +// Hook to audio keycodes +bool process_record_audio(uint16_t keycode, keyrecord_t *record); diff --git a/users/bbaserdem/bb-backlight.c b/users/bbaserdem/bb-backlight.c new file mode 100644 index 00000000000..17017d82790 --- /dev/null +++ b/users/bbaserdem/bb-backlight.c @@ -0,0 +1,26 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-backlight.h" +/* Replaced functions with noeeprom varieties; I don't need retention across + * booting. + */ + +// Backlight LEDs +void keyboard_post_init_backlight(void) { + backlight_enable(); + backlight_level(2); + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +} diff --git a/users/bbaserdem/bb-backlight.h b/users/bbaserdem/bb-backlight.h new file mode 100644 index 00000000000..3fbe1b9fb55 --- /dev/null +++ b/users/bbaserdem/bb-backlight.h @@ -0,0 +1,19 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* Hooks for backlight definitions + */ + +void keyboard_post_init_backlight(void); diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c new file mode 100644 index 00000000000..a4a1e4c3453 --- /dev/null +++ b/users/bbaserdem/bb-encoder.c @@ -0,0 +1,467 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-encoder.h" +/* ROTARY ENCODER + * This contains my general rotary encoder code + * Encoders each have a list of different modes they can be in. + * Each mode also have an on click action as well. + * Modes can be cycled using either shift-click or ctrl-click + * Modes can be reset using OS click + * Some modes are only accessible through some keymap layers + */ +//encoder_state_t encoder_state[NUMBER_OF_ENCODERS]; +encoder_state_t encoder_state[2]; +// Default state for the encoders +void reset_encoder_state(void) { +// for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { + for (int i = 0; i < 2; i++) { + encoder_state[i].base = i; + encoder_state[i].rgb = i; + encoder_state[i].point = i; + } +} + +// Initialize the encoder state beginning +void keyboard_post_init_encoder(void) { + reset_encoder_state(); +} + +// Oled string printing for given layer and index; ONLY for OLED +#ifdef OLED_DRIVER_ENABLE +void oled_encoder_state_5char(uint8_t index, uint8_t layer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + switch (encoder_state[index].rgb) { + case 0: + oled_write_P(PSTR(" mode"), false); + break; + case 1: + oled_write_P(PSTR(" hue "), false); + break; + case 2: + oled_write_P(PSTR("satur"), false); + break; + case 3: + oled_write_P(PSTR("value"), false); + break; + case 4: + oled_write_P(PSTR("speed"), false); + break; + default: + oled_write_P(PSTR("!oob!"), false); + break; + } + break; + #endif + // If pointer control is enabled + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (encoder_state[index].point) { + case 0: + oled_write_P(PSTR("m.lat"), false); + break; + case 1: + oled_write_P(PSTR("m.ver"), false); + break; + case 2: + oled_write_P(PSTR("s.ver"), false); + break; + case 3: + oled_write_P(PSTR("s.lat"), false); + break; + default: + oled_write_P(PSTR("!oob!"), false); + break; + } + break; + #endif + default: + switch (encoder_state[index].base) { + case 0: + oled_write_P(PSTR(" volm"), false); + break; + case 1: + oled_write_P(PSTR(" song"), false); + break; + case 2: + oled_write_P(PSTR(" sink"), false); + break; + case 3: + oled_write_P(PSTR("s.vol"), false); + break; + case 4: + oled_write_P(PSTR(" src "), false); + break; + case 5: + oled_write_P(PSTR(" L/R "), false); + break; + case 6: + oled_write_P(PSTR(" U/D "), false); + break; + case 7: + oled_write_P(PSTR("pgU/D"), false); + break; + case 8: + oled_write_P(PSTR(" del "), false); + break; + default: + oled_write_P(PSTR("!oob!"), false); + break; + } + break; + } +} +#endif + +// Encoder scroll functionality +void encoder_update_user(uint8_t index, bool clockwise) { + // Differentiate layer roles + switch (get_highest_layer(layer_state)) { + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + switch(encoder_state[index].rgb) { + case 0: // Effect the RGB mode + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + rgblight_step_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_step_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_step_reverse_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_step_reverse_noeeprom(); + #endif + } + break; + case 1: // Effect the RGB hue + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + rgblight_increase_hue_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_hue_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_decrease_hue_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_decrease_hue_noeeprom(); + #endif + } + break; + case 2: // Effect the RGB saturation + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + rgblight_increase_sat_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_sat_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_decrease_sat_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_decrease_sat_noeeprom(); + #endif + } + break; + case 3: // Effect the RGB brightness + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + rgblight_increase_val_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_val_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_decrease_val_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_decrease_val_noeeprom(); + #endif + } + break; + case 4: // Effect the RGB effect speed + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_speed_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_decrease_speed_noeeprom(); + #endif + } + break; + } + break; + #endif + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch(encoder_state[index].point) { + case 0: // Move mouse on horizontal axis + if (clockwise) { + tap_code(KC_MS_R); + } else { + tap_code(KC_MS_L); + } + break; + case 1: // Move mouse on vertical axis + if (clockwise) { + tap_code(KC_MS_D); + } else { + tap_code(KC_MS_U); + } + break; + case 2: // Move mouse wheel on vertical axis + if (clockwise) { + tap_code(KC_WH_D); + } else { + tap_code(KC_WH_U); + } + break; + case 3: // Move mouse on horizontal axis + if (clockwise) { + tap_code(KC_WH_R); + } else { + tap_code(KC_WH_L); + } + break; + } + break; + #endif + default: + switch(encoder_state[index].base) { + case 0: // Volume + if (clockwise) { + tap_code16(KC_VOLU); + } else { + tap_code16(KC_VOLD); + } + break; + case 1: // Song change + if (clockwise) { + tap_code16(KC_MNXT); + } else { + tap_code16(KC_MPRV); + } + break; + case 2: // Move to audio sink + if (clockwise) { + tap_code16(KC_F13); + } else { + tap_code16(S(KC_F13)); + } + break; + case 3: // Volume of source + if (clockwise) { + tap_code16(S(KC_VOLU)); + } else { + tap_code16(C(KC_VOLD)); + } + break; + case 4: // Move to audio source + if (clockwise) { + tap_code16(C(KC_F13)); + } else { + tap_code16(C(S(KC_F13))); + } + break; + case 5: // Left-right + if (clockwise) { + tap_code16(KC_RGHT); + } else { + tap_code16(KC_LEFT); + } + break; + case 6: // Up-down + if (clockwise) { + tap_code16(KC_DOWN); + } else { + tap_code16(KC_UP); + } + break; + case 7: // Page Up-down + if (clockwise) { + tap_code16(KC_PGDN); + } else { + tap_code16(KC_PGUP); + } + break; + case 8: // Delete + if (clockwise) { + tap_code16(KC_DEL); + } else { + tap_code16(KC_BSPC); + } + break; + } + break; + } +} + +void encoder_click_action(uint8_t index) { + // Differentiate layer roles + switch (get_highest_layer(layer_state)) { + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + switch(encoder_state[index].rgb) { + case 0: // Return to no animation + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); + #endif + break; + case 1: + case 2: + case 3: // Toggle + #ifdef RGBLIGHT_ENABLE + rgblight_increase_val_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_val_noeeprom(); + #endif + break; + case 4: // Toggle velocikey + #ifdef VELOCIKEY_ENABLE + velocikey_toggle(); + #endif + break; + } + break; + #endif + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch(encoder_state[index].point) { + case 0: // Left click + tap_code16(KC_BTN1); + break; + case 1: // Right click + tap_code16(KC_BTN2); + break; + case 2: + case 3: // Middle click + tap_code16(KC_BTN2); + break; + } + break; + #endif + default: + switch(encoder_state[index].base) { + case 0: // Toggle mute + case 2: + tap_code16(KC_MUTE); + break; + case 1: // Pause + tap_code16(KC_MPLY); + break; + case 3: // Mute source + case 4: + tap_code16(A(KC_MUTE)); + break; + case 5: // Insert + tap_code16(KC_INS); + break; + case 6: // Capslock + tap_code16(KC_CAPS); + break; + case 7: // Redo + tap_code16(BB_REDO); + break; + case 8: // Undo + tap_code16(BB_UNDO); + break; + } + break; + } +} + +bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { + // Check if and which encoder + int encoder_index = -1; + switch (keycode) { + case BB_ENC0: + encoder_index = 0; + break; + case BB_ENC1: + encoder_index = 1; + break; + } + // Activate encoder function of button + if ((encoder_index >= 0) & (!record->event.pressed)) { + // If shifted, move mode one point forward + if (get_mods() & MOD_MASK_SHIFT) { + switch (get_highest_layer(layer_state)) { + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + encoder_state[encoder_index].rgb = + (encoder_state[encoder_index].rgb + 1) % 5; + break; + #endif + #ifdef MOUSEKEY_ENABLE + case _MOUS: + encoder_state[encoder_index].point = + (encoder_state[encoder_index].point + 1) % 4; + break; + #endif + default: + encoder_state[encoder_index].base = + (encoder_state[encoder_index].base + 1) % 9; + break; + } + // If ctrl is active, move mode one point backwards + } else if (get_mods() & MOD_MASK_CTRL) { + switch (get_highest_layer(layer_state)) { + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + encoder_state[encoder_index].rgb = + (encoder_state[encoder_index].rgb + 5 - 1) % 5; + break; + #endif + #ifdef MOUSEKEY_ENABLE + case _MOUS: + encoder_state[encoder_index].point = + (encoder_state[encoder_index].point + 4 - 1) % 4; + break; + #endif + default: + encoder_state[encoder_index].base = + (encoder_state[encoder_index].base + 9 - 1) % 9; + break; + } + // If meta is active, reset the encoder states + } else if (get_mods() & MOD_MASK_GUI) { + reset_encoder_state(); + // If nothing else; just perform the click action + } else { + encoder_click_action(encoder_index); + } + } + return true; +} diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h new file mode 100644 index 00000000000..3a064c6295e --- /dev/null +++ b/users/bbaserdem/bb-encoder.h @@ -0,0 +1,35 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" + +// Code to print to OLED +#ifdef ENCODER_ENABLE +void oled_encoder_state_5char(uint8_t index, uint8_t layer); +#endif +// Hook to encoder stuff +void encoder_update_user(uint8_t index, bool clockwise); +// Complicated code for what the encoder keys do when pressed +bool process_record_encoder(uint16_t keycode, keyrecord_t *record); +// Initializing the encoder array +void keyboard_post_init_encoder(void); +// Clear the encoder settings +void reset_encoder_state(void); + +// Structure to keep runtime info on encoder state +typedef struct { + uint8_t base; // The encoder state on most layers; regular function + uint8_t rgb; // The encoder state on media layer; controls light settings + uint8_t point; // The encoder state on mouse layer; moves pointer +} encoder_state_t; diff --git a/users/bbaserdem/bb-keylight.c b/users/bbaserdem/bb-keylight.c new file mode 100644 index 00000000000..d52f092af79 --- /dev/null +++ b/users/bbaserdem/bb-keylight.c @@ -0,0 +1,78 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-keylight.h" +/* Code relating to per-key RGB LED stuff + */ + +// These are matrix specific so they need to be defined in the keymap code. +// BUT these are made to take RGB arguments so the color choice is central +__attribute__ ((weak)) +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { } +__attribute__ ((weak)) +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { } + +// Allow hooking into the RGB matrix indications using keymap code +__attribute__ ((weak)) void rgb_matrix_indicators_keymap(void) { } +// Set RGB state depending on layer +void rgb_matrix_indicators_user(void) { + // Do each layer seperately + switch (get_highest_layer(layer_state)) { + case _GAME: + keylight_set_left(RGB_TURQUOISE); + break; + case _CHAR: + rgb_matrix_set_color_all(RGB_CHARTREUSE); + break; + case _MEDI: + keylight_set_right(RGB_CORAL); + break; + case _NAVI: + keylight_set_right(RGB_GREEN); + break; + case _SYMB: + keylight_set_right(RGB_PURPLE); + break; + case _NUMB: + keylight_set_left(RGB_CYAN); + break; + case _FUNC: + keylight_set_left(RGB_RED); + break; + case _MOUS: + keylight_set_left(RGB_YELLOW); + break; + case _MUSI: + rgb_matrix_set_color_all(RGB_MAGENTA); + break; + } + // Load keymap hooks + rgb_matrix_indicators_keymap(); +} + +// Hook into shutdown code to make all perkey LED's red on hitting reset +void shutdown_keylight(void) { + // Flash all the key LED's red on shutdown + uint16_t timer_start = timer_read(); + rgb_matrix_set_color_all(RGB_CORAL); + // Delay until this registers + while(timer_elapsed(timer_start) < 250) {wait_ms(1);} +} + +// Hook into suspend code +void suspend_power_down_keylight(void) { + rgb_matrix_set_suspend_state(true); +} +void suspend_wakeup_init_keylight(void) { + rgb_matrix_set_suspend_state(false); +} diff --git a/users/bbaserdem/bb-keylight.h b/users/bbaserdem/bb-keylight.h new file mode 100644 index 00000000000..3297f151139 --- /dev/null +++ b/users/bbaserdem/bb-keylight.h @@ -0,0 +1,27 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* Hooks involving perkey RGB LEDs + */ + +// For custom indicators +void rgb_matrix_indicators_user(void); +// Hook into shutdown code +void shutdown_keylight(void); +void suspend_wakeup_init_keylight(void); +void suspend_power_down_keylight(void); +// These should be defined worst case on this file +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue); +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue); diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c new file mode 100644 index 00000000000..423ebb2525d --- /dev/null +++ b/users/bbaserdem/bb-macro.c @@ -0,0 +1,183 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-macro.h" +/* MACRO Definitions + * This file has my macros/unicodes + * Hooks for other functionality to inject itself into the process_record + */ + +// Tap dance definitons +#ifdef TAP_DANCE_ENABLE +// Bigswitch tap dance code for the last key down event. +void bigswitch_fin(qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 0: + // Change RGB mode + #ifdef RGBLIGHT_ENABLE + rgblight_step(); + #endif + break; + case 1: + // Change RGB mode; but reverse + #ifdef RGBLIGHT_ENABLE + rgblight_step_reverse(); + #endif + break; + case 2: + // Toggle RGB functions + #ifdef RGBLIGHT_ENABLE + rgblight_toggle(); + #endif + break; + case 3: + // Change RGB hue + #ifdef RGBLIGHT_ENABLE + rgblight_increase_hue(); + #endif + break; + case 4: + // Send OS + Escape; which screen locks in my OS + register_code(KC_LGUI); + register_code(KC_ESC); + break; + case 5: + // Send power keycode + register_code(KC_POWER); + break; + } +} +// Unregister the keycodes entered +void bigswitch_res (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 4: + unregister_code(KC_LGUI); + unregister_code(KC_ESC); + break; + case 5: + unregister_code(KC_POWER); + break; + } +} +qk_tap_dance_action_t tap_dance_actions[] = { + #ifdef AUDIO_ENABLE + // Music playback speed modulator + [TD_AUDIO_TEMPO] = ACTION_TAP_DANCE_DOUBLE(MU_SLOW, MU_FAST), + #endif + [TD_BIGSWITCH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, bigswitch_fin, bigswitch_res), +}; +#endif + +// Unicode definitions; for single character keys +// We mask their definitions if unicode is not enabled +#ifdef UNICODEMAP_ENABLE +const uint32_t PROGMEM unicode_map[] = { + [UPC_A_CIRC] = 0x00C2, [LOW_A_CIRC] = 0x00E2, //  â + [UPC_C_CEDI] = 0x00C7, [LOW_C_CEDI] = 0x00E7, // Ç ç + [UPC_G_BREV] = 0x011E, [LOW_G_BREV] = 0x001F, // Ğ ğ + [UPC_I_CIRC] = 0x00CE, [LOW_I_CIRC] = 0x00EE, // Î î + [UPC_I_DOTL] = 0x0049, [LOW_I_DOTL] = 0x0131, // I ı + [UPC_I_DOTT] = 0x0130, [LOW_I_DOTT] = 0x0069, // İ i + [UPC_O_DIAE] = 0x00D6, [LOW_O_DIAE] = 0x00F6, // Ö ö + [UPC_S_CEDI] = 0x015E, [LOW_S_CEDI] = 0x015F, // Ş ş + [UPC_U_CIRC] = 0x00DB, [LOW_U_CIRC] = 0x00FB, // Û û + [UPC_U_DIAE] = 0x00DC, [LOW_U_DIAE] = 0x00FC, // Ü ü + [UPC_ALPHA] = 0x0391, [LOW_ALPHA] = 0x03B1, // Α α + [UPC_BETA] = 0x0392, [LOW_BETA] = 0x03B2, // Β β + [UPC_GAMMA] = 0x0393, [LOW_GAMMA] = 0x03B3, // Γ γ + [UPC_DELTA] = 0x0394, [LOW_DELTA] = 0x03B4, // Δ δ + [UPC_EPSILON] = 0x0395, [LOW_EPSILON] = 0x03B5, // Ε ε + [UPC_ZETA] = 0x0396, [LOW_ZETA] = 0x03B6, // Ζ ζ + [UPC_ETA] = 0x0397, [LOW_ETA] = 0x03B7, // Η η + [UPC_THETA] = 0x0398, [LOW_THETA] = 0x03B8, // Θ θ + [UPC_IOTA] = 0x0399, [LOW_IOTA] = 0x03B9, // Ι ι + [UPC_KAPPA] = 0x039A, [LOW_KAPPA] = 0x03BA, // Κ κ + [UPC_LAMBDA] = 0x039B, [LOW_LAMBDA] = 0x03BB, // Λ λ + [UPC_MU] = 0x039C, [LOW_MU] = 0x03BC, // Μ μ + [UPC_NU] = 0x039D, [LOW_NU] = 0x03BD, // Ν ν + [UPC_XI] = 0x039E, [LOW_XI] = 0x03BE, // Ξ ξ + [UPC_OMICRON] = 0x039F, [LOW_OMICRON] = 0x03BF, // Ο ο + [UPC_PI] = 0x03A0, [LOW_PI] = 0x03C0, // Π π + [UPC_RHO] = 0x03A1, [LOW_RHO] = 0x03C1, // Ρ ρ + [UPC_SIGMA] = 0x03A3, [LOW_SIGMA] = 0x03C3, // Σ σ + [UPC_TAU] = 0x03A4, [LOW_TAU] = 0x03C4, // Τ τ + [UPC_UPSILON] = 0x03A5, [LOW_UPSILON] = 0x03C5, // Υ υ + [UPC_PHI] = 0x03A6, [LOW_PHI] = 0x03C6, // Φ φ + [UPC_CHI] = 0x03A7, [LOW_CHI] = 0x03C7, // Χ χ + [UPC_PSI] = 0x03A8, [LOW_PSI] = 0x03C8, // Ψ ψ + [UPC_OMEGA] = 0x03A9, [LOW_OMEGA] = 0x03C9, // Ω ω + [ELLIPSIS] = 0x2026, // … + [PLANCK_CON] = 0x210F, // ℏ + [ANGSTROM] = 0x212B, // Å + [BITCOIN] = 0x20BF // ₿ +}; +#endif + +// Keycodes +bool process_record_macro(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // Plain macros + case BB_PGPK: + // My public PGP key + if (record->event.pressed) { + SEND_STRING("0B7151C823559DD8A7A04CE36426139E2F4C6CCE"); + } + return false; break; + case DBL_ANG: + // Double angular bracket + if (record->event.pressed) { + SEND_STRING("<>"SS_TAP(X_LEFT)); + } + return false; break; + case DBL_PAR: + // Double paranthesis + if (record->event.pressed) { + SEND_STRING("()"SS_TAP(X_LEFT)); + } + return false; break; + case DBL_BRC: + // Double square brackets + if (record->event.pressed) { + SEND_STRING("[]"SS_TAP(X_LEFT)); + } + return false; break; + case DBL_CBR: + // Double curly brackets + if (record->event.pressed) { + SEND_STRING("{}"SS_TAP(X_LEFT)); + } + return false; break; + // Unicode macros + #ifdef UNICODEMAP_ENABLE + case TR_FLAG: + // Turkish flag + if (record->event.pressed) { + send_unicode_string("🇹🇷"); + } + return false; break; + case BB_LENY: + // Lenny face: ( ͡° ͜ʖ ͡°) + if (record->event.pressed) { + send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029"); + } + return false; break; + case BB_TABL: + // Table flip: ┻━┻︵ \(°□°)/ ︵ ┻━┻ + if (record->event.pressed) { + send_unicode_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); + } + return false; break; + #endif + } + return true; +} diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h new file mode 100644 index 00000000000..9a4bf437894 --- /dev/null +++ b/users/bbaserdem/bb-macro.h @@ -0,0 +1,110 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* This header file contains definitons regarding custom keycodes. + * - Both regular and unicode macros are dealt with in this file + */ + +// These will be delegated to keymap specific stuff (weak definition) +bool process_record_macro(uint16_t keycode, keyrecord_t *record); + +// Unicodemap implementation +#ifdef UNICODEMAP_ENABLE +enum userspace_unicodemap { + UPC_A_CIRC, + UPC_C_CEDI, + UPC_G_BREV, + UPC_I_CIRC, + UPC_I_DOTL, + UPC_I_DOTT, + UPC_O_DIAE, + UPC_S_CEDI, + UPC_U_CIRC, + UPC_U_DIAE, + LOW_A_CIRC, + LOW_C_CEDI, + LOW_G_BREV, + LOW_I_CIRC, + LOW_I_DOTL, + LOW_I_DOTT, + LOW_O_DIAE, + LOW_S_CEDI, + LOW_U_CIRC, + LOW_U_DIAE, + ELLIPSIS, + PLANCK_CON, + ANGSTROM, + MATHPI, + BITCOIN, + UPC_ALPHA, + UPC_BETA, + UPC_GAMMA, + UPC_DELTA, + UPC_EPSILON, + UPC_ZETA, + UPC_ETA, + UPC_THETA, + UPC_IOTA, + UPC_KAPPA, + UPC_LAMBDA, + UPC_MU, + UPC_NU, + UPC_XI, + UPC_OMICRON, + UPC_PI, + UPC_RHO, + UPC_SIGMA, + UPC_TAU, + UPC_UPSILON, + UPC_PHI, + UPC_CHI, + UPC_PSI, + UPC_OMEGA, + LOW_ALPHA, + LOW_BETA, + LOW_GAMMA, + LOW_DELTA, + LOW_EPSILON, + LOW_ZETA, + LOW_ETA, + LOW_THETA, + LOW_IOTA, + LOW_KAPPA, + LOW_LAMBDA, + LOW_MU, + LOW_NU, + LOW_XI, + LOW_OMICRON, + LOW_PI, + LOW_RHO, + LOW_SIGMA, + LOW_TAU, + LOW_UPSILON, + LOW_PHI, + LOW_CHI, + LOW_PSI, + LOW_OMEGA, +}; +#endif + +// Tap dance stuff +#ifdef TAP_DANCE_ENABLE +enum { + #ifdef AUDIO_ENABLE + TD_AUDIO_TEMPO, + #endif + TD_BIGSWITCH, +}; +#endif diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c new file mode 100644 index 00000000000..89208f363f3 --- /dev/null +++ b/users/bbaserdem/bb-oled.c @@ -0,0 +1,162 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-oled.h" +//#include +/* ROTARY ENCODER + * This contains my general rotary encoder code + * Encoders each have a list of different modes they can be in. + * Each mode also have an on click action as well. + * Modes can be cycled using either shift-click or ctrl-click + * Modes can be reset using OS click + * Some modes are only accessible through some keymap layers + */ + +// Following line imports reading of RGB settings +#if defined RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; +#elif defined RGB_MATRIX_ENABLE +extern rgb_config_t rgb_matrix_config; +#endif + +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(qmk_logo, false); +} + +static void render_status(void) { + // Function to print state information + uint8_t this_layer = get_highest_layer(layer_state); + uint8_t this_mod = get_mods(); + #if defined WPM_ENABLE + static char temp[4] = {0}; + #endif + + // Line 1: Layer State + oled_write_P(PSTR("Layer: "), false); + switch (this_layer) { + case _BASE: + oled_write_P(PSTR("Default\n"), false); + break; + case _CHAR: + oled_write_P(PSTR("Sp. Chars\n"), false); + break; + case _GAME: + oled_write_P(PSTR("Gaming\n"), false); + break; + case _MEDI: + oled_write_P(PSTR("Media Ctr\n"), false); + break; + case _NAVI: + oled_write_P(PSTR("Navigation\n"), false); + break; + case _SYMB: + oled_write_P(PSTR("Symbols\n"), false); + break; + case _NUMB: + oled_write_P(PSTR("Numpad\n"), false); + break; + case _FUNC: + oled_write_P(PSTR("Funct Keys\n"), false); + break; + case _MOUS: + oled_write_P(PSTR("Mouse Keys\n"), false); + break; + case _MUSI: + oled_write_P(PSTR("Music Mode\n"), false); + break; + default: + oled_write_P(PSTR("???\n"), false); + } + + // Line 2: Mod or info + switch (this_layer) { + // Show RGB mode as an overlay +#if defined RGBLIGHT_ENABLE + case _MEDI: + oled_write_P(PSTR("m:"), false); + itoa(rgblight_config.mode, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" h:"), false); + itoa(rgblight_config.hsv.h, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" s:"), false); + itoa(rgblight_config.hsv.s, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" v:"), false); + itoa(rgblight_config.hsv.v, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR("\n"), false); + break; +#elif defined RGB_MATRIX_ENABLE + case _MEDI: + oled_write_P(PSTR("m"), false); + itoa(rgb_matrix_config.mode, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" h"), false); + itoa(rgb_matrix_config.hsv.h, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" s"), false); + itoa(rgb_matrix_config.hsv.s, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" v"), false); + itoa(rgb_matrix_config.hsv.v, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR("\n"), false); + break; +#endif + // Show the modifier if nothing else is doing anything + default: + oled_write_P((this_mod & MOD_MASK_SHIFT ) ? PSTR("Shft ") : PSTR(" "), false); + oled_write_P((this_mod & MOD_MASK_CTRL ) ? PSTR("Ctrl ") : PSTR(" "), false); + oled_write_P((this_mod & MOD_MASK_ALT ) ? PSTR("Alt" ) : PSTR(" "), false); + oled_write_P((this_mod & MOD_BIT(KC_RALT)) ? PSTR("G ") : PSTR(" "), false); + oled_write_P((this_mod & MOD_MASK_GUI ) ? PSTR("Meta ") : PSTR(" "), false); + oled_write_P(PSTR("\n"), false); + break; + } + + // Line 3: WPM + oled_write_P(PSTR("KM: Qwerty WPM: "), false); +#if defined WPM_ENABLE + itoa(get_current_wpm(), temp, 10); + oled_write(temp, false); +#else + oled_write_P(PSTR("N/A"), false); +#endif + oled_write_P(PSTR("\n"), false); + + // Line 4: Encoder states +#ifdef ENCODER_ENABLE + oled_write_P(PSTR("EN0:"), false); + oled_encoder_state_5char(0, this_layer); + oled_write_P(PSTR(" EN1:"), false); + oled_encoder_state_5char(1, this_layer); +#endif + oled_write_P(PSTR("\n"), false); + +} + +void oled_task_user(void) { + if (is_keyboard_master()) { + #if defined(KEYBOARD_kyria_rev1) + render_qmk_logo(); + #endif + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_qmk_logo(); + } +} diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h new file mode 100644 index 00000000000..9c38d64078b --- /dev/null +++ b/users/bbaserdem/bb-oled.h @@ -0,0 +1,18 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" + +// Contain the main oled writer here +void oled_task_user(void); diff --git a/users/bbaserdem/bb-underglow.c b/users/bbaserdem/bb-underglow.c new file mode 100644 index 00000000000..937e3007591 --- /dev/null +++ b/users/bbaserdem/bb-underglow.c @@ -0,0 +1,113 @@ +/* +Copyright 2020 Batuhan Başerdem @bbaserdem +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 "bb-underglow.h" +/* UNDERGLOW IMPLEMENTATION + */ + +// Define the layer switching code + +// An empty layer on the base +const rgblight_segment_t PROGMEM bb_base_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 0, HSV_WHITE} +); +// Gaming layer is turquoise +const rgblight_segment_t PROGMEM bb_game_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_TURQUOISE} +); +// Character overlay is chartereuse +const rgblight_segment_t PROGMEM bb_char_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, RGBLED_NUM, HSV_CHARTREUSE} +); + +// Right-hand layers + +// Media layer is orange +const rgblight_segment_t PROGMEM bb_medi_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, 30, 255, 255 + } +); +// Navigation layer is green +const rgblight_segment_t PROGMEM bb_navi_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_GREEN} +); +// Symbol layer is purple +const rgblight_segment_t PROGMEM bb_symb_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_PURPLE} +); + +// Left-hand layers + +// Number layer is blue +const rgblight_segment_t PROGMEM bb_numb_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_CYAN} +); +// Function layer is red +const rgblight_segment_t PROGMEM bb_func_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_RED} +); +// Pointer layer is yellow +const rgblight_segment_t PROGMEM bb_mous_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_YELLOW} +); + +// Music playback layer is magenta +const rgblight_segment_t PROGMEM bb_musi_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, RGBLED_NUM, HSV_MAGENTA} +); + +const rgblight_segment_t* const PROGMEM bb_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + bb_base_layer, + bb_char_layer, + bb_game_layer, + bb_medi_layer, + bb_navi_layer, + bb_symb_layer, + bb_numb_layer, + bb_func_layer, + bb_mous_layer, + bb_musi_layer +); + +// Enable the LED switching layers +void keyboard_post_init_underglow(void) { + rgblight_layers = bb_rgb_layers; + // Default rgb mode is rainbow swirl; set this + rgblight_sethsv_noeeprom(100, 255, 255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL + 0); +} + +// Set RGBLIGHT state depending on layer +layer_state_t layer_state_set_underglow(layer_state_t state) { + // Activate layers if on that region + rgblight_set_layer_state(_BASE, layer_state_cmp(state, _BASE)); + rgblight_set_layer_state(_GAME, layer_state_cmp(state, _GAME)); + rgblight_set_layer_state(_CHAR, layer_state_cmp(state, _CHAR)); + rgblight_set_layer_state(_MEDI, layer_state_cmp(state, _MEDI)); + rgblight_set_layer_state(_NAVI, layer_state_cmp(state, _NAVI)); + rgblight_set_layer_state(_SYMB, layer_state_cmp(state, _SYMB)); + rgblight_set_layer_state(_NUMB, layer_state_cmp(state, _NUMB)); + rgblight_set_layer_state(_FUNC, layer_state_cmp(state, _FUNC)); + rgblight_set_layer_state(_MOUS, layer_state_cmp(state, _MOUS)); + rgblight_set_layer_state(_MUSI, layer_state_cmp(state, _MUSI)); + // Return so other stuff can be done + return state; +} + +// Hook into shutdown code +void shutdown_underglow(void) { + // Make the LED's red on shutdown + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv(HSV_PINK); +} diff --git a/users/bbaserdem/bb-underglow.h b/users/bbaserdem/bb-underglow.h new file mode 100644 index 00000000000..61b66efdf9e --- /dev/null +++ b/users/bbaserdem/bb-underglow.h @@ -0,0 +1,24 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* UNDERGLOW IMPLEMENTATION + */ + +// Used to initialize layer switching overlay +void keyboard_post_init_underglow(void); +// Used to change RGB underglow layers on keymap layer change +layer_state_t layer_state_set_underglow(layer_state_t state); +// Hook into shutdown to show effect on shutdown +void shutdown_underglow(void); diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c new file mode 100644 index 00000000000..f28342ddb5c --- /dev/null +++ b/users/bbaserdem/bbaserdem.c @@ -0,0 +1,224 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bbaserdem.h" +// Language imports +#include + +/*---------------------------*\ +|*-----KEYBOARD PRE INIT-----*| +\*---------------------------*/ +/* This code runs before anything is started. + * Good for early hardware setup + */ +__attribute__ ((weak)) void keyboard_pre_init_keymap(void) {} +__attribute__ ((weak)) void keyboard_pre_init_user(void) { + // Keymap specific stuff + keyboard_pre_init_keymap(); +} + +/*---------------------*\ +|*-----MATRIX INIT-----*| +\*---------------------*/ +/* This code runs once midway thru the firmware process. + * So far, sets the base layer and fixes unicode mode + */ +__attribute__ ((weak)) void matrix_init_keymap(void) {} +void matrix_init_user (void) { + // Keymap specific things + matrix_init_keymap(); +} + +/*----------------------------*\ +|*-----KEYBOARD POST INIT-----*| +\*----------------------------*/ +/* This code runs after anything is started. + * Good for late hardware setup, like setting up layer specifications + */ +__attribute__ ((weak)) void keyboard_post_init_keymap(void) {} +__attribute__ ((weak)) void keyboard_post_init_user(void) { + // Fix beginning base layer, in case some other firmware was flashed + // set_single_persistent_default_layer(_BASE); + + // Backlight LED + #ifdef BACKLIGHT_ENABLE + keyboard_post_init_backlight(); + #endif + + // RGB underglow + #ifdef RGBLIGHT_ENABLE + keyboard_post_init_underglow(); + #endif + + // Encoders + #ifdef ENCODER_ENABLE + keyboard_post_init_encoder(); + #endif + + // Unicode mode + #ifdef UNICODEMAP_ENABLE + set_unicode_input_mode(UC_LNX); + #endif + + // Keymap specific stuff + keyboard_post_init_keymap(); +} + +/*-----------------------*\ +|*-----EECONFIG INIT-----*| +\*-----------------------*/ +/* Default values to send to the eeprom on boot. + */ +__attribute__ ((weak)) void eeconfig_init_keymap(void) {} +void eeconfig_init_user(void) { + // Hook to keymap code + eeconfig_init_keymap(); +} + +/*------------------------*\ +|*-----PROCESS RECORD-----*| +\*------------------------*/ +/* Process record: custom keycodes to process here + * Allow also the following codes to hook here as well; + * Macro definitions + * Audio hooks + */ +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +bool process_record_audio(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +bool process_record_macro(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { + return true; +} +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // Return after running through all individual hooks + return + process_record_keymap(keycode, record) && + process_record_audio(keycode, record) && + process_record_encoder(keycode, record) && + process_record_macro(keycode, record); +} + +/*---------------------*\ +|*-----MATRIX SCAN-----*| +\*---------------------*/ +/* This code runs every frame + * I used to check for layer switching here, but layer state is better used. + * Try to not put anything here; as it runs hundreds time per second-ish + */ +__attribute__ ((weak)) void matrix_scan_keymap(void) { } +void matrix_scan_user (void) { + // Keymap specific scan function + matrix_scan_keymap(); +} + +/*---------------------*\ +|*-----LAYER STATE-----*| +\*---------------------*/ +/* This code runs after every layer change + * State represents the new layer state. + */ +__attribute__ ((weak)) +layer_state_t layer_state_set_keymap (layer_state_t state) { + return state; +} +layer_state_t layer_state_set_user(layer_state_t state) { + // Keymap layer state setting + state = layer_state_set_keymap(state); + // For underglow stuff + #ifdef RGBLIGHT_ENABLE + layer_state_set_underglow(state); + #endif + // Audio playback + #ifdef AUDIO_ENABLE + layer_state_set_audio(state); + #endif + + return state; +} + +/*-----------------------------*\ +|*-----DEFAULT LAYER STATE-----*| +\*-----------------------------*/ +/* This code runs after every time default base layer is changed + */ +__attribute__ ((weak)) +layer_state_t default_layer_state_set_keymap (layer_state_t state) { + return state; +} +layer_state_t default_layer_state_set_user(layer_state_t state) { + // Keymap level code + state = default_layer_state_set_keymap(state); + return state; +} + +/*------------------------*\ +|*-----LED SET KEYMAP-----*| +\*------------------------*/ +/* Code for LED indicators + * I'm not sure when exactly does this code run + */ +__attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) {} +void led_set_user(uint8_t usb_led) { + led_set_keymap(usb_led); +} + +/*-----------------*\ +|*-----SUSPEND-----*| +\*-----------------*/ +/* Suspend stuff here, mostly for the rgb lighting. + */ +__attribute__ ((weak)) void suspend_power_down_keymap (void) { } +void suspend_power_down_user(void) { + suspend_power_down_keymap(); + // RGB matrix sleep hook + #ifdef RGB_MATRIX_ENABLE + suspend_power_down_keylight(); + #endif +} +__attribute__ ((weak)) void suspend_wakeup_init_keymap (void) { } +void suspend_wakeup_init_user(void) { + suspend_wakeup_init_keymap(); + // RGB matrix sleep hook + #ifdef RGB_MATRIX_ENABLE + suspend_wakeup_init_keylight(); + #endif +} + +/*------------------*\ +|*-----SHUTDOWN-----*| +\*------------------*/ +/* Shutdown stuff here; for when entering bootmode. + */ +__attribute__ ((weak)) void shutdown_keymap (void) { } +void shutdown_user(void) { + // Underglow LED hook on boot + #ifdef RGBLIGHT_ENABLE + shutdown_underglow(); + #endif + // Perkey led hook on boot + #ifdef RGB_MATRIX_ENABLE + shutdown_keylight(); + #endif + // Keymap hooks + shutdown_keymap(); +} diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h new file mode 100644 index 00000000000..dc58ab79018 --- /dev/null +++ b/users/bbaserdem/bbaserdem.h @@ -0,0 +1,484 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include QMK_KEYBOARD_H + +/* Besides loading libraries and definitions, this file has my layout defs + * LAYOUTS: + * This file has a couple layouts I use; so that the general changes can be + * propagated by only editing this file. + */ + +// Macros to use, this has base level code so not affected by enabled features +#include "bb-macro.h" +// Audio from onboard speakers +#ifdef AUDIO_ENABLE + #include "bb-audio.h" +#endif +// Underglow using rgb LEDs +#ifdef RGBLIGHT_ENABLE + #include "bb-underglow.h" +#endif +// Keycap backlight using non-rgb LEDs +#ifdef BACKLIGHT_ENABLE + #include "bb-backlight.h" +#endif +// Keycap backlight using rgb LEDs +#ifdef RGB_MATRIX_ENABLE + #include "bb-keylight.h" +#endif +// Rotary encoder +#ifdef ENCODER_ENABLE + #include "bb-encoder.h" +#endif +// Oled screen +#ifdef OLED_DRIVER_ENABLE + #include "bb-oled.h" +#endif + +// Function definitions that can be accessed through specific keymaps +// Runs before all initialization +void keyboard_pre_init_keymap(void); +// For code that launches once midway through initialization +void matrix_init_keymap(void); +// For code that launches after initialization is finished. +void keyboard_post_init_keymap(void); +// This code also launches on boot; but used after eeprom is available to write +void eeconfig_init_keymap(void); +// These will be delegated to keymap specific stuff (weak definition) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +// This code runs on every tick +void matrix_scan_keymap(void); +// This code runs after every layer change +layer_state_t layer_state_set_keymap(layer_state_t state); +// This code runs when the default layer changes +layer_state_t default_layer_state_set_keymap (layer_state_t state); +// This code runs to set LED states +void led_set_keymap(uint8_t usb_led); +// For code that runs on suspend +void suspend_power_down_keymap(void); +void suspend_wakeup_init_keymap(void); +// For code that runs on powerdown +void shutdown_keymap(void); + +// Make it so that keymaps can use KEYMAP_SAFE_RANGE for custom keycodes +#if defined(KEYMAP_SAFE_RANGE) + #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else + #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + +// Custom macro keycode ranges +enum userspace_custom_keycodes { + // Safe stuff + BB_SAFE = PLACEHOLDER_SAFE_RANGE, + // Double entry macros + DBL_ANG, + DBL_PAR, + DBL_CBR, + DBL_BRC, + // Macro key + BB_PGPK, + // Unicode strings + #ifdef UNICODEMAP_ENABLE + BB_LENY, + BB_TABL, + TR_FLAG, + #endif + // Encoder buttons + #ifdef ENCODER_ENABLE + BB_ENC0, + BB_ENC1, + #endif + //use for keymap specific codes + KEYMAP_SAFE_RANGE +}; +// Mask these keycodes if required features are not enabled +#ifndef UNICODEMAP_ENABLE +#define BB_LENY KC_NO +#define BB_TABL KC_NO +#define TR_FLAG KC_NO +#endif +#ifndef ENCODER_ENABLE +#define BB_ENC0 KC_NO +#define BB_ENC1 KC_NO +#endif + +/// Enumerate of layers +enum userspace_layers { + _BASE = 0, // Base layer + _CHAR, // Characters layer + _GAME, // Game layer + _MEDI, // R3: Media layer + _NAVI, // R3: Navigation layer + _SYMB, // R1: Symbols layer + _NUMB, // L1: Numbers layer + _FUNC, // L2: Function keys layer + _MOUS, // L3: Mouse keys layer + _MUSI // Music overlay +}; + +// Use 7 wide characters for keymaps, to keep things aligned with 4 tabs +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// These defines allow multiple multi-parameter definitions to expand +// for these boards +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) +#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) +#define LAYOUT_ortho_3x10_wrapper(...) LAYOUT_ortho_3x10(__VA_ARGS__) +#define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__) +#define LAYOUT_split_3x5_3_wrapper(...) LAYOUT_split_3x5_3(__VA_ARGS__) + +// Masks +#define ___1___ _______ +#define ___2___ _______,_______ +#define ___3___ _______,_______,_______ +#define ___4___ _______,_______,_______,_______ +#define ___5___ _______,_______,_______,_______,_______ +#define ___6___ _______,_______,_______,_______,_______,_______ +#define xxx1xxx KC_NO +#define xxx2xxx KC_NO, KC_NO +#define xxx3xxx KC_NO, KC_NO, KC_NO +#define xxx4xxx KC_NO, KC_NO, KC_NO, KC_NO +#define xxx5xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define xxx6xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define xxx1xxx KC_NO +#define xxx3xxx KC_NO, KC_NO, KC_NO +#define xxx5xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define xxx6xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + +// Quick macros: in dvorak +#define BB_UNDO LCTL(KC_SLSH) // Ctrl + Z +#define BB_REDO LCTL(KC_T) // Ctrl + Y +#define BB_YANK LCTL(KC_I) // Ctrl + C +#define BB_CUT LCTL(KC_B) // Ctrl + X +#define BB_PSTE LCTL(KC_DOT) // Ctrl + V + +// Audio keys +#ifdef AUDIO_ENABLE +#define MU_REC KC_LCTL +#define MU_STOP KC_LALT +#define MU_PLAY KC_LGUI +#define MU_FAST KC_UP +#define MU_SLOW KC_DOWN +#define MU_MASK KC_A +#define BB_SND MU_ON +#ifdef TAP_DANCE_ENABLE +#define MU_TEMP TD(TD_AUDIO_TEMPO) +#else +#define MU_TEMP KC_DOWN +#endif +#else +#define MU_REC KC_NO +#define MU_STOP KC_NO +#define MU_PLAY KC_NO +#define MU_FAST KC_NO +#define MU_TEMP KC_NO +#define MU_SLOW KC_NO +#define MU_MASK KC_NO +#define BB_SND KC_MUTE +#endif + +// Unicode keys +#ifdef UNICODEMAP_ENABLE +#define TR_ACIR XP(LOW_A_CIRC, UPC_A_CIRC ) +#define TR_CCED XP(LOW_C_CEDI, UPC_C_CEDI ) +#define TR_GBRE XP(LOW_G_BREV, LOW_G_BREV ) +#define TR_ICIR XP(LOW_I_CIRC, LOW_I_CIRC ) +#define TR_I_NO XP(LOW_I_DOTL, LOW_I_DOTL ) +#define TR_IDOT XP(LOW_I_DOTT, LOW_I_DOTT ) +#define TR_ODIA XP(LOW_O_DIAE, LOW_O_DIAE ) +#define TR_SCED XP(LOW_S_CEDI, LOW_S_CEDI ) +#define TR_UCIR XP(LOW_U_CIRC, LOW_U_CIRC ) +#define TR_UDIA XP(LOW_U_DIAE, LOW_U_DIAE ) +#define GR_ALP XP(LOW_ALPHA, UPC_ALPHA ) +#define GR_BET XP(LOW_BETA, UPC_BETA ) +#define GR_GAM XP(LOW_GAMMA, UPC_GAMMA ) +#define GR_DEL XP(LOW_DELTA, UPC_DELTA ) +#define GR_EPS XP(LOW_EPSILON,UPC_EPSILON) +#define GR_ZET XP(LOW_ZETA, UPC_ZETA ) +#define GR_ETA XP(LOW_ETA, UPC_ETA ) +#define GR_THE XP(LOW_THETA, UPC_THETA ) +#define GR_IOT XP(LOW_IOTA, UPC_IOTA ) +#define GR_KAP XP(LOW_KAPPA, UPC_KAPPA ) +#define GR_LAM XP(LOW_LAMBDA, UPC_LAMBDA ) +#define GR_MU XP(LOW_MU, UPC_MU ) +#define GR_NU XP(LOW_NU, UPC_NU ) +#define GR_XI XP(LOW_XI, UPC_XI ) +#define GR_OMI XP(LOW_OMICRON,UPC_OMICRON) +#define GR_PI XP(LOW_PI, UPC_PI ) +#define GR_RHO XP(LOW_RHO, UPC_RHO ) +#define GR_SIG XP(LOW_SIGMA, UPC_SIGMA ) +#define GR_TAU XP(LOW_TAU, UPC_TAU ) +#define GR_UPS XP(LOW_UPSILON,UPC_UPSILON) +#define GR_PHI XP(LOW_PHI, UPC_PHI ) +#define GR_CHI XP(LOW_CHI, UPC_CHI ) +#define GR_PSI XP(LOW_PSI, UPC_PSI ) +#define GR_OME XP(LOW_OMEGA, UPC_OMEGA ) +#define BB_ELLI X(ELLIPSIS) +#define BB_PLNK X(PLANCK_CON) +#define BB_ANGS X(ANGSTROM) +#define BB_BITC X(BITCOIN) +#else +#define TR_ACIR KC_A +#define TR_CCED KC_C +#define TR_GBRE KC_G +#define TR_ICIR KC_I +#define TR_I_NO KC_I +#define TR_IDOT KC_I +#define TR_ODIA KC_O +#define TR_SCED KC_S +#define TR_UCIR KC_U +#define TR_UDIA KC_U +#define GR_ALP KC_NO +#define GR_BET KC_NO +#define GR_GAM KC_NO +#define GR_DEL KC_NO +#define GR_EPS KC_NO +#define GR_ZET KC_NO +#define GR_ETA KC_NO +#define GR_THE KC_NO +#define GR_IOT KC_NO +#define GR_KAP KC_NO +#define GR_LAM KC_NO +#define GR_MU KC_NO +#define GR_NU KC_NO +#define GR_XI KC_NO +#define GR_OMI KC_NO +#define GR_PI KC_NO +#define GR_RHO KC_NO +#define GR_SIG KC_NO +#define GR_TAU KC_NO +#define GR_UPS KC_NO +#define GR_PHI KC_NO +#define GR_CHI KC_NO +#define GR_PSI KC_NO +#define GR_OME KC_NO +#define BB_ELLI KC_NO +#define BB_PLNK KC_NO +#define BB_ANGS KC_NO +#define BB_BITC KC_NO +#endif + +// MOD-tap definitions +#define GUI_A MT(MOD_LGUI, KC_A) +#define ALT_S MT(MOD_LALT, KC_S) +#define CTRL_D MT(MOD_LCTL, KC_D) +#define SHIFT_F MT(MOD_LSFT, KC_F) +#define ALTGR_X MT(MOD_RALT, KC_X) +#define GUI_SCL MT(MOD_RGUI, KC_SCLN) +#define ALT_L MT(MOD_LALT, KC_L) +#define CTRL_K MT(MOD_LCTL, KC_K) +#define SHIFT_J MT(MOD_LSFT, KC_J) +#define ALTGR_D MT(MOD_RALT, KC_DOT) + +// Layer switches +#define MED_DEL LT(_MEDI, KC_DEL ) +#define NAV_TAB LT(_NAVI, KC_TAB ) +#define SYM_SPC LT(_SYMB, KC_SPC ) +#define NUM_ENT LT(_NUMB, KC_ENT ) +#define FUN_ESC LT(_FUNC, KC_ESC ) +#define MOU_BSP LT(_MOUS, KC_BSPC) + +// Layer switches +#define BB_CHAR OSL(_CHAR) +#define BB_GAME TG(_GAME) +#define BB_BIGS TD(TD_BIGSWITCH) + +/* Base layout; (shown in DVORAK) + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * │ ' " │ , < │ . > │ P │ Y │ / ? = + │ F │ G │ C │ R │ L │ + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * │ A │ O │ E │ U │ I │ \ | - _ │ D │ H │ T │ N │ S │ + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ + * │ ; : │ Q │ J │ K │ X │ ` ~ < > │ B │ M │ W │ V │ Z │ + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ + * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ + * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ + * The thing about this layout is that these will fit most boards I have. + */ +#define _BL1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _BR1_5_ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _BL2_5_ GUI_A, ALT_S, CTRL_D, SHIFT_F,KC_G +#define _BR2_5_ KC_H, SHIFT_J,CTRL_K, ALT_L, GUI_SCL +#define _BL3_5_ KC_Z, ALTGR_X,KC_C, KC_V, KC_B +#define _BR3_5_ KC_N, KC_M, KC_COMM,ALTGR_D,KC_SLSH +#define _BL4_3_ MED_DEL,NAV_TAB,SYM_SPC +#define _BR4_3_ NUM_ENT,FUN_ESC,MOU_BSP +// The extra line for the 6th (or 0th) row +#define _BL1_1_ KC_LBRC +#define _BR1_1_ KC_RBRC +#define _BL2_1_ KC_BSLS +#define _BR2_1_ KC_QUOT +#define _BL3_1_ KC_GRV +#define _BR3_1_ KC_NUBS + +/* + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * │ α │ ο │ ε │ ψ │ ι │ │ δ │ η │ τ │ ν │ σ │ + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * │ ₿ │ θ │ ℏ │ κ │ ξ │ │ β │ μ │ ω │ Å │ ζ │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │ Shf │ ... │ GPG │ │ │ │ Shf │ + * └─────┴─────┴─────┘ └─────┴─────┴─────┘ + * Extra characters layer + */ +#define _CL1_5_ TR_FLAG,BB_LENY,BB_TABL,GR_PI, GR_UPS +#define _CR1_5_ GR_PHI, GR_GAM, GR_CHI, GR_RHO, GR_LAM +#define _CL2_5_ GR_ALP, GR_OMI, GR_EPS, GR_PSI, GR_IOT +#define _CR2_5_ GR_DEL, GR_ETA, GR_TAU, GR_NU, GR_SIG +#define _CL3_5_ BB_BITC,GR_THE, BB_PLNK,GR_KAP, GR_XI +#define _CR3_5_ GR_BET, GR_MU, GR_OME, BB_ANGS,GR_ZET +#define _CL4_3_ KC_RSFT,BB_ELLI,BB_PGPK +#define _CR4_3_ XXXXXXX,XXXXXXX,KC_LSFT + +/* Game layer; just assume dvorak here + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ Q │ W │ E │ R │ T │ ` ~ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ A │ S │ D │ F │ G │ Tab + * ├─────┼─────┼─────┼─────┼─────┤ + * │ Z │ X │ C │ V │ B │Shift + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │Space│Enter│ Esc │ + * └─────┴─────┴─────┘ + */ +#define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _GA1_1_ KC_GRV +#define _GA2_5_ KC_A, KC_S, KC_D, KC_F, KC_G +#define _GA2_1_ KC_TAB +#define _GA3_5_ KC_Z, KC_X, KC_C, KC_V, KC_B +#define _GA3_1_ KC_LSFT +#define _GA4_3_ KC_SPC, KC_ENT, KC_ESC + +/* Media layer + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ Tog │ Mod │ Hue │ Sat │ Bri │ RGB + * ├─────┼─────┼─────┼─────┼─────┤ + * │Prev.│VolDn│VolUp│Next │ Mut │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ Tog │Brth.│ Val │RgbSp│Veloc│ Led + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Sink │ Tog │Music│ + * └─────┴─────┴─────┘ + */ +#define _ME1_5_ RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI +#define _ME2_5_ KC_MPRV,KC_VOLD,KC_VOLU,KC_MNXT,KC_MUTE +#define _ME3_5_ BL_TOGG,BL_BRTG,BL_STEP,RGB_SPD,VLK_TOG +#define _ME4_3_ KC_F13, KC_MPLY,MU_TOG + +/* Navigation layer + * ┌─────┬─────┬─────┬─────┬─────┐ + * │Redo │Paste│Yank │ Cut │PrScr│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │Undo │ < │ v │ ^ │ > │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ Ins │Home │PgDwn│PgUp │ End │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ + */ +#define _NA1_5_ BB_REDO,BB_PSTE,BB_YANK,BB_CUT, KC_PSCR +#define _NA2_5_ BB_UNDO,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT +#define _NA3_5_ KC_INS, KC_HOME,KC_PGDN,KC_PGUP,KC_END +#define _NA4_3_ KC_ENT, KC_ESC, KC_BSPC + +/* Symbols layer (in DVORAK) + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ ` ~ │ [ │ ] │ = + │CpsLk│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ / ? │ ( │ ) │ - _ │CharL│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ \ | │ { │ } │ < │ > │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ + */ +#define _SY1_5_ KC_GRV,KC_MINS,KC_EQL, KC_RBRC,BB_CHAR +#define _SY2_5_ KC_LBRC,KC_LPRN,KC_RPRN,KC_QUOT,KC_CAPS +#define _SY3_5_ KC_BSLS,KC_UNDS,KC_PLUS,KC_NUBS,LSFT(KC_NUBS) +#define _SY4_3_ KC_ENT, KC_ESC, KC_BSPC + +/* Numbers layer (in DVORAK) + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ , │ 7 & │ 8 * │ 9 ( │ 0 ) │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ . │ 4 $ │ 5 % │ 6 ^ │ - _ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ / ? │ 1 ! │ 2 @ │ 3 # │ = + │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ + */ +#define _NU1_5_ KC_W, KC_7, KC_8, KC_9, KC_0 +#define _NU2_5_ KC_E, KC_4, KC_5, KC_6, KC_QUOT +#define _NU3_5_ KC_LBRC,KC_1, KC_2, KC_3, KC_RBRC +#define _NU4_3_ KC_DEL, KC_TAB, KC_SPC + +/* Function layer + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ F01 │ F02 │ F03 │ F04 │RESET│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ F05 │ F06 │ F07 │ F08 │EEPRM│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ F09 │ F10 │ F11 │ F12 │GameL│ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ + */ +#define _FU1_5_ KC_F1, KC_F2, KC_F3, KC_F4, RESET +#define _FU2_5_ KC_F5, KC_F6, KC_F7, KC_F8, EEP_RST +#define _FU3_5_ KC_F9, KC_F10, KC_F11, KC_F12, BB_GAME +#define _FU4_3_ KC_DEL, KC_TAB, KC_SPC + +/* Mouse layer + * ┌─────┬─────┬─────┬─────┬─────┐ + * │Slow │Right│ Mid │ Lft │Fast │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ |<| │ |v| │ |^| │ |>| │ Bt4 │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ <<< │ vvv │ ^^^ │ >>> │ Bt5 │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ + */ +#define _MO1_5_ KC_ACL0,KC_BTN1,KC_BTN2,KC_BTN3,KC_ACL2 +#define _MO2_5_ KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,KC_BTN4 +#define _MO3_5_ KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,KC_BTN5 +#define _MO4_3_ KC_DEL, KC_TAB, KC_SPC + +/* Music layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * └───┴───┴───┼───┼───┼───┼───┼───┼───┼───┴───┴───┘ + * │Rec│Stp│Ply│Tmp│Mod│Off│ + * └───┴───┴───┴───┴───┴───┘ + */ +#define _MUL_3_ MU_REC, MU_STOP,MU_PLAY +#define _MUR_3_ MU_TEMP,MU_MOD, MU_TOG +#define _MU_01_ MU_MASK +#define _MU_02_ MU_MASK,MU_MASK +#define _MU_03_ MU_MASK,MU_MASK,MU_MASK +#define _MU_06_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK +#define _MU_08_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK +#define _MU_10_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK +#define _MU_12_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h new file mode 100644 index 00000000000..152042a2547 --- /dev/null +++ b/users/bbaserdem/config.h @@ -0,0 +1,139 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +/* CONFIG + * Common hardware configuration accross my boards + */ +// Space saving +#ifdef LOCKING_SUPPORT_ENABLE +# undef LOCKING_SUPPORT_ENABLE +#endif +#ifdef LOCKING_RESYNC_ENABLE +# undef LOCKING_RESYNC_ENABLE +#endif +#ifndef NO_DEBUG +#define NO_DEBUG +#endif + +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif +// Unicode entry mode +#ifdef UNICODEMAP_ENABLE + #define UNICODE_SELECTED_MODES UC_LNX + // Adapt the unicode entry mode to dvorak + #ifdef UNICODE_KEY_LNX + #undef UNICODE_KEY_LNX + #endif + #define UNICODE_KEY_LNX LCTL(LSFT(KC_F)) +#endif + +// Mousekey mode +#ifdef MOUSEKEY_ENABLE + #define MK_COMBINED +#endif + +// Tap-hold settings +#define TAPPING_TERM 200 +#define TAP_CODE_DELAY 20 +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define TAPPING_FORCE_HOLD + +// Encoder settings +#ifdef ENCODER_ENABLE + #define ENCODER_RESOLUTION 2 +#endif + +// Backlight settings +#ifdef BACKLIGHT_ENABLE + // Turn on breathing only if audio is not enabled, due to hardware stuff + #ifndef AUDIO_ENABLE + #define BACKLIGHT_BREATHING + #define BREATHING_PERIOD 5 + #endif +#endif + +// Enable RGB LED sleep mode +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #define RGB_DISABLE_WHEN_USB_SUSPENDED true +#endif + +// Audio definitions +#ifdef AUDIO_ENABLE + // Make findable songs as defaults + #ifdef HOROLOGY + #define STARTUP_SONG SONG(HOROLOGY) + #endif + #ifdef PEOPLE_VULTURES + #define GOODBYE_SONG SONG(PEOPLE_VULTURES) + #endif + #ifdef NONAGON_INFINITY + #define MUSIC_ON_SONG SONG(NONAGON_INFINITY) + #endif + #ifdef WAH_WAH + #define MUSIC_OFF_SONG SONG(WAH_WAH) + #endif + // Audio code expects these to be defined + #ifdef BIG_FIG_WASP + #define GAME_ON_SONG SONG(BIG_FIG_WASP) + #else + #define GAME_ON_SONG SONG(USSR_ANTHEM) + #endif + #ifdef POLYGONDWANALAND + #define GAME_OFF_SONG SONG(POLYGONDWANALAND) + #else + #define GAME_OFF_SONG SONG(NOCTURNE_OP_9_NO_1) + #endif +#endif + +// For underglow light +#ifdef RGBLIGHT_ENABLE + // Enable animations + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_TWINKLE + // Enable layer switching code + #define RGBLIGHT_LAYERS + #define RGBLIGHT_MAX_LAYERS 10 + #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF + // If these are not defined; just default to entire board for layer + #define RGBLIGHT_LEFT_BEG 0 + #define RGBLIGHT_LEFT_NUM RGBLED_NUM + #define RGBLIGHT_RIGHT_BEG 0 + #define RGBLIGHT_RIGHT_NUM RGBLED_NUM +#endif + +// For perkey leds +#ifdef RGB_MATRIX_ENABLE + // Start using this mode + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON + #define RGB_MATRIX_STARTUP_HUE 100 + #define RGB_MATRIX_STARTUP_SAT 255 + #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS + // Some config options + #define RGB_MATRIX_KEYPRESSES + #define RGB_MATRIX_KEYRELEASES + // Disable some animation modes + #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT + #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL + #define DISABLE_RGB_MATRIX_BAND_RAINDROPS + #define DISABLE_RGB_MATRIX_BAND_JELLYBEAN_RAINDROPS + #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE + #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS + #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS + #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk new file mode 100644 index 00000000000..1f7129c53be --- /dev/null +++ b/users/bbaserdem/rules.mk @@ -0,0 +1,83 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Common compilation flags +EXTRAFLAGS += -flto # Used to make code smaller +LTO_ENABLE = yes + +# These should be enabled in all boards +MOUSEKEY_ENABLE = yes # Mouse emulation keys +EXTRAKEY_ENABLE = yes # OS signals like volume control +UNICODEMAP_ENABLE = yes # Used for unicode character emulation +KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general +TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold +VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed +WPM_ENABLE = no # Get WPM reports as you type + +# These should be disabled in all boards +BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed +CONSOLE_ENABLE = no # Allows console output with a command +COMMAND_ENABLE = no # Some bootmagic thing i dont use +SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. +NKRO_ENABLE = no # Default is 6KRO which is plenty +MIDI_ENABLE = no # Midi driver (untested) +UNICODE_ENABLE = no # We use unicodemap, not unicode +UCIS_ENABLE = no # We use unicodemap, not ucis +FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? +VARIABLE_TRACE = no # Allows debugging variables +API_SYSEX_ENABLE = no # Allows OS to send signals. + +# Manually configure these on each keyboard individually +# BLUETOOTH_ENABLE # For bluetooth +# AUDIO_ENABLE # Audio stuff +# BACKLIGHT_ENABLE # Switch LEDs +# RGBLIGHT_ENABLE # LED strip +# RGB_MATRIX_ENABLE # Per-key RGB LED +# ENCODER_ENABLE # Rotary encoder + +# Userspace code +SRC += bbaserdem.c + +# Macros +SRC += bb-macro.c + +# Audio code +ifeq ($(strip $(AUDIO_ENABLE)), yes) +SRC += bb-audio.c +endif + +# Rotary encoder stuff +ifeq ($(strip $(ENCODER_ENABLE)), yes) +SRC += bb-encoder.c +endif + +# Backlight code +ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) +SRC += bb-backlight.c +endif + +# RGB LED Underglow code +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) +SRC += bb-underglow.c +endif + +# OLED code +ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) +SRC += bb-oled.c +endif + +# RGB LED (Perkey) code +ifneq ($(strip $(RGB_MATRIX_ENABLE)),) + ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + SRC += bb-keylight.c + endif +endif From 0e6f569cbf9d63945d73a21e122f250e3525cd9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 23:12:23 -0400 Subject: [PATCH 11/94] Changed up keymap a bit --- users/bbaserdem/bbaserdem.h | 139 +++++++++++++++++++++++++++--------- 1 file changed, 106 insertions(+), 33 deletions(-) diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index dc58ab79018..86932808103 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -298,16 +298,42 @@ enum userspace_layers { #define BB_GAME TG(_GAME) #define BB_BIGS TD(TD_BIGSWITCH) -/* Base layout; (shown in DVORAK) - * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * │ ' " │ , < │ . > │ P │ Y │ / ? = + │ F │ G │ C │ R │ L │ - * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * │ A │ O │ E │ U │ I │ \ | - _ │ D │ H │ T │ N │ S │ - * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * │ ; : │ Q │ J │ K │ X │ ` ~ < > │ B │ M │ W │ V │ Z │ - * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ - * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ - * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ +/* Depending on how the layouts change with language; the keys are shown as; + * ┌────────────────────────────────────────────────┐ + * │AltGr -none- Shift Shift+AltGr │ + * └────────────────────────────────────────────────┘ + * If there is an exclamation mark; it indicates that +/* Base layout + * QWERTY + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * [ { │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ ] } + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * \ | │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ' " + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ + * ` ~ │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ < > + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ + * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ + * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ + * DVORAK + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * / ? │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ = + + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * \ | │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ - _ + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ + * ` ~ │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ < > + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ + * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ + * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ + * TURKISH F + * ! !┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * äq Qå│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │~w W + * !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ ! + * `x Xà│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│#ş Şǎ + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ + * ¬+ *±│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │|< >¦ + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ + * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ + * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * The thing about this layout is that these will fit most boards I have. */ #define _BL1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T @@ -326,7 +352,8 @@ enum userspace_layers { #define _BL3_1_ KC_GRV #define _BR3_1_ KC_NUBS -/* +/* Extra characters layer + * This is accessed using unicode; so IBus compatible apps only. * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ @@ -336,7 +363,7 @@ enum userspace_layers { * └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │ Shf │ ... │ GPG │ │ │ │ Shf │ * └─────┴─────┴─────┘ └─────┴─────┴─────┘ - * Extra characters layer + * */ #define _CL1_5_ TR_FLAG,BB_LENY,BB_TABL,GR_PI, GR_UPS #define _CR1_5_ GR_PHI, GR_GAM, GR_CHI, GR_RHO, GR_LAM @@ -347,16 +374,17 @@ enum userspace_layers { #define _CL4_3_ KC_RSFT,BB_ELLI,BB_PGPK #define _CR4_3_ XXXXXXX,XXXXXXX,KC_LSFT -/* Game layer; just assume dvorak here - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ Q │ W │ E │ R │ T │ ` ~ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ A │ S │ D │ F │ G │ Tab - * ├─────┼─────┼─────┼─────┼─────┤ - * │ Z │ X │ C │ V │ B │Shift - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │Space│Enter│ Esc │ - * └─────┴─────┴─────┘ +/* Game layer + * This layer turns off the tap-hold keys for the left half. + * ┌─────┬─────┬─────┬─────┬─────┐ + * ` ~ │ Q │ W │ E │ R │ T │ + * ├─────┼─────┼─────┼─────┼─────┤ + * Tab │ A │ S │ D │ F │ G │ + * ├─────┼─────┼─────┼─────┼─────┤ + * Shift│ Z │ X │ C │ V │ B │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │Space│Enter│ Esc │ + * └─────┴─────┴─────┘ */ #define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T #define _GA1_1_ KC_GRV @@ -368,19 +396,19 @@ enum userspace_layers { /* Media layer * ┌─────┬─────┬─────┬─────┬─────┐ - * │ Tog │ Mod │ Hue │ Sat │ Bri │ RGB + * │ Tog │ Mod │ Hue │ Sat │ Bri │ RGB light control * ├─────┼─────┼─────┼─────┼─────┤ - * │Prev.│VolDn│VolUp│Next │ Mut │ + * │Media│Prev.│MuTog│MuStp│Next │ Media control * ├─────┼─────┼─────┼─────┼─────┤ - * │ Tog │Brth.│ Val │RgbSp│Veloc│ Led + * │Sink │Vol -│ Mut │Eject│Vol +│ Volume control * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Sink │ Tog │Music│ + * │ │Veloc│Music│ Feature control on keyboard * └─────┴─────┴─────┘ */ #define _ME1_5_ RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI -#define _ME2_5_ KC_MPRV,KC_VOLD,KC_VOLU,KC_MNXT,KC_MUTE -#define _ME3_5_ BL_TOGG,BL_BRTG,BL_STEP,RGB_SPD,VLK_TOG -#define _ME4_3_ KC_F13, KC_MPLY,MU_TOG +#define _ME2_5_ KC_MSEL,KC_MPRV,KC_MPLY,KC_MSTP,KC_MNXT +#define _ME3_5_ KC_F13, KC_VOLD,KC_MUTE,KC_EJCT,KC_VOLU +#define _ME4_3_ XXXXXXX,VLK_TOG,MU_TOG /* Navigation layer * ┌─────┬─────┬─────┬─────┬─────┐ @@ -398,23 +426,58 @@ enum userspace_layers { #define _NA3_5_ KC_INS, KC_HOME,KC_PGDN,KC_PGUP,KC_END #define _NA4_3_ KC_ENT, KC_ESC, KC_BSPC -/* Symbols layer (in DVORAK) +/* Symbols layer + * This layer has the central columns shifted for convenience + * QWERTY * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` ~ │ [ │ ] │ = + │CpsLk│ + * │ ` ~ │ - │ = │ ] } │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ - * │ / ? │ ( │ ) │ - _ │CharL│ + * │ [ { │ ( │ ) │ ' " │CapsL│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ \ | │ _ │ + │ < │ > │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ + * DVORAK + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ ` ~ │ [ │ ] │ = + │Char.│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ / ? │ ( │ ) │ - _ │CapsL│ * ├─────┼─────┼─────┼─────┼─────┤ * │ \ | │ { │ } │ < │ > │ * ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ + * Turkish F + * (AltGr is right on the central column, keys on main layer are omitted) + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ │ / \ │ - | │ │Char.│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │ ) ± │ = ° │ │CapsL│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │ ? ¿ │ _ │ < | │ > ¦ │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ */ #define _SY1_5_ KC_GRV,KC_MINS,KC_EQL, KC_RBRC,BB_CHAR #define _SY2_5_ KC_LBRC,KC_LPRN,KC_RPRN,KC_QUOT,KC_CAPS #define _SY3_5_ KC_BSLS,KC_UNDS,KC_PLUS,KC_NUBS,LSFT(KC_NUBS) #define _SY4_3_ KC_ENT, KC_ESC, KC_BSPC -/* Numbers layer (in DVORAK) +/* Numbers layer + * This layer contains numbers and the associated symbols. + * QWERTY + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ │ 7 & │ 8 * │ 9 ( │ 0 ) │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │ 4 $ │ 5 % │ 6 ^ │ ' " │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ [ { │ 1 ! │ 2 @ │ 3 # │ ] } │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ + * DVORAK * ┌─────┬─────┬─────┬─────┬─────┐ * │ , │ 7 & │ 8 * │ 9 ( │ 0 ) │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -424,6 +487,16 @@ enum userspace_layers { * └─────┴─────┴─────┼─────┼─────┼─────┐ * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ + * Turkish F + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ │{7 ' │[8 ( │]9 )±│}0 =°│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │¼4 $ │½5 %⅜│¾6 & │ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │¹1 !¡│²2 " │#3 ^³│ │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ */ #define _NU1_5_ KC_W, KC_7, KC_8, KC_9, KC_0 #define _NU2_5_ KC_E, KC_4, KC_5, KC_6, KC_QUOT From d995058de70e47e616deeb9d786f591349bbf0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 14:56:47 -0400 Subject: [PATCH 12/94] Modified for ARM; cannot make the compilation detect OLED code. --- .../community/split_3x6_3/bbaserdem/README.md | 10 +++- .../community/split_3x6_3/bbaserdem/chconf.h | 10 ++++ .../community/split_3x6_3/bbaserdem/config.h | 45 +++++++++++++++-- .../community/split_3x6_3/bbaserdem/halconf.h | 8 +++ .../community/split_3x6_3/bbaserdem/keymap.c | 35 +++++++++---- .../community/split_3x6_3/bbaserdem/mcuconf.h | 9 ++++ .../community/split_3x6_3/bbaserdem/rules.mk | 23 +++++++-- users/bbaserdem/bb-audio.c | 2 +- users/bbaserdem/bb-encoder.c | 10 ++-- users/bbaserdem/bb-encoder.h | 8 +-- users/bbaserdem/bb-oled.c | 3 ++ users/bbaserdem/bbaserdem.h | 49 ++++++++++--------- users/bbaserdem/config.h | 4 ++ users/bbaserdem/rules.mk | 13 ++--- 14 files changed, 176 insertions(+), 53 deletions(-) create mode 100644 layouts/community/split_3x6_3/bbaserdem/chconf.h create mode 100644 layouts/community/split_3x6_3/bbaserdem/halconf.h create mode 100644 layouts/community/split_3x6_3/bbaserdem/mcuconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem/README.md index dd1d0074bd3..d89b13f83f6 100644 --- a/layouts/community/split_3x6_3/bbaserdem/README.md +++ b/layouts/community/split_3x6_3/bbaserdem/README.md @@ -5,6 +5,14 @@ Check out the [user readme](../../../../users/bbaserdem/README.md) for more info Using [this](https://github.com/ItsWaffIe/waffle_corne) Proton-C compatible PCB. +Applying the similar keymap to [@waffle](https://github.com/ItsWaffIe/waffle_corne); +using their `crkbd:rev1:arm` build. + ## Build -Build command: `CFLAGS="-Wno-error=deprecated" TBF` +Build commands; + +* For ARM: +`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` +* For ARM: +`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` diff --git a/layouts/community/split_3x6_3/bbaserdem/chconf.h b/layouts/community/split_3x6_3/bbaserdem/chconf.h new file mode 100644 index 00000000000..cf0e7204a52 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/chconf.h @@ -0,0 +1,10 @@ +// Code pertaining the ARM crkbd version +#ifdef KEYBOARD_crkbd_rev1 + #define CH_CFG_ST_RESOLUTION 16 + #define CH_CFG_ST_FREQUENCY 10000 + #if __has_include("platforms/chibios/common/configs/chconf.h") + # include_next "platforms/chibios/common/configs/chconf.h" + #else + # include_next "chconf.h" + #endif +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 165249ff9af..53d933ec6b9 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -17,8 +17,47 @@ along with this program. If not, see . // elite-c: dfu-split-left/right #define EE_HANDS -// Code pertaining to planck rev6 +// Code pertaining to Corne ARM; from Waffle's keymap #ifdef KEYBOARD_crkbd_rev1 - // Corne overrides - #include "../../../../keyboards/crkbd/rev1/config.h" + // Undo Eeprom handedness + #undef EE_HANDS + #include "config_common.h" + #undef PRODUCT + #undef MANUFACTURER + #define MANUFACTURER Waffles + #define PRODUCT Protorne Keyboard + #undef USE_I2C + #undef SSD1306OLED + #define MASTER_RIGHT + #ifdef AUDIO_ENABLE + #define AUDIO_PIN A5 + #endif + #define USE_SERIAL_PD2 + #ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 + #define RGB_MATRIX_SPLIT { 27, 27 } + #define SPLIT_TRANSPORT_MIRROR + #endif + #undef RGBLED_NUM + #define RGBLED_NUM 54 + #undef RGB_DI_PIN + #define RGB_DI_PIN B5 + #ifdef OLED_DRIVER_ENABLE + #define OLED_TIMEOUT 50000 + #define OLED_UPDATE_INTERVAL 100 + #endif + #define WS2812_PWM_DRIVER PWMD3 + #define WS2812_PWM_CHANNEL 3 + #define WS2812_PWM_PAL_MODE 2 + #define WS2812_DMA_STREAM STM32_DMA1_STREAM3 + #define WS2812_DMA_CHANNEL 3 + #undef SOFT_SERIAL_PIN + #define SOFT_SERIAL_PIN D3 + #define SERIAL_USART_SPEED 921600 + #define SERIAL_USART_DRIVER SD1 + #define SERIAL_USART_TX_PAL_MODE 7 + #define ENCODERS_PAD_A { B2 } + #define ENCODERS_PAD_B { B6 } + #define ENCODERS_PAD_A_RIGHT { B2 } + #define ENCODERS_PAD_B_RIGHT { B6 } #endif diff --git a/layouts/community/split_3x6_3/bbaserdem/halconf.h b/layouts/community/split_3x6_3/bbaserdem/halconf.h new file mode 100644 index 00000000000..61ebef685b5 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/halconf.h @@ -0,0 +1,8 @@ +#pragma once + +#ifdef KEYBOARD_crkbd_rev1 + // #define HAL_USE_DAC TRUE + #define HAL_USE_PWM TRUE + #define HAL_USE_SERIAL TRUE + #include_next +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index da6583c8b7f..18bb1d5154d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -27,55 +27,55 @@ along with this program. If not, see . const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( - _BL1_1_,_BL1_5_,_BR1_5_,_BR1_1_, + BB_ENC0,_BL1_5_,_BR1_5_,BB_ENC1, _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, _BL4_3_,_BR4_3_ ), [_CHAR] = LAYOUT_split_3x6_3_wrapper( - XXXXXXX,_CL1_5_,_CR1_5_,XXXXXXX, + _______,_CL1_5_,_CR1_5_,_______, XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, _CL4_3_,_CR4_3_ ), [_GAME] = LAYOUT_split_3x6_3_wrapper( - _GA1_1_,_GA1_5_,___6___, + _______,_GA1_5_,___6___, _GA2_1_,_GA2_5_,___6___, _GA3_1_,_GA3_5_,___6___, _GA4_3_,___3___ ), [_MEDI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_ME1_5_,xxx1xxx, + ___6___,_ME1_5_,_______, ___6___,_ME2_5_,xxx1xxx, ___6___,_ME3_5_,xxx1xxx, ___3___,_ME4_3_ ), [_NAVI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_NA1_5_,xxx1xxx, + ___6___,_NA1_5_,_______, ___6___,_NA2_5_,xxx1xxx, ___6___,_NA3_5_,xxx1xxx, ___3___,_NA4_3_ ), [_SYMB] = LAYOUT_split_3x6_3_wrapper( - ___6___,_SY1_5_,xxx1xxx, + ___6___,_SY1_5_,_______, ___6___,_SY2_5_,xxx1xxx, ___6___,_SY3_5_,xxx1xxx, ___3___,_SY4_3_ ), [_NUMB] = LAYOUT_split_3x6_3_wrapper( - xxx1xxx,_NU1_5_,___6___, + _______,_NU1_5_,___6___, xxx1xxx,_NU2_5_,___6___, xxx1xxx,_NU3_5_,___6___, _NU4_3_,___3___ ), [_FUNC] = LAYOUT_split_3x6_3_wrapper( - xxx1xxx,_FU1_5_,___6___, + _______,_FU1_5_,___6___, xxx1xxx,_FU2_5_,___6___, xxx1xxx,_FU3_5_,___6___, _FU4_3_,___3___ ), [_MOUS] = LAYOUT_split_3x6_3_wrapper( - xxx1xxx,_MO1_5_,___6___, + _______,_MO1_5_,___6___, xxx1xxx,_MO2_5_,___6___, xxx1xxx,_MO3_5_,___6___, _MO4_3_,___3___ @@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // crkbd #if defined(KEYBOARD_crkbd_rev1) -/* This is left-right for planck light indicator light +/* This is left-right for CRKBD indicator light * - The LED 42 is for spacebar specifically, leave it out of the matrix * - This is how it looks like * ┌──┬──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┬──┐ @@ -117,6 +117,21 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_set_color(i, red, green, blue); } } + +#ifdef AUDIO_ENABLE +// Audio requires some fixes to work on @waffle's PCB +// ! Copy pasted from ItsWaffle's waffle fork +void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this + // Set audio pins to analog mode + palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); + palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); +} + +void keyboard_post_init_keymap(void) { + // Enable OPAMP1 as A5 → B1 follower + OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; +} +#endif // End of audio specific stuff // End of differentiations #endif diff --git a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h new file mode 100644 index 00000000000..c13e6f6774a --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h @@ -0,0 +1,9 @@ +#pragma once + +#ifdef KEYBOARD_crkbd_rev1 + #include_next + #undef STM32_PWM_USE_TIM3 + #define STM32_PWM_USE_TIM3 TRUE + #undef STM32_SERIAL_USE_USART1 + #define STM32_SERIAL_USE_USART1 TRUE +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 347894c26b1..59396b158af 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -10,9 +10,26 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Corne keyboard +# Corne keyboard; with ARM ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) - RGBLIGHT_ENABLE = no + # My usual features + AUDIO_ENABLE = yes #breaks reset keycode + BACKLIGHT_ENABLE = no + ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes - OLED_DRIVER_ENABLE = no + RGBLIGHT_ENABLE = no + OLED_DRIVER_ENABLE = yes + # Proton C related stuff + MCU = STM32F303 + COVERT_TO_PROTON_C = yes + DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox + AUDIO_DRIVER = dac_basic + SERIAL_DRIVER = usart + WS2812_DRIVER = pwm + VIA_ENABLE = yes + SPLIT_KEYBOARD = yes + OLED_DRIVER = SSD1306 # Enables the use of OLED displays + # POINTING_DEVICE_ENABLE = no + # SRC += pimoroni_trackball.c + QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 endif diff --git a/users/bbaserdem/bb-audio.c b/users/bbaserdem/bb-audio.c index 700e58bd1f8..9b90a63cc46 100644 --- a/users/bbaserdem/bb-audio.c +++ b/users/bbaserdem/bb-audio.c @@ -22,7 +22,7 @@ float tone_game_intro[][2] = GAME_ON_SONG; float tone_game_outro[][2] = GAME_OFF_SONG; // Audio playing when layer changes -uint32_t layer_state_set_audio(uint32_t state) { +layer_state_t layer_state_set_audio(layer_state_t state) { // Get this layer static bool prev_game = false; diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index a4a1e4c3453..9d858e43023 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -12,6 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-encoder.h" +#ifdef VELOCIKEY_ENABLE + #include "velocikey.h" +#endif /* ROTARY ENCODER * This contains my general rotary encoder code * Encoders each have a list of different modes they can be in. @@ -38,8 +41,8 @@ void keyboard_post_init_encoder(void) { } // Oled string printing for given layer and index; ONLY for OLED -#ifdef OLED_DRIVER_ENABLE void oled_encoder_state_5char(uint8_t index, uint8_t layer) { +#ifdef OLED_DRIVER_ENABLE // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled @@ -124,11 +127,11 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { } break; } -} #endif +} // Encoder scroll functionality -void encoder_update_user(uint8_t index, bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) @@ -322,6 +325,7 @@ void encoder_update_user(uint8_t index, bool clockwise) { } break; } + return true; } void encoder_click_action(uint8_t index) { diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 3a064c6295e..4b668eb1fa0 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -13,13 +13,15 @@ along with this program. If not, see . */ #pragma once #include "bbaserdem.h" +#ifdef VELOCIKEY_ENABLE + #include "velocikey.h" +#endif // Code to print to OLED -#ifdef ENCODER_ENABLE void oled_encoder_state_5char(uint8_t index, uint8_t layer); -#endif + // Hook to encoder stuff -void encoder_update_user(uint8_t index, bool clockwise); +bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed bool process_record_encoder(uint16_t keycode, keyrecord_t *record); // Initializing the encoder array diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 89208f363f3..b1e3206816a 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -12,6 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-oled.h" +#ifdef ENCODER_ENABLE + #include "bb-encoder.h" +#endif //#include /* ROTARY ENCODER * This contains my general rotary encoder code diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 86932808103..6f48c876bb7 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -13,6 +13,7 @@ along with this program. If not, see . */ #pragma once #include QMK_KEYBOARD_H +#include "quantum.h" /* Besides loading libraries and definitions, this file has my layout defs * LAYOUTS: @@ -302,35 +303,37 @@ enum userspace_layers { * ┌────────────────────────────────────────────────┐ * │AltGr -none- Shift Shift+AltGr │ * └────────────────────────────────────────────────┘ - * If there is an exclamation mark; it indicates that + * If there is an exclamation mark; it indicates a dead key on this map. + */ + /* Base layout * QWERTY * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * [ { │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ ] } + * ` ~ │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ < > * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * \ | │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ' " + * [ { │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ] } * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * ` ~ │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ < > + * \ | │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ ' " * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * DVORAK * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * / ? │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ = + + * ` ~ │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ < > * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * \ | │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ - _ + * / ? │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ = + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * ` ~ │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ < > + * \ | │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ - _ * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * TURKISH F - * ! !┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * äq Qå│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │~w W - * !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ ! - * `x Xà│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│#ş Şǎ - * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ - * ¬+ *±│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │|< >¦ + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * ¬+ *±│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │|< >¦ + * ! !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ + * äq Qå│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│~w W + * !├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ ! + * `x Xà│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │#ş Şǎ * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ @@ -345,12 +348,12 @@ enum userspace_layers { #define _BL4_3_ MED_DEL,NAV_TAB,SYM_SPC #define _BR4_3_ NUM_ENT,FUN_ESC,MOU_BSP // The extra line for the 6th (or 0th) row -#define _BL1_1_ KC_LBRC -#define _BR1_1_ KC_RBRC -#define _BL2_1_ KC_BSLS -#define _BR2_1_ KC_QUOT -#define _BL3_1_ KC_GRV -#define _BR3_1_ KC_NUBS +#define _BL1_1_ KC_GRV +#define _BR1_1_ KC_NUBS +#define _BL2_1_ KC_LBRC +#define _BR2_1_ KC_RBRC +#define _BL3_1_ KC_BSLS +#define _BR3_1_ KC_QUOT /* Extra characters layer * This is accessed using unicode; so IBus compatible apps only. @@ -377,7 +380,7 @@ enum userspace_layers { /* Game layer * This layer turns off the tap-hold keys for the left half. * ┌─────┬─────┬─────┬─────┬─────┐ - * ` ~ │ Q │ W │ E │ R │ T │ + * │ Q │ W │ E │ R │ T │ * ├─────┼─────┼─────┼─────┼─────┤ * Tab │ A │ S │ D │ F │ G │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -387,7 +390,7 @@ enum userspace_layers { * └─────┴─────┴─────┘ */ #define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _GA1_1_ KC_GRV +#define _GA1_1_ _______ #define _GA2_5_ KC_A, KC_S, KC_D, KC_F, KC_G #define _GA2_1_ KC_TAB #define _GA3_5_ KC_Z, KC_X, KC_C, KC_V, KC_B @@ -449,9 +452,9 @@ enum userspace_layers { * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ * Turkish F - * (AltGr is right on the central column, keys on main layer are omitted) + * (AltGr is right on the central column, red. keys on main layer are omitted) * ┌─────┬─────┬─────┬─────┬─────┐ - * │ │ / \ │ - | │ │Char.│ + * │¬+ *±│ / \ │ - | │ │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ * │ │ ) ± │ = ° │ │CapsL│ * ├─────┼─────┼─────┼─────┼─────┤ diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 152042a2547..2bd268f592e 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -136,4 +136,8 @@ along with this program. If not, see . #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS + // Some more config options + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 // Set maximum brightness + #define RGB_MATRIX_KEYPRESSES // React to key presses + #define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects #endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 1f7129c53be..4bb0651207c 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -20,15 +20,16 @@ EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold -VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed -WPM_ENABLE = no # Get WPM reports as you type +VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed +WPM_ENABLE = yes # Get WPM reports as you type +NKRO_ENABLE = yes # Default is 6KRO which is plenty +BLUETOOTH_ENABLE = no # For bluetooth # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed CONSOLE_ENABLE = no # Allows console output with a command COMMAND_ENABLE = no # Some bootmagic thing i dont use SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. -NKRO_ENABLE = no # Default is 6KRO which is plenty MIDI_ENABLE = no # Midi driver (untested) UNICODE_ENABLE = no # We use unicodemap, not unicode UCIS_ENABLE = no # We use unicodemap, not ucis @@ -37,12 +38,12 @@ VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. # Manually configure these on each keyboard individually -# BLUETOOTH_ENABLE # For bluetooth # AUDIO_ENABLE # Audio stuff # BACKLIGHT_ENABLE # Switch LEDs -# RGBLIGHT_ENABLE # LED strip -# RGB_MATRIX_ENABLE # Per-key RGB LED # ENCODER_ENABLE # Rotary encoder +# RGB_MATRIX_ENABLE # Per-key RGB LED +# RGBLIGHT_ENABLE # LED strip; compacter code for small leds. +# OLED_DRIVER_ENABLE # For OLED # Userspace code SRC += bbaserdem.c From f3829baa06b31e2eeb238195c921d1271731e8b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 16:52:13 -0400 Subject: [PATCH 13/94] Trying things --- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 6 ++++-- layouts/community/split_3x6_3/bbaserdem/keymap.c | 2 ++ layouts/community/split_3x6_3/bbaserdem/ssd1306.c | 0 users/bbaserdem/bb-oled.c | 1 + users/bbaserdem/bbaserdem.h | 2 +- users/bbaserdem/config.h | 4 +++- users/bbaserdem/rules.mk | 8 ++++---- 7 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 layouts/community/split_3x6_3/bbaserdem/ssd1306.c diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index f54821f1834..0bf40d8a1b9 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -12,8 +12,10 @@ # Kyria hardware ifneq (,$(findstring kyria/rev1,$(KEYBOARD))) - OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays + AUDIO_ENABLE = no # No audio capability + BACKLIGHT_ENABLE = no # No diode leds on the board ENCODER_ENABLE = yes # Enables the use of one or more encoders + RGB_MATRIX_ENABLE = no # No perkey leds on the board RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much - RGB_MATRIX_ENABLE = no + OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 18bb1d5154d..439e74ae000 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -12,7 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include QMK_KEYBOARD_H +#include "quantum.h" #include "bbaserdem.h" + /* F layout * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ * │+ *│ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ diff --git a/layouts/community/split_3x6_3/bbaserdem/ssd1306.c b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c new file mode 100644 index 00000000000..e69de29bb2d diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index b1e3206816a..9c976afc30d 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -15,6 +15,7 @@ along with this program. If not, see . #ifdef ENCODER_ENABLE #include "bb-encoder.h" #endif + //#include /* ROTARY ENCODER * This contains my general rotary encoder code diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 6f48c876bb7..2d58d73e682 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -12,8 +12,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #pragma once -#include QMK_KEYBOARD_H #include "quantum.h" +#include QMK_KEYBOARD_H /* Besides loading libraries and definitions, this file has my layout defs * LAYOUTS: diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 2bd268f592e..c8e30349727 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -68,7 +68,9 @@ along with this program. If not, see . // Enable RGB LED sleep mode #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - #define RGB_DISABLE_WHEN_USB_SUSPENDED true + #ifndef RGB_DISABLE_WHEN_USB_SUSPENDED + #define RGB_DISABLE_WHEN_USB_SUSPENDED true + #endif #endif // Audio definitions diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 4bb0651207c..334edd93325 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -18,12 +18,8 @@ LTO_ENABLE = yes MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation -KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold -VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed WPM_ENABLE = yes # Get WPM reports as you type -NKRO_ENABLE = yes # Default is 6KRO which is plenty -BLUETOOTH_ENABLE = no # For bluetooth # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -36,6 +32,10 @@ UCIS_ENABLE = no # We use unicodemap, not ucis FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. +BLUETOOTH_ENABLE = no # For bluetooth +NKRO_ENABLE = no # Default is 6KRO which is plenty +VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed +KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From b47498801220dbf755e09d4334e5369188c11d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 17:41:55 -0400 Subject: [PATCH 14/94] Revert "Trying things" This reverts commit f3829baa06b31e2eeb238195c921d1271731e8b6. --- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 6 ++---- layouts/community/split_3x6_3/bbaserdem/keymap.c | 2 -- layouts/community/split_3x6_3/bbaserdem/ssd1306.c | 0 users/bbaserdem/bb-oled.c | 1 - users/bbaserdem/bbaserdem.h | 2 +- users/bbaserdem/config.h | 4 +--- users/bbaserdem/rules.mk | 8 ++++---- 7 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 layouts/community/split_3x6_3/bbaserdem/ssd1306.c diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index 0bf40d8a1b9..f54821f1834 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -12,10 +12,8 @@ # Kyria hardware ifneq (,$(findstring kyria/rev1,$(KEYBOARD))) - AUDIO_ENABLE = no # No audio capability - BACKLIGHT_ENABLE = no # No diode leds on the board + OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays ENCODER_ENABLE = yes # Enables the use of one or more encoders - RGB_MATRIX_ENABLE = no # No perkey leds on the board RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much - OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays + RGB_MATRIX_ENABLE = no endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 439e74ae000..18bb1d5154d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -12,9 +12,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include QMK_KEYBOARD_H -#include "quantum.h" #include "bbaserdem.h" - /* F layout * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ * │+ *│ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ diff --git a/layouts/community/split_3x6_3/bbaserdem/ssd1306.c b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 9c976afc30d..b1e3206816a 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -15,7 +15,6 @@ along with this program. If not, see . #ifdef ENCODER_ENABLE #include "bb-encoder.h" #endif - //#include /* ROTARY ENCODER * This contains my general rotary encoder code diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 2d58d73e682..6f48c876bb7 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -12,8 +12,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #pragma once -#include "quantum.h" #include QMK_KEYBOARD_H +#include "quantum.h" /* Besides loading libraries and definitions, this file has my layout defs * LAYOUTS: diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index c8e30349727..2bd268f592e 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -68,9 +68,7 @@ along with this program. If not, see . // Enable RGB LED sleep mode #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - #ifndef RGB_DISABLE_WHEN_USB_SUSPENDED - #define RGB_DISABLE_WHEN_USB_SUSPENDED true - #endif + #define RGB_DISABLE_WHEN_USB_SUSPENDED true #endif // Audio definitions diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 334edd93325..4bb0651207c 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -18,8 +18,12 @@ LTO_ENABLE = yes MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation +KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold +VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed WPM_ENABLE = yes # Get WPM reports as you type +NKRO_ENABLE = yes # Default is 6KRO which is plenty +BLUETOOTH_ENABLE = no # For bluetooth # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -32,10 +36,6 @@ UCIS_ENABLE = no # We use unicodemap, not ucis FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. -BLUETOOTH_ENABLE = no # For bluetooth -NKRO_ENABLE = no # Default is 6KRO which is plenty -VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed -KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 64b439e2b1a5372095395ad01ca7e14b58f00ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 17:46:01 -0400 Subject: [PATCH 15/94] Fixed up the encoder code; and reframed kyria layout to be in future layout folder. --- .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 22 ++++++++++--------- users/bbaserdem/bb-encoder.c | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 8d1358bae8f..1336e8594a5 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -13,6 +13,8 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H #include "bbaserdem.h" +#define LAYOUT_split_3x6_5_wrapper(...) LAYOUT_split_3x6_5(__VA_ARGS__) + /* F layout * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ * │ W │ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ @@ -26,61 +28,61 @@ along with this program. If not, see . */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_wrapper( + [_BASE] = LAYOUT_split_3x6_5_wrapper( _BL1_1_,_BL1_5_, _BR1_5_,_BR1_1_, _BL2_1_,_BL2_5_, _BR2_5_,_BR2_1_, _BL3_1_,_BL3_5_,xxx2xxx,xxx2xxx,_BR3_5_,_BR3_1_, BB_ENC0, _BL4_3_,KC_LSFT,KC_RSFT,_BR4_3_,BB_ENC1 ), - [_CHAR] = LAYOUT_wrapper( + [_CHAR] = LAYOUT_split_3x6_5_wrapper( XXXXXXX,_CL1_5_, _CR1_5_,XXXXXXX, XXXXXXX,_CL2_5_, _CR2_5_,XXXXXXX, XXXXXXX,_CL3_5_,xxx2xxx,xxx2xxx,_CR3_5_,XXXXXXX, _______,_CL4_3_,_______,_______,_CR4_3_,_______ ), - [_GAME] = LAYOUT_wrapper( + [_GAME] = LAYOUT_split_3x6_5_wrapper( _GA1_1_,_GA1_5_, ___5___,___1___, _GA2_1_,_GA2_5_, ___5___,___1___, _GA3_1_,_GA3_5_,xxx2xxx,xxx2xxx,___5___,___1___, _______,_GA4_3_,_______,_______,___3___,_______ ), - [_MEDI] = LAYOUT_wrapper( + [_MEDI] = LAYOUT_split_3x6_5_wrapper( ___1___,___5___, _ME1_5_,___1___, ___1___,___5___, _ME2_5_,___1___, ___1___,___5___,xxx2xxx,xxx2xxx,_ME3_5_,___1___, ___1___,___3___,_______,_______,_ME4_3_,___1___ ), - [_NAVI] = LAYOUT_wrapper( + [_NAVI] = LAYOUT_split_3x6_5_wrapper( ___1___,___5___, _NA1_5_,___1___, ___1___,___5___, _NA2_5_,___1___, ___1___,___5___,xxx2xxx,xxx2xxx,_NA3_5_,___1___, ___1___,___3___,_______,_______,_NA4_3_,___1___ ), - [_SYMB] = LAYOUT_wrapper( + [_SYMB] = LAYOUT_split_3x6_5_wrapper( ___1___,___5___, _SY1_5_,___1___, ___1___,___5___, _SY2_5_,___1___, ___1___,___5___,xxx2xxx,xxx2xxx,_SY3_5_,___1___, ___1___,___3___,_______,_______,_SY4_3_,___1___ ), - [_NUMB] = LAYOUT_wrapper( + [_NUMB] = LAYOUT_split_3x6_5_wrapper( ___1___,_NU1_5_, ___5___,___1___, ___1___,_NU2_5_, ___5___,___1___, ___1___,_NU3_5_,xxx2xxx,xxx2xxx,___5___,___1___, ___1___,_NU4_3_,_______,_______,___3___,___1___ ), - [_FUNC] = LAYOUT_wrapper( + [_FUNC] = LAYOUT_split_3x6_5_wrapper( ___1___,_FU1_5_, ___5___,___1___, ___1___,_FU2_5_, ___5___,___1___, ___1___,_FU3_5_,xxx2xxx,xxx2xxx,___5___,___1___, ___1___,_FU4_3_,_______,_______,___3___,___1___ ), - [_MOUS] = LAYOUT_wrapper( + [_MOUS] = LAYOUT_split_3x6_5_wrapper( ___1___,_MO1_5_, ___5___,___1___, ___1___,_MO2_5_, ___5___,___1___, ___1___,_MO3_5_,xxx2xxx,xxx2xxx,___5___,___1___, ___1___,_MO4_3_,_______,_______,___3___,___1___ ), - [_MUSI] = LAYOUT_wrapper( + [_MUSI] = LAYOUT_split_3x6_5_wrapper( _MU_12_,_MU_12_, _MU_06_,xxx2xxx,xxx2xxx,_MU_06_, MU_TOG,_MUL_3_,_MU_02_,_MUR_3_,___1___ diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 9d858e43023..93c8772486b 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -325,7 +325,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } break; } - return true; + return false; } void encoder_click_action(uint8_t index) { From 103792f4bb67a719996e1565557417ae4ef0b240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 18:28:56 -0400 Subject: [PATCH 16/94] Fixing some build issues --- .../splitkb/kyria/keymaps/bbaserdem/README.md | 2 +- keyboards/splitkb/kyria/keymaps/bbaserdem/config.h | 2 +- keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c | 14 +++++++------- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 2 +- users/bbaserdem/bb-encoder.c | 5 +++-- users/bbaserdem/bb-encoder.h | 4 +++- users/bbaserdem/bb-oled.c | 5 +---- users/bbaserdem/bb-oled.h | 1 - users/bbaserdem/rules.mk | 8 ++++---- 9 files changed, 21 insertions(+), 22 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md b/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md index c05221c6a7a..e68d053a092 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md @@ -1,5 +1,5 @@ This file contains my Kyria board layout. -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. +Check out the [user readme](../../../../../users/bbaserdem/README.md) for more info. # Kyria diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h index 85d33f61cab..f8e1e307edd 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -14,7 +14,7 @@ along with this program. If not, see . #pragma once // Kyria specific -#ifdef KEYBOARD_kyria_rev1 +#ifdef KEYBOARD_splitkb_kyria_rev1 // Split definition; use the following to flash; // pro-micro: avrdude-split-left/right // elite-c: dfu-split-left/right diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 1336e8594a5..3723067076a 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -90,11 +90,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // Kyria specific code -#ifdef KEYBOARD_kyria_rev1 -// Rotate the display on kyria -#ifdef OLED_DRIVER_ENABLE -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; -} -#endif //OLED_DRIVER_ENABLE +#ifdef KEYBOARD_splitkb_kyria_rev1 + // Rotate the display on kyria + #ifdef OLED_DRIVER_ENABLE + oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; + } + #endif //OLED_DRIVER_ENABLE #endif //KEYBOARD_kyria_rev1 diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index f54821f1834..d3f17932997 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -11,7 +11,7 @@ # along with this program. If not, see . # Kyria hardware -ifneq (,$(findstring kyria/rev1,$(KEYBOARD))) +ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays ENCODER_ENABLE = yes # Enables the use of one or more encoders RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 93c8772486b..287a264c821 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -15,6 +15,7 @@ along with this program. If not, see . #ifdef VELOCIKEY_ENABLE #include "velocikey.h" #endif + /* ROTARY ENCODER * This contains my general rotary encoder code * Encoders each have a list of different modes they can be in. @@ -41,8 +42,8 @@ void keyboard_post_init_encoder(void) { } // Oled string printing for given layer and index; ONLY for OLED -void oled_encoder_state_5char(uint8_t index, uint8_t layer) { #ifdef OLED_DRIVER_ENABLE +void oled_encoder_state_5char(uint8_t index, uint8_t layer) { // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled @@ -127,8 +128,8 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { } break; } -#endif } +#endif // Encoder scroll functionality bool encoder_update_user(uint8_t index, bool clockwise) { diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 4b668eb1fa0..7d680e02862 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -18,7 +18,9 @@ along with this program. If not, see . #endif // Code to print to OLED -void oled_encoder_state_5char(uint8_t index, uint8_t layer); +#ifdef OLED_DRIVER_ENABLE + void oled_encoder_state_5char(uint8_t index, uint8_t layer); +#endif // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index b1e3206816a..a5386def8b6 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -12,9 +12,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-oled.h" -#ifdef ENCODER_ENABLE - #include "bb-encoder.h" -#endif //#include /* ROTARY ENCODER * This contains my general rotary encoder code @@ -155,7 +152,7 @@ static void render_status(void) { void oled_task_user(void) { if (is_keyboard_master()) { - #if defined(KEYBOARD_kyria_rev1) + #if defined(KEYBOARD_splitkb_kyria_rev1) render_qmk_logo(); #endif render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index 9c38d64078b..5b8a97efc3b 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -13,6 +13,5 @@ along with this program. If not, see . */ #pragma once #include "bbaserdem.h" - // Contain the main oled writer here void oled_task_user(void); diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 4bb0651207c..334edd93325 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -18,12 +18,8 @@ LTO_ENABLE = yes MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation -KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold -VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed WPM_ENABLE = yes # Get WPM reports as you type -NKRO_ENABLE = yes # Default is 6KRO which is plenty -BLUETOOTH_ENABLE = no # For bluetooth # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -36,6 +32,10 @@ UCIS_ENABLE = no # We use unicodemap, not ucis FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. +BLUETOOTH_ENABLE = no # For bluetooth +NKRO_ENABLE = no # Default is 6KRO which is plenty +VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed +KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 1786b2a4f6512a348a6b5a87663a2e3604d68977 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 20:01:15 -0400 Subject: [PATCH 17/94] Fixed kyria code to operational --- users/bbaserdem/bb-encoder.c | 49 +++++++++++++++--------------- users/bbaserdem/bb-encoder.h | 7 ++--- users/bbaserdem/bb-oled.c | 59 ++++++++++++++++++++++-------------- users/bbaserdem/rules.mk | 2 +- 4 files changed, 64 insertions(+), 53 deletions(-) diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 287a264c821..401e5a2345f 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-encoder.h" +#include #ifdef VELOCIKEY_ENABLE #include "velocikey.h" #endif @@ -41,9 +42,8 @@ void keyboard_post_init_encoder(void) { reset_encoder_state(); } -// Oled string printing for given layer and index; ONLY for OLED -#ifdef OLED_DRIVER_ENABLE -void oled_encoder_state_5char(uint8_t index, uint8_t layer) { +// Oled string printing for given layer and index +void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled @@ -51,22 +51,22 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { case _MEDI: switch (encoder_state[index].rgb) { case 0: - oled_write_P(PSTR(" mode"), false); + strcpy(buffer, " mode"); break; case 1: - oled_write_P(PSTR(" hue "), false); + strcpy(buffer, " hue "); break; case 2: - oled_write_P(PSTR("satur"), false); + strcpy(buffer, "satur"); break; case 3: - oled_write_P(PSTR("value"), false); + strcpy(buffer, "value"); break; case 4: - oled_write_P(PSTR("speed"), false); + strcpy(buffer, "speed"); break; default: - oled_write_P(PSTR("!oob!"), false); + strcpy(buffer, "!oob!"); break; } break; @@ -76,19 +76,19 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { case _MOUS: switch (encoder_state[index].point) { case 0: - oled_write_P(PSTR("m.lat"), false); + strcpy(buffer, "m.lat"); break; case 1: - oled_write_P(PSTR("m.ver"), false); + strcpy(buffer, "m.ver"); break; case 2: - oled_write_P(PSTR("s.ver"), false); + strcpy(buffer, "s.ver"); break; case 3: - oled_write_P(PSTR("s.lat"), false); + strcpy(buffer, "s.lat"); break; default: - oled_write_P(PSTR("!oob!"), false); + strcpy(buffer, "!oob!"); break; } break; @@ -96,40 +96,39 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { default: switch (encoder_state[index].base) { case 0: - oled_write_P(PSTR(" volm"), false); + strcpy(buffer, " volm"); break; case 1: - oled_write_P(PSTR(" song"), false); + strcpy(buffer, " song"); break; case 2: - oled_write_P(PSTR(" sink"), false); + strcpy(buffer, " sink"); break; case 3: - oled_write_P(PSTR("s.vol"), false); + strcpy(buffer, "s.vol"); break; case 4: - oled_write_P(PSTR(" src "), false); + strcpy(buffer, " src "); break; case 5: - oled_write_P(PSTR(" L/R "), false); + strcpy(buffer, " L/R "); break; case 6: - oled_write_P(PSTR(" U/D "), false); + strcpy(buffer, " U/D "); break; case 7: - oled_write_P(PSTR("pgU/D"), false); + strcpy(buffer, "pgU/D"); break; case 8: - oled_write_P(PSTR(" del "), false); + strcpy(buffer, " del "); break; default: - oled_write_P(PSTR("!oob!"), false); + strcpy(buffer, "!oob!"); break; } break; } } -#endif // Encoder scroll functionality bool encoder_update_user(uint8_t index, bool clockwise) { diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 7d680e02862..792555ab916 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -17,11 +17,8 @@ along with this program. If not, see . #include "velocikey.h" #endif -// Code to print to OLED -#ifdef OLED_DRIVER_ENABLE - void oled_encoder_state_5char(uint8_t index, uint8_t layer); -#endif - +// Code to print status string +void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index a5386def8b6..dea42770f94 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -12,7 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-oled.h" -//#include +#ifdef ENCODER_ENABLE + #include "bb-encoder.h" +#endif /* ROTARY ENCODER * This contains my general rotary encoder code * Encoders each have a list of different modes they can be in. @@ -41,8 +43,19 @@ static void render_status(void) { // Function to print state information uint8_t this_layer = get_highest_layer(layer_state); uint8_t this_mod = get_mods(); + // Temporary variable for RGB + #if defined RGBLIGHT_ENABLE + static char rgb_temp4[4] = {0}; + #elif defined RGB_MATRIX_ENABLE + static char rgb_temp4[4] = {0}; + #endif + // Temporary variable for WPM string #if defined WPM_ENABLE - static char temp[4] = {0}; + static char wpm_temp4[4] = {0}; + #endif + // Temporary variable for encoder state + #if defined ENCODER_ENABLE + static char encoder_temp6[6] = {0}; #endif // Line 1: Layer State @@ -88,33 +101,33 @@ static void render_status(void) { #if defined RGBLIGHT_ENABLE case _MEDI: oled_write_P(PSTR("m:"), false); - itoa(rgblight_config.mode, temp, 10); - oled_write(temp, false); + itoa(rgblight_config.mode, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" h:"), false); - itoa(rgblight_config.hsv.h, temp, 10); - oled_write(temp, false); + itoa(rgblight_config.hsv.h, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" s:"), false); - itoa(rgblight_config.hsv.s, temp, 10); - oled_write(temp, false); + itoa(rgblight_config.hsv.s, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" v:"), false); - itoa(rgblight_config.hsv.v, temp, 10); - oled_write(temp, false); + itoa(rgblight_config.hsv.v, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR("\n"), false); break; #elif defined RGB_MATRIX_ENABLE case _MEDI: oled_write_P(PSTR("m"), false); - itoa(rgb_matrix_config.mode, temp, 10); - oled_write(temp, false); + itoa(rgb_matrix_config.mode, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" h"), false); - itoa(rgb_matrix_config.hsv.h, temp, 10); - oled_write(temp, false); + itoa(rgb_matrix_config.hsv.h, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" s"), false); - itoa(rgb_matrix_config.hsv.s, temp, 10); - oled_write(temp, false); + itoa(rgb_matrix_config.hsv.s, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" v"), false); - itoa(rgb_matrix_config.hsv.v, temp, 10); - oled_write(temp, false); + itoa(rgb_matrix_config.hsv.v, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR("\n"), false); break; #endif @@ -132,8 +145,8 @@ static void render_status(void) { // Line 3: WPM oled_write_P(PSTR("KM: Qwerty WPM: "), false); #if defined WPM_ENABLE - itoa(get_current_wpm(), temp, 10); - oled_write(temp, false); + itoa(get_current_wpm(), wpm_temp4, 10); + oled_write(wpm_temp4, false); #else oled_write_P(PSTR("N/A"), false); #endif @@ -142,9 +155,11 @@ static void render_status(void) { // Line 4: Encoder states #ifdef ENCODER_ENABLE oled_write_P(PSTR("EN0:"), false); - oled_encoder_state_5char(0, this_layer); + encoder_state_string(0, this_layer, encoder_temp6); + oled_write(encoder_temp6, false); oled_write_P(PSTR(" EN1:"), false); - oled_encoder_state_5char(1, this_layer); + encoder_state_string(1, this_layer, encoder_temp6); + oled_write(encoder_temp6, false); #endif oled_write_P(PSTR("\n"), false); diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 334edd93325..62ca1b7d14a 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -19,7 +19,6 @@ MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold -WPM_ENABLE = yes # Get WPM reports as you type # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -36,6 +35,7 @@ BLUETOOTH_ENABLE = no # For bluetooth NKRO_ENABLE = no # Default is 6KRO which is plenty VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general +WPM_ENABLE = no # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 5b84a4ebd70401362b66b68b6a952b19f09da432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 23:06:05 -0400 Subject: [PATCH 18/94] Moved layout a bit to ease non-confusion in build; and brought up to date. --- .../{bbaserdem => bbaserdem2}/README.md | 0 .../{bbaserdem => bbaserdem2}/config.h | 0 .../{bbaserdem => bbaserdem2}/keymap.c | 0 .../{bbaserdem => bbaserdem2}/rules.mk | 0 .../community/split_3x6_3/bbaserdem/config.h | 49 ++++++++++++------- .../community/split_3x6_3/bbaserdem/keymap.c | 23 +++------ .../community/split_3x6_3/bbaserdem/rules.mk | 12 ++--- 7 files changed, 45 insertions(+), 39 deletions(-) rename layouts/community/split_3x5_3/{bbaserdem => bbaserdem2}/README.md (100%) rename layouts/community/split_3x5_3/{bbaserdem => bbaserdem2}/config.h (100%) rename layouts/community/split_3x5_3/{bbaserdem => bbaserdem2}/keymap.c (100%) rename layouts/community/split_3x5_3/{bbaserdem => bbaserdem2}/rules.mk (100%) diff --git a/layouts/community/split_3x5_3/bbaserdem/README.md b/layouts/community/split_3x5_3/bbaserdem2/README.md similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem/README.md rename to layouts/community/split_3x5_3/bbaserdem2/README.md diff --git a/layouts/community/split_3x5_3/bbaserdem/config.h b/layouts/community/split_3x5_3/bbaserdem2/config.h similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem/config.h rename to layouts/community/split_3x5_3/bbaserdem2/config.h diff --git a/layouts/community/split_3x5_3/bbaserdem/keymap.c b/layouts/community/split_3x5_3/bbaserdem2/keymap.c similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem/keymap.c rename to layouts/community/split_3x5_3/bbaserdem2/keymap.c diff --git a/layouts/community/split_3x5_3/bbaserdem/rules.mk b/layouts/community/split_3x5_3/bbaserdem2/rules.mk similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem/rules.mk rename to layouts/community/split_3x5_3/bbaserdem2/rules.mk diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 53d933ec6b9..6dc05feb111 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -15,47 +15,62 @@ along with this program. If not, see . // Split definition; use the following to flash; // pro-micro: avrdude-split-left/right // elite-c: dfu-split-left/right -#define EE_HANDS // Code pertaining to Corne ARM; from Waffle's keymap #ifdef KEYBOARD_crkbd_rev1 - // Undo Eeprom handedness - #undef EE_HANDS #include "config_common.h" + + // Undo Eeprom handedness, try EE_HANDS later + #undef EE_HANDS + #define MASTER_RIGHT + + // Rebrand the PCB #undef PRODUCT #undef MANUFACTURER #define MANUFACTURER Waffles #define PRODUCT Protorne Keyboard + + // Remove OLED definitions? #undef USE_I2C #undef SSD1306OLED - #define MASTER_RIGHT + + // Audio output on pin A5 (actualy will be output on B1) #ifdef AUDIO_ENABLE #define AUDIO_PIN A5 #endif + + // Communication has to be serial on ARM #define USE_SERIAL_PD2 - #ifdef RGB_MATRIX_ENABLE - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 - #define RGB_MATRIX_SPLIT { 27, 27 } - #define SPLIT_TRANSPORT_MIRROR - #endif + // Set serial pin as D3 for sure + #undef SOFT_SERIAL_PIN + #define SOFT_SERIAL_PIN D3 + #define SERIAL_USART_SPEED 921600 + #define SERIAL_USART_DRIVER SD1 + #define SERIAL_USART_TX_PAL_MODE 7 + + // Things to make RGB matrix work #undef RGBLED_NUM #define RGBLED_NUM 54 #undef RGB_DI_PIN #define RGB_DI_PIN B5 - #ifdef OLED_DRIVER_ENABLE - #define OLED_TIMEOUT 50000 - #define OLED_UPDATE_INTERVAL 100 + #ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 + #define RGB_MATRIX_SPLIT { 27, 27 } + #define SPLIT_TRANSPORT_MIRROR #endif #define WS2812_PWM_DRIVER PWMD3 #define WS2812_PWM_CHANNEL 3 #define WS2812_PWM_PAL_MODE 2 #define WS2812_DMA_STREAM STM32_DMA1_STREAM3 #define WS2812_DMA_CHANNEL 3 - #undef SOFT_SERIAL_PIN - #define SOFT_SERIAL_PIN D3 - #define SERIAL_USART_SPEED 921600 - #define SERIAL_USART_DRIVER SD1 - #define SERIAL_USART_TX_PAL_MODE 7 + + // OLED related code + #ifdef OLED_DRIVER_ENABLE + #define OLED_TIMEOUT 50000 + #define OLED_UPDATE_INTERVAL 100 + #endif + + // Encoder definitons #define ENCODERS_PAD_A { B2 } #define ENCODERS_PAD_B { B6 } #define ENCODERS_PAD_A_RIGHT { B2 } diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 18bb1d5154d..48bcb92fbfb 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -13,17 +13,6 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H #include "bbaserdem.h" -/* F layout - * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ - * │+ *│ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ - * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ - * │ X │ A │ S │ D │ F │ G │        │ T │ K │ M │ L │ Y │ Ş │ - * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ - * │< >│ J │ Ö │ V │ C │ Ç │        │ Z │ S │ B │. :│, ;│ W │ - * └───┴───┴───┴───┼───┼───┼───┐ ┌───┼───┼───┼───┴───┴───┴───┘ - *                │Tab│Ent│Esc│ │Del│Spc│Bsp│ - *                └───┴───┴───┘ └───┴───┴───┘ - */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -117,8 +106,14 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_set_color(i, red, green, blue); } } +// End of differentiations +#endif +// End of code for the RGB_MATRIX setup +#endif #ifdef AUDIO_ENABLE +// crkbd +#if defined(KEYBOARD_crkbd_rev1) // Audio requires some fixes to work on @waffle's PCB // ! Copy pasted from ItsWaffle's waffle fork void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this @@ -131,9 +126,5 @@ void keyboard_post_init_keymap(void) { // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } +#endif // End of differentiations #endif // End of audio specific stuff -// End of differentiations -#endif - -// End of code for the RGB_MATRIX setup -#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 59396b158af..7cff38959cc 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -13,23 +13,23 @@ # Corne keyboard; with ARM ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # My usual features - AUDIO_ENABLE = yes #breaks reset keycode + AUDIO_ENABLE = yes BACKLIGHT_ENABLE = no ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes RGBLIGHT_ENABLE = no OLED_DRIVER_ENABLE = yes + OLED_DRIVER = SSD1306 + # Features that take otherwise too much space + WPM_ENABLE = yes + NKRO_ENABLE = yes # Proton C related stuff MCU = STM32F303 COVERT_TO_PROTON_C = yes DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox - AUDIO_DRIVER = dac_basic SERIAL_DRIVER = usart WS2812_DRIVER = pwm - VIA_ENABLE = yes + AUDIO_DRIVER = dac_basic SPLIT_KEYBOARD = yes - OLED_DRIVER = SSD1306 # Enables the use of OLED displays - # POINTING_DEVICE_ENABLE = no - # SRC += pimoroni_trackball.c QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 endif From 5169da7d7456692b55a1f716af86398321f59e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Thu, 2 Sep 2021 01:24:50 -0400 Subject: [PATCH 19/94] Removed oled_driver_enable keyword. --- .../splitkb/kyria/keymaps/bbaserdem/config.h | 26 +++---------------- .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 2 +- .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 12 ++++++--- keyboards/splitkb/kyria/rev1/rules.mk | 1 - .../community/split_3x5_3/bbaserdem2/rules.mk | 2 +- .../community/split_3x6_3/bbaserdem/keymap.c | 3 +++ .../community/split_3x6_3/bbaserdem/rules.mk | 9 ++++--- users/bbaserdem/bbaserdem.h | 2 +- users/bbaserdem/rules.mk | 16 +++++++----- 9 files changed, 32 insertions(+), 41 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h index f8e1e307edd..3e873660a82 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -21,33 +21,13 @@ along with this program. If not, see . #define ENCODER_DIRECTION_FLIP #define EE_HANDS - #ifdef OLED_DRIVER_ENABLE + // Make sure kyria has bigger oled display + #ifdef OLED_ENABLE #define OLED_DISPLAY_128X64 #endif - #ifdef RGBLIGHT_ENABLE - #ifdef RGBLIGHT_LEFT_BEG - #undef RGBLIGHT_LEFT_BEG - #endif - #define RGBLIGHT_LEFT_BEG 0 - - #ifdef RGBLIGHT_LEFT_NUM - #undef RGBLIGHT_LEFT_NUM - #endif - #define RGBLIGHT_LEFT_NUM 10 - - #ifdef RGBLIGHT_RIGHT_BEG - #undef RGBLIGHT_RIGHT_BEG - #endif - #define RGBLIGHT_RIGHT_BEG 10 - - #ifdef RGBLIGHT_RIGHT_NUM - #undef RGBLIGHT_RIGHT_NUM - #endif - #define RGBLIGHT_RIGHT_NUM 10 - #endif - // If you are using an Elite C rev3 on the slave side, uncomment the lines below: + // However; this causes the halves to be unresponsive // #define SPLIT_USB_DETECT // #define NO_USB_STARTUP_CHECK #endif diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 3723067076a..8e6ac4d60a3 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -92,7 +92,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Kyria specific code #ifdef KEYBOARD_splitkb_kyria_rev1 // Rotate the display on kyria - #ifdef OLED_DRIVER_ENABLE + #ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index d3f17932997..1d1db3aaa14 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -12,8 +12,14 @@ # Kyria hardware ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) - OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays - ENCODER_ENABLE = yes # Enables the use of one or more encoders - RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much + # Elective features + AUDIO_ENABLE = no + BACKLIGHT_ENABLE = no + ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = no + OLED_ENABLE = yes + # Space savers + NKRO_ENABLE = no + VELOCIKEY_ENABLE = no + WPM_ENABLE = no endif diff --git a/keyboards/splitkb/kyria/rev1/rules.mk b/keyboards/splitkb/kyria/rev1/rules.mk index cc2cbba604b..e7d6763fcd3 100644 --- a/keyboards/splitkb/kyria/rev1/rules.mk +++ b/keyboards/splitkb/kyria/rev1/rules.mk @@ -1,5 +1,4 @@ OLED_ENABLE = yes -OLED_DRIVER = SSD1306 # Enables the use of OLED displays ENCODER_ENABLE = yes # ENables the use of one or more encoders RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow RGB_MATRIX_ENABLE = no # Enable keyboard RGB matrix (do not use together with RGBLIGHT_ENABLE) diff --git a/layouts/community/split_3x5_3/bbaserdem2/rules.mk b/layouts/community/split_3x5_3/bbaserdem2/rules.mk index 347894c26b1..1d557030589 100644 --- a/layouts/community/split_3x5_3/bbaserdem2/rules.mk +++ b/layouts/community/split_3x5_3/bbaserdem2/rules.mk @@ -14,5 +14,5 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) RGBLIGHT_ENABLE = no RGB_MATRIX_ENABLE = yes - OLED_DRIVER_ENABLE = no + OLED_ENABLE = no endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 48bcb92fbfb..3b54abd75e3 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -13,6 +13,7 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H #include "bbaserdem.h" +#include const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -116,6 +117,7 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { #if defined(KEYBOARD_crkbd_rev1) // Audio requires some fixes to work on @waffle's PCB // ! Copy pasted from ItsWaffle's waffle fork +/* void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this // Set audio pins to analog mode palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); @@ -126,5 +128,6 @@ void keyboard_post_init_keymap(void) { // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } +*/ #endif // End of differentiations #endif // End of audio specific stuff diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 7cff38959cc..b005e5609fb 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -18,18 +18,19 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes RGBLIGHT_ENABLE = no - OLED_DRIVER_ENABLE = yes - OLED_DRIVER = SSD1306 + OLED_ENABLE = yes # Features that take otherwise too much space WPM_ENABLE = yes NKRO_ENABLE = yes # Proton C related stuff MCU = STM32F303 - COVERT_TO_PROTON_C = yes - DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox + BOARD = QMK_PROTON_C + # Config SERIAL_DRIVER = usart WS2812_DRIVER = pwm AUDIO_DRIVER = dac_basic SPLIT_KEYBOARD = yes + # These are from waffle + DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 endif diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 6f48c876bb7..32879e0bff7 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -44,7 +44,7 @@ along with this program. If not, see . #include "bb-encoder.h" #endif // Oled screen -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE #include "bb-oled.h" #endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 62ca1b7d14a..d8039609097 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -32,18 +32,20 @@ FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. BLUETOOTH_ENABLE = no # For bluetooth -NKRO_ENABLE = no # Default is 6KRO which is plenty -VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general -WPM_ENABLE = no # Get WPM reports as you type +RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead + +# These features can be enabled on ARM boards; disabled for AVR due to space +# NKRO_ENABLE = no # Default is 6KRO which is plenty +# VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed +# WPM_ENABLE = no # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff # BACKLIGHT_ENABLE # Switch LEDs # ENCODER_ENABLE # Rotary encoder -# RGB_MATRIX_ENABLE # Per-key RGB LED -# RGBLIGHT_ENABLE # LED strip; compacter code for small leds. -# OLED_DRIVER_ENABLE # For OLED +# RGB_MATRIX_ENABLE # RGB LEDs +# OLED_ENABLE # For OLED # Userspace code SRC += bbaserdem.c @@ -72,7 +74,7 @@ SRC += bb-underglow.c endif # OLED code -ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) +ifeq ($(strip $(OLED_ENABLE)), yes) SRC += bb-oled.c endif From 58990aba6117a55ec1877f518241da9b165eb73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Thu, 2 Sep 2021 11:44:36 -0400 Subject: [PATCH 20/94] Fixed the audio fix working --- layouts/community/split_3x6_3/bbaserdem/config.h | 3 +-- layouts/community/split_3x6_3/bbaserdem/keymap.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 6dc05feb111..471539c8ea2 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -21,8 +21,7 @@ along with this program. If not, see . #include "config_common.h" // Undo Eeprom handedness, try EE_HANDS later - #undef EE_HANDS - #define MASTER_RIGHT + #define EE_HANDS // Rebrand the PCB #undef PRODUCT diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 3b54abd75e3..7980b1ba802 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -13,6 +13,7 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H #include "bbaserdem.h" +#include "quantum.h" #include const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -117,7 +118,6 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { #if defined(KEYBOARD_crkbd_rev1) // Audio requires some fixes to work on @waffle's PCB // ! Copy pasted from ItsWaffle's waffle fork -/* void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this // Set audio pins to analog mode palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); @@ -128,6 +128,5 @@ void keyboard_post_init_keymap(void) { // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } -*/ #endif // End of differentiations #endif // End of audio specific stuff From fa8b5e981ea57e74d41d8db01886dfe5389d6f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 3 Sep 2021 11:29:25 -0400 Subject: [PATCH 21/94] Changed up rules a bit --- layouts/community/split_3x6_3/bbaserdem/rules.mk | 1 + users/bbaserdem/rules.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index b005e5609fb..3d01525966c 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -33,4 +33,5 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # These are from waffle DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 + LTO_ENABLE = no endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index d8039609097..55686ea2cdf 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -12,7 +12,7 @@ # Common compilation flags EXTRAFLAGS += -flto # Used to make code smaller -LTO_ENABLE = yes +#LTO_ENABLE = yes # These should be enabled in all boards MOUSEKEY_ENABLE = yes # Mouse emulation keys From b787187daa4a755a8185f465764f061f7b0932c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sun, 5 Sep 2021 19:35:33 -0400 Subject: [PATCH 22/94] Made some changes. --- layouts/community/split_3x6_3/bbaserdem/rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 3d01525966c..e9fca701978 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -25,6 +25,7 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # Proton C related stuff MCU = STM32F303 BOARD = QMK_PROTON_C + BOOTLOADER = stm32-dfu # Config SERIAL_DRIVER = usart WS2812_DRIVER = pwm From 54802032be984ad91b0ed3f61045f152a95f1391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 6 Sep 2021 19:35:57 -0400 Subject: [PATCH 23/94] Reformatted some code and cleaned stuff up. --- .../community/ortho_3x10/bbaserdem/keymap.c | 11 +- .../community/ortho_3x10/bbaserdem/rules.mk | 3 +- .../community/ortho_4x12/bbaserdem/README.md | 23 +-- .../community/ortho_4x12/bbaserdem/config.h | 88 ---------- .../community/ortho_4x12/bbaserdem/keymap.c | 113 ------------ .../community/ortho_4x12/bbaserdem/rules.mk | 7 +- .../community/ortho_5x15/bbaserdem/README.md | 16 -- .../community/ortho_5x15/bbaserdem/config.h | 15 -- .../community/ortho_5x15/bbaserdem/keymap.c | 128 -------------- .../community/ortho_5x15/bbaserdem/rules.mk | 17 -- .../community/split_3x6_3/bbaserdem/rules.mk | 1 - users/bbaserdem/README.md | 163 +++++------------- users/bbaserdem/bb-encoder.c | 70 +------- users/bbaserdem/bb-keylight.c | 78 --------- users/bbaserdem/bb-macro.c | 51 ------ users/bbaserdem/bb-macro.h | 1 - users/bbaserdem/bb-oled.c | 28 +-- users/bbaserdem/bb-rgb.c | 104 +++++++++++ users/bbaserdem/{bb-keylight.h => bb-rgb.h} | 5 +- users/bbaserdem/bbaserdem.h | 1 - users/bbaserdem/rules.mk | 17 +- 21 files changed, 177 insertions(+), 763 deletions(-) delete mode 100644 layouts/community/ortho_5x15/bbaserdem/README.md delete mode 100644 layouts/community/ortho_5x15/bbaserdem/config.h delete mode 100644 layouts/community/ortho_5x15/bbaserdem/keymap.c delete mode 100755 layouts/community/ortho_5x15/bbaserdem/rules.mk delete mode 100644 users/bbaserdem/bb-keylight.c create mode 100644 users/bbaserdem/bb-rgb.c rename users/bbaserdem/{bb-keylight.h => bb-rgb.h} (80%) diff --git a/layouts/community/ortho_3x10/bbaserdem/keymap.c b/layouts/community/ortho_3x10/bbaserdem/keymap.c index c094f526a4f..cf81f7036ef 100644 --- a/layouts/community/ortho_3x10/bbaserdem/keymap.c +++ b/layouts/community/ortho_3x10/bbaserdem/keymap.c @@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -// Music map, guitar like +// Music map, guitar like. #ifdef AUDIO_ENABLE const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_3x10( 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, @@ -92,8 +92,7 @@ led_config_t g_led_config = { }, { // LED Index to Flag 2,2,2,2,2,2,2,2,2,2 }}; -// Disable -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { } -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { } -#endif -#endif +// Disable layer switching +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {return true;} +#endif // Gherkin +#endif // RGB Matrix diff --git a/layouts/community/ortho_3x10/bbaserdem/rules.mk b/layouts/community/ortho_3x10/bbaserdem/rules.mk index 0c668c221bf..7232f6969d5 100755 --- a/layouts/community/ortho_3x10/bbaserdem/rules.mk +++ b/layouts/community/ortho_3x10/bbaserdem/rules.mk @@ -15,7 +15,8 @@ # Gherkin has both RGB strip and LED lights ifneq (,$(findstring 40percentclub/gherkin,$(KEYBOARD))) CONVERT_TO_PROTON_C = yes - RGB_MATRIX_ENABLE = WS2812 + RGB_MATRIX_ENABLE = yes + RGB_MATRIX_DRIVER = WS2812 AUDIO_ENABLE = yes BACKLIGHT_ENABLE = yes VELOCIKEY_ENABLE = yes diff --git a/layouts/community/ortho_4x12/bbaserdem/README.md b/layouts/community/ortho_4x12/bbaserdem/README.md index a9ddc339a0a..3e1e30cf54d 100644 --- a/layouts/community/ortho_4x12/bbaserdem/README.md +++ b/layouts/community/ortho_4x12/bbaserdem/README.md @@ -1,37 +1,18 @@ This file contains my [4x12 ortho](../../../default/ortho_4x12) board layouts Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. -# Planck +# Planck Light I use a couple [planck](../../../../keyboards/planck/readme.md) keyboards. -To sell soon; don't use them anymore. - -* Use the [light](../../../../keyboards/planck/light/readme.md) version. -* Use the [rev6](../../../../keyboards/planck/rev6/readme.md) version. - -I have a daughter board that I'm trying to use for perkey leds. -Originally, in the firmware, the underglow rgb prints are configured both for -`RGBLIGHT` and `RGBMATRIX` code. -I differentiate between these two; and use; - -* `RGBLIGHT` for underglow leds. -* `RGB_MATRIX` for the daughterboard, if I get to it at some point. (Doubtful) - -Enable in rules.mk accordingly. +To sell soon; don't use them anymore, but will keep the light version. # JJ40 A planck rev4 replacement; for my acrylic planck case which used to host a now defunct rev4. -Enable in rules.mk accordingly. - ## Status * [x] Layout adapted * [ ] Have not tested build yet. * [ ] Have not confirmed on board - -# Let's Split Eh? - -I have a [let's split eh?](../../../../keyboards/lets_split_eh/README.md), unused, will sell this. diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h index 81f77c44fb8..66ba01f27f2 100755 --- a/layouts/community/ortho_4x12/bbaserdem/config.h +++ b/layouts/community/ortho_4x12/bbaserdem/config.h @@ -20,92 +20,4 @@ along with this program. If not, see . #undef ENCODER_RESOLUTION #endif #define ENCODER_RESOLUTION 2 - // Daughter board related utilities - #ifdef RGB_MATRIX_ENABLE - // Reconfigure the RGB DI Pin - #ifdef RGB_DI_PIN - #undef RGB_DI_PIN - #endif - // Change this later - #define RGB_DI_PIN A1 - // Reconfigure number of LEDS - #ifdef DRIVER_LED_TOTAL - #undef DRIVER_LED_TOTAL - #endif - #define DRIVER_LED_TOTAL 48 - #elif RGBLIGHT_ENABLE - // RGB Underglow with on-board SMD footprints - // This is for original planck led locations - // ┌────────────┐ - // │ 6 5 4 3 │ - // │ │ - // │ 0 │ - // │ 7 8 1 2 │ - // └────────────┘ - #ifdef RGBLIGHT_RIGHT_BEG - #undef RGBLIGHT_RIGHT_BEG - #endif - #define RGBLIGHT_RIGHT_BEG 1 - - #ifdef RGBLIGHT_RIGHT_NUM - #undef RGBLIGHT_RIGHT_NUM - #endif - #define RGBLIGHT_RIGHT_NUM 4 - - #ifdef RGBLIGHT_LEFT_BEG - #undef RGBLIGHT_LEFT_BEG - #endif - #define RGBLIGHT_LEFT_BEG 5 - - #ifdef RGBLIGHT_LEFT_NUM - #undef RGBLIGHT_LEFT_NUM - #endif - #define RGBLIGHT_LEFT_NUM 4 - #endif -#endif - -// Let's Split Eh! specific -#ifdef KEYBOARD_lets_split_eh_eh - #ifdef RGBLIGHT_LEFT_BEG - #undef RGBLIGHT_LEFT_BEG - #endif - #define RGBLIGHT_LEFT_BEG 0 - - #ifdef RGBLIGHT_LEFT_NUM - #undef RGBLIGHT_LEFT_NUM - #endif - #define RGBLIGHT_LEFT_NUM 6 - - #ifdef RGBLIGHT_RIGHT_BEG - #undef RGBLIGHT_RIGHT_BEG - #endif - #define RGBLIGHT_RIGHT_BEG 6 - - #ifdef RGBLIGHT_RIGHT_NUM - #undef RGBLIGHT_RIGHT_NUM - #endif - #define RGBLIGHT_RIGHT_NUM 6 -#endif - -// JJ40 specific -#ifdef KEYBOARD_jj40 - #ifdef RGBLIGHT_LEFT_BEG - #undef RGBLIGHT_LEFT_BEG - #endif - #define RGBLIGHT_LEFT_BEG 0 - - #ifdef RGBLIGHT_LEFT_NUM - #undef RGBLIGHT_LEFT_NUM - #endif - #define RGBLIGHT_LEFT_NUM 2 - - #ifdef RGBLIGHT_RIGHT_BEG - #undef RGBLIGHT_RIGHT_BEG - #endif - #define RGBLIGHT_RIGHT_BEG 3 - - #ifdef RGBLIGHT_RIGHT_NUM - #undef RGBLIGHT_RIGHT_NUM - #endif - #define RGBLIGHT_RIGHT_NUM 2 #endif diff --git a/layouts/community/ortho_4x12/bbaserdem/keymap.c b/layouts/community/ortho_4x12/bbaserdem/keymap.c index 654e4bfdeda..3c53c83d7a3 100755 --- a/layouts/community/ortho_4x12/bbaserdem/keymap.c +++ b/layouts/community/ortho_4x12/bbaserdem/keymap.c @@ -83,116 +83,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _MU_12_,_MU_12_,_MU_12_, ___1___,_MU_02_,_MUL_3_,_MUR_3_,_MU_02_,___1___) }; - -// RGB Matrix configuration -#ifdef RGB_MATRIX_ENABLE - -// planck:Light -#if defined(KEYBOARD_planck_light) -/* This is left-right for planck light indicator light - * - The LED 42 is for spacebar specifically, leave it out of the matrix - * - This is how it looks like - * ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ - * │00│01│02│03│04│05│06│07│08│09│10│11│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │12│13│14│15│16│17│18│19│20│21│22│23│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │24│25│26│27│28│29│30│31│32│33│34│35│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │36│37│38│39│40│41│43│44│45│46│47│48│ - * └──┴──┴──┴──┴──┴─042─┴──┴──┴──┴──┴──┘ - */ -int board_left[24] = { - 0, 1, 2, 3, 4, 5, - 12, 13, 14, 15, 16, 17, - 24, 25, 26, 27, 28, 29, - 36, 37, 38, 39, 40, 41}; -int board_right[24] = { - 6, 7, 8, 9, 10, 11, - 18, 19, 20, 21, 22, 23, - 30, 31, 32, 33, 34, 35, - 43, 44, 45, 46, 47, 48}; -// Sided color-setting -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(board_left[i], red, green, blue); - } -} -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(board_right[i], red, green, blue); - } -} - -// planck:rev6 -#elif defined(KEYBOARD_planck_rev6) -/* Rev6 has RGB matrix to the bottom LED footprints - * Breakdown of the daughter board layout that I'm planning to use - * ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ - * │35│36│37│38│39│40│41│42│43│44│45│46│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │23│24│25│26│27│28│29│30│31│32│33│34│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │12│13│14│15│16│17│18│19│20│21│22│47│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │00│01│02│03│04│05│06│07│08│09│10│11│ - * └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘ - */ -led_config_t g_led_config = { - { // Key Matrix to LED Index - {35, 36, 37, 38, 39, 40}, // R1: Left - {23, 24, 25, 26, 27, 28}, // R2: Left - {12, 13, 14, 15, 16, 17}, // R3: Left - { 0, 1, 2, 9, 10, 11}, // R4: 1-3, 10-12 - {41, 42, 43, 44, 45, 46}, // R1: Right - {29, 30, 31, 32, 33, 34}, // R2: Right - {18, 19, 20, 21, 22, 47}, // R3: Right - { 6, 7, 8, 3, 4, 5}, // R4: 7-9, 4-6 - }, {// LED Index to Physical Position - // R4: 12 leds - { 0, 64}, { 20, 64}, { 41, 64}, { 61, 64}, { 81, 64}, {102, 64}, - {122, 64}, {143, 64}, {163, 64}, {183, 64}, {204, 64}, {224, 64}, - // R3: 11 leds (last one in this row is the last LED) - { 0, 43}, { 20, 43}, { 41, 43}, { 61, 43}, { 81, 43}, {102, 43}, - {122, 43}, {143, 43}, {163, 43}, {183, 43}, {204, 43}, - // R2: 12 leds - { 0, 21}, { 20, 21}, { 41, 21}, { 61, 21}, { 81, 21}, {102, 21}, - {122, 21}, {143, 21}, {163, 21}, {183, 21}, {204, 21}, {224, 21}, - // R1: 12 leds - { 0, 0}, { 20, 0}, { 41, 0}, { 61, 0}, { 81, 0}, {102, 0}, - { 122, 0}, {143, 0}, {163, 0}, {183, 0}, {204, 0}, {224, 0}, - // Last led: right most R3 - {224, 43} - }, {// LED Index to Flag (4: regular key, 1: modifier) - 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4 - } -}; -int board_left[24] = { - 0, 1, 2, 3, 4, 5, - 12, 13, 14, 15, 16, 17, - 23, 24, 25, 26, 27, 28, - 35, 36, 37, 38, 39, 40}; -int board_right[24] = { - 6, 7, 8, 9, 10, 11, - 18, 19, 20, 21, 22, 47, - 29, 30, 31, 32, 33, 34, - 41, 42, 43, 44, 45, 46}; -// Sided color-setting -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(board_left[i], red, green, blue); - } -} -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(board_right[i], red, green, blue); - } -} -// End of differentiations -#endif - -// End of code for the RGB_MATRIX setup -#endif diff --git a/layouts/community/ortho_4x12/bbaserdem/rules.mk b/layouts/community/ortho_4x12/bbaserdem/rules.mk index fddeacc0b79..e8b2c793ba0 100755 --- a/layouts/community/ortho_4x12/bbaserdem/rules.mk +++ b/layouts/community/ortho_4x12/bbaserdem/rules.mk @@ -14,11 +14,10 @@ # RGBLIGHT should be enabled for a board with the underglow leds # RGB_MATRIX_ENABLE should be set to WS2812 for the daughter board ifneq (,$(findstring planck/rev6,$(KEYBOARD))) - RGBLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = no + RGB_MATRIX_ENABLE = yes + RGBLIGHT_ENABLE = no endif # JJ40 here ifneq (,$(findstring jj40,$(KEYBOARD))) - RGBLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = no + RGB_MATRIX_ENABLE = yes endif diff --git a/layouts/community/ortho_5x15/bbaserdem/README.md b/layouts/community/ortho_5x15/bbaserdem/README.md deleted file mode 100644 index e6e15b72605..00000000000 --- a/layouts/community/ortho_5x15/bbaserdem/README.md +++ /dev/null @@ -1,16 +0,0 @@ -This file contains my [5x15 ortho](../../../default/ortho_5x15) board layouts -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. - -# XD75RE - -One of my first boards, the [XD75Re](../../../../keyboards/xd75/readme.md). -(At least before the price hike.) -To be sold. - -The board has `RGBLIGHT_ENABLE` leds underneath; but I use a wooden case. -Instead; I hooked up some LED's to the three lock indicators. -I use them for layer indication. - -## Build - -Build command: `CFLAGS="-Wno-error=deprecated" TBF` diff --git a/layouts/community/ortho_5x15/bbaserdem/config.h b/layouts/community/ortho_5x15/bbaserdem/config.h deleted file mode 100644 index f51237a94d7..00000000000 --- a/layouts/community/ortho_5x15/bbaserdem/config.h +++ /dev/null @@ -1,15 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 diff --git a/layouts/community/ortho_5x15/bbaserdem/keymap.c b/layouts/community/ortho_5x15/bbaserdem/keymap.c deleted file mode 100644 index 8b9b742e192..00000000000 --- a/layouts/community/ortho_5x15/bbaserdem/keymap.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 QMK_KEYBOARD_H -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_ortho_5x15_wrapper( - xxx6xxx,KC_NLCK,KC_PSLS,KC_PAST,xxx6xxx, - _BL1_1_,_BL1_5_,KC_P7, KC_P8, KC_P9, _BR1_5_,_BR1_1_, - _BL2_1_,_BL2_5_,KC_P4, KC_P5, KC_P6, _BR2_5_,_BR2_1_, - _BL3_1_,_BL3_5_,KC_P1, KC_P2, KC_P3, _BR3_5_,_BR3_1_, - BL_STEP,XXXXXXX,KC_LEFT,KC_RGHT,_BL4_3_,KC_P0, _BL4_3_,KC_DOWN,KC_UP, MU_ON, BL_TOGG - ), - [_CHAR] = LAYOUT_ortho_5x15_wrapper( - xxx6xxx,xxx3xxx,xxx6xxx, - XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, - XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, - XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, - ___4___,_CL4_3_,XXXXXXX,_CL4_3_,___4___ - ), - [_GAME] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - _GA1_1_,_GA1_5_,___3___,___6___, - _GA2_1_,_GA2_5_,___3___,___6___, - _GA3_1_,_GA3_5_,___3___,___6___, - ___4___,_GA4_3_,___1___,___3___,___4___ - ), - [_MEDI] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - xxx1xxx,_ME1_5_,___3___,___6___, - xxx1xxx,_ME2_5_,___3___,___6___, - xxx1xxx,_ME3_5_,___3___,___6___, - ___4___,___3___,___1___,_ME4_3_,___4___ - ), - [_NAVI] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - xxx1xxx,_NA1_5_,___3___,___6___, - xxx1xxx,_NA2_5_,___3___,___6___, - xxx1xxx,_NA3_5_,___3___,___6___, - ___4___,_NA4_3_,___1___,___3___,___4___ - ), - [_SYMB] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - xxx1xxx,_SY1_5_,___3___,___6___, - xxx1xxx,_SY2_5_,___3___,___6___, - xxx1xxx,_SY3_5_,___3___,___6___, - ___4___,_SY4_3_,___1___,___3___,___4___ - ), - [_NUMB] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - ___6___,___3___,_NU1_5_,xxx1xxx, - ___6___,___3___,_NU2_5_,xxx1xxx, - ___6___,___3___,_NU3_5_,xxx1xxx, - ___4___,___3___,___1___,_NU4_3_,___4___ - ), - [_FUNC] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - ___6___,___3___,_FU1_5_,xxx1xxx, - ___6___,___3___,_FU2_5_,xxx1xxx, - ___6___,___3___,_FU3_5_,xxx1xxx, - ___4___,___3___,___1___,_FU4_3_,___4___ - ), - [_MOUS] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - ___6___,___3___,_MO1_5_,xxx1xxx, - ___6___,___3___,_MO2_5_,xxx1xxx, - ___6___,___3___,_MO3_5_,xxx1xxx, - ___4___,___3___,___1___,_MO4_3_,___4___ - ), - [_MUSI] = LAYOUT_ortho_5x15_wrapper( - _MU_06_,_MU_03_,_MU_06_, - _MU_06_,_MU_03_,_MU_06_, - _MU_06_,_MU_03_,_MU_06_, - _MU_06_,_MU_03_,_MU_06_, - _MU_06_,_MU_01_,_MUS_4_,MU_SLOW,MU_FAST,MU_OFF, ___1___ - ) -}; - -layer_state_t layer_state_set_keymap(layer_state_t state) { - // XD75RE layer indicator - #ifdef KEYBOARD_xd75 - if (layer_state_cmp(state, _CHAR)) { - capslock_led_on(); - gp103_led_on(); - gp100_led_on(); - } else if (layer_state_cmp(state, _MEDI)) { - capslock_led_off(); - gp103_led_off(); - gp100_led_on(); - } else if (layer_state_cmp(state, _NAVI)) { - capslock_led_off(); - gp103_led_on(); - gp100_led_off(); - } else if (layer_state_cmp(state, _NUMB)) { - capslock_led_on(); - gp103_led_off(); - gp100_led_off(); - } else if (layer_state_cmp(state, _SYMB)) { - capslock_led_off(); - gp103_led_on(); - gp100_led_on(); - } else if (layer_state_cmp(state, _FUNC)) { - capslock_led_on(); - gp103_led_off(); - gp100_led_on(); - } else if (layer_state_cmp(state, _MOUS)) { - capslock_led_on(); - gp103_led_on(); - gp100_led_off(); - } else { - capslock_led_off(); - gp103_led_off(); - gp100_led_off(); - } - #endif - return state; -}; diff --git a/layouts/community/ortho_5x15/bbaserdem/rules.mk b/layouts/community/ortho_5x15/bbaserdem/rules.mk deleted file mode 100755 index 3a387185fc9..00000000000 --- a/layouts/community/ortho_5x15/bbaserdem/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2019 Batuhan Başerdem @bbaserdem -# 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 . - -# XD75RE specific stuff -ifneq (,$(findstring xd75,$(KEYBOARD))) - RGBLIGHT_ENABLE = no - BACKLIGHT_ENABLE = yes -endif diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index e9fca701978..21fd9526c0d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -17,7 +17,6 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) BACKLIGHT_ENABLE = no ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes - RGBLIGHT_ENABLE = no OLED_ENABLE = yes # Features that take otherwise too much space WPM_ENABLE = yes diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md index 74a0488a451..f0999c7a96d 100644 --- a/users/bbaserdem/README.md +++ b/users/bbaserdem/README.md @@ -4,146 +4,75 @@ My userspace code for my various keyboards; available here. # Todo -- [X] Add OLED support -- [ ] Centralize color definitions for RGB -- [ ] Document all features more extensibly -- [ ] Generate json files to be used with Keyboard-Layout-Editor to produce images. - -# Keyboards - -A list of my code accross the QMK repo accessible here. -(I will sell my built-but-not-using ones.) +- [ ] Convert all RGB code to use RGB matrix. +- [ ] Make workflow so that ARM and AVR are both differentiable. +- [ ] Finish README to be intelligible. +- [ ] Generate JSON files to be used with Keyboard-Layout-Editor to produce images. ## Builds These are my keyboard builds and info, it allows me to plan out my builds. -### Planck WORK - -* Board: planck/rev6 -* Switches: Zilent -* Case: Planck Hi-Pro Bottom Case: Glossy White -* Plate: Stainless steel with shiny finish (LaserBoost) -* Keycaps: Pudding PBT Doubleshot Keycap Set -* Artisan: B.O.B StoneuCarved Lotus Artisan Keycap -* Artisan: Teamwolf 304 Stainless Steel Transparent Metal Keycaps - -I use this at the workplace to not bother coworkers; focus on silence. - -### Planck HOME - -* Board: planck/rev6 -* Switches: Crystal BOX Navy -* Case: Planck Hi-Pro Bottom Case (MOD version): Matte Black -* Plate: Copper with shiny finish (LaserBoost) -* Keycaps: Buger TH01 XDA Dye-Subbed PBT -* Artisan: Sparkle Loft Reactor Artisan Keycap - -I use this at home. -Has all the extra pinouts exposed to play arounh with. - ### Planck SERVER -* Board: jj40 -* Switches: BOX Navy +* Board: `kprepublic/jj40` +* Microcontroller: Embedded +* Layout: `ortho_4x12` +* Functionality: Underglow RGB Lighting, LED diode lighting. * Case: Clear Acrylic Top and Bottow, with Frosted Acrylic Diffuser (Smashing Acrylics) +* Switches: BOX Navy * Keycaps: Datamancer Tall Deco Typewriter Keycaps -I'm using this while I'm in between boards; but very usable. -Long term plan is to use this for the server. -The case was initially designed for planck rev4; -I'm replaced the PCB since my rev4 one was derelict -due to repeated desolderings. - -### Planck CARRY - -* Board: planck/light -* Switches: Choc Low Jade -* Case: Stock Planck light case -* Keycaps: Blanck MKB - -I carry this around; and is one of my favourite boards. -Found a better keycap profile for these as well. - -### XD75RE - -* Board: xd75 -* Switches: Zealios 67g + Silencios -* Case: Npkc 60% Wooden Case (Rosewood) -* Keycaps: Massdrop x MITO XDA Godspeed -* Artisan: Hammer Fidget Spinner Artisan Keycap -* Artisan: Waffle Key Studio Rosette (Sunset) - -My first work board; that is not seing any use due to being big. - -### Gherkin PAD +Just a decorative planck replacement (for my rev4 PCB that died.) -* Board: 40percentclub/gherkin -* Case: Acrylic Case (Smashing Acrylics) -* Controller: Proton C -* Switches: Novelkeys Creams -* Keycaps: Random +### Planck Light -The point of this is to act like a game/macro pad. -Other than that; i just use this for bragging points. -I have been planning on using my Proton C to turn into a MIDI controller. - -### Let's Split Eh? - -* Board: lets_split_eh/eh -* Case: Acrylic Case (Smashing Acrylics) -* Switches: Novelkeys BOX Royals -* Keycaps: G20 Semiotics - -I built this; but then I realized that I really don't enjoy ortholinear split. - -### Infinity Ergodox - -* Board: ergodox_infinity -* Case: Datamancer Wooden case -* Switches: Kailh Speed Gold -* Keycaps: None +* Board: `planck/light` +* Microcontroller: Embedded +* Layout: `ortho_4x12` +* Functionality: Per-key RGB Lighting, Audio. +* Case: Clear Acrylic Top and Bottow, with Frosted Acrylic Diffuser (Smashing Acrylics) +* Switches: BOX Navy +* Keycaps: Datamancer Tall Deco Typewriter Keycaps -I don't like Infinity Ergodox. -Should sell this soon cause really not seeing myself ever using this. -Lucky me got the case for free due to (then) Massdrop shipping errors. +Just a decorative planck replacement (for my rev4 PCB that died.) -### Corne +### Corne ARM -* Board: [Proton-C Compatible crkbd PCB](https://github.com/ItsWaffIe/waffle_corne) +* Board: `crkbd/rev1` +* Microcontroller: Proton C (x2) +* Layout: `split_3x6_3` +* Functionality: OLED, Audio, Per-key RGB Lighting, Rotary Encoder (x2) * Case: IMK Corne Case v2 Polycarbonate * Switches: Healios V2 * Keycaps: POM Jelly -I'm planning on adding a trackpad for this, as detailed -[here](https://github.com/manna-harbour/crkbd/blob/master/trackpoint/readme.org). +PCB is actually [Proton-C Compatible crkbd PCB](https://github.com/ItsWaffIe/waffle_corne). ### Corne Lite -* Board: crkbd/rev1 +* Board: `crkbd/rev1` +* Microcontroller: Pro Micro (x2) +* Layout: `split_3x5_3` +* Functionality: Per-key RGB Lighting, OLED (No firmware space) * Case: Custom * Switches: Choc Low Burnt Orange * Keycaps: [Scooped Choc Keycaps](https://mkultra.click/collections/keycaps/products/scooped-choc-keycaps?variant=31223543365730) +Maybe try adding a trackpad for this, as detailed +[here](https://github.com/manna-harbour/crkbd/blob/master/trackpoint/readme.org). + ### Kyria -* Board: kyria/rev1 +* Board: `splitkb/kyria/rev1` +* Microcontroller: Pro Micro (x2) +* Layout: `split_3x6_6` +* Functionality: OLED, Underglow RGB Lighting (No firmware space), Rotary Encoder (x2) * Case: Matte Black Acrylic High-Profile case * Switches: Gateron Ink Silent Black * Keycaps: Oblotzky SA Oblivion -Want to add a joystick to this board for mouse control. - -### Big Switch - -* Board: bigseries/1key -* Case: WoodKeys (KNOWN SCAMMER: DO NOT RECOMMEND) -* Switches: Big Series Pale Blue -* Keycaps: Idea23 - -Got this before being scammed out of 200$ by Cole Markham: owner of WoodKeys; -The usb port got torn off; and could not fix it. -Expensive paperweight? +Main driver at work currently; love the switches and the board layout. # Firmware building @@ -151,10 +80,12 @@ Expensive paperweight? On archlinux, the package *arm-none-eabi-gcc* is too new. To fix; add to the environment `CFLAGS="-Wno-error=deprecated"` to compilation commands. -Also; try to run `avr-gcc` version `8.4.0` for smaller firmware. +Also; says to run `avr-gcc` version `8.4.0` for smaller firmware, +but I find that it only saves a few bytes. ## Bootloader +Needed to type this out from the QMK website. If I want to flash a new bootloader for a machine; here are steps; 1. Flash the util/pro_micro_ISP_B6_10.hex to a spare promicro using; @@ -184,22 +115,20 @@ My userspace has a lot of shared code between different keyboards. These files are prefixed with `sbp-` to remove any naming clash. * [bb-audio](bb-audio.c): Code dealing with audio playback using onboard sound. -Also contains stuff regarding using the devices as MIDI controllers. (WIP) -* [bb-backlight](bb-backlight.c): Controls global key single-channel LED stuff. -* [bb-keylight](bb-keylight.c): Controls per-key RGB LED matrix stuff. -* [bb-underglow](bb-underglow.c): Controls RGB underglow effects. -* [bb-process](bb-macro.c): My custom keycodes; macros, tap dances, etc. -* [bb-rotary](bb-rotary.c): Rotary encoder sutff +* [bb-encoder](bb-encoder.c): Rotary encoder sutff. +* [bb-macro](bb-macro.c): My custom keycodes; macros, tap dances, etc. +* [bb-oled](bb-oled.c): Controls OLED displays. +* [bb-rgb](bb-rgb.c): Controls per-key RGB LED matrix stuff. # Layout -![Corne layout](https://i.imgur.com/6VvQZ2I.png) - My personal layout is mostly inspired by the [Miryoku layout](../manna-harbour_miryoku/miryoku.org). There are some changes to make it friendlier to international keyboards. My board is compatible with software implementation of Dvorak and Turkish F. +WIP + ## Base Base layer uses tap-hold functionality to have access to modifiers. diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 401e5a2345f..68d87c2f8e4 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -47,7 +47,7 @@ void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: switch (encoder_state[index].rgb) { case 0: @@ -134,90 +134,42 @@ void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef(RGB_MATRIX_ENABLE) case _MEDI: switch(encoder_state[index].rgb) { case 0: // Effect the RGB mode if (clockwise) { - #ifdef RGBLIGHT_ENABLE - rgblight_step_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_step_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - rgblight_step_reverse_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_step_reverse_noeeprom(); - #endif } break; case 1: // Effect the RGB hue if (clockwise) { - #ifdef RGBLIGHT_ENABLE - rgblight_increase_hue_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_hue_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - rgblight_decrease_hue_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_decrease_hue_noeeprom(); - #endif } break; case 2: // Effect the RGB saturation if (clockwise) { - #ifdef RGBLIGHT_ENABLE - rgblight_increase_sat_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_sat_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - rgblight_decrease_sat_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_decrease_sat_noeeprom(); - #endif } break; case 3: // Effect the RGB brightness if (clockwise) { - #ifdef RGBLIGHT_ENABLE - rgblight_increase_val_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_val_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - rgblight_decrease_val_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_decrease_val_noeeprom(); - #endif } break; case 4: // Effect the RGB effect speed if (clockwise) { - #ifdef RGBLIGHT_ENABLE - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_speed_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_decrease_speed_noeeprom(); - #endif } break; } @@ -331,31 +283,19 @@ bool encoder_update_user(uint8_t index, bool clockwise) { void encoder_click_action(uint8_t index) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef(RGB_MATRIX_ENABLE) case _MEDI: switch(encoder_state[index].rgb) { case 0: // Return to no animation - #ifdef RGBLIGHT_ENABLE - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); - #endif break; case 1: case 2: case 3: // Toggle - #ifdef RGBLIGHT_ENABLE - rgblight_increase_val_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_val_noeeprom(); - #endif break; case 4: // Toggle velocikey - #ifdef VELOCIKEY_ENABLE velocikey_toggle(); - #endif break; } break; @@ -422,7 +362,7 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // If shifted, move mode one point forward if (get_mods() & MOD_MASK_SHIFT) { switch (get_highest_layer(layer_state)) { - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: encoder_state[encoder_index].rgb = (encoder_state[encoder_index].rgb + 1) % 5; @@ -442,7 +382,7 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // If ctrl is active, move mode one point backwards } else if (get_mods() & MOD_MASK_CTRL) { switch (get_highest_layer(layer_state)) { - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: encoder_state[encoder_index].rgb = (encoder_state[encoder_index].rgb + 5 - 1) % 5; diff --git a/users/bbaserdem/bb-keylight.c b/users/bbaserdem/bb-keylight.c deleted file mode 100644 index d52f092af79..00000000000 --- a/users/bbaserdem/bb-keylight.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 "bb-keylight.h" -/* Code relating to per-key RGB LED stuff - */ - -// These are matrix specific so they need to be defined in the keymap code. -// BUT these are made to take RGB arguments so the color choice is central -__attribute__ ((weak)) -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { } -__attribute__ ((weak)) -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { } - -// Allow hooking into the RGB matrix indications using keymap code -__attribute__ ((weak)) void rgb_matrix_indicators_keymap(void) { } -// Set RGB state depending on layer -void rgb_matrix_indicators_user(void) { - // Do each layer seperately - switch (get_highest_layer(layer_state)) { - case _GAME: - keylight_set_left(RGB_TURQUOISE); - break; - case _CHAR: - rgb_matrix_set_color_all(RGB_CHARTREUSE); - break; - case _MEDI: - keylight_set_right(RGB_CORAL); - break; - case _NAVI: - keylight_set_right(RGB_GREEN); - break; - case _SYMB: - keylight_set_right(RGB_PURPLE); - break; - case _NUMB: - keylight_set_left(RGB_CYAN); - break; - case _FUNC: - keylight_set_left(RGB_RED); - break; - case _MOUS: - keylight_set_left(RGB_YELLOW); - break; - case _MUSI: - rgb_matrix_set_color_all(RGB_MAGENTA); - break; - } - // Load keymap hooks - rgb_matrix_indicators_keymap(); -} - -// Hook into shutdown code to make all perkey LED's red on hitting reset -void shutdown_keylight(void) { - // Flash all the key LED's red on shutdown - uint16_t timer_start = timer_read(); - rgb_matrix_set_color_all(RGB_CORAL); - // Delay until this registers - while(timer_elapsed(timer_start) < 250) {wait_ms(1);} -} - -// Hook into suspend code -void suspend_power_down_keylight(void) { - rgb_matrix_set_suspend_state(true); -} -void suspend_wakeup_init_keylight(void) { - rgb_matrix_set_suspend_state(false); -} diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 423ebb2525d..377eb33d855 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -19,62 +19,11 @@ along with this program. If not, see . // Tap dance definitons #ifdef TAP_DANCE_ENABLE -// Bigswitch tap dance code for the last key down event. -void bigswitch_fin(qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 0: - // Change RGB mode - #ifdef RGBLIGHT_ENABLE - rgblight_step(); - #endif - break; - case 1: - // Change RGB mode; but reverse - #ifdef RGBLIGHT_ENABLE - rgblight_step_reverse(); - #endif - break; - case 2: - // Toggle RGB functions - #ifdef RGBLIGHT_ENABLE - rgblight_toggle(); - #endif - break; - case 3: - // Change RGB hue - #ifdef RGBLIGHT_ENABLE - rgblight_increase_hue(); - #endif - break; - case 4: - // Send OS + Escape; which screen locks in my OS - register_code(KC_LGUI); - register_code(KC_ESC); - break; - case 5: - // Send power keycode - register_code(KC_POWER); - break; - } -} -// Unregister the keycodes entered -void bigswitch_res (qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 4: - unregister_code(KC_LGUI); - unregister_code(KC_ESC); - break; - case 5: - unregister_code(KC_POWER); - break; - } -} qk_tap_dance_action_t tap_dance_actions[] = { #ifdef AUDIO_ENABLE // Music playback speed modulator [TD_AUDIO_TEMPO] = ACTION_TAP_DANCE_DOUBLE(MU_SLOW, MU_FAST), #endif - [TD_BIGSWITCH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, bigswitch_fin, bigswitch_res), }; #endif diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h index 9a4bf437894..ce32e8ca471 100644 --- a/users/bbaserdem/bb-macro.h +++ b/users/bbaserdem/bb-macro.h @@ -105,6 +105,5 @@ enum { #ifdef AUDIO_ENABLE TD_AUDIO_TEMPO, #endif - TD_BIGSWITCH, }; #endif diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index dea42770f94..efda79a8806 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -25,9 +25,7 @@ along with this program. If not, see . */ // Following line imports reading of RGB settings -#if defined RGBLIGHT_ENABLE -extern rgblight_config_t rgblight_config; -#elif defined RGB_MATRIX_ENABLE +#if defined RGB_MATRIX_ENABLE extern rgb_config_t rgb_matrix_config; #endif @@ -44,9 +42,7 @@ static void render_status(void) { uint8_t this_layer = get_highest_layer(layer_state); uint8_t this_mod = get_mods(); // Temporary variable for RGB - #if defined RGBLIGHT_ENABLE - static char rgb_temp4[4] = {0}; - #elif defined RGB_MATRIX_ENABLE + #if defined RGB_MATRIX_ENABLE static char rgb_temp4[4] = {0}; #endif // Temporary variable for WPM string @@ -97,24 +93,8 @@ static void render_status(void) { // Line 2: Mod or info switch (this_layer) { - // Show RGB mode as an overlay -#if defined RGBLIGHT_ENABLE - case _MEDI: - oled_write_P(PSTR("m:"), false); - itoa(rgblight_config.mode, rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write_P(PSTR(" h:"), false); - itoa(rgblight_config.hsv.h, rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write_P(PSTR(" s:"), false); - itoa(rgblight_config.hsv.s, rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write_P(PSTR(" v:"), false); - itoa(rgblight_config.hsv.v, rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write_P(PSTR("\n"), false); - break; -#elif defined RGB_MATRIX_ENABLE + // Show RGB mode as an overlay in media mode. +#if defined RGB_MATRIX_ENABLE case _MEDI: oled_write_P(PSTR("m"), false); itoa(rgb_matrix_config.mode, rgb_temp4, 10); diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c new file mode 100644 index 00000000000..ee8915031ed --- /dev/null +++ b/users/bbaserdem/bb-rgb.c @@ -0,0 +1,104 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-rgb.h" +#define SPLIT_POINT 112 +/* Code relating to per-key RGB LED stuff + */ + +// Allow hooking into the RGB matrix indications using keymap code +__attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { + return false; +} +// Set RGB state depending on layer +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + // Load keymap hooks + if(rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max)) { + return; + } + // Do each layer seperately + switch (get_highest_layer(layer_state)) { + case _GAME: // Set left side as turquoise + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x < SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_PURPLE); + } + } + break; + case _CHAR: // Set full board as chartreuse + rgb_matrix_set_color_all(RGB_GOLD); + break; + case _MEDI: // Set right side as coral + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x > SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_PINK); + } + } + break; + case _NAVI: // Set right side as green + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x > SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_GREEN); + } + } + break; + case _SYMB: // Set right side as purple + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x > SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_YELLOW); + } + } + break; + case _NUMB: // Set left side as cyan + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x < SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_CYAN); + } + } + break; + case _FUNC: // Set left side as red + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x < SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_RED); + } + } + break; + case _MOUS: // Set left side as yellow + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x < SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_SPRINGGREEN); + } + } + break; + case _MUSI: // Set full board as magenta + rgb_matrix_set_color_all(RGB_ORANGE); + break; + } +} + +// Hook into shutdown code to make all perkey LED's red on hitting reset +void shutdown_keylight(void) { + // Flash all the key LED's red on shutdown + uint16_t timer_start = timer_read(); + rgb_matrix_set_color_all(RGB_CORAL); + // Delay until this registers + while(timer_elapsed(timer_start) < 250) {wait_ms(1);} +} + +// Hook into suspend code +void suspend_power_down_keylight(void) { + rgb_matrix_set_suspend_state(true); +} +void suspend_wakeup_init_keylight(void) { + rgb_matrix_set_suspend_state(false); +} diff --git a/users/bbaserdem/bb-keylight.h b/users/bbaserdem/bb-rgb.h similarity index 80% rename from users/bbaserdem/bb-keylight.h rename to users/bbaserdem/bb-rgb.h index 3297f151139..e71c88e5585 100644 --- a/users/bbaserdem/bb-keylight.h +++ b/users/bbaserdem/bb-rgb.h @@ -17,11 +17,8 @@ along with this program. If not, see . */ // For custom indicators -void rgb_matrix_indicators_user(void); +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); // Hook into shutdown code void shutdown_keylight(void); void suspend_wakeup_init_keylight(void); void suspend_power_down_keylight(void); -// These should be defined worst case on this file -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue); -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue); diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 32879e0bff7..eb61c3eff36 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -297,7 +297,6 @@ enum userspace_layers { // Layer switches #define BB_CHAR OSL(_CHAR) #define BB_GAME TG(_GAME) -#define BB_BIGS TD(TD_BIGSWITCH) /* Depending on how the layouts change with language; the keys are shown as; * ┌────────────────────────────────────────────────┐ diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 55686ea2cdf..41dee7322aa 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -63,24 +63,17 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes) SRC += bb-encoder.c endif +# RGB LED (Perkey) code +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) +SRC += bb-rgb.c +endif + # Backlight code ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) SRC += bb-backlight.c endif -# RGB LED Underglow code -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) -SRC += bb-underglow.c -endif - # OLED code ifeq ($(strip $(OLED_ENABLE)), yes) SRC += bb-oled.c endif - -# RGB LED (Perkey) code -ifneq ($(strip $(RGB_MATRIX_ENABLE)),) - ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) - SRC += bb-keylight.c - endif -endif From ec5872fcc789ed1ed09c922f5f34c91e86001909 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 6 Sep 2021 21:10:43 -0400 Subject: [PATCH 24/94] Checking kyria code --- keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c | 2 +- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 8e6ac4d60a3..97f942ab8fc 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -96,5 +96,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } - #endif //OLED_DRIVER_ENABLE + #endif //OLED_ENABLE #endif //KEYBOARD_kyria_rev1 diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index 1d1db3aaa14..10868450488 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -13,11 +13,12 @@ # Kyria hardware ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) # Elective features + ENCODER_ENABLE = yes + OLED_ENABLE = yes + # Nonexistent features AUDIO_ENABLE = no BACKLIGHT_ENABLE = no - ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = no - OLED_ENABLE = yes # Space savers NKRO_ENABLE = no VELOCIKEY_ENABLE = no From 52f5ea4d335a465c087cfe30d3859fcd9612ed81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 22:23:37 -0400 Subject: [PATCH 25/94] Changed up some stuff --- .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 2 +- .../split_3x6_5/default_split_3x6_3/keymap.c | 24 ++++ layouts/default/split_3x6_5/info.json | 62 ++++++++++ layouts/default/split_3x6_5/layout.json | 12 ++ layouts/default/split_3x6_5/readme.md | 5 + users/bbaserdem/; | 109 ++++++++++++++++++ users/bbaserdem/bb-encoder.c | 4 +- users/bbaserdem/bb-macro.c | 4 +- users/bbaserdem/bb-macro.h | 4 +- users/bbaserdem/config.h | 38 +++--- users/bbaserdem/rules.mk | 4 +- 11 files changed, 235 insertions(+), 33 deletions(-) create mode 100644 layouts/default/split_3x6_5/default_split_3x6_3/keymap.c create mode 100644 layouts/default/split_3x6_5/info.json create mode 100644 layouts/default/split_3x6_5/layout.json create mode 100644 layouts/default/split_3x6_5/readme.md create mode 100644 users/bbaserdem/; diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index 10868450488..c98f1772960 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -22,5 +22,5 @@ ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) # Space savers NKRO_ENABLE = no VELOCIKEY_ENABLE = no - WPM_ENABLE = no + WPM_ENABLE = yes endif diff --git a/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c b/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c new file mode 100644 index 00000000000..4fb2bab5737 --- /dev/null +++ b/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c @@ -0,0 +1,24 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┐ + * │Tab│ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │Bsp│ + * ├───┼───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┼───┤ + * │Ctl│ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ + * ├───┼───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┼───┤ + * │Sft│ Z │ X │ C │ V │ B │ │ N │ M │ , │ . │ / │Sft│ + * └───┴───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┴───┘ + * ┌───┐ ┌───┐ + * │GUI├───┐ ┌───┤Alt│ + * └───┤Bsp├───┐ ┌───┤Ent├───┘ + * └───┤ │ │ ├───┘ + * └───┘ └───┘ + */ + [0] = 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_RSFT, + KC_LGUI, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_RALT + ) +}; diff --git a/layouts/default/split_3x6_5/info.json b/layouts/default/split_3x6_5/info.json new file mode 100644 index 00000000000..b1ca28168bf --- /dev/null +++ b/layouts/default/split_3x6_5/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "3x6+3 split layout", + "url": "", + "maintainer": "qmk", + "width": 14, + "height": 4.75, + "layouts": { + "LAYOUT_split_3x6_3": { + "layout": [ + {"x":0, "y":0.25}, + {"x":1, "y":0.25}, + {"x":2, "y":0.125}, + {"x":3, "y":0}, + {"x":4, "y":0.125}, + {"x":5, "y":0.25}, + + {"x":8, "y":0.25}, + {"x":9, "y":0.125}, + {"x":10, "y":0}, + {"x":11, "y":0.125}, + {"x":12, "y":0.25}, + {"x":13, "y":0.25}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.125}, + {"x":3, "y":1}, + {"x":4, "y":1.125}, + {"x":5, "y":1.25}, + + {"x":8, "y":1.25}, + {"x":9, "y":1.125}, + {"x":10, "y":1}, + {"x":11, "y":1.125}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25}, + + {"x":0, "y":2.25}, + {"x":1, "y":2.25}, + {"x":2, "y":2.125}, + {"x":3, "y":2}, + {"x":4, "y":2.125}, + {"x":5, "y":2.25}, + + {"x":8, "y":2.25}, + {"x":9, "y":2.125}, + {"x":10, "y":2}, + {"x":11, "y":2.125}, + {"x":12, "y":2.25}, + {"x":13, "y":2.25}, + + {"x":3.5, "y":3.25}, + {"x":4.5, "y":3.5}, + {"x":5.5, "y":3.75}, + + {"x":7.5, "y":3.75}, + {"x":8.5, "y":3.5}, + {"x":9.5, "y":3.25} + ] + } + } +} diff --git a/layouts/default/split_3x6_5/layout.json b/layouts/default/split_3x6_5/layout.json new file mode 100644 index 00000000000..c1256eed98a --- /dev/null +++ b/layouts/default/split_3x6_5/layout.json @@ -0,0 +1,12 @@ +[{x:3,a:7},"",{x:6},""], +[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], +[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], +[{y:-0.25,x:3},"",{x:6},""], +[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], +[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], +[{y:-0.25,x:3},"",{x:6},""], +[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], +[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], +[{x:3.5},"",{x:5},""], +[{y:-0.75,x:4.5},"",{x:3},""], +[{y:-0.75,x:5.5},"",{x:1},""] diff --git a/layouts/default/split_3x6_5/readme.md b/layouts/default/split_3x6_5/readme.md new file mode 100644 index 00000000000..0e83aec2b98 --- /dev/null +++ b/layouts/default/split_3x6_5/readme.md @@ -0,0 +1,5 @@ +# split_3x6_5 + + LAYOUT_split_3x6_5 + +Layout for split keyboards with 3x6 keys and five thumb keys per hand. Examples include Kyria. diff --git a/users/bbaserdem/; b/users/bbaserdem/; new file mode 100644 index 00000000000..f3b8a2189b6 --- /dev/null +++ b/users/bbaserdem/; @@ -0,0 +1,109 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* This header file contains definitons regarding custom keycodes. + * - Both regular and unicode macros are dealt with in this file + */ + +// These will be delegated to keymap specific stuff (weak definition) +bool process_record_macro(uint16_t keycode, keyrecord_t *record); + +// Unicodemap implementation +#ifdef UNICODEMAP_ENABLE +enum userspace_unicodemap { + UPC_A_CIRC, + UPC_C_CEDI, + UPC_G_BREV, + UPC_I_CIRC, + UPC_I_DOTL, + UPC_I_DOTT, + UPC_O_DIAE, + UPC_S_CEDI, + UPC_U_CIRC, + UPC_U_DIAE, + LOW_A_CIRC, + LOW_C_CEDI, + LOW_G_BREV, + LOW_I_CIRC, + LOW_I_DOTL, + LOW_I_DOTT, + LOW_O_DIAE, + LOW_S_CEDI, + LOW_U_CIRC, + LOW_U_DIAE, + ELLIPSIS, + PLANCK_CON, + ANGSTROM, + MATHPI, + BITCOIN, + UPC_ALPHA, + UPC_BETA, + UPC_GAMMA, + UPC_DELTA, + UPC_EPSILON, + UPC_ZETA, + UPC_ETA, + UPC_THETA, + UPC_IOTA, + UPC_KAPPA, + UPC_LAMBDA, + UPC_MU, + UPC_NU, + UPC_XI, + UPC_OMICRON, + UPC_PI, + UPC_RHO, + UPC_SIGMA, + UPC_TAU, + UPC_UPSILON, + UPC_PHI, + UPC_CHI, + UPC_PSI, + UPC_OMEGA, + LOW_ALPHA, + LOW_BETA, + LOW_GAMMA, + LOW_DELTA, + LOW_EPSILON, + LOW_ZETA, + LOW_ETA, + LOW_THETA, + LOW_IOTA, + LOW_KAPPA, + LOW_LAMBDA, + LOW_MU, + LOW_NU, + LOW_XI, + LOW_OMICRON, + LOW_PI, + LOW_RHO, + LOW_SIGMA, + LOW_TAU, + LOW_UPSILON, + LOW_PHI, + LOW_CHI, + LOW_PSI, + LOW_OMEGA, +}; +#endif + +// Tap dance stuff +#ifdef AUDIO_ENABLE +#ifdef TAP_DANCE_ENABLE +enum { + TD_AUDIO_TEMPO, +}; +#endif +#endif diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 68d87c2f8e4..58e6af22b50 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -134,7 +134,7 @@ void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #ifdef(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: switch(encoder_state[index].rgb) { case 0: // Effect the RGB mode @@ -283,7 +283,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { void encoder_click_action(uint8_t index) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #ifdef(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: switch(encoder_state[index].rgb) { case 0: // Return to no animation diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 377eb33d855..04b8a1a8c5e 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -18,14 +18,14 @@ along with this program. If not, see . */ // Tap dance definitons +#ifdef AUDIO_ENABLE #ifdef TAP_DANCE_ENABLE qk_tap_dance_action_t tap_dance_actions[] = { - #ifdef AUDIO_ENABLE // Music playback speed modulator [TD_AUDIO_TEMPO] = ACTION_TAP_DANCE_DOUBLE(MU_SLOW, MU_FAST), - #endif }; #endif +#endif // Unicode definitions; for single character keys // We mask their definitions if unicode is not enabled diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h index ce32e8ca471..f3b8a2189b6 100644 --- a/users/bbaserdem/bb-macro.h +++ b/users/bbaserdem/bb-macro.h @@ -100,10 +100,10 @@ enum userspace_unicodemap { #endif // Tap dance stuff +#ifdef AUDIO_ENABLE #ifdef TAP_DANCE_ENABLE enum { - #ifdef AUDIO_ENABLE TD_AUDIO_TEMPO, - #endif }; #endif +#endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 2bd268f592e..2da1be253bb 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -30,6 +30,17 @@ along with this program. If not, see . #if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) #define NO_PRINT #endif + +// Split transport settings +#ifdef SPLIT_KEYBOARD +#define SPLIT_TRANSPORT_MIRROR +// #define SPLIT_LAYER_STATE_ENABLE +// #define SPLIT_MODS_ENABLE +#ifdef WPM_ENABLE + // #define SPLIT_WPM_ENABLE +#endif +#endif + // Unicode entry mode #ifdef UNICODEMAP_ENABLE #define UNICODE_SELECTED_MODES UC_LNX @@ -59,15 +70,12 @@ along with this program. If not, see . // Backlight settings #ifdef BACKLIGHT_ENABLE - // Turn on breathing only if audio is not enabled, due to hardware stuff - #ifndef AUDIO_ENABLE - #define BACKLIGHT_BREATHING - #define BREATHING_PERIOD 5 - #endif + #define BACKLIGHT_BREATHING + #define BREATHING_PERIOD 5 #endif // Enable RGB LED sleep mode -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +#ifdef RGB_MATRIX_ENABLE #define RGB_DISABLE_WHEN_USB_SUSPENDED true #endif @@ -99,24 +107,6 @@ along with this program. If not, see . #endif #endif -// For underglow light -#ifdef RGBLIGHT_ENABLE - // Enable animations - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - #define RGBLIGHT_EFFECT_TWINKLE - // Enable layer switching code - #define RGBLIGHT_LAYERS - #define RGBLIGHT_MAX_LAYERS 10 - #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF - // If these are not defined; just default to entire board for layer - #define RGBLIGHT_LEFT_BEG 0 - #define RGBLIGHT_LEFT_NUM RGBLED_NUM - #define RGBLIGHT_RIGHT_BEG 0 - #define RGBLIGHT_RIGHT_NUM RGBLED_NUM -#endif - // For perkey leds #ifdef RGB_MATRIX_ENABLE // Start using this mode diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 41dee7322aa..0775e0a64bd 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -12,13 +12,12 @@ # Common compilation flags EXTRAFLAGS += -flto # Used to make code smaller -#LTO_ENABLE = yes +LTO_ENABLE = yes # These should be enabled in all boards MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation -TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -34,6 +33,7 @@ API_SYSEX_ENABLE = no # Allows OS to send signals. BLUETOOTH_ENABLE = no # For bluetooth KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead +TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance # These features can be enabled on ARM boards; disabled for AVR due to space # NKRO_ENABLE = no # Default is 6KRO which is plenty From 3090d6a53213d9747d90a33661c2b513c77e5272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 22:24:22 -0400 Subject: [PATCH 26/94] Erroneous file deleted --- users/bbaserdem/; | 109 ---------------------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 users/bbaserdem/; diff --git a/users/bbaserdem/; b/users/bbaserdem/; deleted file mode 100644 index f3b8a2189b6..00000000000 --- a/users/bbaserdem/; +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 -#include "bbaserdem.h" -/* This header file contains definitons regarding custom keycodes. - * - Both regular and unicode macros are dealt with in this file - */ - -// These will be delegated to keymap specific stuff (weak definition) -bool process_record_macro(uint16_t keycode, keyrecord_t *record); - -// Unicodemap implementation -#ifdef UNICODEMAP_ENABLE -enum userspace_unicodemap { - UPC_A_CIRC, - UPC_C_CEDI, - UPC_G_BREV, - UPC_I_CIRC, - UPC_I_DOTL, - UPC_I_DOTT, - UPC_O_DIAE, - UPC_S_CEDI, - UPC_U_CIRC, - UPC_U_DIAE, - LOW_A_CIRC, - LOW_C_CEDI, - LOW_G_BREV, - LOW_I_CIRC, - LOW_I_DOTL, - LOW_I_DOTT, - LOW_O_DIAE, - LOW_S_CEDI, - LOW_U_CIRC, - LOW_U_DIAE, - ELLIPSIS, - PLANCK_CON, - ANGSTROM, - MATHPI, - BITCOIN, - UPC_ALPHA, - UPC_BETA, - UPC_GAMMA, - UPC_DELTA, - UPC_EPSILON, - UPC_ZETA, - UPC_ETA, - UPC_THETA, - UPC_IOTA, - UPC_KAPPA, - UPC_LAMBDA, - UPC_MU, - UPC_NU, - UPC_XI, - UPC_OMICRON, - UPC_PI, - UPC_RHO, - UPC_SIGMA, - UPC_TAU, - UPC_UPSILON, - UPC_PHI, - UPC_CHI, - UPC_PSI, - UPC_OMEGA, - LOW_ALPHA, - LOW_BETA, - LOW_GAMMA, - LOW_DELTA, - LOW_EPSILON, - LOW_ZETA, - LOW_ETA, - LOW_THETA, - LOW_IOTA, - LOW_KAPPA, - LOW_LAMBDA, - LOW_MU, - LOW_NU, - LOW_XI, - LOW_OMICRON, - LOW_PI, - LOW_RHO, - LOW_SIGMA, - LOW_TAU, - LOW_UPSILON, - LOW_PHI, - LOW_CHI, - LOW_PSI, - LOW_OMEGA, -}; -#endif - -// Tap dance stuff -#ifdef AUDIO_ENABLE -#ifdef TAP_DANCE_ENABLE -enum { - TD_AUDIO_TEMPO, -}; -#endif -#endif From 1aad4d0639ad220a84e5ba70859d8ec7d63954cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 22:24:56 -0400 Subject: [PATCH 27/94] Erroneous files deleted --- .../split_3x6_5/default_split_3x6_3/keymap.c | 24 ------- layouts/default/split_3x6_5/info.json | 62 ------------------- layouts/default/split_3x6_5/layout.json | 12 ---- layouts/default/split_3x6_5/readme.md | 5 -- 4 files changed, 103 deletions(-) delete mode 100644 layouts/default/split_3x6_5/default_split_3x6_3/keymap.c delete mode 100644 layouts/default/split_3x6_5/info.json delete mode 100644 layouts/default/split_3x6_5/layout.json delete mode 100644 layouts/default/split_3x6_5/readme.md diff --git a/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c b/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c deleted file mode 100644 index 4fb2bab5737..00000000000 --- a/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c +++ /dev/null @@ -1,24 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * ┌───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┐ - * │Tab│ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │Bsp│ - * ├───┼───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┼───┤ - * │Ctl│ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ - * ├───┼───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┼───┤ - * │Sft│ Z │ X │ C │ V │ B │ │ N │ M │ , │ . │ / │Sft│ - * └───┴───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┴───┘ - * ┌───┐ ┌───┐ - * │GUI├───┐ ┌───┤Alt│ - * └───┤Bsp├───┐ ┌───┤Ent├───┘ - * └───┤ │ │ ├───┘ - * └───┘ └───┘ - */ - [0] = 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_RSFT, - KC_LGUI, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_RALT - ) -}; diff --git a/layouts/default/split_3x6_5/info.json b/layouts/default/split_3x6_5/info.json deleted file mode 100644 index b1ca28168bf..00000000000 --- a/layouts/default/split_3x6_5/info.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "keyboard_name": "3x6+3 split layout", - "url": "", - "maintainer": "qmk", - "width": 14, - "height": 4.75, - "layouts": { - "LAYOUT_split_3x6_3": { - "layout": [ - {"x":0, "y":0.25}, - {"x":1, "y":0.25}, - {"x":2, "y":0.125}, - {"x":3, "y":0}, - {"x":4, "y":0.125}, - {"x":5, "y":0.25}, - - {"x":8, "y":0.25}, - {"x":9, "y":0.125}, - {"x":10, "y":0}, - {"x":11, "y":0.125}, - {"x":12, "y":0.25}, - {"x":13, "y":0.25}, - - {"x":0, "y":1.25}, - {"x":1, "y":1.25}, - {"x":2, "y":1.125}, - {"x":3, "y":1}, - {"x":4, "y":1.125}, - {"x":5, "y":1.25}, - - {"x":8, "y":1.25}, - {"x":9, "y":1.125}, - {"x":10, "y":1}, - {"x":11, "y":1.125}, - {"x":12, "y":1.25}, - {"x":13, "y":1.25}, - - {"x":0, "y":2.25}, - {"x":1, "y":2.25}, - {"x":2, "y":2.125}, - {"x":3, "y":2}, - {"x":4, "y":2.125}, - {"x":5, "y":2.25}, - - {"x":8, "y":2.25}, - {"x":9, "y":2.125}, - {"x":10, "y":2}, - {"x":11, "y":2.125}, - {"x":12, "y":2.25}, - {"x":13, "y":2.25}, - - {"x":3.5, "y":3.25}, - {"x":4.5, "y":3.5}, - {"x":5.5, "y":3.75}, - - {"x":7.5, "y":3.75}, - {"x":8.5, "y":3.5}, - {"x":9.5, "y":3.25} - ] - } - } -} diff --git a/layouts/default/split_3x6_5/layout.json b/layouts/default/split_3x6_5/layout.json deleted file mode 100644 index c1256eed98a..00000000000 --- a/layouts/default/split_3x6_5/layout.json +++ /dev/null @@ -1,12 +0,0 @@ -[{x:3,a:7},"",{x:6},""], -[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], -[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], -[{y:-0.25,x:3},"",{x:6},""], -[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], -[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], -[{y:-0.25,x:3},"",{x:6},""], -[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], -[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], -[{x:3.5},"",{x:5},""], -[{y:-0.75,x:4.5},"",{x:3},""], -[{y:-0.75,x:5.5},"",{x:1},""] diff --git a/layouts/default/split_3x6_5/readme.md b/layouts/default/split_3x6_5/readme.md deleted file mode 100644 index 0e83aec2b98..00000000000 --- a/layouts/default/split_3x6_5/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# split_3x6_5 - - LAYOUT_split_3x6_5 - -Layout for split keyboards with 3x6 keys and five thumb keys per hand. Examples include Kyria. From e9c8c123f223d99dc66c6504b1349b3d4706f994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 22:58:48 -0400 Subject: [PATCH 28/94] Made crkbd layout work with arm. --- .../crkbd/keymaps/bbaserdem-arm/chconf.h | 7 ++ .../crkbd/keymaps/bbaserdem-arm/config.h | 53 +++++++++++++ .../crkbd/keymaps/bbaserdem-arm/halconf.h | 5 ++ .../crkbd/keymaps/bbaserdem-arm/keymap.c | 79 +++++++++++++++++++ .../crkbd/keymaps/bbaserdem-arm/mcuconf.h | 6 ++ .../crkbd/keymaps/bbaserdem-arm/rules.mk | 22 ++++++ .../crkbd/keymaps/bbaserdem-arm/ssd1306.c | 0 .../README.md | 0 .../config.h | 0 .../keymap.c | 0 .../rules.mk | 0 .../README.md | 0 .../{bbaserdem => bbaserdem-disable}/chconf.h | 0 .../{bbaserdem => bbaserdem-disable}/config.h | 0 .../halconf.h | 0 .../{bbaserdem => bbaserdem-disable}/keymap.c | 34 -------- .../mcuconf.h | 0 .../{bbaserdem => bbaserdem-disable}/rules.mk | 0 users/bbaserdem/bb-encoder.c | 2 + users/bbaserdem/bb-rgb.c | 2 +- users/bbaserdem/bbaserdem.h | 6 +- users/bbaserdem/config.h | 1 - 22 files changed, 176 insertions(+), 41 deletions(-) create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/config.h create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c rename layouts/community/split_3x5_3/{bbaserdem2 => bbaserdem-disable}/README.md (100%) rename layouts/community/split_3x5_3/{bbaserdem2 => bbaserdem-disable}/config.h (100%) rename layouts/community/split_3x5_3/{bbaserdem2 => bbaserdem-disable}/keymap.c (100%) rename layouts/community/split_3x5_3/{bbaserdem2 => bbaserdem-disable}/rules.mk (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/README.md (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/chconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/config.h (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/halconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/keymap.c (67%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/mcuconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/rules.mk (100%) diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h new file mode 100644 index 00000000000..2041f2e4cd0 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h @@ -0,0 +1,7 @@ +#define CH_CFG_ST_RESOLUTION 16 +#define CH_CFG_ST_FREQUENCY 10000 +#if __has_include("platforms/chibios/common/configs/chconf.h") +# include_next "platforms/chibios/common/configs/chconf.h" +#else +# include_next "chconf.h" +#endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/config.h b/keyboards/crkbd/keymaps/bbaserdem-arm/config.h new file mode 100644 index 00000000000..27b616c1e57 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/config.h @@ -0,0 +1,53 @@ +#pragma once +#include "config_common.h" +#undef PRODUCT +#undef MANUFACTURER +#define MANUFACTURER Waffles +#define PRODUCT Protorne Keyboard +#undef USE_I2C +#undef SSD1306OLED +#define EE_HANDS +#define USE_SERIAL_PD2 +#undef RGBLED_NUM +#undef RGB_DI_PIN +#ifdef RGB_MATRIX_ENABLE +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 +#define RGB_MATRIX_SPLIT { 27, 27 } +// #define RGB_MATRIX_KEYPRESSES +// #define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// #define RGB_DISABLE_WHEN_USB_SUSPENDED true +// #define SPLIT_TRANSPORT_MIRROR +#endif +#ifdef RGBLIGHT_ENABLE +#define RGBLIGHT_ANIMATIONS +#undef RGBLED_SPLIT +#define RGBLED_SPLIT { 27, 27 } +#define RGBLIGHT_LIMIT_VAL 175 +#endif +#define RGBLED_NUM 54 +#define RGB_DI_PIN B5 +#define WS2812_PWM_DRIVER PWMD3 +#define WS2812_PWM_CHANNEL 3 +#define WS2812_PWM_PAL_MODE 2 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM3 +#define WS2812_DMA_CHANNEL 3 +#undef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D3 +#define SERIAL_USART_SPEED 921600 +#define SERIAL_USART_DRIVER SD1 +#define SERIAL_USART_TX_PAL_MODE 7 +#ifdef ENCODER_ENABLE +#define ENCODERS_PAD_A { B2 } +#define ENCODERS_PAD_B { B6 } +#define ENCODERS_PAD_A_RIGHT { B2 } +#define ENCODERS_PAD_B_RIGHT { B6 } +#define ENCODER_RESOLUTIONS { 4, 2 } +#endif +#ifdef PIMORONI_TRACKBALL +#define PIMORONI_TRACKBALL_ROTATE +#define PIMORONI_TRACKBALL_INVERT_Y +#endif +#ifdef AUDIO_ENABLE +#define AUDIO_PIN A5 +#define STARTUP_SONG SONG(ODE_TO_JOY) +#endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h new file mode 100644 index 00000000000..c144217ae45 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h @@ -0,0 +1,5 @@ +#pragma once +// #define HAL_USE_DAC TRUE +#define HAL_USE_PWM TRUE +#define HAL_USE_SERIAL TRUE +#include_next diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c b/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c new file mode 100644 index 00000000000..4f192e8fed9 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c @@ -0,0 +1,79 @@ +#include "bbaserdem.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_split_3x6_3_wrapper( + BB_ENC0,_BL1_5_,_BR1_5_,BB_ENC1, + _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, + _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, + _BL4_3_,_BR4_3_ + ), + [_CHAR] = LAYOUT_split_3x6_3_wrapper( + _______,_CL1_5_,_CR1_5_,_______, + XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, + XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, + _CL4_3_,_CR4_3_ + ), + [_GAME] = LAYOUT_split_3x6_3_wrapper( + _______,_GA1_5_,___6___, + _GA2_1_,_GA2_5_,___6___, + _GA3_1_,_GA3_5_,___6___, + _GA4_3_,___3___ + ), + [_MEDI] = LAYOUT_split_3x6_3_wrapper( + ___6___,_ME1_5_,_______, + ___6___,_ME2_5_,xxx1xxx, + ___6___,_ME3_5_,xxx1xxx, + ___3___,_ME4_3_ + ), + [_NAVI] = LAYOUT_split_3x6_3_wrapper( + ___6___,_NA1_5_,_______, + ___6___,_NA2_5_,xxx1xxx, + ___6___,_NA3_5_,xxx1xxx, + ___3___,_NA4_3_ + ), + [_SYMB] = LAYOUT_split_3x6_3_wrapper( + ___6___,_SY1_5_,_______, + ___6___,_SY2_5_,xxx1xxx, + ___6___,_SY3_5_,xxx1xxx, + ___3___,_SY4_3_ + ), + [_NUMB] = LAYOUT_split_3x6_3_wrapper( + _______,_NU1_5_,___6___, + xxx1xxx,_NU2_5_,___6___, + xxx1xxx,_NU3_5_,___6___, + _NU4_3_,___3___ + ), + [_FUNC] = LAYOUT_split_3x6_3_wrapper( + _______,_FU1_5_,___6___, + xxx1xxx,_FU2_5_,___6___, + xxx1xxx,_FU3_5_,___6___, + _FU4_3_,___3___ + ), + [_MOUS] = LAYOUT_split_3x6_3_wrapper( + _______,_MO1_5_,___6___, + xxx1xxx,_MO2_5_,___6___, + xxx1xxx,_MO3_5_,___6___, + _MO4_3_,___3___ + ), + [_MUSI] = LAYOUT_split_3x6_3_wrapper( + _MU_12_, + _MU_12_, + _MU_12_, + _MUL_3_,_MUR_3_ + ) +}; + + + +#ifdef AUDIO_ENABLE +void keyboard_pre_init_kb(void) { //thank you to @sigprof for this + // Set audio pins to analog mode + palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); + palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); +} + +void keyboard_post_init_kb(void) { + // Enable OPAMP1 as A5 → B1 follower + OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; +} +#endif //audio diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h new file mode 100644 index 00000000000..5acc7678257 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h @@ -0,0 +1,6 @@ +#pragma once +#include_next +#undef STM32_PWM_USE_TIM3 +#define STM32_PWM_USE_TIM3 TRUE +#undef STM32_SERIAL_USE_USART1 +#define STM32_SERIAL_USE_USART1 TRUE diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk b/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk new file mode 100644 index 00000000000..f1a4e84112b --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk @@ -0,0 +1,22 @@ +USER_NAME := bbaserdem +MCU = STM32F303 +CTPC = yes +DEBUG_MATRIX_SCAN_RATE_ENABLE = no +SERIAL_DRIVER = usart +WS2812_DRIVER = pwm +VIA_ENABLE = yes +OLED_ENABLE = yes +WPM_ENABLE = yes +AUDIO_ENABLE = yes #breaks reset keycode? +AUDIO_DRIVER = dac_basic +EXTRAKEY_ENABLE = yes +COMMAND_ENABLE = no +CONSOLE_ENABLE = no +BOOTMAGIC_ENABLE = lite +SPLIT_KEYBOARD = yes +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = yes +LTO_ENABLE = yes +NKRO_ENABLE = yes +ENCODER_ENABLE = yes +PIMORONI_TRACKBALL = no diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c b/keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c new file mode 100644 index 00000000000..e69de29bb2d diff --git a/layouts/community/split_3x5_3/bbaserdem2/README.md b/layouts/community/split_3x5_3/bbaserdem-disable/README.md similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem2/README.md rename to layouts/community/split_3x5_3/bbaserdem-disable/README.md diff --git a/layouts/community/split_3x5_3/bbaserdem2/config.h b/layouts/community/split_3x5_3/bbaserdem-disable/config.h similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem2/config.h rename to layouts/community/split_3x5_3/bbaserdem-disable/config.h diff --git a/layouts/community/split_3x5_3/bbaserdem2/keymap.c b/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem2/keymap.c rename to layouts/community/split_3x5_3/bbaserdem-disable/keymap.c diff --git a/layouts/community/split_3x5_3/bbaserdem2/rules.mk b/layouts/community/split_3x5_3/bbaserdem-disable/rules.mk similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem2/rules.mk rename to layouts/community/split_3x5_3/bbaserdem-disable/rules.mk diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem-disable/README.md similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/README.md rename to layouts/community/split_3x6_3/bbaserdem-disable/README.md diff --git a/layouts/community/split_3x6_3/bbaserdem/chconf.h b/layouts/community/split_3x6_3/bbaserdem-disable/chconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/chconf.h rename to layouts/community/split_3x6_3/bbaserdem-disable/chconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem-disable/config.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/config.h rename to layouts/community/split_3x6_3/bbaserdem-disable/config.h diff --git a/layouts/community/split_3x6_3/bbaserdem/halconf.h b/layouts/community/split_3x6_3/bbaserdem-disable/halconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/halconf.h rename to layouts/community/split_3x6_3/bbaserdem-disable/halconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem-disable/keymap.c similarity index 67% rename from layouts/community/split_3x6_3/bbaserdem/keymap.c rename to layouts/community/split_3x6_3/bbaserdem-disable/keymap.c index 7980b1ba802..ecddacf845e 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem-disable/keymap.c @@ -79,40 +79,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// RGB Matrix configuration -#ifdef RGB_MATRIX_ENABLE - -// crkbd -#if defined(KEYBOARD_crkbd_rev1) -/* This is left-right for CRKBD indicator light - * - The LED 42 is for spacebar specifically, leave it out of the matrix - * - This is how it looks like - * ┌──┬──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┬──┐ - * │24│23│18│17│10│09│      │36│37│44│45│50│51│ - * ├──┼02┼──┼01┼──┼00┤      ├27┼──┼28┼──┼29┼──┤ - * │25│22│19│16│11│08│     │35│38│43│46│49│52│ - * ├──┼03┼──┼04┼──┼05┤      ├32┼──┼31┼──┼30┼──┤ - * │26│21│20│15│12│07│     │34│39│42│47│48│53│ - * └──┴──┴──┴──┼──┼──┼──┐┌──┼──┼──┼──┴──┴──┴──┘ - *             │14│13│06││33│40│41│ - *             └──┴──┴──┘└──┴──┴──┘ - */ -// Sided color-setting -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 27; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -} -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 28; i < 54; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -} -// End of differentiations -#endif -// End of code for the RGB_MATRIX setup -#endif - #ifdef AUDIO_ENABLE // crkbd #if defined(KEYBOARD_crkbd_rev1) diff --git a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem-disable/mcuconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/mcuconf.h rename to layouts/community/split_3x6_3/bbaserdem-disable/mcuconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem-disable/rules.mk similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/rules.mk rename to layouts/community/split_3x6_3/bbaserdem-disable/rules.mk diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 58e6af22b50..a9ac645e107 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -295,7 +295,9 @@ void encoder_click_action(uint8_t index) { rgb_matrix_increase_val_noeeprom(); break; case 4: // Toggle velocikey + #ifdef VELOCIKEY_ENABLE velocikey_toggle(); + #endif break; } break; diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index ee8915031ed..2b2c78e240e 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -23,7 +23,7 @@ __attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_mi // Set RGB state depending on layer void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { // Load keymap hooks - if(rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max)) { + if(rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { return; } // Do each layer seperately diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index eb61c3eff36..f9771cf1893 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -27,17 +27,13 @@ along with this program. If not, see . #ifdef AUDIO_ENABLE #include "bb-audio.h" #endif -// Underglow using rgb LEDs -#ifdef RGBLIGHT_ENABLE - #include "bb-underglow.h" -#endif // Keycap backlight using non-rgb LEDs #ifdef BACKLIGHT_ENABLE #include "bb-backlight.h" #endif // Keycap backlight using rgb LEDs #ifdef RGB_MATRIX_ENABLE - #include "bb-keylight.h" + #include "bb-rgb.h" #endif // Rotary encoder #ifdef ENCODER_ENABLE diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 2da1be253bb..ff35e8cefb1 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -127,7 +127,6 @@ along with this program. If not, see . #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Some more config options - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 // Set maximum brightness #define RGB_MATRIX_KEYPRESSES // React to key presses #define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects #endif From 7c7f5dd6385890346313861d9f574083e426f5cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 23:18:29 -0400 Subject: [PATCH 29/94] Made layout work --- .../crkbd/keymaps/bbaserdem-arm/chconf.h | 7 -- .../crkbd/keymaps/bbaserdem-arm/config.h | 53 ------------- .../crkbd/keymaps/bbaserdem-arm/halconf.h | 5 -- .../crkbd/keymaps/bbaserdem-arm/keymap.c | 79 ------------------- .../crkbd/keymaps/bbaserdem-arm/mcuconf.h | 6 -- .../crkbd/keymaps/bbaserdem-arm/rules.mk | 22 ------ .../README.md | 0 .../{bbaserdem-disable => bbaserdem}/chconf.h | 0 .../{bbaserdem-disable => bbaserdem}/config.h | 18 ++--- .../halconf.h | 0 .../{bbaserdem-disable => bbaserdem}/keymap.c | 6 +- .../mcuconf.h | 0 .../{bbaserdem-disable => bbaserdem}/rules.mk | 16 ++-- .../split_3x6_3/bbaserdem}/ssd1306.c | 0 14 files changed, 22 insertions(+), 190 deletions(-) delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/config.h delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/README.md (100%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/chconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/config.h (85%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/halconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/keymap.c (95%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/mcuconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/rules.mk (84%) rename {keyboards/crkbd/keymaps/bbaserdem-arm => layouts/community/split_3x6_3/bbaserdem}/ssd1306.c (100%) diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h deleted file mode 100644 index 2041f2e4cd0..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h +++ /dev/null @@ -1,7 +0,0 @@ -#define CH_CFG_ST_RESOLUTION 16 -#define CH_CFG_ST_FREQUENCY 10000 -#if __has_include("platforms/chibios/common/configs/chconf.h") -# include_next "platforms/chibios/common/configs/chconf.h" -#else -# include_next "chconf.h" -#endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/config.h b/keyboards/crkbd/keymaps/bbaserdem-arm/config.h deleted file mode 100644 index 27b616c1e57..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/config.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once -#include "config_common.h" -#undef PRODUCT -#undef MANUFACTURER -#define MANUFACTURER Waffles -#define PRODUCT Protorne Keyboard -#undef USE_I2C -#undef SSD1306OLED -#define EE_HANDS -#define USE_SERIAL_PD2 -#undef RGBLED_NUM -#undef RGB_DI_PIN -#ifdef RGB_MATRIX_ENABLE -#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 -#define RGB_MATRIX_SPLIT { 27, 27 } -// #define RGB_MATRIX_KEYPRESSES -// #define RGB_MATRIX_FRAMEBUFFER_EFFECTS -// #define RGB_DISABLE_WHEN_USB_SUSPENDED true -// #define SPLIT_TRANSPORT_MIRROR -#endif -#ifdef RGBLIGHT_ENABLE -#define RGBLIGHT_ANIMATIONS -#undef RGBLED_SPLIT -#define RGBLED_SPLIT { 27, 27 } -#define RGBLIGHT_LIMIT_VAL 175 -#endif -#define RGBLED_NUM 54 -#define RGB_DI_PIN B5 -#define WS2812_PWM_DRIVER PWMD3 -#define WS2812_PWM_CHANNEL 3 -#define WS2812_PWM_PAL_MODE 2 -#define WS2812_DMA_STREAM STM32_DMA1_STREAM3 -#define WS2812_DMA_CHANNEL 3 -#undef SOFT_SERIAL_PIN -#define SOFT_SERIAL_PIN D3 -#define SERIAL_USART_SPEED 921600 -#define SERIAL_USART_DRIVER SD1 -#define SERIAL_USART_TX_PAL_MODE 7 -#ifdef ENCODER_ENABLE -#define ENCODERS_PAD_A { B2 } -#define ENCODERS_PAD_B { B6 } -#define ENCODERS_PAD_A_RIGHT { B2 } -#define ENCODERS_PAD_B_RIGHT { B6 } -#define ENCODER_RESOLUTIONS { 4, 2 } -#endif -#ifdef PIMORONI_TRACKBALL -#define PIMORONI_TRACKBALL_ROTATE -#define PIMORONI_TRACKBALL_INVERT_Y -#endif -#ifdef AUDIO_ENABLE -#define AUDIO_PIN A5 -#define STARTUP_SONG SONG(ODE_TO_JOY) -#endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h deleted file mode 100644 index c144217ae45..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -// #define HAL_USE_DAC TRUE -#define HAL_USE_PWM TRUE -#define HAL_USE_SERIAL TRUE -#include_next diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c b/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c deleted file mode 100644 index 4f192e8fed9..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c +++ /dev/null @@ -1,79 +0,0 @@ -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_split_3x6_3_wrapper( - BB_ENC0,_BL1_5_,_BR1_5_,BB_ENC1, - _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, - _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, - _BL4_3_,_BR4_3_ - ), - [_CHAR] = LAYOUT_split_3x6_3_wrapper( - _______,_CL1_5_,_CR1_5_,_______, - XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, - XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, - _CL4_3_,_CR4_3_ - ), - [_GAME] = LAYOUT_split_3x6_3_wrapper( - _______,_GA1_5_,___6___, - _GA2_1_,_GA2_5_,___6___, - _GA3_1_,_GA3_5_,___6___, - _GA4_3_,___3___ - ), - [_MEDI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_ME1_5_,_______, - ___6___,_ME2_5_,xxx1xxx, - ___6___,_ME3_5_,xxx1xxx, - ___3___,_ME4_3_ - ), - [_NAVI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_NA1_5_,_______, - ___6___,_NA2_5_,xxx1xxx, - ___6___,_NA3_5_,xxx1xxx, - ___3___,_NA4_3_ - ), - [_SYMB] = LAYOUT_split_3x6_3_wrapper( - ___6___,_SY1_5_,_______, - ___6___,_SY2_5_,xxx1xxx, - ___6___,_SY3_5_,xxx1xxx, - ___3___,_SY4_3_ - ), - [_NUMB] = LAYOUT_split_3x6_3_wrapper( - _______,_NU1_5_,___6___, - xxx1xxx,_NU2_5_,___6___, - xxx1xxx,_NU3_5_,___6___, - _NU4_3_,___3___ - ), - [_FUNC] = LAYOUT_split_3x6_3_wrapper( - _______,_FU1_5_,___6___, - xxx1xxx,_FU2_5_,___6___, - xxx1xxx,_FU3_5_,___6___, - _FU4_3_,___3___ - ), - [_MOUS] = LAYOUT_split_3x6_3_wrapper( - _______,_MO1_5_,___6___, - xxx1xxx,_MO2_5_,___6___, - xxx1xxx,_MO3_5_,___6___, - _MO4_3_,___3___ - ), - [_MUSI] = LAYOUT_split_3x6_3_wrapper( - _MU_12_, - _MU_12_, - _MU_12_, - _MUL_3_,_MUR_3_ - ) -}; - - - -#ifdef AUDIO_ENABLE -void keyboard_pre_init_kb(void) { //thank you to @sigprof for this - // Set audio pins to analog mode - palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); - palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); -} - -void keyboard_post_init_kb(void) { - // Enable OPAMP1 as A5 → B1 follower - OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; -} -#endif //audio diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h deleted file mode 100644 index 5acc7678257..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include_next -#undef STM32_PWM_USE_TIM3 -#define STM32_PWM_USE_TIM3 TRUE -#undef STM32_SERIAL_USE_USART1 -#define STM32_SERIAL_USE_USART1 TRUE diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk b/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk deleted file mode 100644 index f1a4e84112b..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -USER_NAME := bbaserdem -MCU = STM32F303 -CTPC = yes -DEBUG_MATRIX_SCAN_RATE_ENABLE = no -SERIAL_DRIVER = usart -WS2812_DRIVER = pwm -VIA_ENABLE = yes -OLED_ENABLE = yes -WPM_ENABLE = yes -AUDIO_ENABLE = yes #breaks reset keycode? -AUDIO_DRIVER = dac_basic -EXTRAKEY_ENABLE = yes -COMMAND_ENABLE = no -CONSOLE_ENABLE = no -BOOTMAGIC_ENABLE = lite -SPLIT_KEYBOARD = yes -RGBLIGHT_ENABLE = no -RGB_MATRIX_ENABLE = yes -LTO_ENABLE = yes -NKRO_ENABLE = yes -ENCODER_ENABLE = yes -PIMORONI_TRACKBALL = no diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/README.md b/layouts/community/split_3x6_3/bbaserdem/README.md similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem-disable/README.md rename to layouts/community/split_3x6_3/bbaserdem/README.md diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/chconf.h b/layouts/community/split_3x6_3/bbaserdem/chconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem-disable/chconf.h rename to layouts/community/split_3x6_3/bbaserdem/chconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h similarity index 85% rename from layouts/community/split_3x6_3/bbaserdem-disable/config.h rename to layouts/community/split_3x6_3/bbaserdem/config.h index 471539c8ea2..ace48a65655 100644 --- a/layouts/community/split_3x6_3/bbaserdem-disable/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -20,20 +20,20 @@ along with this program. If not, see . #ifdef KEYBOARD_crkbd_rev1 #include "config_common.h" - // Undo Eeprom handedness, try EE_HANDS later + // Use EE_HANDS to determine handedness #define EE_HANDS // Rebrand the PCB #undef PRODUCT + #define PRODUCT Protorne Keyboard #undef MANUFACTURER #define MANUFACTURER Waffles - #define PRODUCT Protorne Keyboard // Remove OLED definitions? #undef USE_I2C #undef SSD1306OLED - // Audio output on pin A5 (actualy will be output on B1) + // Audio output on pin A5 (actualy will be output on B1 using keymap init) #ifdef AUDIO_ENABLE #define AUDIO_PIN A5 #endif @@ -47,7 +47,7 @@ along with this program. If not, see . #define SERIAL_USART_DRIVER SD1 #define SERIAL_USART_TX_PAL_MODE 7 - // Things to make RGB matrix work + // Things to make RGB matrix work on the waffle board #undef RGBLED_NUM #define RGBLED_NUM 54 #undef RGB_DI_PIN @@ -55,7 +55,6 @@ along with this program. If not, see . #ifdef RGB_MATRIX_ENABLE #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 #define RGB_MATRIX_SPLIT { 27, 27 } - #define SPLIT_TRANSPORT_MIRROR #endif #define WS2812_PWM_DRIVER PWMD3 #define WS2812_PWM_CHANNEL 3 @@ -70,8 +69,9 @@ along with this program. If not, see . #endif // Encoder definitons - #define ENCODERS_PAD_A { B2 } - #define ENCODERS_PAD_B { B6 } - #define ENCODERS_PAD_A_RIGHT { B2 } - #define ENCODERS_PAD_B_RIGHT { B6 } + #define ENCODERS_PAD_A { B6 } + #define ENCODERS_PAD_B { B2 } + #define ENCODERS_PAD_A_RIGHT { B6 } + #define ENCODERS_PAD_B_RIGHT { B2 } + #define ENCODER_RESOLUTIONS { 4, 2 } #endif diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/halconf.h b/layouts/community/split_3x6_3/bbaserdem/halconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem-disable/halconf.h rename to layouts/community/split_3x6_3/bbaserdem/halconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c similarity index 95% rename from layouts/community/split_3x6_3/bbaserdem-disable/keymap.c rename to layouts/community/split_3x6_3/bbaserdem/keymap.c index ecddacf845e..5271b2ec2a5 100644 --- a/layouts/community/split_3x6_3/bbaserdem-disable/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -11,10 +11,7 @@ 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 QMK_KEYBOARD_H #include "bbaserdem.h" -#include "quantum.h" -#include const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -84,7 +81,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #if defined(KEYBOARD_crkbd_rev1) // Audio requires some fixes to work on @waffle's PCB // ! Copy pasted from ItsWaffle's waffle fork -void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this +void keyboard_pre_init_keymap(void) { + //thank you to @sigprof for this // Set audio pins to analog mode palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem-disable/mcuconf.h rename to layouts/community/split_3x6_3/bbaserdem/mcuconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk similarity index 84% rename from layouts/community/split_3x6_3/bbaserdem-disable/rules.mk rename to layouts/community/split_3x6_3/bbaserdem/rules.mk index 21fd9526c0d..6a7c8c1e4f2 100644 --- a/layouts/community/split_3x6_3/bbaserdem-disable/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -12,6 +12,11 @@ # Corne keyboard; with ARM ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) + # Proton C conversion + MCU = STM32F303 + CTPC = yes + # BOARD = QMK_PROTON_C + # BOOTLOADER = stm32-dfu # My usual features AUDIO_ENABLE = yes BACKLIGHT_ENABLE = no @@ -21,10 +26,6 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # Features that take otherwise too much space WPM_ENABLE = yes NKRO_ENABLE = yes - # Proton C related stuff - MCU = STM32F303 - BOARD = QMK_PROTON_C - BOOTLOADER = stm32-dfu # Config SERIAL_DRIVER = usart WS2812_DRIVER = pwm @@ -33,5 +34,10 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # These are from waffle DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 - LTO_ENABLE = no + VIA_ENABLE = yes + # COMMAND_ENABLE = no + # CONSOLE_ENABLE = no + # BOOTMAGIC_ENABLE = lite + # LTO_ENABLE = yes + # PIMORONI_TRACKBALL = no endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c similarity index 100% rename from keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c rename to layouts/community/split_3x6_3/bbaserdem/ssd1306.c From 141c70ff7a8092b563962b605958ab1825f9e6ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 8 Sep 2021 00:15:27 -0400 Subject: [PATCH 30/94] Fixed encoder related stuff on corne --- layouts/community/split_3x6_3/bbaserdem/config.h | 11 ++++++----- users/bbaserdem/config.h | 5 ----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index ace48a65655..1c7a0a11c1e 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -69,9 +69,10 @@ along with this program. If not, see . #endif // Encoder definitons - #define ENCODERS_PAD_A { B6 } - #define ENCODERS_PAD_B { B2 } - #define ENCODERS_PAD_A_RIGHT { B6 } - #define ENCODERS_PAD_B_RIGHT { B2 } - #define ENCODER_RESOLUTIONS { 4, 2 } + #define ENCODERS_PAD_A { B2 } + #define ENCODERS_PAD_B { B6 } + #define ENCODER_RESOLUTIONS { 4 } + #define ENCODERS_PAD_A_RIGHT { B2 } + #define ENCODERS_PAD_B_RIGHT { B6 } + #define ENCODER_RESOLUTIONS_RIGHT { 2 } #endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index ff35e8cefb1..8d849def102 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -63,11 +63,6 @@ along with this program. If not, see . #define PERMISSIVE_HOLD #define TAPPING_FORCE_HOLD -// Encoder settings -#ifdef ENCODER_ENABLE - #define ENCODER_RESOLUTION 2 -#endif - // Backlight settings #ifdef BACKLIGHT_ENABLE #define BACKLIGHT_BREATHING From f7875d54892cc3163f44795ff2c05e38c6de5e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 8 Sep 2021 02:30:47 -0400 Subject: [PATCH 31/94] Simplified OLED code (no firmware size change) --- users/bbaserdem/bb-oled.c | 58 +++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index efda79a8806..51c7d3c1128 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -55,40 +55,40 @@ static void render_status(void) { #endif // Line 1: Layer State - oled_write_P(PSTR("Layer: "), false); + oled_write("Layer: ", false); switch (this_layer) { case _BASE: - oled_write_P(PSTR("Default\n"), false); + oled_write("Default\n", false); break; case _CHAR: - oled_write_P(PSTR("Sp. Chars\n"), false); + oled_write("Sp. Chars\n", false); break; case _GAME: - oled_write_P(PSTR("Gaming\n"), false); + oled_write("Gaming\n", false); break; case _MEDI: - oled_write_P(PSTR("Media Ctr\n"), false); + oled_write("Media Ctr\n", false); break; case _NAVI: - oled_write_P(PSTR("Navigation\n"), false); + oled_write("Navigation\n", false); break; case _SYMB: - oled_write_P(PSTR("Symbols\n"), false); + oled_write("Symbols\n", false); break; case _NUMB: - oled_write_P(PSTR("Numpad\n"), false); + oled_write("Numpad\n", false); break; case _FUNC: - oled_write_P(PSTR("Funct Keys\n"), false); + oled_write("Funct Keys\n", false); break; case _MOUS: - oled_write_P(PSTR("Mouse Keys\n"), false); + oled_write("Mouse Keys\n", false); break; case _MUSI: - oled_write_P(PSTR("Music Mode\n"), false); + oled_write("Music Mode\n", false); break; default: - oled_write_P(PSTR("???\n"), false); + oled_write("???\n", false); } // Line 2: Mod or info @@ -96,52 +96,52 @@ static void render_status(void) { // Show RGB mode as an overlay in media mode. #if defined RGB_MATRIX_ENABLE case _MEDI: - oled_write_P(PSTR("m"), false); + oled_write("m", false); itoa(rgb_matrix_config.mode, rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_write_P(PSTR(" h"), false); + oled_write(" h", false); itoa(rgb_matrix_config.hsv.h, rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_write_P(PSTR(" s"), false); + oled_write(" s", false); itoa(rgb_matrix_config.hsv.s, rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_write_P(PSTR(" v"), false); + oled_write(" v", false); itoa(rgb_matrix_config.hsv.v, rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_write_P(PSTR("\n"), false); + oled_write("\n", false); break; #endif // Show the modifier if nothing else is doing anything default: - oled_write_P((this_mod & MOD_MASK_SHIFT ) ? PSTR("Shft ") : PSTR(" "), false); - oled_write_P((this_mod & MOD_MASK_CTRL ) ? PSTR("Ctrl ") : PSTR(" "), false); - oled_write_P((this_mod & MOD_MASK_ALT ) ? PSTR("Alt" ) : PSTR(" "), false); - oled_write_P((this_mod & MOD_BIT(KC_RALT)) ? PSTR("G ") : PSTR(" "), false); - oled_write_P((this_mod & MOD_MASK_GUI ) ? PSTR("Meta ") : PSTR(" "), false); - oled_write_P(PSTR("\n"), false); + oled_write((this_mod & MOD_MASK_SHIFT ) ? "Shft " : " ", false); + oled_write((this_mod & MOD_MASK_CTRL ) ? "Ctrl " : " ", false); + oled_write((this_mod & MOD_MASK_ALT ) ? "Alt" : " ", false); + oled_write((this_mod & MOD_BIT(KC_RALT)) ? "G " : " ", false); + oled_write((this_mod & MOD_MASK_GUI ) ? "Meta " : " ", false); + oled_write("\n", false); break; } // Line 3: WPM - oled_write_P(PSTR("KM: Qwerty WPM: "), false); + oled_write("KM: Qwerty WPM: ", false); #if defined WPM_ENABLE itoa(get_current_wpm(), wpm_temp4, 10); oled_write(wpm_temp4, false); #else - oled_write_P(PSTR("N/A"), false); + oled_write("N/A", false); #endif - oled_write_P(PSTR("\n"), false); + oled_write("\n", false); // Line 4: Encoder states #ifdef ENCODER_ENABLE - oled_write_P(PSTR("EN0:"), false); + oled_write("EN0:", false); encoder_state_string(0, this_layer, encoder_temp6); oled_write(encoder_temp6, false); - oled_write_P(PSTR(" EN1:"), false); + oled_write(" EN1:", false); encoder_state_string(1, this_layer, encoder_temp6); oled_write(encoder_temp6, false); #endif - oled_write_P(PSTR("\n"), false); + oled_write("\n", false); } From 93eb0f7cf47e71b0372a5cfd30f441ab2149fef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 8 Sep 2021 17:15:19 -0400 Subject: [PATCH 32/94] Removed VIA from firmware --- .../community/split_3x6_3/bbaserdem/config.h | 5 +++++ .../community/split_3x6_3/bbaserdem/rules.mk | 2 +- users/bbaserdem/bb-oled.c | 5 +++++ users/bbaserdem/config.h | 17 ++++++++++++----- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 1c7a0a11c1e..f2bbe766cad 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -33,6 +33,11 @@ along with this program. If not, see . #undef USE_I2C #undef SSD1306OLED + // Add state info transmission + #define SPLIT_LAYER_STATE_ENABLE + #define SPLIT_MODS_ENABLE + #define SPLIT_WPM_ENABLE + // Audio output on pin A5 (actualy will be output on B1 using keymap init) #ifdef AUDIO_ENABLE #define AUDIO_PIN A5 diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 6a7c8c1e4f2..49db761e4d0 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -34,7 +34,7 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # These are from waffle DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 - VIA_ENABLE = yes + VIA_ENABLE = no # COMMAND_ENABLE = no # CONSOLE_ENABLE = no # BOOTMAGIC_ENABLE = lite diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 51c7d3c1128..a171d3052f8 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -29,6 +29,7 @@ along with this program. If not, see . extern rgb_config_t rgb_matrix_config; #endif +#if defined(KEYBOARD_splitkb_kyria_rev1) static void render_qmk_logo(void) { static const char PROGMEM qmk_logo[] = { 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, @@ -36,6 +37,7 @@ static void render_qmk_logo(void) { 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; oled_write_P(qmk_logo, false); } +#endif static void render_status(void) { // Function to print state information @@ -152,6 +154,9 @@ void oled_task_user(void) { #endif render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) } else { + #if defined(KEYBOARD_splitkb_kyria_rev1) render_qmk_logo(); + #endif + render_status(); } } diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 8d849def102..34e5e9488ed 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -33,7 +33,9 @@ along with this program. If not, see . // Split transport settings #ifdef SPLIT_KEYBOARD +// Enable reacting to keypresses on the other half #define SPLIT_TRANSPORT_MIRROR +// Enable communicatong layer state changes. // #define SPLIT_LAYER_STATE_ENABLE // #define SPLIT_MODS_ENABLE #ifdef WPM_ENABLE @@ -69,11 +71,6 @@ along with this program. If not, see . #define BREATHING_PERIOD 5 #endif -// Enable RGB LED sleep mode -#ifdef RGB_MATRIX_ENABLE - #define RGB_DISABLE_WHEN_USB_SUSPENDED true -#endif - // Audio definitions #ifdef AUDIO_ENABLE // Make findable songs as defaults @@ -102,8 +99,18 @@ along with this program. If not, see . #endif #endif +// OLED definitions +#ifdef OLED_ENABLE + // Timeout in one minute + #define OLED_TIMEOUT 60000 + // Fade out the screen when timing out + #define OLED_FADE_OUT + #define OLED_FADE_OUT_INTERVAL 5 +#endif + // For perkey leds #ifdef RGB_MATRIX_ENABLE + #define RGB_DISABLE_WHEN_USB_SUSPENDED true // Start using this mode #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON #define RGB_MATRIX_STARTUP_HUE 100 From 05b6e0372bcc914684d649499264fd2e39db148a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 10 Sep 2021 03:24:49 -0400 Subject: [PATCH 33/94] Created the cropping script --- users/bbaserdem/bbaserdem.h | 86 +++++++++++++++++++---- users/bbaserdem/keymap-bitmaps/.gitignore | 3 + users/bbaserdem/keymap-bitmaps/cropBmp | 22 ++++++ 3 files changed, 98 insertions(+), 13 deletions(-) create mode 100644 users/bbaserdem/keymap-bitmaps/.gitignore create mode 100755 users/bbaserdem/keymap-bitmaps/cropBmp diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index f9771cf1893..bd9d8390e6d 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -306,9 +306,9 @@ enum userspace_layers { * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * ` ~ │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ < > * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * [ { │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ] } + * \ | │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ' " * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * \ | │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ ' " + * [ { │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ ] } * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ @@ -316,19 +316,19 @@ enum userspace_layers { * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * ` ~ │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ < > * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * / ? │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ = + + * \ | │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ - _ * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * \ | │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ - _ + * / ? │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ = + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * TURKISH F * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * ¬+ *±│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │|< >¦ - * ! !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ - * äq Qå│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│~w W - * !├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ ! - * `x Xà│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │#ş Şǎ + * !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ ! + * `x Xà│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│#ş Şǎ + * ! !├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ + * äq Qå│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │~w W * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ @@ -345,15 +345,15 @@ enum userspace_layers { // The extra line for the 6th (or 0th) row #define _BL1_1_ KC_GRV #define _BR1_1_ KC_NUBS -#define _BL2_1_ KC_LBRC -#define _BR2_1_ KC_RBRC -#define _BL3_1_ KC_BSLS -#define _BR3_1_ KC_QUOT +#define _BL2_1_ KC_BSLS +#define _BR2_1_ KC_QUOT +#define _BL3_1_ KC_LBRC +#define _BR3_1_ KC_RBRC /* Extra characters layer * This is accessed using unicode; so IBus compatible apps only. * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ + * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ΙΘ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ * │ α │ ο │ ε │ ψ │ ι │ │ δ │ η │ τ │ ν │ σ │ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ @@ -427,6 +427,16 @@ enum userspace_layers { /* Symbols layer * This layer has the central columns shifted for convenience * QWERTY + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ ` │ - │ = │ { │ } │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ ~ │ _ │ + │ [ │ ] │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │CapsL│ ( │ ) │ \ │ | │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ ` ~ │ - │ = │ ] } │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ @@ -437,6 +447,16 @@ enum userspace_layers { * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ * DVORAK + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ ` │ { │ } │ / │ = │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ ~ │ [ │ ] │ ? │ + │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │CapsL│ ( │ ) │ \ │ | │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ ` ~ │ [ │ ] │ = + │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ @@ -448,6 +468,16 @@ enum userspace_layers { * └─────┴─────┴─────┘ * Turkish F * (AltGr is right on the central column, red. keys on main layer are omitted) + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ + ¬ │ / \ │ - | │ │ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ * ± │ ? ¿ │ _ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │CapsL│ │ │ │ │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │¬+ *±│ / \ │ - | │ │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ @@ -466,6 +496,16 @@ enum userspace_layers { /* Numbers layer * This layer contains numbers and the associated symbols. * QWERTY + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ " │ 4 $ │ 5 % │ 6 ^ │ ' │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ > │ 1 ! │ 2 @ │ 3 # │Char.│ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ │ 7 & │ 8 * │ 9 ( │ 0 ) │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -476,6 +516,16 @@ enum userspace_layers { * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ * DVORAK + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ _ │ 4 $ │ 5 % │ 6 ^ │ - │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ > │ 1 ! │ 2 @ │ 3 # │Char.│ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ , │ 7 & │ 8 * │ 9 ( │ 0 ) │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -486,6 +536,16 @@ enum userspace_layers { * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ * Turkish F + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ < | │{7 ' │[8 ( │]9 )±│}0 =°│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │¼4 $ │½5 %⅜│¾6 & │ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ > ¦ │¹1 !¡│²2 " │#3 ^³│Char.│ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ │{7 ' │[8 ( │]9 )±│}0 =°│ * ├─────┼─────┼─────┼─────┼─────┤ diff --git a/users/bbaserdem/keymap-bitmaps/.gitignore b/users/bbaserdem/keymap-bitmaps/.gitignore new file mode 100644 index 00000000000..4f6fdcf7c15 --- /dev/null +++ b/users/bbaserdem/keymap-bitmaps/.gitignore @@ -0,0 +1,3 @@ +*.bmp +splitImages +templates diff --git a/users/bbaserdem/keymap-bitmaps/cropBmp b/users/bbaserdem/keymap-bitmaps/cropBmp new file mode 100755 index 00000000000..fdb0805b910 --- /dev/null +++ b/users/bbaserdem/keymap-bitmaps/cropBmp @@ -0,0 +1,22 @@ +#!/bin/bash + +# Goes through all the files and turns them into strips in their respective folder +if [ -z "${1}" ] ; then + echo 'No argument; defaulting to script directory.' + target_dir="$(dirname "${0}")" +elif [ -d "${1}" ] ; then + echo "Targeting files in '${1}'." + target_dir="${1}" +else + echo 'Argument is not directory.' + exit 1 +fi + +output_dir="${target_dir}/splitImages" +mkdir -p "${output_dir}" + +for this_image in "${target_dir}/"*.bmp ; do + echo "Found '${this_image}'." + this_name="$(basename "${this_image%%.bmp}")" + convert "${this_image}" -crop 'x8' "${output_dir}/${this_name}"_%d.bmp +done From 5fb00d180fca8c55b19ac6480c3d11df7bdded79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 10 Sep 2021 15:20:59 -0400 Subject: [PATCH 34/94] Did oled testing --- users/bbaserdem/bb-oled.c | 59 +++++++++++++- users/bbaserdem/bbaserdem.h | 149 +++++++++--------------------------- 2 files changed, 92 insertions(+), 116 deletions(-) diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index a171d3052f8..70991558b75 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -39,6 +39,61 @@ static void render_qmk_logo(void) { } #endif + + +#if defined(KEYBOARD_crkbd_rev1) +// These are my images for keyboard layout +// Naming scheme is _left/right{_keyboardLayout}{_modifiers} +//static const char PROGMEM base0_L_dvor_nomod[][4] = {}; +//static const char PROGMEM base0_L_dvor_shift[][4] = {}; +//static const char PROGMEM base0_R_dvor_nomod[][4] = {}; +//static const char PROGMEM base0_R_dvor_shift[][4] = {}; +//static const char PROGMEM char1_L[][4] = {}; +//static const char PROGMEM char1_R[][4] = {}; +//static const char PROGMEM game2_L[][4] = {}; +//static const char PROGMEM medi3_R[][4] = {}; +//static const char PROGMEM navi4_R[][4] = {}; +//static const char PROGMEM symb5_R_dvor[][4] = {}; +//static const char PROGMEM numb6_L_dvor_nomod[][4] = {}; +//static const char PROGMEM numb6_L_dvor_shift[][4] = {}; +//static const char PROGMEM func7_L[][4] = {}; +//static const char PROGMEM mous8_L[][4] = {}; +//static const char PROGMEM musi9_L[][4] = {}; +static const char PROGMEM musi9_R[4][42] = { + { 0x00, 0x00, 0x00, 0xfe, 0x04, 0x18, 0x04, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x00, +0x8c, 0x12, 0x12, 0x12, 0xe4, 0x00, 0x00, 0x02, 0xfe, 0x02, 0x00, 0x00, 0xfc, 0x02, 0x02, 0x02, +0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x73, 0x00, 0x00}, { + 0x00, 0x00, 0x00, 0x81, 0x60, 0x10, 0x60, 0x81, 0x60, 0x10, 0x00, 0x01, 0x01, 0x01, 0xe0, 0xe0, +0x60, 0x61, 0x61, 0x61, 0x60, 0xf8, 0x70, 0x21, 0x01, 0x01, 0xc0, 0xe0, 0x60, 0x01, 0xf9, 0xf9, +0x00, 0x60, 0xe0, 0xc0, 0x00, 0x00, 0x9c, 0xce, 0x00, 0x00}, { + 0x18, 0x24, 0x4b, 0x48, 0x48, 0x4c, 0x4b, 0x48, 0x4b, 0x2c, 0x18, 0x00, 0x00, 0x00, 0x4f, 0xe7, +0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x7f, 0x00, 0x0f, 0x3f, 0x70, 0x60, 0xc0, 0xc1, 0xc1, +0xc0, 0x60, 0x70, 0x3f, 0x0f, 0x00, 0x73, 0x39, 0x00, 0x00}, { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, 0xf8, 0x08, 0xf0, 0x00, 0x70, 0x88, 0x88, 0x88, +0x71, 0x00, 0x70, 0x88, 0x88, 0x48, 0xff, 0x00, 0x70, 0xa8, 0xa8, 0xa8, 0xb0, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xe7, 0x00, 0x00} }; + +static void render_test(void) { + // Oled set cursor does characters; so moves in 8x6 + // Oled write raw does not advance the cursor; it has to be done seperately. + oled_write_raw_P(musi9_R[0], 42); + oled_set_cursor(8, 0); + oled_write("This text", false); + oled_advance_page(false); + oled_write_raw_P(musi9_R[1], 42); + oled_set_cursor(8, 1); + oled_write("is a test", false); + oled_advance_page(false); + oled_write_raw_P(musi9_R[2], 42); + oled_set_cursor(8, 2); + oled_write("for me to", false); + oled_advance_page(false); + oled_write_raw_P(musi9_R[3], 42); + oled_set_cursor(8, 3); + oled_write("check it.", false); +} +#endif + static void render_status(void) { // Function to print state information uint8_t this_layer = get_highest_layer(layer_state); @@ -151,12 +206,12 @@ void oled_task_user(void) { if (is_keyboard_master()) { #if defined(KEYBOARD_splitkb_kyria_rev1) render_qmk_logo(); + render_status(); #endif - render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) } else { #if defined(KEYBOARD_splitkb_kyria_rev1) render_qmk_logo(); + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) #endif - render_status(); } } diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index bd9d8390e6d..3e9b70117e7 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -14,6 +14,7 @@ along with this program. If not, see . #pragma once #include QMK_KEYBOARD_H #include "quantum.h" +#include "keymap_dvorak.h" /* Besides loading libraries and definitions, this file has my layout defs * LAYOUTS: @@ -271,16 +272,16 @@ enum userspace_layers { #endif // MOD-tap definitions -#define GUI_A MT(MOD_LGUI, KC_A) -#define ALT_S MT(MOD_LALT, KC_S) -#define CTRL_D MT(MOD_LCTL, KC_D) -#define SHIFT_F MT(MOD_LSFT, KC_F) -#define ALTGR_X MT(MOD_RALT, KC_X) -#define GUI_SCL MT(MOD_RGUI, KC_SCLN) -#define ALT_L MT(MOD_LALT, KC_L) -#define CTRL_K MT(MOD_LCTL, KC_K) -#define SHIFT_J MT(MOD_LSFT, KC_J) -#define ALTGR_D MT(MOD_RALT, KC_DOT) +#define GUI_A MT(MOD_LGUI, DV_A) +#define ALT_O MT(MOD_LALT, DV_O) +#define CTRL_E MT(MOD_LCTL, DV_E) +#define SHIFT_U MT(MOD_LSFT, DV_U) +#define ALTGR_Q MT(MOD_RALT, DV_Q) +#define GUI_S MT(MOD_RGUI, DV_S) +#define ALT_N MT(MOD_LALT, DV_N) +#define CTRL_T MT(MOD_LCTL, DV_T) +#define SHIFT_H MT(MOD_LSFT, DV_H) +#define ALTGR_V MT(MOD_RALT, DV_V) // Layer switches #define MED_DEL LT(_MEDI, KC_DEL ) @@ -302,16 +303,6 @@ enum userspace_layers { */ /* Base layout - * QWERTY - * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * ` ~ │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ < > - * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * \ | │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ' " - * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * [ { │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ ] } - * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ - * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ - * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * DVORAK * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * ` ~ │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ < > @@ -334,26 +325,26 @@ enum userspace_layers { * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * The thing about this layout is that these will fit most boards I have. */ -#define _BL1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _BR1_5_ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _BL2_5_ GUI_A, ALT_S, CTRL_D, SHIFT_F,KC_G -#define _BR2_5_ KC_H, SHIFT_J,CTRL_K, ALT_L, GUI_SCL -#define _BL3_5_ KC_Z, ALTGR_X,KC_C, KC_V, KC_B -#define _BR3_5_ KC_N, KC_M, KC_COMM,ALTGR_D,KC_SLSH +#define _BL1_5_ DV_QUOT,DV_COMM,DV_DOT, DV_P, DV_Y +#define _BR1_5_ DV_F, DV_G, DV_C, DV_R, DV_L +#define _BL2_5_ GUI_A, ALT_O, CTRL_E, SHIFT_U,DV_I +#define _BR2_5_ DV_D, SHIFT_H,CTRL_T, ALT_N, GUI_S +#define _BL3_5_ DV_SCLN,ALTGR_Q,DV_J, DV_K, DV_X +#define _BR3_5_ DV_B, DV_M, DV_W, ALTGR_V,DV_Z #define _BL4_3_ MED_DEL,NAV_TAB,SYM_SPC #define _BR4_3_ NUM_ENT,FUN_ESC,MOU_BSP // The extra line for the 6th (or 0th) row -#define _BL1_1_ KC_GRV +#define _BL1_1_ DV_GRV #define _BR1_1_ KC_NUBS -#define _BL2_1_ KC_BSLS -#define _BR2_1_ KC_QUOT -#define _BL3_1_ KC_LBRC -#define _BR3_1_ KC_RBRC +#define _BL2_1_ DV_BSLS +#define _BR2_1_ DV_MINS +#define _BL3_1_ DV_SLSH +#define _BR3_1_ DV_EQL /* Extra characters layer * This is accessed using unicode; so IBus compatible apps only. * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ΙΘ + * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ * │ α │ ο │ ε │ ψ │ ι │ │ δ │ η │ τ │ ν │ σ │ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ @@ -381,7 +372,7 @@ enum userspace_layers { * ├─────┼─────┼─────┼─────┼─────┤ * Shift│ Z │ X │ C │ V │ B │ * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │Space│Enter│ Esc │ + * │ Esc │Enter│Space│ * └─────┴─────┴─────┘ */ #define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T @@ -390,7 +381,7 @@ enum userspace_layers { #define _GA2_1_ KC_TAB #define _GA3_5_ KC_Z, KC_X, KC_C, KC_V, KC_B #define _GA3_1_ KC_LSFT -#define _GA4_3_ KC_SPC, KC_ENT, KC_ESC +#define _GA4_3_ KC_ESC, KC_ENT, KC_SPC /* Media layer * ┌─────┬─────┬─────┬─────┬─────┐ @@ -426,28 +417,7 @@ enum userspace_layers { /* Symbols layer * This layer has the central columns shifted for convenience - * QWERTY - * - new layout - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` │ - │ = │ { │ } │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ ~ │ _ │ + │ [ │ ] │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │CapsL│ ( │ ) │ \ │ | │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` ~ │ - │ = │ ] } │Char.│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ [ { │ ( │ ) │ ' " │CapsL│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ \ | │ _ │ + │ < │ > │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ * DVORAK - * - new layout * ┌─────┬─────┬─────┬─────┬─────┐ * │ ` │ { │ } │ / │ = │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -457,18 +427,8 @@ enum userspace_layers { * ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` ~ │ [ │ ] │ = + │Char.│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ / ? │ ( │ ) │ - _ │CapsL│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ \ | │ { │ } │ < │ > │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ * Turkish F * (AltGr is right on the central column, red. keys on main layer are omitted) - * - new layout * ┌─────┬─────┬─────┬─────┬─────┐ * │ + ¬ │ / \ │ - | │ │ │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -478,45 +438,25 @@ enum userspace_layers { * ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ + * QWERTY * ┌─────┬─────┬─────┬─────┬─────┐ - * │¬+ *±│ / \ │ - | │ │Char.│ + * │ ` │ - │ = │ { │ } │ * ├─────┼─────┼─────┼─────┼─────┤ - * │ │ ) ± │ = ° │ │CapsL│ + * │ ~ │ _ │ + │ [ │ ] │ * ├─────┼─────┼─────┼─────┼─────┤ - * │ │ ? ¿ │ _ │ < | │ > ¦ │ + * │CapsL│ ( │ ) │ \ │ | │ * ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ */ -#define _SY1_5_ KC_GRV,KC_MINS,KC_EQL, KC_RBRC,BB_CHAR -#define _SY2_5_ KC_LBRC,KC_LPRN,KC_RPRN,KC_QUOT,KC_CAPS -#define _SY3_5_ KC_BSLS,KC_UNDS,KC_PLUS,KC_NUBS,LSFT(KC_NUBS) +#define _SY1_5_ DV_GRV, DV_LCBR,DV_RCBR,DV_SLSH,DV_EQL +#define _SY2_5_ DV_TILD,DV_LBRC,DV_RBRC,DV_QUES,DV_PLUS +#define _SY3_5_ KC_CAPS,DV_LPRN,DV_RPRN,DV_BSLS,DV_PIPE #define _SY4_3_ KC_ENT, KC_ESC, KC_BSPC /* Numbers layer * This layer contains numbers and the associated symbols. - * QWERTY - * - new layout - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ " │ 4 $ │ 5 % │ 6 ^ │ ' │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ > │ 1 ! │ 2 @ │ 3 # │Char.│ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ │ 7 & │ 8 * │ 9 ( │ 0 ) │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ │ 4 $ │ 5 % │ 6 ^ │ ' " │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ [ { │ 1 ! │ 2 @ │ 3 # │ ] } │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ * DVORAK - * - new layout * ┌─────┬─────┬─────┬─────┬─────┐ * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -526,17 +466,7 @@ enum userspace_layers { * └─────┴─────┴─────┼─────┼─────┼─────┐ * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ , │ 7 & │ 8 * │ 9 ( │ 0 ) │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ . │ 4 $ │ 5 % │ 6 ^ │ - _ │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ / ? │ 1 ! │ 2 @ │ 3 # │ = + │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ * Turkish F - * - new layout * ┌─────┬─────┬─────┬─────┬─────┐ * │ < | │{7 ' │[8 ( │]9 )±│}0 =°│ * ├─────┼─────┼─────┼─────┼─────┤ @@ -546,19 +476,10 @@ enum userspace_layers { * └─────┴─────┴─────┼─────┼─────┼─────┐ * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ │{7 ' │[8 ( │]9 )±│}0 =°│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ │¼4 $ │½5 %⅜│¾6 & │ │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ │¹1 !¡│²2 " │#3 ^³│ │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ */ -#define _NU1_5_ KC_W, KC_7, KC_8, KC_9, KC_0 -#define _NU2_5_ KC_E, KC_4, KC_5, KC_6, KC_QUOT -#define _NU3_5_ KC_LBRC,KC_1, KC_2, KC_3, KC_RBRC +#define _NU1_5_ KC_NUBS,KC_7, KC_8, KC_9, KC_0 +#define _NU2_5_ DV_UNDS,KC_4, KC_5, KC_6, DV_MINS +#define _NU3_5_ LSFT(KC_NUBS), KC_1, KC_2, KC_3, BB_CHAR #define _NU4_3_ KC_DEL, KC_TAB, KC_SPC /* Function layer From 22164b4450b151caa98bf97cce9667cee7ee6f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 11 Sep 2021 14:04:17 -0400 Subject: [PATCH 35/94] Updated OLED code --- users/bbaserdem/bb-encoder.c | 87 +++++++ users/bbaserdem/bb-encoder.h | 1 + users/bbaserdem/bb-oled.c | 431 +++++++++++++++++++++++++++++------ 3 files changed, 446 insertions(+), 73 deletions(-) diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index a9ac645e107..f63be9f931a 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -43,6 +43,93 @@ void keyboard_post_init_encoder(void) { } // Oled string printing for given layer and index +void encoder_state_string_long(uint8_t index, uint8_t layer, char* buffer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled + #ifdef RGB_MATRIX_ENABLE + case _MEDI: + switch (encoder_state[index].rgb) { + case 0: + strcpy(buffer, "ani mode"); + break; + case 1: + strcpy(buffer, "hue "); + break; + case 2: + strcpy(buffer, "saturat."); + break; + case 3: + strcpy(buffer, "bright. "); + break; + case 4: + strcpy(buffer, "ani. spd"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + #endif + // If pointer control is enabled + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (encoder_state[index].point) { + case 0: + strcpy(buffer, "Lateral "); + break; + case 1: + strcpy(buffer, "Vertical"); + break; + case 2: + strcpy(buffer, "Scr. Ver"); + break; + case 3: + strcpy(buffer, "Scr. Lat"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + #endif + default: + switch (encoder_state[index].base) { + case 0: + strcpy(buffer, "Volume "); + break; + case 1: + strcpy(buffer, "Song "); + break; + case 2: + strcpy(buffer, "Sink "); + break; + case 3: + strcpy(buffer, "Src. Vol"); + break; + case 4: + strcpy(buffer, "Source "); + break; + case 5: + strcpy(buffer, "Arrow LR"); + break; + case 6: + strcpy(buffer, "Arrow UD"); + break; + case 7: + strcpy(buffer, "Page U/D"); + break; + case 8: + strcpy(buffer, "Erase "); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + } +} + void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { // Get the layer straight from the main function switch (layer) { diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 792555ab916..92011c12b3a 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -19,6 +19,7 @@ along with this program. If not, see . // Code to print status string void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); +void encoder_state_string_long(uint8_t index, uint8_t layer, char* buffer); // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 70991558b75..2df1ceab409 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -15,13 +15,12 @@ along with this program. If not, see . #ifdef ENCODER_ENABLE #include "bb-encoder.h" #endif -/* ROTARY ENCODER - * This contains my general rotary encoder code - * Encoders each have a list of different modes they can be in. - * Each mode also have an on click action as well. - * Modes can be cycled using either shift-click or ctrl-click - * Modes can be reset using OS click - * Some modes are only accessible through some keymap layers +/* OLED ENCODER + * This contains my general oled code + * Currently I have two setups with OLEDs + * - Kyria; with 128x64 but with low memory (elite C) + * - Protorne; wh 128x32 but with excellent memory + * This file differentiates only between those two */ // Following line imports reading of RGB settings @@ -29,75 +28,367 @@ along with this program. If not, see . extern rgb_config_t rgb_matrix_config; #endif -#if defined(KEYBOARD_splitkb_kyria_rev1) -static void render_qmk_logo(void) { - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - oled_write_P(qmk_logo, false); -} -#endif - - - #if defined(KEYBOARD_crkbd_rev1) // These are my images for keyboard layout // Naming scheme is _left/right{_keyboardLayout}{_modifiers} -//static const char PROGMEM base0_L_dvor_nomod[][4] = {}; -//static const char PROGMEM base0_L_dvor_shift[][4] = {}; +static const char PROGMEM base0_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, + 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, + 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, + 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, + 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, + 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, + 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, + 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, + 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; +static const char PROGMEM base0_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, + 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, + 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, + 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, + 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, + 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, + 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, + 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, + 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; //static const char PROGMEM base0_R_dvor_nomod[][4] = {}; //static const char PROGMEM base0_R_dvor_shift[][4] = {}; -//static const char PROGMEM char1_L[][4] = {}; +static const char PROGMEM char1_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, + 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, + 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, + 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, + 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, + 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, + 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, + 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; //static const char PROGMEM char1_R[][4] = {}; -//static const char PROGMEM game2_L[][4] = {}; +static const char PROGMEM game2_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, + 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, + 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, + 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, + 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, + 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, + 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, + 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, + 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; //static const char PROGMEM medi3_R[][4] = {}; //static const char PROGMEM navi4_R[][4] = {}; //static const char PROGMEM symb5_R_dvor[][4] = {}; -//static const char PROGMEM numb6_L_dvor_nomod[][4] = {}; -//static const char PROGMEM numb6_L_dvor_shift[][4] = {}; -//static const char PROGMEM func7_L[][4] = {}; -//static const char PROGMEM mous8_L[][4] = {}; -//static const char PROGMEM musi9_L[][4] = {}; +static const char PROGMEM numb6_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; +static const char PROGMEM numb6_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, + 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, + 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, + 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, + 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; +static const char PROGMEM func7_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, + 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, + 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, + 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, + 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 + },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, + 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, + 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, + 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, + 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; +static const char PROGMEM mous8_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, + 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, + 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 + },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, + 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, + 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, + 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, + 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f + },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, + 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, + 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; +static const char PROGMEM musi9_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, + 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, + 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, + 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, + 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, + 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, + 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, + 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; static const char PROGMEM musi9_R[4][42] = { - { 0x00, 0x00, 0x00, 0xfe, 0x04, 0x18, 0x04, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x00, -0x8c, 0x12, 0x12, 0x12, 0xe4, 0x00, 0x00, 0x02, 0xfe, 0x02, 0x00, 0x00, 0xfc, 0x02, 0x02, 0x02, -0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x73, 0x00, 0x00}, { - 0x00, 0x00, 0x00, 0x81, 0x60, 0x10, 0x60, 0x81, 0x60, 0x10, 0x00, 0x01, 0x01, 0x01, 0xe0, 0xe0, -0x60, 0x61, 0x61, 0x61, 0x60, 0xf8, 0x70, 0x21, 0x01, 0x01, 0xc0, 0xe0, 0x60, 0x01, 0xf9, 0xf9, -0x00, 0x60, 0xe0, 0xc0, 0x00, 0x00, 0x9c, 0xce, 0x00, 0x00}, { - 0x18, 0x24, 0x4b, 0x48, 0x48, 0x4c, 0x4b, 0x48, 0x4b, 0x2c, 0x18, 0x00, 0x00, 0x00, 0x4f, 0xe7, -0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x7f, 0x00, 0x0f, 0x3f, 0x70, 0x60, 0xc0, 0xc1, 0xc1, -0xc0, 0x60, 0x70, 0x3f, 0x0f, 0x00, 0x73, 0x39, 0x00, 0x00}, { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, 0xf8, 0x08, 0xf0, 0x00, 0x70, 0x88, 0x88, 0x88, -0x71, 0x00, 0x70, 0x88, 0x88, 0x48, 0xff, 0x00, 0x70, 0xa8, 0xa8, 0xa8, 0xb0, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xe7, 0x00, 0x00} }; - -static void render_test(void) { - // Oled set cursor does characters; so moves in 8x6 - // Oled write raw does not advance the cursor; it has to be done seperately. - oled_write_raw_P(musi9_R[0], 42); - oled_set_cursor(8, 0); - oled_write("This text", false); - oled_advance_page(false); - oled_write_raw_P(musi9_R[1], 42); - oled_set_cursor(8, 1); - oled_write("is a test", false); - oled_advance_page(false); - oled_write_raw_P(musi9_R[2], 42); - oled_set_cursor(8, 2); - oled_write("for me to", false); - oled_advance_page(false); - oled_write_raw_P(musi9_R[3], 42); - oled_set_cursor(8, 3); - oled_write("check it.", false); + { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, + 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, + 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, + 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, + 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, + 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, + 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, + 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, + 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; +static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; +static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; +static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; +static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; +static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; +static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; + +void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { + // Write modifiers starting from said column and row; does 14 characters + // Looks like: + // Mods: + oled_set_cursor(col, row); + oled_write("Mods: ", false); + // Meta + if (mods & MOD_MASK_GUI) { + oled_write_raw_P(mod_meta, 12); + oled_set_cursor(col + 8, row); + } else { + oled_write(" ", false); + } + // Alt(Gr) + if (mods & MOD_BIT(KC_RALT)) { + oled_write_raw_P(mod_altR, 12); + oled_set_cursor(col + 10, row); + } else if (mods & MOD_MASK_ALT) { + oled_write_raw_P(mod_altL, 12); + oled_set_cursor(col + 10, row); + } else { + oled_write(" ", false); + } + // Ctrl + if (mods & MOD_MASK_CTRL) { + oled_write_raw_P(mod_ctrl, 12); + oled_set_cursor(col + 12, row); + } else { + oled_write(" ", false); + } + // Shift + if (mods & MOD_MASK_SHIFT) { + oled_write_raw_P(mod_shft, 12); + oled_set_cursor(col + 14, row); + } else { + oled_write(" ", false); + } +} + +void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { + // Renders the encoder state, 14 characters + static char encoder_temp9[9] = {0}; + + oled_set_cursor(col, row); + #if defined ENCODER_ENABLE + oled_write("Enc: ", false); + encoder_state_string_long(index, layer, encoder_temp9); + oled_write(encoder_temp9, false); + #else + oled_set_cursor(col, row); + oled_write("No enc. avail.", false); + #endif +} + +void render_wpm(uint8_t row, uint8_t col) { + // Renders the WPM, 14 characters + static char wpm_temp4[4] = {0}; + + oled_set_cursor(col, row); + #if defined WPM_ENABLE + oled_write("WPM: ", false); + itoa(get_current_wpm(), wpm_temp4, 10); + oled_write(wpm_temp4, false); + oled_write(" ", false); + #else + oled_write("WPM not avail.", false); + #endif +} + +void render_keymap(uint8_t row, uint8_t col) { + // Render the oled layout + oled_set_cursor(col, row); + oled_write("Layout: DVORAK", false); +} + +void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { + // Draw this image iteratively + for (int i = 0; i < 4; i++) { + oled_set_cursor(col, row + i); + oled_write_raw_P(image[i], 42); + } +} + +void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { + // Render the requested image on the given column and row + // Don't grab highest layer; instead compare from top to bottom. + // Highest layer might be on the other side + if (isLeft) { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_L); + } else if (layer_state_cmp(layer_state, _MOUS)) { + draw_image(row, col, mous8_L); + } else if (layer_state_cmp(layer_state, _FUNC)) { + draw_image(row, col, func7_L); + } else if (layer_state_cmp(layer_state, _NUMB)) { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, numb6_L_dvor_shift); + } else { + draw_image(row, col, numb6_L_dvor_nomod); + } + } else if (layer_state_cmp(layer_state, _GAME)) { + draw_image(row, col, game2_L); + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_L); + } else { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_L_dvor_shift); + } else { + draw_image(row, col, base0_L_dvor_nomod); + } + } + } else { + // WIP + draw_image(row, col, musi9_R); + } } + +void render_rgb(uint8_t row, uint8_t col) { + // Render the RGB state on the given column and row + static char rgb_temp4[4] = {0}; + static char rgb_temp3[3] = {0}; + + oled_set_cursor(col, row); +#if defined RGB_MATRIX_ENABLE + if (rgb_matrix_is_enabled()) { + oled_write_raw_P(rgb_enab, 12); + } else { + oled_write_raw_P(rgb_disa, 12); + } + oled_set_cursor(col + 2, row); + oled_write(" hue sat val", false); + oled_set_cursor(col, row + 1); + itoa(rgb_matrix_get_mode(), rgb_temp3, 10); + oled_write(rgb_temp3, false); + oled_write(" ", false); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); + oled_write(rgb_temp4, false); +#else + oled_write("-RGB disabled-", false); #endif +} + +void render_status_left(void) { + // Left side looks like this on the left half + // (Should be 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + // Right half is whatever layer image needs be + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // MODIFIERS + render_modifiers(0, 0, this_mod); + + // Encoders + render_encoder(1, 0, 0, this_layer); + + // WPM text + render_wpm(2, 0); + + // Visual layout + render_keymap(3, 0); + + // Draw the image after 14'th character + render_layout(0, 14, this_mod, true); +} + +void render_status_right(void) { + // Right half is whatever layer image needs be on the left + // Right side looks like this on the right half + // (Should be after the 12'th character; max 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // Draw the image + render_layout(0, 0, this_mod, false); + // Modifiers + render_modifiers(0, 7, this_mod); + + // Encoder + render_encoder(1, 7, 1, this_layer); + + // RGB State; WIP + render_rgb(2, 7); +} +#endif + +#if defined(KEYBOARD_splitkb_kyria_rev1) +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(qmk_logo, false); +} static void render_status(void) { // Function to print state information uint8_t this_layer = get_highest_layer(layer_state); uint8_t this_mod = get_mods(); + // Render qmk + render_qmk_logo(); // Temporary variable for RGB #if defined RGB_MATRIX_ENABLE static char rgb_temp4[4] = {0}; @@ -110,7 +401,6 @@ static void render_status(void) { #if defined ENCODER_ENABLE static char encoder_temp6[6] = {0}; #endif - // Line 1: Layer State oled_write("Layer: ", false); switch (this_layer) { @@ -147,7 +437,6 @@ static void render_status(void) { default: oled_write("???\n", false); } - // Line 2: Mod or info switch (this_layer) { // Show RGB mode as an overlay in media mode. @@ -178,7 +467,6 @@ static void render_status(void) { oled_write("\n", false); break; } - // Line 3: WPM oled_write("KM: Qwerty WPM: ", false); #if defined WPM_ENABLE @@ -188,7 +476,6 @@ static void render_status(void) { oled_write("N/A", false); #endif oled_write("\n", false); - // Line 4: Encoder states #ifdef ENCODER_ENABLE oled_write("EN0:", false); @@ -199,19 +486,17 @@ static void render_status(void) { oled_write(encoder_temp6, false); #endif oled_write("\n", false); - } +#endif void oled_task_user(void) { - if (is_keyboard_master()) { - #if defined(KEYBOARD_splitkb_kyria_rev1) - render_qmk_logo(); - render_status(); - #endif + #if defined(KEYBOARD_splitkb_kyria_rev1) + render_status(); + #elif defined(KEYBOARD_crkbd_rev1) + if (is_keyboard_left()) { + render_status_left(); } else { - #if defined(KEYBOARD_splitkb_kyria_rev1) - render_qmk_logo(); - render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) - #endif + render_status_right(); } + #endif } From e894ea089f189db4d16fb03099720b668a408f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 11 Sep 2021 16:27:55 -0400 Subject: [PATCH 36/94] Refactored OLED code --- .../splitkb/kyria/keymaps/bbaserdem/config.h | 5 - .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 30 +- .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 2 +- .../community/split_3x6_3/bbaserdem/README.md | 5 +- .../split_3x6_3/bbaserdem/bb-crkbdarm-oled.c | 447 ++++++++++++++ .../split_3x6_3/bbaserdem/bb-crkbdarm-oled.h | 19 + .../community/split_3x6_3/bbaserdem/keymap.c | 10 + .../community/split_3x6_3/bbaserdem/rules.mk | 1 + users/bbaserdem/bb-encoder.c | 179 +----- users/bbaserdem/bb-encoder.h | 6 +- users/bbaserdem/bb-oled.c | 567 ++++++------------ users/bbaserdem/bb-oled.h | 6 + users/bbaserdem/config.h | 2 +- users/bbaserdem/rules.mk | 2 +- 14 files changed, 705 insertions(+), 576 deletions(-) create mode 100644 layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c create mode 100644 layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h index 3e873660a82..e06a6144d0d 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -25,9 +25,4 @@ along with this program. If not, see . #ifdef OLED_ENABLE #define OLED_DISPLAY_128X64 #endif - - // If you are using an Elite C rev3 on the slave side, uncomment the lines below: - // However; this causes the halves to be unresponsive - // #define SPLIT_USB_DETECT - // #define NO_USB_STARTUP_CHECK #endif diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 97f942ab8fc..8b540057c71 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -89,12 +89,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// Kyria specific code -#ifdef KEYBOARD_splitkb_kyria_rev1 - // Rotate the display on kyria - #ifdef OLED_ENABLE - oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; - } - #endif //OLED_ENABLE -#endif //KEYBOARD_kyria_rev1 +#ifdef KEYBOARD_splitkb_kyria_rev1 // Kyria specific code +#ifdef OLED_ENABLE // Kyria's oled screen +// Rotate the display on kyria +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} +// QMK logo screen renderer; will render 126x32 image; but on the default font. +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(qmk_logo, false); +} +// For kyria; print logo, and allow default status printing +bool oled_task_keymap(void) { + render_qmk_logo(); + return true; +} +#endif //OLED_ENABLE +#endif //KEYBOARD_splitkb_kyria_rev1 diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index c98f1772960..ec18b9b1949 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -22,5 +22,5 @@ ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) # Space savers NKRO_ENABLE = no VELOCIKEY_ENABLE = no - WPM_ENABLE = yes + # WPM_ENABLE = no endif diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem/README.md index d89b13f83f6..6d0cda270ad 100644 --- a/layouts/community/split_3x6_3/bbaserdem/README.md +++ b/layouts/community/split_3x6_3/bbaserdem/README.md @@ -12,7 +12,4 @@ using their `crkbd:rev1:arm` build. Build commands; -* For ARM: -`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` -* For ARM: -`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` +* For ARM: `CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` diff --git a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c new file mode 100644 index 00000000000..c869458b952 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c @@ -0,0 +1,447 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-oled.h" +#include "bb-crkbdarm-oled.h" +#ifdef ENCODER_ENABLE + #include "bb-encoder.h" +#endif + +// PROGMEM images +// Naming scheme is _left/right{_keyboardLayout}{_modifiers} +static const char PROGMEM base0_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, + 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, + 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, + 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, + 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, + 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, + 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, + 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, + 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; +static const char PROGMEM base0_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, + 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, + 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, + 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, + 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, + 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, + 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, + 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, + 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; +static const char PROGMEM base0_R_dvor_nomod[4][42] = { + { 0x00,0xfc,0x12,0x12,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x70,0x88, + 0x88,0x88,0x88,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x00,0x02,0x7e,0x80, + 0x80,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x80,0x80,0xf0,0x00,0xf0,0x02,0x82,0x82,0x01,0x00,0x00,0x80, + 0xf0,0x80,0x80,0x00,0xc0,0x40,0x40,0x40,0x80,0x00,0x80,0x40,0x40,0x40, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x83,0x04,0x04,0x02,0x07,0x00,0x07,0x01,0x00,0x00,0x07,0x00,0x00,0x00, + 0x03,0x04,0x04,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x04,0x05,0x05,0x05, + 0x02,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x3f,0x24,0x22,0x22,0x1c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x1e,0x20, + 0x1c,0x20,0x1e,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x22,0x32,0x2a,0x26, + 0x22,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM base0_R_dvor_shift[4][42] = { + { 0xfe,0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xfc,0x02, + 0x02,0x02,0x84,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x00,0x04,0x88,0x50,0x20,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xf1,0x10,0x10,0x10,0xe0,0x00,0xf0,0x81,0x81,0x81,0xf0,0x00,0x10,0x11, + 0xf1,0x11,0x10,0x00,0xf1,0x60,0x80,0x00,0xf1,0x00,0x61,0x91,0x91,0x91, + 0x21,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x8f,0x88,0x88,0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x8f,0x00,0x80,0x00, + 0x0f,0x00,0x80,0x00,0x8f,0x00,0x01,0x06,0x8f,0x00,0x84,0x88,0x88,0x88, + 0x87,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x7f,0x44,0x44,0x44,0x3b,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x1f,0x60, + 0x1c,0x60,0x1f,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x70,0x48,0x44,0x42, + 0x41,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM char1_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, + 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, + 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, + 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, + 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, + 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, + 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, + 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; +static const char PROGMEM char1_R[4][42] = { + { 0x70,0x88,0xf0,0x88,0x70,0x00,0xfe,0x02,0x02,0x02,0x06,0x00,0x88,0x48, + 0x70,0x90,0x88,0x00,0xf0,0x88,0x88,0x88,0x70,0x00,0xc0,0x30,0x0c,0x30, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xa0,0x50,0x53,0x90,0x20,0x00,0xc0,0x80,0x40,0x40,0x80,0x00,0x40,0x40, + 0xc0,0x40,0x40,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x80,0x40,0xc0,0x40, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x03,0x84,0x84,0x04,0x03,0x00,0x07,0x00,0x00,0x00,0x1f,0x00,0x00,0x80, + 0x83,0x84,0x00,0x00,0x00,0x83,0x54,0x8b,0x00,0x00,0x83,0x84,0x84,0x83, + 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0xff,0x24,0x24,0x27,0x18,0x00,0x7e,0x10,0x20,0x20,0x1e,0x00,0x2f,0x30, + 0x00,0x30,0x2f,0x00,0xe0,0x38,0x25,0x38,0xe0,0x00,0x18,0x26,0xa1,0xa0, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM game2_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, + 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, + 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, + 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, + 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, + 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, + 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, + 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, + 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; +static const char PROGMEM medi3_R[4][42] = { + { 0xe0,0x00,0x38,0x00,0xe0,0x00,0x7f,0x02,0x9c,0x02,0x7f,0x00,0x7f,0x08, + 0x88,0x08,0x7f,0x00,0x26,0x49,0xc9,0x49,0x32,0x00,0x07,0x18,0xa0,0x18, + 0x07,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x01,0x01,0xf1,0x70,0x00,0xf0,0x81,0xc3,0xe1,0xf0,0x00,0x00,0x71, + 0x03,0x71,0x00,0x00,0x00,0xc1,0xc3,0xc1,0x00,0x00,0xf0,0xe1,0xc3,0x81, + 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 + },{ 0x0e,0x0a,0x0c,0x0f,0x00,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, + 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, + 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 + },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, + 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, + 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM navi4_R[4][42] = { + { 0xe0,0x10,0x54,0x38,0x10,0x00,0xfc,0x24,0x24,0x24,0x18,0x00,0x0c,0x10, + 0xe0,0x10,0x0c,0x00,0x8c,0x50,0x20,0x50,0x8c,0x00,0xc0,0xbe,0xa2,0xbe, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0xc1,0xa1,0x81,0x00,0x00,0x01,0x80,0x40,0x20,0x00,0x00,0x00,0x00, + 0xf1,0x00,0x00,0x00,0x41,0x20,0xd0,0x20,0x41,0x00,0x01,0x21,0x41,0x81, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x00,0x49,0x4a,0x48,0x87,0x00,0x81,0x82,0x85,0x89,0x01,0x00,0x01,0x02, + 0x85,0x02,0x01,0x00,0x40,0x40,0x47,0x40,0x40,0x00,0x81,0x09,0x05,0x02, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x12,0x65,0x85,0x65,0x17,0x00,0x07,0x01,0x06,0x18,0x60,0x00,0x88,0x90, + 0xaf,0x90,0x88,0x00,0x04,0x02,0x7d,0x02,0x04,0x00,0x01,0x46,0x58,0x60, + 0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM symb5_R_dvor[4][42] = { + { 0x00,0x02,0x04,0x08,0x00,0x00,0x20,0x20,0xdc,0x02,0x02,0x00,0x02,0x02, + 0xdc,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x50,0x50,0x50,0x50, + 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xf0,0x11,0x12,0x02,0x00,0x02,0x12, + 0x11,0xf0,0x00,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00,0xc0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x00,0x1f,0x10,0x90,0x00,0x00,0x00,0x90, + 0x10,0x1f,0x00,0x00,0xc0,0x00,0x14,0x03,0x00,0x00,0x01,0x01,0x87,0x01, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1c,0x63,0x80,0x00,0x00,0x00,0x80, + 0x63,0x1c,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x7f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM numb6_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; +static const char PROGMEM numb6_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, + 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, + 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, + 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, + 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; +static const char PROGMEM func7_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, + 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, + 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, + 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, + 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 + },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, + 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, + 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, + 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, + 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; +static const char PROGMEM mous8_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, + 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, + 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 + },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, + 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, + 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, + 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, + 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f + },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, + 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, + 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; +static const char PROGMEM musi9_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, + 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, + 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, + 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, + 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, + 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, + 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, + 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; +static const char PROGMEM musi9_R[4][42] = { + { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, + 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, + 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, + 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, + 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, + 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, + 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, + 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, + 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +// Helper function that draws these images +void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { + // Draw this image iteratively + for (int i = 0; i < 4; i++) { + oled_set_cursor(col, row + i); + oled_write_raw_P(image[i], 42); + } +} +// Custom 2 character wide icons +static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; +static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; +static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; +static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; +static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; +static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; +static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; + + +// Write modifiers to the screen +void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { + // Looks like Mods: + oled_set_cursor(col, row); + oled_write("Mods: ", false); + // Meta + if (mods & MOD_MASK_GUI) { + oled_write_raw_P(mod_meta, 12); + oled_set_cursor(col + 8, row); + } else { + oled_write(" ", false); + } + // Alt(Gr) + if (mods & MOD_BIT(KC_RALT)) { + oled_write_raw_P(mod_altR, 12); + oled_set_cursor(col + 10, row); + } else if (mods & MOD_MASK_ALT) { + oled_write_raw_P(mod_altL, 12); + oled_set_cursor(col + 10, row); + } else { + oled_write(" ", false); + } + // Ctrl + if (mods & MOD_MASK_CTRL) { + oled_write_raw_P(mod_ctrl, 12); + oled_set_cursor(col + 12, row); + } else { + oled_write(" ", false); + } + // Shift + if (mods & MOD_MASK_SHIFT) { + oled_write_raw_P(mod_shft, 12); + oled_set_cursor(col + 14, row); + } else { + oled_write(" ", false); + } +} + +// Renders the encoder state, 14 characters +void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { + static char encoder_temp9[9] = {0}; + + oled_set_cursor(col, row); + #if defined ENCODER_ENABLE + oled_write("Enc: ", false); + encoder_state_string8(index, layer, encoder_temp9); + oled_write(encoder_temp9, false); + #else + oled_set_cursor(col, row); + oled_write("No enc. avail.", false); + #endif +} + +// Writes WPM on the screen +void render_wpm(uint8_t row, uint8_t col) { + // Renders the WPM, 14 characters + static char wpm_temp4[4] = {0}; + + oled_set_cursor(col, row); + #if defined WPM_ENABLE + oled_write("WPM: ", false); + itoa(get_current_wpm(), wpm_temp4, 10); + oled_write(wpm_temp4, false); + oled_write(" ", false); + #else + oled_write("WPM not avail.", false); + #endif +} + +// Writes the currently used OLED display layout +void render_keymap(uint8_t row, uint8_t col) { + // Render the oled layout + oled_set_cursor(col, row); + oled_write("Layout: DVORAK", false); +} + +// Draws the image of the currently used layout +void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { + // Render the requested image on the given column and row + // Don't grab highest layer; instead compare from top to bottom. + // Highest layer might be on the other side + if (isLeft) { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_L); + } else if (layer_state_cmp(layer_state, _MOUS)) { + draw_image(row, col, mous8_L); + } else if (layer_state_cmp(layer_state, _FUNC)) { + draw_image(row, col, func7_L); + } else if (layer_state_cmp(layer_state, _NUMB)) { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, numb6_L_dvor_shift); + } else { + draw_image(row, col, numb6_L_dvor_nomod); + } + } else if (layer_state_cmp(layer_state, _GAME)) { + draw_image(row, col, game2_L); + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_L); + } else { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_L_dvor_shift); + } else { + draw_image(row, col, base0_L_dvor_nomod); + } + } + } else { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_R); + } else if (layer_state_cmp(layer_state, _SYMB)) { + draw_image(row, col, symb5_R_dvor); + } else if (layer_state_cmp(layer_state, _NAVI)) { + draw_image(row, col, navi4_R); + } else if (layer_state_cmp(layer_state, _MEDI)) { + draw_image(row, col, medi3_R); + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_R); + } else { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_R_dvor_shift); + } else { + draw_image(row, col, base0_R_dvor_nomod); + } + } + } +} + +// Render the RGB state on the given column and row +void render_rgb(uint8_t row, uint8_t col) { + static char rgb_temp4[4] = {0}; + static char rgb_temp3[3] = {0}; + + oled_set_cursor(col, row); +#if defined RGB_MATRIX_ENABLE + if (rgb_matrix_is_enabled()) { + oled_write_raw_P(rgb_enab, 12); + } else { + oled_write_raw_P(rgb_disa, 12); + } + oled_set_cursor(col + 2, row); + oled_write(" hue sat val", false); + oled_set_cursor(col, row + 1); + itoa(rgb_matrix_get_mode(), rgb_temp3, 10); + oled_write(rgb_temp3, false); + oled_write(" ", false); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); + oled_write(rgb_temp4, false); +#else + oled_write("-RGB disabled-", false); +#endif +} + +void render_status_left(void) { + // Left side looks like this on the left half + // (Should be 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + // Right half is whatever layer image needs be + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // MODIFIERS + render_modifiers(0, 0, this_mod); + // Encoders + render_encoder(1, 0, 0, this_layer); + // WPM text + render_wpm(2, 0); + // Visual layout + render_keymap(3, 0); + // Draw the image after 14'th character + render_layout(0, 14, this_mod, true); +} + +void render_status_right(void) { + // Right half is whatever layer image needs be on the left + // Right side looks like this on the right half + // (Should be after the 12'th character; max 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // Draw the image + render_layout(0, 0, this_mod, false); + // Modifiers + render_modifiers(0, 7, this_mod); + // Encoder + render_encoder(1, 7, 1, this_layer); + // RGB State + render_rgb(2, 7); +} diff --git a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h new file mode 100644 index 00000000000..f9f549a8757 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h @@ -0,0 +1,19 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" + +// These are protorne specific functions to be called for drawing +void render_status_left(void); +void render_status_right(void); diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 5271b2ec2a5..d4efa027b8f 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bbaserdem.h" +#include "bb-crkbdarm-oled.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -92,5 +93,14 @@ void keyboard_post_init_keymap(void) { // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } + +bool oled_task_keymap(void) { + if (is_keyboard_left()) { + render_status_left(); + } else { + render_status_right(); + } + return false; +} #endif // End of differentiations #endif // End of audio specific stuff diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 49db761e4d0..3ad7da01ef2 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -40,4 +40,5 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # BOOTMAGIC_ENABLE = lite # LTO_ENABLE = yes # PIMORONI_TRACKBALL = no + SRC += bb-crkbdarm-oled.c endif diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index f63be9f931a..b83d6b7c11e 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -25,8 +25,10 @@ along with this program. If not, see . * Modes can be reset using OS click * Some modes are only accessible through some keymap layers */ -//encoder_state_t encoder_state[NUMBER_OF_ENCODERS]; + +// Initialize the encoder state variable encoder_state_t encoder_state[2]; + // Default state for the encoders void reset_encoder_state(void) { // for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { @@ -42,181 +44,6 @@ void keyboard_post_init_encoder(void) { reset_encoder_state(); } -// Oled string printing for given layer and index -void encoder_state_string_long(uint8_t index, uint8_t layer, char* buffer) { - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled - #ifdef RGB_MATRIX_ENABLE - case _MEDI: - switch (encoder_state[index].rgb) { - case 0: - strcpy(buffer, "ani mode"); - break; - case 1: - strcpy(buffer, "hue "); - break; - case 2: - strcpy(buffer, "saturat."); - break; - case 3: - strcpy(buffer, "bright. "); - break; - case 4: - strcpy(buffer, "ani. spd"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - #endif - // If pointer control is enabled - #ifdef MOUSEKEY_ENABLE - case _MOUS: - switch (encoder_state[index].point) { - case 0: - strcpy(buffer, "Lateral "); - break; - case 1: - strcpy(buffer, "Vertical"); - break; - case 2: - strcpy(buffer, "Scr. Ver"); - break; - case 3: - strcpy(buffer, "Scr. Lat"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - #endif - default: - switch (encoder_state[index].base) { - case 0: - strcpy(buffer, "Volume "); - break; - case 1: - strcpy(buffer, "Song "); - break; - case 2: - strcpy(buffer, "Sink "); - break; - case 3: - strcpy(buffer, "Src. Vol"); - break; - case 4: - strcpy(buffer, "Source "); - break; - case 5: - strcpy(buffer, "Arrow LR"); - break; - case 6: - strcpy(buffer, "Arrow UD"); - break; - case 7: - strcpy(buffer, "Page U/D"); - break; - case 8: - strcpy(buffer, "Erase "); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - } -} - -void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled - #ifdef RGB_MATRIX_ENABLE - case _MEDI: - switch (encoder_state[index].rgb) { - case 0: - strcpy(buffer, " mode"); - break; - case 1: - strcpy(buffer, " hue "); - break; - case 2: - strcpy(buffer, "satur"); - break; - case 3: - strcpy(buffer, "value"); - break; - case 4: - strcpy(buffer, "speed"); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - #endif - // If pointer control is enabled - #ifdef MOUSEKEY_ENABLE - case _MOUS: - switch (encoder_state[index].point) { - case 0: - strcpy(buffer, "m.lat"); - break; - case 1: - strcpy(buffer, "m.ver"); - break; - case 2: - strcpy(buffer, "s.ver"); - break; - case 3: - strcpy(buffer, "s.lat"); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - #endif - default: - switch (encoder_state[index].base) { - case 0: - strcpy(buffer, " volm"); - break; - case 1: - strcpy(buffer, " song"); - break; - case 2: - strcpy(buffer, " sink"); - break; - case 3: - strcpy(buffer, "s.vol"); - break; - case 4: - strcpy(buffer, " src "); - break; - case 5: - strcpy(buffer, " L/R "); - break; - case 6: - strcpy(buffer, " U/D "); - break; - case 7: - strcpy(buffer, "pgU/D"); - break; - case 8: - strcpy(buffer, " del "); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - } -} - // Encoder scroll functionality bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 92011c12b3a..5591f298568 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -17,9 +17,6 @@ along with this program. If not, see . #include "velocikey.h" #endif -// Code to print status string -void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); -void encoder_state_string_long(uint8_t index, uint8_t layer, char* buffer); // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed @@ -35,3 +32,6 @@ typedef struct { uint8_t rgb; // The encoder state on media layer; controls light settings uint8_t point; // The encoder state on mouse layer; moves pointer } encoder_state_t; + +// Make this available to all that declare us +extern encoder_state_t encoder_state[2]; diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 2df1ceab409..a5801ad733d 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -12,383 +12,199 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-oled.h" +#include +// Allow access to encoder_state #ifdef ENCODER_ENABLE - #include "bb-encoder.h" -#endif -/* OLED ENCODER - * This contains my general oled code - * Currently I have two setups with OLEDs - * - Kyria; with 128x64 but with low memory (elite C) - * - Protorne; wh 128x32 but with excellent memory - * This file differentiates only between those two - */ - -// Following line imports reading of RGB settings -#if defined RGB_MATRIX_ENABLE -extern rgb_config_t rgb_matrix_config; -#endif - -#if defined(KEYBOARD_crkbd_rev1) -// These are my images for keyboard layout -// Naming scheme is _left/right{_keyboardLayout}{_modifiers} -static const char PROGMEM base0_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, - 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, - 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, - 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, - 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, - 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, - 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, - 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, - 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; -static const char PROGMEM base0_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, - 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, - 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, - 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, - 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, - 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, - 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, - 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, - 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; -//static const char PROGMEM base0_R_dvor_nomod[][4] = {}; -//static const char PROGMEM base0_R_dvor_shift[][4] = {}; -static const char PROGMEM char1_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, - 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, - 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, - 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, - 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, - 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, - 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, - 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; -//static const char PROGMEM char1_R[][4] = {}; -static const char PROGMEM game2_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, - 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, - 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, - 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, - 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, - 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, - 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, - 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, - 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; -//static const char PROGMEM medi3_R[][4] = {}; -//static const char PROGMEM navi4_R[][4] = {}; -//static const char PROGMEM symb5_R_dvor[][4] = {}; -static const char PROGMEM numb6_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, - 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, - 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, - 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, - 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, - 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, - 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; -static const char PROGMEM numb6_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, - 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, - 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, - 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, - 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; -static const char PROGMEM func7_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, - 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, - 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 - },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, - 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, - 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 - },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, - 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, - 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, - 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, - 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; -static const char PROGMEM mous8_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, - 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, - 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 - },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, - 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, - 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, - 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, - 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f - },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, - 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, - 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; -static const char PROGMEM musi9_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, - 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, - 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, - 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, - 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, - 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, - 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, - 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; -static const char PROGMEM musi9_R[4][42] = { - { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, - 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, - 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, - 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, - 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, - 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, - 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, - 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, - 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; -static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; -static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; -static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; -static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; -static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; -static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; - -void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { - // Write modifiers starting from said column and row; does 14 characters - // Looks like: - // Mods: - oled_set_cursor(col, row); - oled_write("Mods: ", false); - // Meta - if (mods & MOD_MASK_GUI) { - oled_write_raw_P(mod_meta, 12); - oled_set_cursor(col + 8, row); - } else { - oled_write(" ", false); - } - // Alt(Gr) - if (mods & MOD_BIT(KC_RALT)) { - oled_write_raw_P(mod_altR, 12); - oled_set_cursor(col + 10, row); - } else if (mods & MOD_MASK_ALT) { - oled_write_raw_P(mod_altL, 12); - oled_set_cursor(col + 10, row); - } else { - oled_write(" ", false); - } - // Ctrl - if (mods & MOD_MASK_CTRL) { - oled_write_raw_P(mod_ctrl, 12); - oled_set_cursor(col + 12, row); - } else { - oled_write(" ", false); - } - // Shift - if (mods & MOD_MASK_SHIFT) { - oled_write_raw_P(mod_shft, 12); - oled_set_cursor(col + 14, row); - } else { - oled_write(" ", false); - } -} - -void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { - // Renders the encoder state, 14 characters - static char encoder_temp9[9] = {0}; - - oled_set_cursor(col, row); - #if defined ENCODER_ENABLE - oled_write("Enc: ", false); - encoder_state_string_long(index, layer, encoder_temp9); - oled_write(encoder_temp9, false); - #else - oled_set_cursor(col, row); - oled_write("No enc. avail.", false); - #endif -} - -void render_wpm(uint8_t row, uint8_t col) { - // Renders the WPM, 14 characters - static char wpm_temp4[4] = {0}; +#include "bb-encoder.h" +#endif // ENCODER_ENABLE - oled_set_cursor(col, row); - #if defined WPM_ENABLE - oled_write("WPM: ", false); - itoa(get_current_wpm(), wpm_temp4, 10); - oled_write(wpm_temp4, false); - oled_write(" ", false); - #else - oled_write("WPM not avail.", false); - #endif -} - -void render_keymap(uint8_t row, uint8_t col) { - // Render the oled layout - oled_set_cursor(col, row); - oled_write("Layout: DVORAK", false); -} +/* OLED + * This contains general purpose oled code + */ -void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { - // Draw this image iteratively - for (int i = 0; i < 4; i++) { - oled_set_cursor(col, row + i); - oled_write_raw_P(image[i], 42); - } -} +#ifdef ENCODER_ENABLE -void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { - // Render the requested image on the given column and row - // Don't grab highest layer; instead compare from top to bottom. - // Highest layer might be on the other side - if (isLeft) { - if (layer_state_cmp(layer_state, _MUSI)) { - draw_image(row, col, musi9_L); - } else if (layer_state_cmp(layer_state, _MOUS)) { - draw_image(row, col, mous8_L); - } else if (layer_state_cmp(layer_state, _FUNC)) { - draw_image(row, col, func7_L); - } else if (layer_state_cmp(layer_state, _NUMB)) { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, numb6_L_dvor_shift); - } else { - draw_image(row, col, numb6_L_dvor_nomod); +#if !defined KEYBOARD_splitkb_kyria_rev1 // Don't include in kyria; space +void encoder_state_string8(uint8_t index, uint8_t layer, char* buffer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled + #ifdef RGB_MATRIX_ENABLE + case _MEDI: + switch (encoder_state[index].rgb) { + case 0: + strcpy(buffer, "ani mode"); + break; + case 1: + strcpy(buffer, "hue "); + break; + case 2: + strcpy(buffer, "saturat."); + break; + case 3: + strcpy(buffer, "bright. "); + break; + case 4: + strcpy(buffer, "ani. spd"); + break; + default: + strcpy(buffer, " -N/A- "); + break; } - } else if (layer_state_cmp(layer_state, _GAME)) { - draw_image(row, col, game2_L); - } else if (layer_state_cmp(layer_state, _CHAR)) { - draw_image(row, col, char1_L); - } else { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_L_dvor_shift); - } else { - draw_image(row, col, base0_L_dvor_nomod); + break; + #endif + // If pointer control is enabled + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (encoder_state[index].point) { + case 0: + strcpy(buffer, "Lateral "); + break; + case 1: + strcpy(buffer, "Vertical"); + break; + case 2: + strcpy(buffer, "Scr. Ver"); + break; + case 3: + strcpy(buffer, "Scr. Lat"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + #endif + default: + switch (encoder_state[index].base) { + case 0: + strcpy(buffer, "Volume "); + break; + case 1: + strcpy(buffer, "Song "); + break; + case 2: + strcpy(buffer, "Sink "); + break; + case 3: + strcpy(buffer, "Src. Vol"); + break; + case 4: + strcpy(buffer, "Source "); + break; + case 5: + strcpy(buffer, "Arrow LR"); + break; + case 6: + strcpy(buffer, "Arrow UD"); + break; + case 7: + strcpy(buffer, "Page U/D"); + break; + case 8: + strcpy(buffer, "Erase "); + break; + default: + strcpy(buffer, " -N/A- "); + break; } - } - } else { - // WIP - draw_image(row, col, musi9_R); + break; } } +#endif // !KEYBOARD_splitkb_kyria_rev1 -void render_rgb(uint8_t row, uint8_t col) { - // Render the RGB state on the given column and row - static char rgb_temp4[4] = {0}; - static char rgb_temp3[3] = {0}; - - oled_set_cursor(col, row); -#if defined RGB_MATRIX_ENABLE - if (rgb_matrix_is_enabled()) { - oled_write_raw_P(rgb_enab, 12); - } else { - oled_write_raw_P(rgb_disa, 12); +void encoder_state_string5(uint8_t index, uint8_t layer, char* buffer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled + #ifdef RGB_MATRIX_ENABLE + case _MEDI: + switch (encoder_state[index].rgb) { + case 0: + strcpy(buffer, " mode"); + break; + case 1: + strcpy(buffer, " hue "); + break; + case 2: + strcpy(buffer, "satur"); + break; + case 3: + strcpy(buffer, "value"); + break; + case 4: + strcpy(buffer, "speed"); + break; + default: + strcpy(buffer, "!oob!"); + break; + } + break; + #endif + // If pointer control is enabled + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (encoder_state[index].point) { + case 0: + strcpy(buffer, "m.lat"); + break; + case 1: + strcpy(buffer, "m.ver"); + break; + case 2: + strcpy(buffer, "s.ver"); + break; + case 3: + strcpy(buffer, "s.lat"); + break; + default: + strcpy(buffer, "!oob!"); + break; + } + break; + #endif + default: + switch (encoder_state[index].base) { + case 0: + strcpy(buffer, " volm"); + break; + case 1: + strcpy(buffer, " song"); + break; + case 2: + strcpy(buffer, " sink"); + break; + case 3: + strcpy(buffer, "s.vol"); + break; + case 4: + strcpy(buffer, " src "); + break; + case 5: + strcpy(buffer, " L/R "); + break; + case 6: + strcpy(buffer, " U/D "); + break; + case 7: + strcpy(buffer, "pgU/D"); + break; + case 8: + strcpy(buffer, " del "); + break; + default: + strcpy(buffer, "!oob!"); + break; + } + break; } - oled_set_cursor(col + 2, row); - oled_write(" hue sat val", false); - oled_set_cursor(col, row + 1); - itoa(rgb_matrix_get_mode(), rgb_temp3, 10); - oled_write(rgb_temp3, false); - oled_write(" ", false); - itoa(rgb_matrix_get_hue(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_sat(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_val(), rgb_temp4, 10); - oled_write(rgb_temp4, false); -#else - oled_write("-RGB disabled-", false); -#endif -} - -void render_status_left(void) { - // Left side looks like this on the left half - // (Should be 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - // Right half is whatever layer image needs be - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // MODIFIERS - render_modifiers(0, 0, this_mod); - - // Encoders - render_encoder(1, 0, 0, this_layer); - - // WPM text - render_wpm(2, 0); - - // Visual layout - render_keymap(3, 0); - - // Draw the image after 14'th character - render_layout(0, 14, this_mod, true); -} - -void render_status_right(void) { - // Right half is whatever layer image needs be on the left - // Right side looks like this on the right half - // (Should be after the 12'th character; max 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // Draw the image - render_layout(0, 0, this_mod, false); - - // Modifiers - render_modifiers(0, 7, this_mod); - - // Encoder - render_encoder(1, 7, 1, this_layer); - - // RGB State; WIP - render_rgb(2, 7); } -#endif +#endif // ENCODER_ENABLE -#if defined(KEYBOARD_splitkb_kyria_rev1) -static void render_qmk_logo(void) { - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - oled_write_P(qmk_logo, false); -} static void render_status(void) { // Function to print state information uint8_t this_layer = get_highest_layer(layer_state); uint8_t this_mod = get_mods(); - // Render qmk - render_qmk_logo(); // Temporary variable for RGB #if defined RGB_MATRIX_ENABLE static char rgb_temp4[4] = {0}; @@ -443,16 +259,16 @@ static void render_status(void) { #if defined RGB_MATRIX_ENABLE case _MEDI: oled_write("m", false); - itoa(rgb_matrix_config.mode, rgb_temp4, 10); + itoa(rgb_matrix_get_mode(), rgb_temp4, 10); oled_write(rgb_temp4, false); oled_write(" h", false); - itoa(rgb_matrix_config.hsv.h, rgb_temp4, 10); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); oled_write(rgb_temp4, false); oled_write(" s", false); - itoa(rgb_matrix_config.hsv.s, rgb_temp4, 10); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); oled_write(rgb_temp4, false); oled_write(" v", false); - itoa(rgb_matrix_config.hsv.v, rgb_temp4, 10); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); oled_write(rgb_temp4, false); oled_write("\n", false); break; @@ -479,24 +295,23 @@ static void render_status(void) { // Line 4: Encoder states #ifdef ENCODER_ENABLE oled_write("EN0:", false); - encoder_state_string(0, this_layer, encoder_temp6); + encoder_state_string5(0, this_layer, encoder_temp6); oled_write(encoder_temp6, false); oled_write(" EN1:", false); - encoder_state_string(1, this_layer, encoder_temp6); + encoder_state_string5(1, this_layer, encoder_temp6); oled_write(encoder_temp6, false); +#else + oled_write("-Encoder unavailable-", false); #endif oled_write("\n", false); } -#endif +// Allow default to be overwritten by keymap if they return false +__attribute__ ((weak)) bool oled_task_keymap(void) {return true;} + +// Do sane defaults for regular oled rendering void oled_task_user(void) { - #if defined(KEYBOARD_splitkb_kyria_rev1) - render_status(); - #elif defined(KEYBOARD_crkbd_rev1) - if (is_keyboard_left()) { - render_status_left(); - } else { - render_status_right(); + if (oled_task_keymap()) { + render_status(); } - #endif } diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index 5b8a97efc3b..6e88cfc1cb1 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -15,3 +15,9 @@ along with this program. If not, see . #include "bbaserdem.h" // Contain the main oled writer here void oled_task_user(void); +bool oled_task_keymap(void); +// This is only neccessary for oled; hence here +#ifdef ENCODER_ENABLE +void encoder_state_string5(uint8_t index, uint8_t layer, char* buffer); +void encoder_state_string8(uint8_t index, uint8_t layer, char* buffer); +#endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 34e5e9488ed..7ed5af06798 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -35,7 +35,7 @@ along with this program. If not, see . #ifdef SPLIT_KEYBOARD // Enable reacting to keypresses on the other half #define SPLIT_TRANSPORT_MIRROR -// Enable communicatong layer state changes. +// Enable communicating layer state changes. // #define SPLIT_LAYER_STATE_ENABLE // #define SPLIT_MODS_ENABLE #ifdef WPM_ENABLE diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 0775e0a64bd..facc61a3f09 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -38,7 +38,7 @@ TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance # These features can be enabled on ARM boards; disabled for AVR due to space # NKRO_ENABLE = no # Default is 6KRO which is plenty # VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed -# WPM_ENABLE = no # Get WPM reports as you type +WPM_ENABLE = yes # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 5f8b1fe85b8b3d5feced879d104411583bccfa7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 11 Sep 2021 16:37:22 -0400 Subject: [PATCH 37/94] Changed colors a bit --- layouts/community/split_3x6_3/bbaserdem/keymap.c | 9 +++++++++ users/bbaserdem/bb-rgb.c | 16 ++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index d4efa027b8f..ee98f58fbf3 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -94,6 +94,15 @@ void keyboard_post_init_keymap(void) { OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } +// Flip the display on the right half +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_left()) { + return OLED_ROTATION_180; + } + + return rotation; +} + bool oled_task_keymap(void) { if (is_keyboard_left()) { render_status_left(); diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index 2b2c78e240e..e21f47ece42 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -28,17 +28,17 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } // Do each layer seperately switch (get_highest_layer(layer_state)) { - case _GAME: // Set left side as turquoise + case _GAME: // Set left side as purple for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x < SPLIT_POINT) { rgb_matrix_set_color(i, RGB_PURPLE); } } break; - case _CHAR: // Set full board as chartreuse + case _CHAR: // Set full board as gold rgb_matrix_set_color_all(RGB_GOLD); break; - case _MEDI: // Set right side as coral + case _MEDI: // Set right side as pink for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x > SPLIT_POINT) { rgb_matrix_set_color(i, RGB_PINK); @@ -52,17 +52,17 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } } break; - case _SYMB: // Set right side as purple + case _SYMB: // Set right side as yellow for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x > SPLIT_POINT) { rgb_matrix_set_color(i, RGB_YELLOW); } } break; - case _NUMB: // Set left side as cyan + case _NUMB: // Set left side as blue for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_CYAN); + rgb_matrix_set_color(i, RGB_BLUE); } } break; @@ -73,14 +73,14 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } } break; - case _MOUS: // Set left side as yellow + case _MOUS: // Set left side as blue-green for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x < SPLIT_POINT) { rgb_matrix_set_color(i, RGB_SPRINGGREEN); } } break; - case _MUSI: // Set full board as magenta + case _MUSI: // Set full board as orange rgb_matrix_set_color_all(RGB_ORANGE); break; } From 60b132c783e7bc8a17d50ccb346e387ff29022a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 15 Sep 2021 23:54:59 -0400 Subject: [PATCH 38/94] Working keeb --- .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 13 +- .../split_3x6_3/bbaserdem/bb-crkbdarm-oled.c | 447 ----------- .../community/split_3x6_3/bbaserdem/config.h | 87 +-- .../community/split_3x6_3/bbaserdem/keymap.c | 93 ++- .../community/split_3x6_3/bbaserdem/rules.mk | 1 - users/bbaserdem/bb-encoder.c | 144 +++- users/bbaserdem/bb-encoder.h | 17 +- users/bbaserdem/bb-macro.c | 22 +- users/bbaserdem/bb-oled-extra.c | 700 ++++++++++++++++++ .../bbaserdem/bb-oled-extra.h | 10 +- users/bbaserdem/bb-oled.c | 406 ++++------ users/bbaserdem/bb-oled.h | 17 +- users/bbaserdem/bb-rgb.c | 100 ++- users/bbaserdem/bbaserdem.c | 122 ++- users/bbaserdem/bbaserdem.h | 53 +- users/bbaserdem/config.h | 112 ++- users/bbaserdem/rules.mk | 13 +- 17 files changed, 1408 insertions(+), 949 deletions(-) delete mode 100644 layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c create mode 100644 users/bbaserdem/bb-oled-extra.c rename layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h => users/bbaserdem/bb-oled-extra.h (69%) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 8b540057c71..4c76884c76a 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -95,18 +95,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } -// QMK logo screen renderer; will render 126x32 image; but on the default font. -static void render_qmk_logo(void) { - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - oled_write_P(qmk_logo, false); -} // For kyria; print logo, and allow default status printing bool oled_task_keymap(void) { - render_qmk_logo(); - return true; + render_qmk_logo(0, 0); + render_status_lite(4, 0); + return false; } #endif //OLED_ENABLE #endif //KEYBOARD_splitkb_kyria_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c deleted file mode 100644 index c869458b952..00000000000 --- a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c +++ /dev/null @@ -1,447 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 "bb-oled.h" -#include "bb-crkbdarm-oled.h" -#ifdef ENCODER_ENABLE - #include "bb-encoder.h" -#endif - -// PROGMEM images -// Naming scheme is _left/right{_keyboardLayout}{_modifiers} -static const char PROGMEM base0_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, - 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, - 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, - 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, - 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, - 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, - 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, - 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, - 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; -static const char PROGMEM base0_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, - 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, - 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, - 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, - 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, - 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, - 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, - 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, - 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; -static const char PROGMEM base0_R_dvor_nomod[4][42] = { - { 0x00,0xfc,0x12,0x12,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x70,0x88, - 0x88,0x88,0x88,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x00,0x02,0x7e,0x80, - 0x80,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x80,0x80,0x80,0xf0,0x00,0xf0,0x02,0x82,0x82,0x01,0x00,0x00,0x80, - 0xf0,0x80,0x80,0x00,0xc0,0x40,0x40,0x40,0x80,0x00,0x80,0x40,0x40,0x40, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x83,0x04,0x04,0x02,0x07,0x00,0x07,0x01,0x00,0x00,0x07,0x00,0x00,0x00, - 0x03,0x04,0x04,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x04,0x05,0x05,0x05, - 0x02,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x3f,0x24,0x22,0x22,0x1c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x1e,0x20, - 0x1c,0x20,0x1e,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x22,0x32,0x2a,0x26, - 0x22,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM base0_R_dvor_shift[4][42] = { - { 0xfe,0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xfc,0x02, - 0x02,0x02,0x84,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x00,0x04,0x88,0x50,0x20,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0xf1,0x10,0x10,0x10,0xe0,0x00,0xf0,0x81,0x81,0x81,0xf0,0x00,0x10,0x11, - 0xf1,0x11,0x10,0x00,0xf1,0x60,0x80,0x00,0xf1,0x00,0x61,0x91,0x91,0x91, - 0x21,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x8f,0x88,0x88,0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x8f,0x00,0x80,0x00, - 0x0f,0x00,0x80,0x00,0x8f,0x00,0x01,0x06,0x8f,0x00,0x84,0x88,0x88,0x88, - 0x87,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x7f,0x44,0x44,0x44,0x3b,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x1f,0x60, - 0x1c,0x60,0x1f,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x70,0x48,0x44,0x42, - 0x41,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM char1_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, - 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, - 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, - 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, - 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, - 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, - 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, - 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; -static const char PROGMEM char1_R[4][42] = { - { 0x70,0x88,0xf0,0x88,0x70,0x00,0xfe,0x02,0x02,0x02,0x06,0x00,0x88,0x48, - 0x70,0x90,0x88,0x00,0xf0,0x88,0x88,0x88,0x70,0x00,0xc0,0x30,0x0c,0x30, - 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0xa0,0x50,0x53,0x90,0x20,0x00,0xc0,0x80,0x40,0x40,0x80,0x00,0x40,0x40, - 0xc0,0x40,0x40,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x80,0x40,0xc0,0x40, - 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x03,0x84,0x84,0x04,0x03,0x00,0x07,0x00,0x00,0x00,0x1f,0x00,0x00,0x80, - 0x83,0x84,0x00,0x00,0x00,0x83,0x54,0x8b,0x00,0x00,0x83,0x84,0x84,0x83, - 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0xff,0x24,0x24,0x27,0x18,0x00,0x7e,0x10,0x20,0x20,0x1e,0x00,0x2f,0x30, - 0x00,0x30,0x2f,0x00,0xe0,0x38,0x25,0x38,0xe0,0x00,0x18,0x26,0xa1,0xa0, - 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM game2_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, - 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, - 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, - 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, - 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, - 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, - 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, - 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, - 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; -static const char PROGMEM medi3_R[4][42] = { - { 0xe0,0x00,0x38,0x00,0xe0,0x00,0x7f,0x02,0x9c,0x02,0x7f,0x00,0x7f,0x08, - 0x88,0x08,0x7f,0x00,0x26,0x49,0xc9,0x49,0x32,0x00,0x07,0x18,0xa0,0x18, - 0x07,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x01,0x01,0xf1,0x70,0x00,0xf0,0x81,0xc3,0xe1,0xf0,0x00,0x00,0x71, - 0x03,0x71,0x00,0x00,0x00,0xc1,0xc3,0xc1,0x00,0x00,0xf0,0xe1,0xc3,0x81, - 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 - },{ 0x0e,0x0a,0x0c,0x0f,0x00,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, - 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, - 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 - },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, - 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, - 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM navi4_R[4][42] = { - { 0xe0,0x10,0x54,0x38,0x10,0x00,0xfc,0x24,0x24,0x24,0x18,0x00,0x0c,0x10, - 0xe0,0x10,0x0c,0x00,0x8c,0x50,0x20,0x50,0x8c,0x00,0xc0,0xbe,0xa2,0xbe, - 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x80,0xc1,0xa1,0x81,0x00,0x00,0x01,0x80,0x40,0x20,0x00,0x00,0x00,0x00, - 0xf1,0x00,0x00,0x00,0x41,0x20,0xd0,0x20,0x41,0x00,0x01,0x21,0x41,0x81, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x00,0x49,0x4a,0x48,0x87,0x00,0x81,0x82,0x85,0x89,0x01,0x00,0x01,0x02, - 0x85,0x02,0x01,0x00,0x40,0x40,0x47,0x40,0x40,0x00,0x81,0x09,0x05,0x02, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x12,0x65,0x85,0x65,0x17,0x00,0x07,0x01,0x06,0x18,0x60,0x00,0x88,0x90, - 0xaf,0x90,0x88,0x00,0x04,0x02,0x7d,0x02,0x04,0x00,0x01,0x46,0x58,0x60, - 0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM symb5_R_dvor[4][42] = { - { 0x00,0x02,0x04,0x08,0x00,0x00,0x20,0x20,0xdc,0x02,0x02,0x00,0x02,0x02, - 0xdc,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x50,0x50,0x50,0x50, - 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xf0,0x11,0x12,0x02,0x00,0x02,0x12, - 0x11,0xf0,0x00,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00,0xc0,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x00,0x1f,0x10,0x90,0x00,0x00,0x00,0x90, - 0x10,0x1f,0x00,0x00,0xc0,0x00,0x14,0x03,0x00,0x00,0x01,0x01,0x87,0x01, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1c,0x63,0x80,0x00,0x00,0x00,0x80, - 0x63,0x1c,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x7f,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM numb6_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, - 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, - 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, - 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, - 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, - 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, - 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; -static const char PROGMEM numb6_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, - 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, - 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, - 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, - 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; -static const char PROGMEM func7_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, - 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, - 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 - },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, - 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, - 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 - },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, - 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, - 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, - 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, - 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; -static const char PROGMEM mous8_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, - 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, - 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 - },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, - 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, - 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, - 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, - 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f - },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, - 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, - 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; -static const char PROGMEM musi9_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, - 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, - 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, - 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, - 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, - 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, - 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, - 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; -static const char PROGMEM musi9_R[4][42] = { - { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, - 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, - 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, - 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, - 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, - 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, - 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, - 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, - 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -// Helper function that draws these images -void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { - // Draw this image iteratively - for (int i = 0; i < 4; i++) { - oled_set_cursor(col, row + i); - oled_write_raw_P(image[i], 42); - } -} -// Custom 2 character wide icons -static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; -static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; -static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; -static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; -static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; -static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; -static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; - - -// Write modifiers to the screen -void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { - // Looks like Mods: - oled_set_cursor(col, row); - oled_write("Mods: ", false); - // Meta - if (mods & MOD_MASK_GUI) { - oled_write_raw_P(mod_meta, 12); - oled_set_cursor(col + 8, row); - } else { - oled_write(" ", false); - } - // Alt(Gr) - if (mods & MOD_BIT(KC_RALT)) { - oled_write_raw_P(mod_altR, 12); - oled_set_cursor(col + 10, row); - } else if (mods & MOD_MASK_ALT) { - oled_write_raw_P(mod_altL, 12); - oled_set_cursor(col + 10, row); - } else { - oled_write(" ", false); - } - // Ctrl - if (mods & MOD_MASK_CTRL) { - oled_write_raw_P(mod_ctrl, 12); - oled_set_cursor(col + 12, row); - } else { - oled_write(" ", false); - } - // Shift - if (mods & MOD_MASK_SHIFT) { - oled_write_raw_P(mod_shft, 12); - oled_set_cursor(col + 14, row); - } else { - oled_write(" ", false); - } -} - -// Renders the encoder state, 14 characters -void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { - static char encoder_temp9[9] = {0}; - - oled_set_cursor(col, row); - #if defined ENCODER_ENABLE - oled_write("Enc: ", false); - encoder_state_string8(index, layer, encoder_temp9); - oled_write(encoder_temp9, false); - #else - oled_set_cursor(col, row); - oled_write("No enc. avail.", false); - #endif -} - -// Writes WPM on the screen -void render_wpm(uint8_t row, uint8_t col) { - // Renders the WPM, 14 characters - static char wpm_temp4[4] = {0}; - - oled_set_cursor(col, row); - #if defined WPM_ENABLE - oled_write("WPM: ", false); - itoa(get_current_wpm(), wpm_temp4, 10); - oled_write(wpm_temp4, false); - oled_write(" ", false); - #else - oled_write("WPM not avail.", false); - #endif -} - -// Writes the currently used OLED display layout -void render_keymap(uint8_t row, uint8_t col) { - // Render the oled layout - oled_set_cursor(col, row); - oled_write("Layout: DVORAK", false); -} - -// Draws the image of the currently used layout -void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { - // Render the requested image on the given column and row - // Don't grab highest layer; instead compare from top to bottom. - // Highest layer might be on the other side - if (isLeft) { - if (layer_state_cmp(layer_state, _MUSI)) { - draw_image(row, col, musi9_L); - } else if (layer_state_cmp(layer_state, _MOUS)) { - draw_image(row, col, mous8_L); - } else if (layer_state_cmp(layer_state, _FUNC)) { - draw_image(row, col, func7_L); - } else if (layer_state_cmp(layer_state, _NUMB)) { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, numb6_L_dvor_shift); - } else { - draw_image(row, col, numb6_L_dvor_nomod); - } - } else if (layer_state_cmp(layer_state, _GAME)) { - draw_image(row, col, game2_L); - } else if (layer_state_cmp(layer_state, _CHAR)) { - draw_image(row, col, char1_L); - } else { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_L_dvor_shift); - } else { - draw_image(row, col, base0_L_dvor_nomod); - } - } - } else { - if (layer_state_cmp(layer_state, _MUSI)) { - draw_image(row, col, musi9_R); - } else if (layer_state_cmp(layer_state, _SYMB)) { - draw_image(row, col, symb5_R_dvor); - } else if (layer_state_cmp(layer_state, _NAVI)) { - draw_image(row, col, navi4_R); - } else if (layer_state_cmp(layer_state, _MEDI)) { - draw_image(row, col, medi3_R); - } else if (layer_state_cmp(layer_state, _CHAR)) { - draw_image(row, col, char1_R); - } else { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_R_dvor_shift); - } else { - draw_image(row, col, base0_R_dvor_nomod); - } - } - } -} - -// Render the RGB state on the given column and row -void render_rgb(uint8_t row, uint8_t col) { - static char rgb_temp4[4] = {0}; - static char rgb_temp3[3] = {0}; - - oled_set_cursor(col, row); -#if defined RGB_MATRIX_ENABLE - if (rgb_matrix_is_enabled()) { - oled_write_raw_P(rgb_enab, 12); - } else { - oled_write_raw_P(rgb_disa, 12); - } - oled_set_cursor(col + 2, row); - oled_write(" hue sat val", false); - oled_set_cursor(col, row + 1); - itoa(rgb_matrix_get_mode(), rgb_temp3, 10); - oled_write(rgb_temp3, false); - oled_write(" ", false); - itoa(rgb_matrix_get_hue(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_sat(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_val(), rgb_temp4, 10); - oled_write(rgb_temp4, false); -#else - oled_write("-RGB disabled-", false); -#endif -} - -void render_status_left(void) { - // Left side looks like this on the left half - // (Should be 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - // Right half is whatever layer image needs be - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // MODIFIERS - render_modifiers(0, 0, this_mod); - // Encoders - render_encoder(1, 0, 0, this_layer); - // WPM text - render_wpm(2, 0); - // Visual layout - render_keymap(3, 0); - // Draw the image after 14'th character - render_layout(0, 14, this_mod, true); -} - -void render_status_right(void) { - // Right half is whatever layer image needs be on the left - // Right side looks like this on the right half - // (Should be after the 12'th character; max 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // Draw the image - render_layout(0, 0, this_mod, false); - // Modifiers - render_modifiers(0, 7, this_mod); - // Encoder - render_encoder(1, 7, 1, this_layer); - // RGB State - render_rgb(2, 7); -} diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index f2bbe766cad..8316408548d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -18,66 +18,67 @@ along with this program. If not, see . // Code pertaining to Corne ARM; from Waffle's keymap #ifdef KEYBOARD_crkbd_rev1 - #include "config_common.h" +# include "config_common.h" // Use EE_HANDS to determine handedness - #define EE_HANDS +# define EE_HANDS // Rebrand the PCB - #undef PRODUCT - #define PRODUCT Protorne Keyboard - #undef MANUFACTURER - #define MANUFACTURER Waffles +# undef PRODUCT +# define PRODUCT Protorne Keyboard +# undef MANUFACTURER +# define MANUFACTURER Waffles // Remove OLED definitions? - #undef USE_I2C - #undef SSD1306OLED +# undef USE_I2C +# undef SSD1306OLED // Add state info transmission - #define SPLIT_LAYER_STATE_ENABLE - #define SPLIT_MODS_ENABLE - #define SPLIT_WPM_ENABLE +# define SPLIT_LAYER_STATE_ENABLE +# define SPLIT_MODS_ENABLE +# define SPLIT_WPM_ENABLE // Audio output on pin A5 (actualy will be output on B1 using keymap init) - #ifdef AUDIO_ENABLE - #define AUDIO_PIN A5 - #endif +# ifdef AUDIO_ENABLE +# define AUDIO_PIN A5 +# define MUSIC_MAP +# endif // Communication has to be serial on ARM - #define USE_SERIAL_PD2 +# define USE_SERIAL_PD2 // Set serial pin as D3 for sure - #undef SOFT_SERIAL_PIN - #define SOFT_SERIAL_PIN D3 - #define SERIAL_USART_SPEED 921600 - #define SERIAL_USART_DRIVER SD1 - #define SERIAL_USART_TX_PAL_MODE 7 +# undef SOFT_SERIAL_PIN +# define SOFT_SERIAL_PIN D3 +# define SERIAL_USART_SPEED 921600 +# define SERIAL_USART_DRIVER SD1 +# define SERIAL_USART_TX_PAL_MODE 7 // Things to make RGB matrix work on the waffle board - #undef RGBLED_NUM - #define RGBLED_NUM 54 - #undef RGB_DI_PIN - #define RGB_DI_PIN B5 - #ifdef RGB_MATRIX_ENABLE - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 - #define RGB_MATRIX_SPLIT { 27, 27 } - #endif - #define WS2812_PWM_DRIVER PWMD3 - #define WS2812_PWM_CHANNEL 3 - #define WS2812_PWM_PAL_MODE 2 - #define WS2812_DMA_STREAM STM32_DMA1_STREAM3 - #define WS2812_DMA_CHANNEL 3 +# undef RGBLED_NUM +# define RGBLED_NUM 54 +# undef RGB_DI_PIN +# define RGB_DI_PIN B5 +# ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 +# define RGB_MATRIX_SPLIT { 27, 27 } +# endif +# define WS2812_PWM_DRIVER PWMD3 +# define WS2812_PWM_CHANNEL 3 +# define WS2812_PWM_PAL_MODE 2 +# define WS2812_DMA_STREAM STM32_DMA1_STREAM3 +# define WS2812_DMA_CHANNEL 3 // OLED related code - #ifdef OLED_DRIVER_ENABLE - #define OLED_TIMEOUT 50000 - #define OLED_UPDATE_INTERVAL 100 - #endif +# ifdef OLED_DRIVER_ENABLE +# define OLED_TIMEOUT 50000 +# define OLED_UPDATE_INTERVAL 100 +# endif // Encoder definitons - #define ENCODERS_PAD_A { B2 } - #define ENCODERS_PAD_B { B6 } - #define ENCODER_RESOLUTIONS { 4 } - #define ENCODERS_PAD_A_RIGHT { B2 } - #define ENCODERS_PAD_B_RIGHT { B6 } - #define ENCODER_RESOLUTIONS_RIGHT { 2 } +# define ENCODERS_PAD_A { B2 } +# define ENCODERS_PAD_B { B6 } +# define ENCODER_RESOLUTIONS { 4 } +# define ENCODERS_PAD_A_RIGHT { B2 } +# define ENCODERS_PAD_B_RIGHT { B6 } +# define ENCODER_RESOLUTIONS_RIGHT { 2 } #endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index ee98f58fbf3..ed969c7877b 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -12,7 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bbaserdem.h" -#include "bb-crkbdarm-oled.h" +#ifdef KEYBOARD_crkbd_rev1 +# include "bb-oled-extra.h" +#endif // KEYBOARD_crkbd_rev1 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -77,39 +79,108 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -#ifdef AUDIO_ENABLE // crkbd -#if defined(KEYBOARD_crkbd_rev1) -// Audio requires some fixes to work on @waffle's PCB -// ! Copy pasted from ItsWaffle's waffle fork +#ifdef KEYBOARD_crkbd_rev1 +#ifdef AUDIO_ENABLE +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_split_3x6_3( + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 0, 0, 0, 0, 0, 0 +); +#endif // AUDIO_ENABLE void keyboard_pre_init_keymap(void) { +# ifdef AUDIO_ENABLE //thank you to @sigprof for this // Set audio pins to analog mode palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); +# endif // AUDIO_ENABLE +# ifdef RGB_MATRIX_ENABLE + // Led locations are different on protorne; need to be fixed + g_led_config = (led_config_t) { { + // Logical Layout + // 0 1 2 3 4 5 COLS + // -LEFT ROWS + // 16 17 18 19 20 21 0 + // 15 14 13 12 11 10 1 + // 04 05 06 07 08 09 2 + // 03 02 01 3 + // -Right + // 21 20 19 18 17 16 4 + // 10 11 12 13 14 15 5 + // 09 08 07 06 05 04 6 + // 01 02 03 7 + { 15, 16, 17, 18, 19, 20}, + { 14, 13, 12, 11, 10, 9 }, + { 3, 4, 5, 6, 7, 8 }, + { NO_LED, NO_LED, NO_LED, 2, 1, 0 }, + { 47, 46, 45, 44, 43, 42 }, + { 36, 37, 38, 39, 40, 41 }, + { 35, 34, 33, 32, 31, 30 }, + { NO_LED, NO_LED, NO_LED, 27, 28, 29 } + }, { + // Physical Layout + // LEFT RIGHT + // 16 17 18 19 20 21 16 17 18 19 20 21 + // 24 23 22 24 23 22 + // 15 14 13 12 11 10 15 14 13 12 11 10 + // 25 27 + // 04 05 06 07 08 09 04 05 06 07 08 09 + // 26 27 25 26 + // 03 02 01 03 02 01 + { 95, 63 }, { 80, 58 }, { 60, 55 }, + { 0, 41 }, { 16, 42 }, { 33, 37 }, { 50, 35 }, { 68, 37 }, { 85, 39 }, + { 85, 21 }, { 68, 19 }, { 50, 13 }, { 33, 20 }, { 16, 24 }, { 0, 24 }, + { 0, 7 }, { 16, 7 }, { 33, 3 }, { 50, 0 }, { 68, 2 }, { 85, 4 }, + { 85, 16 }, { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, + { 164, 55 }, { 144, 58 }, { 129, 63 }, + { 139, 39 }, { 156, 37 }, { 174, 35 }, { 191, 37 }, { 208, 42 }, { 224, 41 }, + { 224, 24 }, { 208, 24 }, { 191, 20 }, { 174, 13 }, { 156, 19 }, { 139, 21 }, + { 139, 4 }, { 156, 2 }, { 174, 0 }, { 191, 3 }, { 208, 7 }, { 224, 7 }, + { 208, 20 }, { 174, 13 }, { 139, 16 }, { 139, 52 }, { 174, 48 }, { 208, 38 } + }, { + // (x---)8 stands for indicator + // (-x--)4 stands for per-key led + // (--x-)2 stands for underglow led + // (---1)1 stands for modifier key + 12, 12, 12, + 4, 4, 5, 4, 4, 4, + 4, 5, 5, 5, 5, 4, + 4, 4, 4, 4, 4, 4, + 10, 10, 10, 10, 10, 10, + 12, 12, 12, + 4, 4, 4, 5, 4, 4, + 4, 5, 5, 5, 5, 4, + 4, 4, 4, 4, 4, 4, + 10, 10, 10, 10, 10, 10 + } }; +# endif // RGB_MATRIX_ENABLE } +// Enable OPAMP1 as A5 → B1 follower +#ifdef AUDIO_ENABLE void keyboard_post_init_keymap(void) { - // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } +#endif // AUDIO_ENABLE +#ifdef OLED_ENABLE // Flip the display on the right half oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!is_keyboard_left()) { return OLED_ROTATION_180; } - return rotation; } bool oled_task_keymap(void) { if (is_keyboard_left()) { - render_status_left(); + render_status_left(0, 0); } else { - render_status_right(); + render_status_right(0, 0); } return false; } -#endif // End of differentiations -#endif // End of audio specific stuff +#endif // OLED_ENABLE +#endif // KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 3ad7da01ef2..49db761e4d0 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -40,5 +40,4 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # BOOTMAGIC_ENABLE = lite # LTO_ENABLE = yes # PIMORONI_TRACKBALL = no - SRC += bb-crkbdarm-oled.c endif diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index b83d6b7c11e..38f4163a86a 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -12,10 +12,15 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-encoder.h" -#include +// Need this to call velocikey activation #ifdef VELOCIKEY_ENABLE - #include "velocikey.h" +# include "velocikey.h" #endif +// Need memcpy and memcmp from string.h along with transfer stuff +#ifdef OLED_ENABLE +# include +#endif + /* ROTARY ENCODER * This contains my general rotary encoder code @@ -26,16 +31,13 @@ along with this program. If not, see . * Some modes are only accessible through some keymap layers */ -// Initialize the encoder state variable -encoder_state_t encoder_state[2]; - // Default state for the encoders void reset_encoder_state(void) { // for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { for (int i = 0; i < 2; i++) { - encoder_state[i].base = i; - encoder_state[i].rgb = i; - encoder_state[i].point = i; + userspace_config.encoder[i].base = i; + userspace_config.encoder[i].rgb = i; + userspace_config.encoder[i].point = i; } } @@ -50,7 +52,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { switch (get_highest_layer(layer_state)) { #ifdef RGB_MATRIX_ENABLE case _MEDI: - switch(encoder_state[index].rgb) { + switch(userspace_config.encoder[index].rgb) { case 0: // Effect the RGB mode if (clockwise) { rgb_matrix_step_noeeprom(); @@ -91,7 +93,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #endif #ifdef MOUSEKEY_ENABLE case _MOUS: - switch(encoder_state[index].point) { + switch(userspace_config.encoder[index].point) { case 0: // Move mouse on horizontal axis if (clockwise) { tap_code(KC_MS_R); @@ -124,7 +126,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { break; #endif default: - switch(encoder_state[index].base) { + switch(userspace_config.encoder[index].base) { case 0: // Volume if (clockwise) { tap_code16(KC_VOLU); @@ -199,7 +201,7 @@ void encoder_click_action(uint8_t index) { switch (get_highest_layer(layer_state)) { #ifdef RGB_MATRIX_ENABLE case _MEDI: - switch(encoder_state[index].rgb) { + switch(userspace_config.encoder[index].rgb) { case 0: // Return to no animation rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); break; @@ -218,7 +220,7 @@ void encoder_click_action(uint8_t index) { #endif #ifdef MOUSEKEY_ENABLE case _MOUS: - switch(encoder_state[index].point) { + switch(userspace_config.encoder[index].point) { case 0: // Left click tap_code16(KC_BTN1); break; @@ -233,7 +235,7 @@ void encoder_click_action(uint8_t index) { break; #endif default: - switch(encoder_state[index].base) { + switch(userspace_config.encoder[index].base) { case 0: // Toggle mute case 2: tap_code16(KC_MUTE); @@ -280,19 +282,19 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { switch (get_highest_layer(layer_state)) { #ifdef RGB_MATRIX_ENABLE case _MEDI: - encoder_state[encoder_index].rgb = - (encoder_state[encoder_index].rgb + 1) % 5; + userspace_config.encoder[encoder_index].rgb = + (userspace_config.encoder[encoder_index].rgb + 1) % 5; break; #endif #ifdef MOUSEKEY_ENABLE case _MOUS: - encoder_state[encoder_index].point = - (encoder_state[encoder_index].point + 1) % 4; + userspace_config.encoder[encoder_index].point = + (userspace_config.encoder[encoder_index].point + 1) % 4; break; #endif default: - encoder_state[encoder_index].base = - (encoder_state[encoder_index].base + 1) % 9; + userspace_config.encoder[encoder_index].base = + (userspace_config.encoder[encoder_index].base + 1) % 9; break; } // If ctrl is active, move mode one point backwards @@ -300,19 +302,19 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { switch (get_highest_layer(layer_state)) { #ifdef RGB_MATRIX_ENABLE case _MEDI: - encoder_state[encoder_index].rgb = - (encoder_state[encoder_index].rgb + 5 - 1) % 5; + userspace_config.encoder[encoder_index].rgb = + (userspace_config.encoder[encoder_index].rgb + 5 - 1) % 5; break; #endif #ifdef MOUSEKEY_ENABLE case _MOUS: - encoder_state[encoder_index].point = - (encoder_state[encoder_index].point + 4 - 1) % 4; + userspace_config.encoder[encoder_index].point = + (userspace_config.encoder[encoder_index].point + 4 - 1) % 4; break; #endif default: - encoder_state[encoder_index].base = - (encoder_state[encoder_index].base + 9 - 1) % 9; + userspace_config.encoder[encoder_index].base = + (userspace_config.encoder[encoder_index].base + 9 - 1) % 9; break; } // If meta is active, reset the encoder states @@ -325,3 +327,93 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { } return true; } + +// For printing status to OLED +#ifdef OLED_ENABLE +void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled +# ifdef RGB_MATRIX_ENABLE + case _MEDI: + switch (userspace_config.encoder[index].rgb) { + case 0: + strcpy(buffer, "ani mode"); + break; + case 1: + strcpy(buffer, "hue "); + break; + case 2: + strcpy(buffer, "saturat."); + break; + case 3: + strcpy(buffer, "bright. "); + break; + case 4: + strcpy(buffer, "ani. spd"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; +# endif // RGB_MATRIX_ENABLE + // If pointer control is enabled +# ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (userspace_config.encoder[index].point) { + case 0: + strcpy(buffer, "Lateral "); + break; + case 1: + strcpy(buffer, "Vertical"); + break; + case 2: + strcpy(buffer, "Scr. Ver"); + break; + case 3: + strcpy(buffer, "Scr. Lat"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; +# endif // MOUSEKEY_ENABLE + default: + switch (userspace_config.encoder[index].base) { + case 0: + strcpy(buffer, "Volume "); + break; + case 1: + strcpy(buffer, "Song "); + break; + case 2: + strcpy(buffer, "Sink "); + break; + case 3: + strcpy(buffer, "Src. Vol"); + break; + case 4: + strcpy(buffer, "Source "); + break; + case 5: + strcpy(buffer, "Arrow LR"); + break; + case 6: + strcpy(buffer, "Arrow UD"); + break; + case 7: + strcpy(buffer, "Page U/D"); + break; + case 8: + strcpy(buffer, "Erase "); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + } +} +#endif // OLED_ENABLE diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 5591f298568..121f10e095a 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -13,9 +13,6 @@ along with this program. If not, see . */ #pragma once #include "bbaserdem.h" -#ifdef VELOCIKEY_ENABLE - #include "velocikey.h" -#endif // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); @@ -25,13 +22,7 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record); void keyboard_post_init_encoder(void); // Clear the encoder settings void reset_encoder_state(void); - -// Structure to keep runtime info on encoder state -typedef struct { - uint8_t base; // The encoder state on most layers; regular function - uint8_t rgb; // The encoder state on media layer; controls light settings - uint8_t point; // The encoder state on mouse layer; moves pointer -} encoder_state_t; - -// Make this available to all that declare us -extern encoder_state_t encoder_state[2]; +// This is so that encoder state is synched between two halves +void housekeeping_task_encoder(void); +// This is purely for oled; should it want to use it +void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 04b8a1a8c5e..7dbd0aa5c5d 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -75,6 +75,26 @@ const uint32_t PROGMEM unicode_map[] = { // Keycodes bool process_record_macro(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + // AltGr + Caps should change the oled layout variable + case KC_CAPSLOCK: + if (record->event.pressed) { + if (get_mods() & MOD_BIT(KC_RALT)) { + userspace_config.layout = (userspace_config.layout + 1) % 3; + } + } + return true; + break; + case BB_OLED: + if (record->event.pressed) { + if (get_mods() & MOD_MASK_SHIFT) { + // Scroll in opposite direction + userspace_config.layout = (userspace_config.layout + 4) % 3; + } else { + userspace_config.layout = (userspace_config.layout + 1) % 3; + } + } + return false; + break; // Plain macros case BB_PGPK: // My public PGP key @@ -123,7 +143,7 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { case BB_TABL: // Table flip: ┻━┻︵ \(°□°)/ ︵ ┻━┻ if (record->event.pressed) { - send_unicode_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); + send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); } return false; break; #endif diff --git a/users/bbaserdem/bb-oled-extra.c b/users/bbaserdem/bb-oled-extra.c new file mode 100644 index 00000000000..ece65054f2f --- /dev/null +++ b/users/bbaserdem/bb-oled-extra.c @@ -0,0 +1,700 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-oled.h" +#include "bb-oled-extra.h" + +// Helper function that draws images +void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { + // Draw this image iteratively + for (int i = 0; i < 4; i++) { + oled_set_cursor(col, row + i); + oled_write_raw_P(image[i], 42); + } +} + +// Write modifiers to the screen +void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { + static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; + static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; + static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; + static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; + static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; + // Looks like Mods: + oled_set_cursor(col, row); + oled_write("Mods: ", false); + // Meta + if (mods & MOD_MASK_GUI) { + oled_write_raw_P(mod_meta, 12); + oled_set_cursor(col + 8, row); + } else { + oled_write(" ", false); + } + // Alt(Gr) + if (mods & MOD_BIT(KC_RALT)) { + oled_write_raw_P(mod_altR, 12); + oled_set_cursor(col + 10, row); + } else if (mods & MOD_MASK_ALT) { + oled_write_raw_P(mod_altL, 12); + oled_set_cursor(col + 10, row); + } else { + oled_write(" ", false); + } + // Ctrl + if (mods & MOD_MASK_CTRL) { + oled_write_raw_P(mod_ctrl, 12); + oled_set_cursor(col + 12, row); + } else { + oled_write(" ", false); + } + // Shift + if (mods & MOD_MASK_SHIFT) { + oled_write_raw_P(mod_shft, 12); + oled_set_cursor(col + 14, row); + } else { + oled_write(" ", false); + } +} + +// Draws the image of the currently used layout +void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { + // DVORAK + static const char PROGMEM base0_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, + 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, + 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, + 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, + 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, + 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, + 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, + 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, + 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; + static const char PROGMEM base0_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, + 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, + 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, + 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, + 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, + 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, + 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, + 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, + 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; + static const char PROGMEM base0_R_dvor_nomod[4][42] = { + { 0x00,0xfc,0x12,0x12,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x70,0x88, + 0x88,0x88,0x88,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x00,0x02,0x7e,0x80, + 0x80,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x80,0x80,0xf0,0x00,0xf0,0x02,0x82,0x82,0x01,0x00,0x00,0x80, + 0xf0,0x80,0x80,0x00,0xc0,0x40,0x40,0x40,0x80,0x00,0x80,0x40,0x40,0x40, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x83,0x04,0x04,0x02,0x07,0x00,0x07,0x01,0x00,0x00,0x07,0x00,0x00,0x00, + 0x03,0x04,0x04,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x04,0x05,0x05,0x05, + 0x02,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x3f,0x24,0x22,0x22,0x1c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x1e,0x20, + 0x1c,0x20,0x1e,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x22,0x32,0x2a,0x26, + 0x22,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_dvor_shift[4][42] = { + { 0xfe,0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xfc,0x02, + 0x02,0x02,0x84,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x00,0x04,0x88,0x50,0x20,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xf1,0x10,0x10,0x10,0xe0,0x00,0xf0,0x81,0x81,0x81,0xf0,0x00,0x10,0x11, + 0xf1,0x11,0x10,0x00,0xf1,0x60,0x80,0x00,0xf1,0x00,0x61,0x91,0x91,0x91, + 0x21,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x8f,0x88,0x88,0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x8f,0x00,0x80,0x00, + 0x0f,0x00,0x80,0x00,0x8f,0x00,0x01,0x06,0x8f,0x00,0x84,0x88,0x88,0x88, + 0x87,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x7f,0x44,0x44,0x44,0x3b,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x1f,0x60, + 0x1c,0x60,0x1f,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x70,0x48,0x44,0x42, + 0x41,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM symb5_R_dvor[4][42] = { + { 0x00,0x02,0x04,0x08,0x00,0x00,0x20,0x20,0xdc,0x02,0x02,0x00,0x02,0x02, + 0xdc,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x50,0x50,0x50,0x50, + 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xf0,0x11,0x12,0x02,0x00,0x02,0x12, + 0x11,0xf0,0x00,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00,0xc0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x00,0x1f,0x10,0x90,0x00,0x00,0x00,0x90, + 0x10,0x1f,0x00,0x00,0xc0,0x00,0x14,0x03,0x00,0x00,0x01,0x01,0x87,0x01, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1c,0x63,0x80,0x00,0x00,0x00,0x80, + 0x63,0x1c,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x7f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM numb6_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, + 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, + 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, + 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, + 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; + // Turkish F + static const char PROGMEM base0_L_turf_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x00,0x00, + 0xfe,0x09,0x09,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x51,0xaa,0xaa, + 0x92,0x09,0x00,0x00,0x88,0xf8,0x80,0x00,0x00,0x70,0x88,0x88,0x88,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x80,0x00,0x80,0x40,0x00,0xc0, + 0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01,0x00,0x81,0x42,0x42, + 0x42,0x81,0x00,0x00,0x40,0x40,0x40,0x80,0x00,0xc0,0x10,0x00,0x10,0xc0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x04,0x02,0x01,0x02,0x04,0x00,0x03, + 0x04,0x04,0x82,0x07,0x00,0x00,0x80,0x07,0x84,0x00,0x00,0x03,0x05,0x05, + 0x05,0x05,0x00,0x02,0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x02,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00, + 0x80,0x82,0x7e,0x00,0x00,0x1c,0x22,0x22,0x22,0x1c,0x00,0x06,0x18,0x20, + 0x18,0x06,0x00,0x1c,0x22,0x22,0x22,0x22,0x00,0x1c,0xa2,0x62,0x22,0x22}}; + static const char PROGMEM base0_L_turf_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x28,0x10,0x7c,0x10,0x28,0x00,0xfe, + 0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xf1,0x0a,0x4a, + 0x4a,0xd1,0x00,0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0xfc + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x30,0x40,0x80,0x40,0x30,0x00,0xf1, + 0x00,0x00,0x00,0xf0,0x00,0x00,0x21,0xe9,0x21,0x00,0x00,0xf1,0x92,0x92, + 0x92,0x11,0x00,0xe0,0x91,0x91,0x91,0xe0,0x00,0xe0,0x09,0x01,0x09,0xe0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x0e,0x81,0x80,0x81,0x0e,0x00,0x07, + 0x08,0x08,0x08,0x87,0x00,0x00,0x50,0x1f,0x50,0x00,0x00,0x8f,0x08,0x08, + 0x08,0x88,0x00,0x0f,0x80,0x80,0x80,0x0f,0x00,0x8f,0x50,0x50,0x50,0x8f + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x3f,0x40,0x50,0x20,0xdf,0x00,0x30, + 0x40,0x40,0x40,0x3f,0x00,0x7e,0x81,0x81,0x81,0x7e,0x00,0x07,0x18,0x60, + 0x18,0x07,0x00,0x3f,0x40,0x40,0x40,0x21,0x00,0x1f,0xa0,0x60,0x20,0x10}}; + static const char PROGMEM base0_L_turf_altgr[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x10,0x10,0x10,0x30,0x00,0x00,0xf0, + 0x08,0xe8,0xa8,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x0c,0x1e,0xfe,0x02,0xfe,0x00,0x70,0x8a,0x89,0x8a,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x10,0x20,0x40,0x00,0x00,0xc1, + 0x12,0x0a,0x12,0xc2,0x00,0x00,0x10,0xc8,0x10,0x00,0x00,0x40,0xe0,0x50, + 0x10,0x20,0x00,0x00,0x50,0x48,0x50,0x80,0x00,0xc0,0x10,0x08,0x10,0xc0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x00,0x03, + 0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x83,0x05, + 0x04,0x82,0x00,0x02,0x05,0x05,0x05,0x07,0x00,0x83,0x84,0x04,0x82,0x87 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x3e,0x3e,0x3e,0x00,0x08,0x14, + 0x22,0x08,0x14,0x22,0x00,0x22,0x14,0x08,0x22,0x14,0x08,0x03,0x02,0x00, + 0x03,0x02,0x00,0x1c,0x22,0x7f,0x22,0x22,0x00,0x02,0x01,0x00,0x02,0x01}}; + static const char PROGMEM base0_L_turf_shfgr[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x90,0x90,0xfc,0x90,0x90,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x0a,0x09,0x0a,0xf0 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x88,0x90,0xa0,0x00,0x00,0xc0, + 0x10,0x08,0x10,0xc0,0x00,0x00,0x50,0xc8,0x50,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x80,0x50,0x48,0x50,0x80,0x00,0xc1,0x12,0x0a,0x12,0xc1 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x8f,0x4f,0x8f,0x00,0x00,0x0f, + 0x10,0x10,0x90,0x0f,0x00,0x80,0x10,0x1f,0x10,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x1f,0x82,0x82,0x82,0x1f,0x00,0x0f,0x10,0x10,0x10,0x0f + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x7c,0x7d,0x7c,0x00,0x00,0x04, + 0x0a,0x11,0x20,0x00,0x00,0x20,0x11,0x0a,0x04,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x1f,0x24,0x2a,0x20,0x1f,0x00,0x00,0x00,0x00,0x00,0x00}}; + static const char PROGMEM base0_R_turf_nomod[4][42] = { + { 0x70,0x88,0x88,0x48,0xff,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0xf8,0x08, + 0x08,0x08,0xf0,0x00,0xff,0x10,0x08,0x08,0xf0,0x00,0xf8,0x90,0x88,0x88, + 0x70,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x40,0xf8,0x40,0x40,0x00,0x00,0xf8,0x00,0x80,0x40,0x00,0x00,0xc0,0x40, + 0xc0,0x40,0x80,0x00,0x08,0xf8,0x00,0x00,0x00,0x00,0xc3,0x00,0x00,0x00, + 0xc0,0x00,0x80,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x00,0x03,0x04,0x04,0x00,0x00,0x07,0x01,0x01,0x02,0x04,0x00,0xc7,0x00, + 0x07,0x00,0x07,0x00,0x00,0x03,0x04,0x04,0x00,0x00,0x03,0x14,0x14,0x12, + 0x0f,0x00,0x04,0x15,0x0d,0x05,0x02,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0x32,0x2a,0x26,0x22,0x00,0x24,0x2a,0x2a,0x2a,0x10,0x00,0x3f,0x24, + 0x22,0x22,0x1c,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0xb0,0x70,0x00, + 0x00,0x00,0x1e,0x20,0x1c,0x20,0x1e,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_turf_shift[4][42] = { + { 0xfe,0x02,0x02,0x02,0xfc,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x0c, + 0x30,0xc0,0xfe,0x00,0xfe,0x10,0x10,0x10,0xfe,0x00,0xfe,0x12,0x12,0x12, + 0x0c,0x00,0x82,0x44,0x28,0x10,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x11,0x11,0xf1,0x11,0x10,0x00,0xf1,0x80,0x40,0x20,0x11,0x00,0xf1,0x20, + 0xc0,0x20,0xf1,0x00,0xf1,0x00,0x00,0x00,0x01,0x00,0x31,0x40,0x80,0x40, + 0x30,0x00,0x30,0x48,0x48,0x48,0x90,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x80,0x80,0x8f,0x80,0x80,0x00,0x0f,0x80,0x81,0x82,0x0c,0x00,0x8f,0x80, + 0x80,0x80,0x0f,0x00,0x0f,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x0f,0x00, + 0x00,0x00,0x82,0x14,0x0c,0x04,0x83,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x70,0x48,0x44,0x42,0x41,0x00,0x23,0x44,0x44,0x44,0x39,0x00,0x7f,0x44, + 0x44,0x44,0x3b,0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x00,0xb6,0x76,0x00, + 0x00,0x00,0x1f,0x60,0x1c,0x60,0x1f,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_turf_altgr[4][42] = { + { 0x53,0x54,0xf8,0x54,0x53,0x00,0x7c,0xba,0x8a,0x8a,0x7c,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x0c,0x12,0x12,0x0c,0x00,0x00,0x20,0xfc,0x22,0x02, + 0x84,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0x80,0xf1,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00, + 0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x20,0x11,0x01, + 0x00,0x00,0x40,0xf0,0x41,0xf0,0x40,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x02,0x01,0x0f,0x08,0x08,0x06,0x83,0x40,0x40,0x40,0x00,0x00,0x0f,0x02, + 0x04,0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x07,0x01,0x07,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x4a,0x4a,0x3c,0x00,0x00,0x11,0x0a, + 0x04,0x0a,0x11,0x00,0x04,0x04,0x15,0x04,0x04,0x00,0x00,0x00,0x04,0x00, + 0x00,0x00,0x04,0x02,0x04,0x08,0x04,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_turf_shfgr[4][42] = { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xef,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x90,0x88, + 0x00,0x00,0x00,0x90,0xa1,0x90,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x0f,0x0f, + 0x00,0x00,0x00,0x0f,0x0f,0x0f,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x7d,0x7c, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM symb5_R_turf_nomod[4][42] = { + { 0x20,0x20,0xf8,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x20,0x20, + 0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0x00,0xc0,0x00,0x80,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x02,0x81,0x47,0x81,0x02,0x00,0x00,0x00,0x0a,0x01,0x00,0x00,0x04,0x04, + 0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM symb5_R_turf_altgr[4][42] = { + { 0x10,0x10,0x10,0x30,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x00, + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0x80,0xe0,0x80,0x80,0x00,0x00,0x00,0xa0,0x00,0x03,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x04,0x84,0x47,0x84,0x04,0x00,0x06,0x09,0x08,0x08,0x04,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM numb6_L_turf_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_turf_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04, + 0x88,0x50,0x20,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x38,0xc6, + 0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00,0x00,0x50,0x50,0x50,0x50,0x50 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, + 0x00,0x00,0x00,0x00,0x00,0x60,0x90,0xf8,0x90,0x20,0x00,0x20,0x50,0x20, + 0x81,0x60,0x00,0x70,0x89,0x48,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x82,0x09, + 0x94,0x08,0x00,0x07,0x08,0x89,0x06,0x09,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x00,0x03,0x00, + 0x03,0x00,0x00,0x02,0x01,0x00,0x01,0x02,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_turf_altgr[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0xff,0x00,0x00,0x00,0x10,0x10,0xee,0x01,0x01,0x00,0x00,0xff,0x01, + 0x01,0x00,0x00,0x00,0x01,0x01,0xff,0x00,0x00,0x01,0x01,0xee,0x10,0x10 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x01,0x00,0x00,0x00,0x10,0xf8,0x00,0x01,0x01,0x00,0x10,0xf9,0x01, + 0x01,0x00,0x00,0x88,0xa9,0x51,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0xc0,0x00,0x00,0x00,0x00,0x08,0x8c,0x0a,0x1f,0x00,0x00,0x00,0x90, + 0x90,0x10,0x00,0x00,0x08,0x0c,0x0a,0x1f,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x7b,0x00,0x00,0x00,0x00,0x09,0x0f,0x08,0x00,0x00,0x00,0x09,0x0c, + 0x0a,0x09,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_turf_shfgr[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0xef,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0xfc, + 0x90,0x90,0x00,0x06,0x09,0x09,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0xa8,0x50, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x0a, + 0x15,0x0a,0x00,0x40,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x7b,0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x04,0x05,0x05,0x02,0x00,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + + // UNIVERSAL + static const char PROGMEM char1_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, + 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, + 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, + 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, + 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, + 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, + 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, + 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; + static const char PROGMEM char1_R[4][42] = { + { 0x70,0x88,0xf0,0x88,0x70,0x00,0xfe,0x02,0x02,0x02,0x06,0x00,0x88,0x48, + 0x70,0x90,0x88,0x00,0xf0,0x88,0x88,0x88,0x70,0x00,0xc0,0x30,0x0c,0x30, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xa0,0x50,0x53,0x90,0x20,0x00,0xc0,0x80,0x40,0x40,0x80,0x00,0x40,0x40, + 0xc0,0x40,0x40,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x80,0x40,0xc0,0x40, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x03,0x84,0x84,0x04,0x03,0x00,0x07,0x00,0x00,0x00,0x1f,0x00,0x00,0x80, + 0x83,0x84,0x00,0x00,0x00,0x83,0x54,0x8b,0x00,0x00,0x83,0x84,0x84,0x83, + 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0xff,0x24,0x24,0x27,0x18,0x00,0x7e,0x10,0x20,0x20,0x1e,0x00,0x2f,0x30, + 0x00,0x30,0x2f,0x00,0xe0,0x38,0x25,0x38,0xe0,0x00,0x18,0x26,0xa1,0xa0, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM game2_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, + 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, + 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, + 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, + 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, + 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, + 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, + 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, + 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; + static const char PROGMEM medi3_R_nomod[4][42] = { + { 0x03,0x0c,0xb0,0x0c,0x03,0x00,0x3f,0x02,0x9c,0x02,0x3f,0x00,0x3f,0x04, + 0x84,0x04,0x3f,0x00,0x22,0x25,0xa5,0x25,0x18,0x00,0x3f,0x25,0xa5,0x25, + 0x1a,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 + },{ 0xc0,0x01,0x73,0x01,0xc0,0x00,0xf0,0x81,0xc3,0xe1,0xf0,0x00,0x00,0x71, + 0x03,0x71,0x00,0x00,0x00,0xc1,0xc3,0xc1,0x00,0x00,0xf0,0xe1,0xc3,0x81, + 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x02,0x02,0x02,0x01,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, + 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, + 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 + },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, + 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, + 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM medi3_R_shift[4][42] = { + { 0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x02,0x1c,0x02,0x3f,0x00,0x3f,0x04, + 0x04,0x04,0x3f,0x00,0x22,0x25,0x25,0x25,0x18,0x00,0x3f,0x25,0x25,0x25, + 0x1a,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 + },{ 0xc0,0x01,0x71,0x01,0xc0,0x00,0xf0,0x81,0xc1,0xe1,0xf0,0x00,0x00,0x71, + 0x01,0x71,0x00,0x00,0x00,0xc1,0xc1,0xc1,0x00,0x00,0xf0,0xe1,0xc1,0x81, + 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x02,0x02,0x02,0x01,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, + 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, + 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 + },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, + 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, + 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM navi4_R[4][42] = { + { 0xe0,0x10,0x54,0x38,0x10,0x00,0xfc,0x24,0x24,0x24,0x18,0x00,0x0c,0x10, + 0xe0,0x10,0x0c,0x00,0x8c,0x50,0x20,0x50,0x8c,0x00,0xc0,0xbe,0xa2,0xbe, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0xc1,0xa1,0x81,0x00,0x00,0x01,0x80,0x40,0x20,0x00,0x00,0x00,0x00, + 0xf1,0x00,0x00,0x00,0x41,0x20,0xd0,0x20,0x41,0x00,0x01,0x21,0x41,0x81, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x00,0x49,0x4a,0x48,0x87,0x00,0x81,0x82,0x85,0x89,0x01,0x00,0x01,0x02, + 0x85,0x02,0x01,0x00,0x40,0x40,0x47,0x40,0x40,0x00,0x81,0x09,0x05,0x02, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x12,0x65,0x85,0x65,0x17,0x00,0x07,0x01,0x06,0x18,0x60,0x00,0x88,0x90, + 0xaf,0x90,0x88,0x00,0x04,0x02,0x7d,0x02,0x04,0x00,0x01,0x46,0x58,0x60, + 0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM func7_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, + 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, + 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, + 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, + 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 + },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, + 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, + 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, + 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, + 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; + static const char PROGMEM mous8_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, + 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, + 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 + },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, + 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, + 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, + 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, + 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f + },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, + 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, + 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; + static const char PROGMEM musi9_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, + 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, + 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, + 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, + 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, + 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, + 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, + 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; + static const char PROGMEM musi9_R[4][42] = { + { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, + 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, + 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, + 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, + 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, + 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, + 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, + 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, + 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + + // Render the requested image on the given column and row + // Don't grab highest layer; instead compare from top to bottom. + // Highest layer might be on the other side + if (isLeft) { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_L); + } else if (layer_state_cmp(layer_state, _MOUS)) { + draw_image(row, col, mous8_L); + } else if (layer_state_cmp(layer_state, _FUNC)) { + draw_image(row, col, func7_L); + } else if (layer_state_cmp(layer_state, _NUMB)) { + switch (userspace_config.layout % 3) { + case 0: // Dvorak + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, numb6_L_dvor_shift); + } else { + draw_image(row, col, numb6_L_dvor_nomod); + } + break; + case 1: // Turkish F + if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { + // Shift + AltGr + draw_image(row, col, numb6_L_turf_shfgr); + } else if (mods & MOD_MASK_SHIFT) { + // Shift + draw_image(row, col, numb6_L_turf_shift); + } else if (mods & MOD_BIT(KC_RALT)) { + // AltGr + draw_image(row, col, numb6_L_turf_altgr); + } else { + // Normal + draw_image(row, col, numb6_L_turf_nomod); + } + break; + case 3: // Qwerty + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, numb6_L_dvor_shift); + } else { + draw_image(row, col, numb6_L_dvor_nomod); + } + break; + } + } else if (layer_state_cmp(layer_state, _GAME)) { + draw_image(row, col, game2_L); + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_L); + } else { + switch (userspace_config.layout % 3) { + case 0: // Dvorak + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_L_dvor_shift); + } else { + draw_image(row, col, base0_L_dvor_nomod); + } + break; + case 1: // Turkish F + if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { + // Shift + AltGr + draw_image(row, col, base0_L_turf_shfgr); + } else if (mods & MOD_MASK_SHIFT) { + // Shift + draw_image(row, col, base0_L_turf_shift); + } else if (mods & MOD_BIT(KC_RALT)) { + // AltGr + draw_image(row, col, base0_L_turf_altgr); + } else { + // Normal + draw_image(row, col, base0_L_turf_nomod); + } + break; + case 2: // Qwerty + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_L_dvor_shift); + } else { + draw_image(row, col, base0_L_dvor_nomod); + } + break; + } + } + } else { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_R); + } else if (layer_state_cmp(layer_state, _SYMB)) { + switch (userspace_config.layout % 3) { + case 0: // Dvorak + draw_image(row, col, symb5_R_dvor); + break; + case 1: // Turkish f + if (mods & MOD_BIT(KC_RALT)) { + // AltGr + draw_image(row, col, symb5_R_turf_altgr); + } else { + // Normal + draw_image(row, col, symb5_R_turf_nomod); + } + break; + case 2: // Qwerty + draw_image(row, col, symb5_R_dvor); + break; + } + } else if (layer_state_cmp(layer_state, _NAVI)) { + draw_image(row, col, navi4_R); + } else if (layer_state_cmp(layer_state, _MEDI)) { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, medi3_R_shift); + } else { + draw_image(row, col, medi3_R_nomod); + } + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_R); + } else { + switch (userspace_config.layout % 3) { + case 0: // Dvorak + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_R_dvor_shift); + } else { + draw_image(row, col, base0_R_dvor_nomod); + } + break; + case 1: // Turkish F + if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { + // Shift + AltGr + draw_image(row, col, base0_R_turf_shfgr); + } else if (mods & MOD_MASK_SHIFT) { + // Shift + draw_image(row, col, base0_R_turf_shift); + } else if (mods & MOD_BIT(KC_RALT)) { + // AltGr + draw_image(row, col, base0_R_turf_altgr); + } else { + // Normal + draw_image(row, col, base0_R_turf_nomod); + } + break; + case 2: // Qwerty + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_R_dvor_shift); + } else { + draw_image(row, col, base0_R_dvor_nomod); + } + break; + } + } + } +} + +// Render the RGB state on the given column and row +void render_rgb(uint8_t row, uint8_t col) { + static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; + static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; + static char rgb_temp4[4] = {0}; + static char rgb_temp3[3] = {0}; + + oled_set_cursor(col, row); +# ifdef RGB_MATRIX_ENABLE + if (rgb_matrix_is_enabled()) { + oled_write_raw_P(rgb_enab, 12); + } else { + oled_write_raw_P(rgb_disa, 12); + } + oled_set_cursor(col + 2, row); + oled_write(" hue sat val", false); + oled_set_cursor(col, row + 1); + itoa(rgb_matrix_get_mode(), rgb_temp3, 10); + oled_write(rgb_temp3, false); + oled_write(" ", false); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); + oled_write(rgb_temp4, false); +# else // RGB_MATRIX_ENABLE + oled_write("-RGB disabled-", false); +# endif // RGB_MATRIX_ENABLE +} + +void render_status_left(uint8_t row, uint8_t col) { + // Left side looks like this on the left half + // (Should be 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + // Right half is whatever layer image needs be + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // MODIFIERS + render_modifiers(row + 0, col + 0, this_mod); + // Encoders + render_encoder(row + 1, col + 0, 0, this_layer); + // WPM text + render_wpm(row + 2, col + 0); + // Visual layout + render_keymap(row + 3, col + 0, false); + // Draw the image after 14'th character + render_layout(row + 0, col + 14, this_mod, true); +} + +void render_status_right(uint8_t row, uint8_t col) { + // Right half is whatever layer image needs be on the left + // Right side looks like this on the right half + // (Should be after the 12'th character; max 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // Draw the image + render_layout(row + 0, col + 0, this_mod, false); + // Modifiers + render_modifiers(row + 0, col + 7, this_mod); + // Encoder + render_encoder(row + 1, col + 7, 1, this_layer); + // RGB State (2 rows) + render_rgb(row + 2, col + 7); +} diff --git a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h b/users/bbaserdem/bb-oled-extra.h similarity index 69% rename from layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h rename to users/bbaserdem/bb-oled-extra.h index f9f549a8757..7584cb4fe2d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h +++ b/users/bbaserdem/bb-oled-extra.h @@ -13,7 +13,9 @@ along with this program. If not, see . */ #pragma once #include "bbaserdem.h" - -// These are protorne specific functions to be called for drawing -void render_status_left(void); -void render_status_right(void); +// OLED layout images writer function +void render_modifiers(uint8_t row, uint8_t col, uint8_t mods); +void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft); +void render_rgb(uint8_t row, uint8_t col); +void render_status_left(uint8_t row, uint8_t col); +void render_status_right(uint8_t row, uint8_t col); diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index a5801ad733d..1d7231a5fdc 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -13,305 +13,205 @@ along with this program. If not, see . */ #include "bb-oled.h" #include -// Allow access to encoder_state +// Grab the print function #ifdef ENCODER_ENABLE -#include "bb-encoder.h" +# include "bb-encoder.h" #endif // ENCODER_ENABLE /* OLED * This contains general purpose oled code */ -#ifdef ENCODER_ENABLE +// Allow default to be overwritten by keymap if they return false +__attribute__ ((weak)) bool oled_task_keymap(void) {return true;} -#if !defined KEYBOARD_splitkb_kyria_rev1 // Don't include in kyria; space -void encoder_state_string8(uint8_t index, uint8_t layer, char* buffer) { - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled - #ifdef RGB_MATRIX_ENABLE - case _MEDI: - switch (encoder_state[index].rgb) { - case 0: - strcpy(buffer, "ani mode"); - break; - case 1: - strcpy(buffer, "hue "); - break; - case 2: - strcpy(buffer, "saturat."); - break; - case 3: - strcpy(buffer, "bright. "); - break; - case 4: - strcpy(buffer, "ani. spd"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - #endif - // If pointer control is enabled - #ifdef MOUSEKEY_ENABLE - case _MOUS: - switch (encoder_state[index].point) { - case 0: - strcpy(buffer, "Lateral "); - break; - case 1: - strcpy(buffer, "Vertical"); - break; - case 2: - strcpy(buffer, "Scr. Ver"); - break; - case 3: - strcpy(buffer, "Scr. Lat"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - #endif - default: - switch (encoder_state[index].base) { - case 0: - strcpy(buffer, "Volume "); - break; - case 1: - strcpy(buffer, "Song "); - break; - case 2: - strcpy(buffer, "Sink "); - break; - case 3: - strcpy(buffer, "Src. Vol"); - break; - case 4: - strcpy(buffer, "Source "); - break; - case 5: - strcpy(buffer, "Arrow LR"); - break; - case 6: - strcpy(buffer, "Arrow UD"); - break; - case 7: - strcpy(buffer, "Page U/D"); - break; - case 8: - strcpy(buffer, "Erase "); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; +// Do sane defaults for regular oled rendering +void oled_task_user(void) { + if (oled_task_keymap()) { + render_status_lite(0, 0); } } -#endif // !KEYBOARD_splitkb_kyria_rev1 -void encoder_state_string5(uint8_t index, uint8_t layer, char* buffer) { - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled - #ifdef RGB_MATRIX_ENABLE - case _MEDI: - switch (encoder_state[index].rgb) { - case 0: - strcpy(buffer, " mode"); - break; - case 1: - strcpy(buffer, " hue "); - break; - case 2: - strcpy(buffer, "satur"); - break; - case 3: - strcpy(buffer, "value"); - break; - case 4: - strcpy(buffer, "speed"); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - #endif - // If pointer control is enabled - #ifdef MOUSEKEY_ENABLE - case _MOUS: - switch (encoder_state[index].point) { - case 0: - strcpy(buffer, "m.lat"); - break; - case 1: - strcpy(buffer, "m.ver"); - break; - case 2: - strcpy(buffer, "s.ver"); - break; - case 3: - strcpy(buffer, "s.lat"); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - #endif - default: - switch (encoder_state[index].base) { - case 0: - strcpy(buffer, " volm"); - break; - case 1: - strcpy(buffer, " song"); - break; - case 2: - strcpy(buffer, " sink"); - break; - case 3: - strcpy(buffer, "s.vol"); - break; - case 4: - strcpy(buffer, " src "); - break; - case 5: - strcpy(buffer, " L/R "); - break; - case 6: - strcpy(buffer, " U/D "); - break; - case 7: - strcpy(buffer, "pgU/D"); - break; - case 8: - strcpy(buffer, " del "); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - } +/*-------------------------*\ +|*---RENDERING FUNCTIONS---*| +\*-------------------------*/ +void render_qmk_logo(uint8_t row, uint8_t col) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d, + 0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6, + 0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd, + 0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_set_cursor(col, row); + oled_write_P(qmk_logo, false); } -#endif // ENCODER_ENABLE -static void render_status(void) { - // Function to print state information - uint8_t this_layer = get_highest_layer(layer_state); - uint8_t this_mod = get_mods(); - // Temporary variable for RGB - #if defined RGB_MATRIX_ENABLE - static char rgb_temp4[4] = {0}; - #endif - // Temporary variable for WPM string - #if defined WPM_ENABLE - static char wpm_temp4[4] = {0}; - #endif - // Temporary variable for encoder state - #if defined ENCODER_ENABLE - static char encoder_temp6[6] = {0}; - #endif - // Line 1: Layer State +void render_layer(uint8_t row, uint8_t col, uint8_t top_layer) { + // Write the layer state + oled_set_cursor(col, row); oled_write("Layer: ", false); - switch (this_layer) { + switch (top_layer) { case _BASE: - oled_write("Default\n", false); + oled_write("Default", false); break; case _CHAR: - oled_write("Sp. Chars\n", false); + oled_write("Sp. Chars", false); break; case _GAME: - oled_write("Gaming\n", false); + oled_write("Gaming", false); break; case _MEDI: - oled_write("Media Ctr\n", false); + oled_write("Media Ctr", false); break; case _NAVI: - oled_write("Navigation\n", false); + oled_write("Navigation", false); break; case _SYMB: - oled_write("Symbols\n", false); + oled_write("Symbols", false); break; case _NUMB: - oled_write("Numpad\n", false); + oled_write("Numpad", false); break; case _FUNC: - oled_write("Funct Keys\n", false); + oled_write("Funct Keys", false); break; case _MOUS: - oled_write("Mouse Keys\n", false); + oled_write("Mouse Keys", false); break; case _MUSI: - oled_write("Music Mode\n", false); + oled_write("Music Mode", false); break; default: - oled_write("???\n", false); + oled_write("???", false); } + oled_advance_page(true); +} + +void render_modifiers_lite(uint8_t row, uint8_t col, uint8_t mods) { + // Write the modifier state + oled_set_cursor(col, row); + oled_write((mods & MOD_MASK_SHIFT ) ? "Shft " : " ", false); + oled_write((mods & MOD_MASK_CTRL ) ? "Ctrl " : " ", false); + oled_write((mods & MOD_MASK_ALT ) ? "Alt" : " ", false); + oled_write((mods & MOD_BIT(KC_RALT)) ? "G " : " ", false); + oled_write((mods & MOD_MASK_GUI ) ? "Meta " : " ", false); + oled_advance_page(true); +} + +// Renders the encoder state, 14 characters +void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { + oled_set_cursor(col, row); + +# ifdef ENCODER_ENABLE + static char encoder_temp9[9] = {0}; + oled_write("Enc: ", false); + encoder_state_string(index, layer, encoder_temp9); + oled_write(encoder_temp9, false); +# else // ENCODER_ENABLE + oled_write("No enc. avail.", false); +# endif // ENCODER_ENABLE + oled_advance_page(true); +} + +void render_wpm(uint8_t row, uint8_t col) { + // Renders the WPM, 8 characters + oled_set_cursor(col, row); +# ifdef WPM_ENABLE + static char wpm_temp4[4] = {0}; + oled_write("WPM: ", false); + itoa(get_current_wpm(), wpm_temp4, 10); + oled_write(wpm_temp4, false); + oled_write(" ", false); +# else // WPM_ENABLE + oled_write("WPM: N/A", false); +# endif // WPM_ENABLE + oled_advance_page(true); +} + +// Writes the currently used OLED display layout +void render_keymap(uint8_t row, uint8_t col, bool isLite) { + // Render the oled layout + oled_set_cursor(col, row); + if (isLite) { + oled_write("KM: ", false); + } else { + oled_write("Layout: ", false); + } + switch (userspace_config.layout % 3) { + case 0: + oled_write("Dvorak", false); + break; + case 1: + oled_write("Tur. F", false); + break; + case 2: + oled_write("Qwerty", false); + break; + } + if (isLite) { + oled_write(" ", false); + } else { + oled_advance_page(true); + } +} + +// Writes the currently used OLED display layout +#ifdef RGB_MATRIX_ENABLE +void render_rgb_lite(uint8_t row, uint8_t col) { + static char rgb_temp4[4] = {0}; + // Render the oled layout + oled_set_cursor(col, row); + oled_write("m", false); + itoa(rgb_matrix_get_mode(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" h", false); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" s", false); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" v", false); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_advance_page(true); +} +#endif // RGB_MATRIX_ENABLE + +void render_status_lite(uint8_t row, uint8_t col) { + // Function to print state information; for low flash memory + uint8_t this_layer = get_highest_layer(layer_state); + uint8_t this_mod = get_mods(); + + // Line 1: Layer State + render_layer(row + 0, col + 0, this_layer); + // Line 2: Mod or info switch (this_layer) { // Show RGB mode as an overlay in media mode. -#if defined RGB_MATRIX_ENABLE +# ifdef RGB_MATRIX_ENABLE case _MEDI: - oled_write("m", false); - itoa(rgb_matrix_get_mode(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" h", false); - itoa(rgb_matrix_get_hue(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" s", false); - itoa(rgb_matrix_get_sat(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" v", false); - itoa(rgb_matrix_get_val(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write("\n", false); + render_rgb_lite(row + 1, col + 0); break; -#endif +# endif // RGB_MATRIX_ENABLE // Show the modifier if nothing else is doing anything default: - oled_write((this_mod & MOD_MASK_SHIFT ) ? "Shft " : " ", false); - oled_write((this_mod & MOD_MASK_CTRL ) ? "Ctrl " : " ", false); - oled_write((this_mod & MOD_MASK_ALT ) ? "Alt" : " ", false); - oled_write((this_mod & MOD_BIT(KC_RALT)) ? "G " : " ", false); - oled_write((this_mod & MOD_MASK_GUI ) ? "Meta " : " ", false); - oled_write("\n", false); + render_modifiers_lite(row + 1, col + 0, this_mod); break; } - // Line 3: WPM - oled_write("KM: Qwerty WPM: ", false); -#if defined WPM_ENABLE - itoa(get_current_wpm(), wpm_temp4, 10); - oled_write(wpm_temp4, false); -#else - oled_write("N/A", false); -#endif - oled_write("\n", false); - // Line 4: Encoder states -#ifdef ENCODER_ENABLE - oled_write("EN0:", false); - encoder_state_string5(0, this_layer, encoder_temp6); - oled_write(encoder_temp6, false); - oled_write(" EN1:", false); - encoder_state_string5(1, this_layer, encoder_temp6); - oled_write(encoder_temp6, false); -#else - oled_write("-Encoder unavailable-", false); -#endif - oled_write("\n", false); -} -// Allow default to be overwritten by keymap if they return false -__attribute__ ((weak)) bool oled_task_keymap(void) {return true;} + // Line 3: WPM and layout + render_keymap(row + 2, col + 0, true); + render_wpm(row + 2, col + 11); -// Do sane defaults for regular oled rendering -void oled_task_user(void) { - if (oled_task_keymap()) { - render_status(); + // Line 4: Encoder states + oled_write("Encoder: ", false); +# ifdef SPLIT_KEYBOARD + if (is_keyboard_left()) { + render_encoder(row + 3, col + 0, 0, this_layer); + } else { + render_encoder(row + 3, col + 0, 1, this_layer); } +# else // SPLIT_KEYBOARD + render_encoder(row + 3, col + 0, 0, this_layer); +# endif // SPLIT_KEYBOARD } diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index 6e88cfc1cb1..c403e4c96aa 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -15,9 +15,14 @@ along with this program. If not, see . #include "bbaserdem.h" // Contain the main oled writer here void oled_task_user(void); -bool oled_task_keymap(void); -// This is only neccessary for oled; hence here -#ifdef ENCODER_ENABLE -void encoder_state_string5(uint8_t index, uint8_t layer, char* buffer); -void encoder_state_string8(uint8_t index, uint8_t layer, char* buffer); -#endif +// Some generic rendering functions +void render_qmk_logo(uint8_t row, uint8_t col); +void render_layer(uint8_t row, uint8_t col, uint8_t top_layer); +void render_modifiers_lite(uint8_t row, uint8_t col, uint8_t mods); +void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer); +void render_wpm(uint8_t row, uint8_t col); +void render_keymap(uint8_t row, uint8_t col, bool isLite); +#ifdef RGB_MATRIX_ENABLE +void render_rgb_lite(uint8_t row, uint8_t col); +#endif // RGB_MATRIX_ENABLE +void render_status_lite(uint8_t row, uint8_t col); diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index e21f47ece42..81f58cb52c8 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -12,78 +12,100 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-rgb.h" -#define SPLIT_POINT 112 +#include "color.h" +#define X_DIV 224/2 /* Code relating to per-key RGB LED stuff */ // Allow hooking into the RGB matrix indications using keymap code +// Allow to turn off global handling __attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { return false; } + +// Modulates the brightness of indicator +RGB helper_dimmer(uint8_t r, uint8_t g, uint8_t b) { + RGB output; + output.r = r / 2; + output.g = g / 2; + output.b = b / 2; + return output; +} +// x range from 0-left to 224-right +// y range from 0-top to 64-bottom +void helper_painter(uint8_t led_min, uint8_t led_max, RGB col, uint8_t side) { + if (side == 1) { + // Left + for(uint8_t i = led_min; i <= led_max; i++) { + if((g_led_config.point[i].x < X_DIV) && (g_led_config.flags[i] & LED_FLAG_INDICATOR)) { + rgb_matrix_set_color(i, col.r, col.g, col.b); + } + } + } else if (side == 2) { + // Right + for(uint8_t i = led_min; i <= led_max; i++) { + if((g_led_config.point[i].x > X_DIV) && (g_led_config.flags[i] & LED_FLAG_INDICATOR)) { + rgb_matrix_set_color(i, col.r, col.g, col.b); + } + } + } else if (side == 0) { + // Both + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.flags[i] & LED_FLAG_INDICATOR) { + rgb_matrix_set_color(i, col.r, col.g, col.b); + } + } + } +} + // Set RGB state depending on layer void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t thisInd = 3; + RGB thisCol; // Load keymap hooks if(rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { return; } - // Do each layer seperately + // Grab color info switch (get_highest_layer(layer_state)) { case _GAME: // Set left side as purple - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_PURPLE); - } - } + thisCol = helper_dimmer(RGB_PURPLE); + thisInd = 1; break; case _CHAR: // Set full board as gold - rgb_matrix_set_color_all(RGB_GOLD); + thisCol = helper_dimmer(RGB_GOLD); + thisInd = 0; break; case _MEDI: // Set right side as pink - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x > SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_PINK); - } - } + thisCol = helper_dimmer(RGB_MAGENTA); + thisInd = 2; break; case _NAVI: // Set right side as green - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x > SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_GREEN); - } - } + thisCol = helper_dimmer(RGB_GREEN); + thisInd = 2; break; case _SYMB: // Set right side as yellow - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x > SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_YELLOW); - } - } + thisCol = helper_dimmer(RGB_YELLOW); + thisInd = 2; break; case _NUMB: // Set left side as blue - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_BLUE); - } - } + thisCol = helper_dimmer(RGB_BLUE); + thisInd = 1; break; case _FUNC: // Set left side as red - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_RED); - } - } + thisCol = helper_dimmer(RGB_RED); + thisInd = 1; break; case _MOUS: // Set left side as blue-green - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_SPRINGGREEN); - } - } + thisCol = helper_dimmer(RGB_SPRINGGREEN); + thisInd = 1; break; case _MUSI: // Set full board as orange - rgb_matrix_set_color_all(RGB_ORANGE); + thisCol = helper_dimmer(RGB_ORANGE); + thisInd = 0; break; } + helper_painter(led_min, led_max, thisCol, thisInd); } // Hook into shutdown code to make all perkey LED's red on hitting reset diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index f28342ddb5c..74d582641f4 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -14,6 +14,72 @@ along with this program. If not, see . #include "bbaserdem.h" // Language imports #include +// Need memcpy and memcmp from string.h along with transfer stuff +#ifdef SPLIT_KEYBOARD +#include "transactions.h" +#include +#endif // SPLIT_KEYBOARD + +/*-------------------------*\ +|*-----KEYBOARD CONFIG-----*| +\*-------------------------*/ +userspace_config_t userspace_config; + +/*---------------------------------*\ +|*----SPLIT KEYBOARD TRANSPORT-----*| +\*---------------------------------*/ +#ifdef SPLIT_KEYBOARD +userspace_config_t transport_userspace_config; + +// Translate the RPC data to the local variable +void userspace_config_sync(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { + // Copy incoming data to local variable + if (in_buflen == sizeof(transport_userspace_config)) { + memcpy(&transport_userspace_config, in_data, in_buflen); + } + // There is no data to send back; so no output handling +} + +// Either send or receive the correct data +void userspace_config_transport_update(void) { + if (is_keyboard_master()) { + // If we are the main device; we want to send info. + transport_userspace_config.raw = userspace_config.raw; + } else { + // If we are the secondary device; we want to receive info. + userspace_config.raw = transport_userspace_config.raw; + } +} + +// Initiate the protocol on sync +void userspace_config_transport_sync(void) { + if (is_keyboard_master()) { + // Keep track of the last state + static userspace_config_t last_userspace_config; + static uint32_t last_sync; + bool needs_sync = false; + + // Check if the state values are different + if (memcmp(&transport_userspace_config, &last_userspace_config, sizeof(transport_userspace_config))) { + needs_sync = true; + memcpy(&last_userspace_config, &transport_userspace_config, sizeof(transport_userspace_config)); + } + + // Send to secondary every 500ms regardless of state change + if (timer_elapsed32(last_sync) > 500) { + needs_sync = true; + } + + // Perform the sync if requested + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_USERSPACE_SYNC, sizeof(transport_userspace_config), &transport_userspace_config)) { + last_sync = timer_read32(); + } + needs_sync = false; + } + } +} +#endif // SPLIT_KEYBOARD /*---------------------------*\ |*-----KEYBOARD PRE INIT-----*| @@ -50,30 +116,54 @@ __attribute__ ((weak)) void keyboard_post_init_user(void) { // Fix beginning base layer, in case some other firmware was flashed // set_single_persistent_default_layer(_BASE); + // Initialize userspace config + userspace_config.layout = 0; + + // Split keyboard halves communication +# ifdef SPLIT_KEYBOARD + transaction_register_rpc(RPC_ID_USERSPACE_SYNC, userspace_config_sync); +# endif // SPLIT_KEYBOARD + // Backlight LED - #ifdef BACKLIGHT_ENABLE +# ifdef BACKLIGHT_ENABLE keyboard_post_init_backlight(); - #endif +# endif // RGB underglow - #ifdef RGBLIGHT_ENABLE +# ifdef RGBLIGHT_ENABLE keyboard_post_init_underglow(); - #endif +# endif // Encoders - #ifdef ENCODER_ENABLE +# ifdef ENCODER_ENABLE keyboard_post_init_encoder(); - #endif +# endif // Unicode mode - #ifdef UNICODEMAP_ENABLE +# ifdef UNICODEMAP_ENABLE set_unicode_input_mode(UC_LNX); - #endif +# endif // Keymap specific stuff keyboard_post_init_keymap(); } +/*---------------------------*\ +|*-----HOUSEKEEPING TASK-----*| +\*---------------------------*/ +/* I have no idea what this does + */ +__attribute__ ((weak)) void housekeeping_task_keymap(void) {} +void housekeeping_task_user(void) { +# ifdef SPLIT_KEYBOARD + userspace_config_transport_update(); + userspace_config_transport_sync(); +# endif // SPLIT_KEYBOARD + + // Hook to keymap code + housekeeping_task_keymap(); +} + /*-----------------------*\ |*-----EECONFIG INIT-----*| \*-----------------------*/ @@ -97,24 +187,16 @@ __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } -__attribute__ ((weak)) -bool process_record_audio(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__ ((weak)) -bool process_record_macro(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__ ((weak)) -bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { - return true; -} bool process_record_user(uint16_t keycode, keyrecord_t *record) { // Return after running through all individual hooks return process_record_keymap(keycode, record) && +# ifdef AUDIO_ENABLE process_record_audio(keycode, record) && +# endif // AUDIO_ENABLE +# ifdef ENCODER_ENABLE process_record_encoder(keycode, record) && +# endif // ENCODER_ENABLE process_record_macro(keycode, record); } diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 3e9b70117e7..265898c3e6b 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -45,6 +45,29 @@ along with this program. If not, see . #include "bb-oled.h" #endif +// Structure to keep runtime info on encoder state +typedef union { + uint16_t raw; + struct { + uint8_t base :4; // (9) The encoder state on most layers; regular function + uint8_t rgb :4; // (5) The encoder state on media layer; controls light + uint8_t point :4; // (4) The encoder state on mouse layer; moves pointer + uint8_t :4; // Padding + }; +} encoder_state_t; + +// Structure to contain userspace config in total +typedef union { + uint64_t raw; + struct { + encoder_state_t encoder[2]; + uint8_t layout; + }; +} userspace_config_t; + +// Broadcast us to everyone else +extern userspace_config_t userspace_config; + // Function definitions that can be accessed through specific keymaps // Runs before all initialization void keyboard_pre_init_keymap(void); @@ -62,6 +85,8 @@ void matrix_scan_keymap(void); layer_state_t layer_state_set_keymap(layer_state_t state); // This code runs when the default layer changes layer_state_t default_layer_state_set_keymap (layer_state_t state); +// Some code +void housekeeping_task_user(void); // This code runs to set LED states void led_set_keymap(uint8_t usb_led); // For code that runs on suspend @@ -89,16 +114,24 @@ enum userspace_custom_keycodes { // Macro key BB_PGPK, // Unicode strings - #ifdef UNICODEMAP_ENABLE +# ifdef UNICODEMAP_ENABLE BB_LENY, BB_TABL, TR_FLAG, - #endif +# endif // Encoder buttons - #ifdef ENCODER_ENABLE +# ifdef ENCODER_ENABLE BB_ENC0, BB_ENC1, - #endif +# endif + // Some RGB toggles +# ifdef RGB_MATRIX_ENABLE + BB_RGBO, +# endif + // Oled editor +# ifdef OLED_ENABLE + BB_OLED, +# endif //use for keymap specific codes KEYMAP_SAFE_RANGE }; @@ -385,19 +418,19 @@ enum userspace_layers { /* Media layer * ┌─────┬─────┬─────┬─────┬─────┐ - * │ Tog │ Mod │ Hue │ Sat │ Bri │ RGB light control + * │Speed│ Mod │ Hue │ Sat │ Bri │ RGB light control * ├─────┼─────┼─────┼─────┼─────┤ * │Media│Prev.│MuTog│MuStp│Next │ Media control * ├─────┼─────┼─────┼─────┼─────┤ * │Sink │Vol -│ Mut │Eject│Vol +│ Volume control * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │ │Veloc│Music│ Feature control on keyboard + * │OledL│Veloc│Music│ Feature control on keyboard * └─────┴─────┴─────┘ */ -#define _ME1_5_ RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI -#define _ME2_5_ KC_MSEL,KC_MPRV,KC_MPLY,KC_MSTP,KC_MNXT +#define _ME1_5_ RGB_SPI,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI +#define _ME2_5_ RGB_TOG,KC_MPRV,KC_MPLY,KC_MSTP,KC_MNXT #define _ME3_5_ KC_F13, KC_VOLD,KC_MUTE,KC_EJCT,KC_VOLU -#define _ME4_3_ XXXXXXX,VLK_TOG,MU_TOG +#define _ME4_3_ BB_OLED,VLK_TOG,MU_TOG /* Navigation layer * ┌─────┬─────┬─────┬─────┬─────┐ @@ -484,7 +517,7 @@ enum userspace_layers { /* Function layer * ┌─────┬─────┬─────┬─────┬─────┐ - * │ F01 │ F02 │ F03 │ F04 │RESET│ + * │ F01 │ F02 │ F03 │ F04 │EEPRM│ * ├─────┼─────┼─────┼─────┼─────┤ * │ F05 │ F06 │ F07 │ F08 │EEPRM│ * ├─────┼─────┼─────┼─────┼─────┤ diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 7ed5af06798..8c497da88e6 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -33,29 +33,32 @@ along with this program. If not, see . // Split transport settings #ifdef SPLIT_KEYBOARD -// Enable reacting to keypresses on the other half -#define SPLIT_TRANSPORT_MIRROR -// Enable communicating layer state changes. -// #define SPLIT_LAYER_STATE_ENABLE -// #define SPLIT_MODS_ENABLE -#ifdef WPM_ENABLE - // #define SPLIT_WPM_ENABLE -#endif +# define SPLIT_TRANSPORT_MIRROR +# define SPLIT_LAYER_STATE_ENABLE +# define SPLIT_MODS_ENABLE +# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USERSPACE_SYNC, USER_SYNC_OLED, USER_SYNC_UNUSED +# define SPLIT_LED_STATE_ENABLE +# ifdef WPM_ENABLE +# define SPLIT_WPM_ENABLE +# endif +# ifdef OLED_ENABLE +# define SPLIT_OLED_ENABLE +# endif #endif // Unicode entry mode #ifdef UNICODEMAP_ENABLE - #define UNICODE_SELECTED_MODES UC_LNX +# define UNICODE_SELECTED_MODES UC_LNX // Adapt the unicode entry mode to dvorak - #ifdef UNICODE_KEY_LNX - #undef UNICODE_KEY_LNX - #endif - #define UNICODE_KEY_LNX LCTL(LSFT(KC_F)) +# ifdef UNICODE_KEY_LNX +# undef UNICODE_KEY_LNX +# endif +# define UNICODE_KEY_LNX LCTL(LSFT(KC_F)) #endif // Mousekey mode #ifdef MOUSEKEY_ENABLE - #define MK_COMBINED +# define MK_COMBINED #endif // Tap-hold settings @@ -67,68 +70,57 @@ along with this program. If not, see . // Backlight settings #ifdef BACKLIGHT_ENABLE - #define BACKLIGHT_BREATHING - #define BREATHING_PERIOD 5 +# define BACKLIGHT_BREATHING +# define BREATHING_PERIOD 5 #endif // Audio definitions #ifdef AUDIO_ENABLE +//# define AUDIO_ENABLE_TONE_MULTIPLEXING // Make findable songs as defaults - #ifdef HOROLOGY - #define STARTUP_SONG SONG(HOROLOGY) - #endif - #ifdef PEOPLE_VULTURES - #define GOODBYE_SONG SONG(PEOPLE_VULTURES) - #endif - #ifdef NONAGON_INFINITY - #define MUSIC_ON_SONG SONG(NONAGON_INFINITY) - #endif - #ifdef WAH_WAH - #define MUSIC_OFF_SONG SONG(WAH_WAH) - #endif +# ifdef HOROLOGY +# define STARTUP_SONG SONG(HOROLOGY) +# endif +# ifdef PEOPLE_VULTURES +# define GOODBYE_SONG SONG(PEOPLE_VULTURES) +# endif +# ifdef NONAGON_INFINITY +# define MUSIC_ON_SONG SONG(NONAGON_INFINITY) +# endif +# ifdef WAH_WAH +# define MUSIC_OFF_SONG SONG(WAH_WAH) +# endif // Audio code expects these to be defined - #ifdef BIG_FIG_WASP - #define GAME_ON_SONG SONG(BIG_FIG_WASP) - #else - #define GAME_ON_SONG SONG(USSR_ANTHEM) - #endif - #ifdef POLYGONDWANALAND - #define GAME_OFF_SONG SONG(POLYGONDWANALAND) - #else - #define GAME_OFF_SONG SONG(NOCTURNE_OP_9_NO_1) - #endif +# ifdef BIG_FIG_WASP +# define GAME_ON_SONG SONG(BIG_FIG_WASP) +# else +# define GAME_ON_SONG SONG(USSR_ANTHEM) +# endif +# ifdef POLYGONDWANALAND +# define GAME_OFF_SONG SONG(POLYGONDWANALAND) +# else +# define GAME_OFF_SONG SONG(NOCTURNE_OP_9_NO_1) +# endif #endif // OLED definitions #ifdef OLED_ENABLE // Timeout in one minute - #define OLED_TIMEOUT 60000 +# define OLED_TIMEOUT 60000 // Fade out the screen when timing out - #define OLED_FADE_OUT - #define OLED_FADE_OUT_INTERVAL 5 +# define OLED_FADE_OUT +# define OLED_FADE_OUT_INTERVAL 5 #endif // For perkey leds #ifdef RGB_MATRIX_ENABLE - #define RGB_DISABLE_WHEN_USB_SUSPENDED true +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // Start using this mode - #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON - #define RGB_MATRIX_STARTUP_HUE 100 - #define RGB_MATRIX_STARTUP_SAT 255 - #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS +# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON +# define RGB_MATRIX_STARTUP_HUE 100 +# define RGB_MATRIX_STARTUP_SAT 255 +# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Some config options - #define RGB_MATRIX_KEYPRESSES - #define RGB_MATRIX_KEYRELEASES - // Disable some animation modes - #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT - #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL - #define DISABLE_RGB_MATRIX_BAND_RAINDROPS - #define DISABLE_RGB_MATRIX_BAND_JELLYBEAN_RAINDROPS - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS - // Some more config options - #define RGB_MATRIX_KEYPRESSES // React to key presses - #define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects +# define RGB_MATRIX_KEYRELEASES +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects #endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index facc61a3f09..501c85c8aed 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -35,10 +35,10 @@ KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance -# These features can be enabled on ARM boards; disabled for AVR due to space -# NKRO_ENABLE = no # Default is 6KRO which is plenty -# VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed -WPM_ENABLE = yes # Get WPM reports as you type +# These features can be disabled at whim +NKRO_ENABLE ?= yes # Default is 6KRO +VELOCIKEY_ENABLE ?= yes # Speed effects change with typing speed +WPM_ENABLE = ?yes # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff @@ -75,5 +75,8 @@ endif # OLED code ifeq ($(strip $(OLED_ENABLE)), yes) -SRC += bb-oled.c + SRC += bb-oled.c + ifeq ($(strip $(CTPC)), yes) + SRC += bb-oled-extra.c + endif endif From c555ce16f5c4d2776650ec67c14b94347ebd706c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 17 Sep 2021 12:20:22 -0400 Subject: [PATCH 39/94] Fully did changes --- users/bbaserdem/bb-oled-extra.c | 108 +++++++++++++++++++++++++++++--- users/bbaserdem/config.h | 1 + 2 files changed, 101 insertions(+), 8 deletions(-) diff --git a/users/bbaserdem/bb-oled-extra.c b/users/bbaserdem/bb-oled-extra.c index ece65054f2f..3f648baa295 100644 --- a/users/bbaserdem/bb-oled-extra.c +++ b/users/bbaserdem/bb-oled-extra.c @@ -343,6 +343,98 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x7b,0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x04,0x05,0x05,0x02,0x00,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + // QWERTY + static const char PROGMEM base0_L_qwer_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x70, + 0x88,0x88,0x48,0xf8,0x00,0x78,0x80,0x70,0x80,0x78,0x00,0x70,0xa8,0xa8, + 0xa8,0xb0,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x08,0x7f,0x88,0x88,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x18,0x60,0x80,0x00,0x00,0x00,0x00, + 0x40,0x40,0x40,0x83,0x00,0x80,0x40,0x40,0x40,0x00,0x00,0x80,0x40,0x40, + 0x40,0xf8,0x00,0x00,0xf0,0x48,0x48,0x00,0x00,0x80,0x40,0x40,0x40,0xc0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0xc0,0x41,0x46,0x18,0x00,0x02, + 0x05,0x05,0x05,0x07,0x00,0x04,0x05,0x05,0x05,0x02,0x00,0x03,0x04,0x04, + 0x02,0x07,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0xc3,0x14,0x14,0x12,0x0f + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0xff,0x80,0x80,0x00,0x00,0x22, + 0x32,0x2a,0x26,0x22,0x00,0x22,0x14,0x08,0x14,0x22,0x00,0x1c,0x22,0x22, + 0x22,0x22,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x3f,0x24,0x22,0x22,0x1c}}; + static const char PROGMEM base0_L_qwer_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0xfc, + 0x02,0x42,0x82,0x7c,0x00,0x7e,0x80,0x70,0x80,0x7e,0x00,0xfe,0x12,0x12, + 0x12,0x02,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0xe0, + 0x91,0x91,0x90,0xe3,0x00,0x60,0x91,0x90,0x91,0x20,0x00,0xf1,0x11,0x11, + 0x11,0xe1,0x00,0xf1,0x90,0x90,0x90,0x11,0x00,0xe0,0x10,0x91,0x90,0xa0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x9f,0x40,0x40,0x00,0x8f, + 0x80,0x80,0x80,0x8f,0x00,0x84,0x08,0x08,0x08,0x87,0x00,0x0f,0x88,0x88, + 0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x80,0x00,0x87,0x88,0x88,0x88,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x04,0x04,0x7b,0x80,0x80,0x00,0x70, + 0x48,0x44,0x42,0x41,0x00,0x71,0x0a,0x04,0x0a,0x71,0x00,0x3f,0x40,0x40, + 0x40,0x21,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x7f,0x44,0x44,0x44,0x3b}}; + static const char PROGMEM base0_R_qwer_nomod[4][42] = { + { 0x78,0x80,0x80,0x40,0xf8,0x00,0x78,0x80,0x80,0x40,0xf8,0x00,0x00,0x08, + 0xfa,0x80,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0xf8,0x90,0x88,0x88, + 0x70,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xf8,0x82,0x42,0x42,0x81,0x00,0x00,0x00,0x40,0xd0,0x00,0x00,0xf8,0x00, + 0x80,0x40,0x00,0x00,0x08,0xf8,0x00,0x00,0x00,0x00,0x03,0xc0,0xc0,0x00, + 0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x10,0x10,0x0f,0x00,0x00,0x07,0x01, + 0x01,0x02,0x04,0x00,0x00,0x03,0x04,0x04,0x00,0x00,0x00,0x16,0x0e,0x00, + 0xc0,0x00,0x00,0x40,0x40,0xc0,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x3e,0x02,0x02,0x02,0x3c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x00,0xb0, + 0x70,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0xc0,0x30,0x0c,0x03, + 0x00,0x00,0x00,0x80,0x80,0xff,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_qwer_shift[4][42] = { + { 0x06,0x08,0xf0,0x08,0x06,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x00,0x02, + 0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0xfc,0x00,0xfe,0x12,0x12,0x12, + 0x0c,0x00,0x82,0x44,0x28,0x10,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xf0,0x80,0x81,0x80,0xf0,0x00,0x00,0x01,0x01,0x01,0xf0,0x00,0xf0,0x81, + 0x41,0x21,0x10,0x00,0xf0,0x01,0x01,0x01,0x00,0x00,0x01,0xc0,0xc0,0x00, + 0x00,0x00,0x00,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x8f,0x00,0x00,0x00,0x8f,0x00,0x86,0x08,0x08,0x08,0x87,0x00,0x0f,0x00, + 0x01,0x82,0x0c,0x00,0x8f,0x08,0x08,0x08,0x08,0x00,0x00,0x86,0x86,0x80, + 0x00,0x00,0x00,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x7f,0x03,0x0c,0x30,0x7f,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x04,0x0a, + 0x11,0x20,0x00,0x00,0x20,0x11,0x0a,0x04,0x00,0x00,0x01,0x00,0x28,0x04, + 0x03,0x00,0x00,0x80,0x80,0x7b,0x04,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM symb5_R_qwer[4][42] = { + { 0x00,0x04,0x08,0x10,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x50,0x50, + 0x50,0x50,0x50,0x00,0x10,0x10,0xee,0x01,0x01,0x00,0x01,0x01,0xee,0x10, + 0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xc0,0x00,0x00,0x00,0x00,0xf8,0x09,0x0a,0x02,0x00,0x02,0x0a,0x09,0xf8, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x04,0x04,0x84,0x44,0x04,0x00,0x01,0x41, + 0x87,0x01,0x01,0x00,0xc0,0x1f,0x10,0x10,0x00,0x00,0x00,0x10,0xd0,0x1f, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1e,0x61,0x80,0x00,0x00,0x00,0x80, + 0x61,0x1e,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0xff,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM numb6_L_qwer_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x70,0x00,0x71,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x71,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_qwer_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, + 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x70,0x00,0x70,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, + 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x71,0x00,0x70,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, + 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, + 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; // UNIVERSAL static const char PROGMEM char1_L[4][42] = { @@ -510,11 +602,11 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { draw_image(row, col, numb6_L_turf_nomod); } break; - case 3: // Qwerty + case 2: // Qwerty if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, numb6_L_dvor_shift); + draw_image(row, col, numb6_L_qwer_shift); } else { - draw_image(row, col, numb6_L_dvor_nomod); + draw_image(row, col, numb6_L_qwer_nomod); } break; } @@ -548,9 +640,9 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { break; case 2: // Qwerty if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_L_dvor_shift); + draw_image(row, col, base0_L_qwer_shift); } else { - draw_image(row, col, base0_L_dvor_nomod); + draw_image(row, col, base0_L_qwer_nomod); } break; } @@ -573,7 +665,7 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { } break; case 2: // Qwerty - draw_image(row, col, symb5_R_dvor); + draw_image(row, col, symb5_R_qwer); break; } } else if (layer_state_cmp(layer_state, _NAVI)) { @@ -612,9 +704,9 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { break; case 2: // Qwerty if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_R_dvor_shift); + draw_image(row, col, base0_R_qwer_shift); } else { - draw_image(row, col, base0_R_dvor_nomod); + draw_image(row, col, base0_R_qwer_nomod); } break; } diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 8c497da88e6..b86d859d098 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -35,6 +35,7 @@ along with this program. If not, see . #ifdef SPLIT_KEYBOARD # define SPLIT_TRANSPORT_MIRROR # define SPLIT_LAYER_STATE_ENABLE +# define SPLIT_OLED_ENABLE # define SPLIT_MODS_ENABLE # define SPLIT_TRANSACTION_IDS_USER RPC_ID_USERSPACE_SYNC, USER_SYNC_OLED, USER_SYNC_UNUSED # define SPLIT_LED_STATE_ENABLE From c2f60036c00ba13ad58f36a713af9d1cb3351655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 17 Sep 2021 18:10:06 -0400 Subject: [PATCH 40/94] Finalized the config --- .../1key/keymaps/bbaserdem/README.md | 18 ------------ .../bigseries/1key/keymaps/bbaserdem/config.h | 19 ------------- .../bigseries/1key/keymaps/bbaserdem/keymap.c | 28 ------------------- .../bigseries/1key/keymaps/bbaserdem/rules.mk | 6 ---- .../community/ortho_4x12/bbaserdem/README.md | 6 ---- .../community/ortho_4x12/bbaserdem/config.h | 2 +- .../split_3x5_3/bbaserdem-disable/README.md | 12 ++++---- .../split_3x5_3/bbaserdem-disable/keymap.c | 12 +------- users/bbaserdem/README.md | 24 ++-------------- users/bbaserdem/bb-underglow.c | 17 ++++++----- users/bbaserdem/bbaserdem.c | 12 ++++---- users/bbaserdem/bbaserdem.h | 10 +++---- users/bbaserdem/keymap-bitmaps/.gitignore | 1 + users/bbaserdem/rules.mk | 5 ++++ 14 files changed, 36 insertions(+), 136 deletions(-) delete mode 100644 keyboards/bigseries/1key/keymaps/bbaserdem/README.md delete mode 100644 keyboards/bigseries/1key/keymaps/bbaserdem/config.h delete mode 100755 keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c delete mode 100755 keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md deleted file mode 100644 index a4d8715a233..00000000000 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,18 +0,0 @@ -This file contains my [1x1](../../../default/ortho_1x1) board layouts -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Big Series PCB - -Big switch that does tap dance, and works as a fancy light only. -The PCB was sourced from Woodkeys (Cole Markham); -Currently AWOL and scammed people out of their money (me personally for 150$) -Cannot recommend anyone try to obtain one of these PCBs. - -My PCB to USB connector broke; and could not repair it yet. -Managed to obtain a custom glow in the dark keycap for this. - -## Status - -* [x] Layout adapted -* [ ] Have not tested build yet. -* [ ] Have not confirmed on board diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/config.h b/keyboards/bigseries/1key/keymaps/bbaserdem/config.h deleted file mode 100644 index ba45696ad24..00000000000 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 - -#ifdef TAPPING_TERM -#undef TAPPING_TERM -#endif -#define TAPPING_TERM 500 diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c b/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c deleted file mode 100755 index 2bb2d06e93c..00000000000 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2019 Batuhan Baserdem - -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 QMK_KEYBOARD_H -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT(BB_BIGS) -}; - -void matrix_init_keymap(void) { - rgblight_enable(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD); - rgblight_sethsv_noeeprom(0,255,255); -} diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk b/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk deleted file mode 100755 index 89651e991c8..00000000000 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -# Differences from userspace -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes -RGB_MATRIX_ENABLE = no -AUDIO_ENABLE = no -BLUETOOTH_ENABLE = no diff --git a/layouts/community/ortho_4x12/bbaserdem/README.md b/layouts/community/ortho_4x12/bbaserdem/README.md index 3e1e30cf54d..992da3b58bd 100644 --- a/layouts/community/ortho_4x12/bbaserdem/README.md +++ b/layouts/community/ortho_4x12/bbaserdem/README.md @@ -10,9 +10,3 @@ To sell soon; don't use them anymore, but will keep the light version. A planck rev4 replacement; for my acrylic planck case which used to host a now defunct rev4. - -## Status - -* [x] Layout adapted -* [ ] Have not tested build yet. -* [ ] Have not confirmed on board diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h index 66ba01f27f2..bc70788cd3c 100755 --- a/layouts/community/ortho_4x12/bbaserdem/config.h +++ b/layouts/community/ortho_4x12/bbaserdem/config.h @@ -16,7 +16,7 @@ along with this program. If not, see . // Code pertaining to planck rev6 #if defined(KEYBOARD_planck_rev6) // Encoder I use; - #ifdef RGB_DI_PIN + #ifdef ENCODER_RESOLUTION #undef ENCODER_RESOLUTION #endif #define ENCODER_RESOLUTION 2 diff --git a/layouts/community/split_3x5_3/bbaserdem-disable/README.md b/layouts/community/split_3x5_3/bbaserdem-disable/README.md index 9086172df88..f32f72feb5f 100644 --- a/layouts/community/split_3x5_3/bbaserdem-disable/README.md +++ b/layouts/community/split_3x5_3/bbaserdem-disable/README.md @@ -5,14 +5,14 @@ Check out the [user readme](../../../../users/bbaserdem/README.md) for more info Using a no 6th column crkbd (rev 2.1 choc) as a mobile keyboard. -This version uses Elite-C and ProMicro as controllers; hence no RGB and OLED. +This version uses ProMicro as controllers; can't have OLED and RGB at the same time. ## Build -Build command: `CFLAGS="-Wno-error=deprecated" TBF` +Used to flash Pro Micro explicitly using the following line; -## Todo +``` +sudo avrdude -p atmgea34u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.build/.hex +``` -* Switch PCB to the Proton-C compatible hotswap switch. -* Or use cable rerouting to make the pcb Proton-C compatible. -* Or find a way to use both OLED and LEDs. +But it does not work anymore in Archlinux. diff --git a/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c b/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c index 36a1fa3a52d..b5169e638a6 100644 --- a/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c +++ b/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c @@ -105,17 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { *          │14│13│06││30│37│38│ *          └──┴──┴──┘└──┴──┴──┘ */ -// Sided color-setting -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -} -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 24; i < 48; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -} + // End of differentiations #endif diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md index f0999c7a96d..0a1b80cc74a 100644 --- a/users/bbaserdem/README.md +++ b/users/bbaserdem/README.md @@ -2,13 +2,6 @@ My userspace code for my various keyboards; available here. -# Todo - -- [ ] Convert all RGB code to use RGB matrix. -- [ ] Make workflow so that ARM and AVR are both differentiable. -- [ ] Finish README to be intelligible. -- [ ] Generate JSON files to be used with Keyboard-Layout-Editor to produce images. - ## Builds These are my keyboard builds and info, it allows me to plan out my builds. @@ -117,8 +110,9 @@ These files are prefixed with `sbp-` to remove any naming clash. * [bb-audio](bb-audio.c): Code dealing with audio playback using onboard sound. * [bb-encoder](bb-encoder.c): Rotary encoder sutff. * [bb-macro](bb-macro.c): My custom keycodes; macros, tap dances, etc. -* [bb-oled](bb-oled.c): Controls OLED displays. -* [bb-rgb](bb-rgb.c): Controls per-key RGB LED matrix stuff. +* [bb-oled](bb-oled.c): Controls OLED displays. For higher memory; there is also [bb-oled-extra](bb-oled-extra.c). +* [bb-rgb](bb-rgb.c): Controls per-key RGB LED matrix stuff, and layer indication. Uses `RGB_MATRIX`. +* [bb-underglaw](bb-underglow.c): Controls RGB LED strip, and layer indication. Uses `RGBLIGHT`. # Layout @@ -127,8 +121,6 @@ My personal layout is mostly inspired by the There are some changes to make it friendlier to international keyboards. My board is compatible with software implementation of Dvorak and Turkish F. -WIP - ## Base Base layer uses tap-hold functionality to have access to modifiers. @@ -137,13 +129,3 @@ as to make those modifiers accessible to the keys that overlap them. Besides the Alt key; each side has the proper L/R version of the modifier. Since Right Alt key functions as AltGr key; both the L and R versions are available on each side. - -# Shoutout - -* To [drashna](../drashna/readme.md), for documenting how to use userspace features; -all my code is pretty much inspired from them. -* To [Manna Harbour](../manna-harbour_miryoku/README.org) for their -amazing keymap that inspired me to recreate mine and allowed me to move to -smaller split keyboards. -* To people who taught me C and have me enjoy working with it; -Dr. Mehmet Enis Oğuz and Dr. Veysi Erkcan Özcan. diff --git a/users/bbaserdem/bb-underglow.c b/users/bbaserdem/bb-underglow.c index 937e3007591..6b74c4a3f41 100644 --- a/users/bbaserdem/bb-underglow.c +++ b/users/bbaserdem/bb-underglow.c @@ -23,19 +23,18 @@ const rgblight_segment_t PROGMEM bb_base_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); // Gaming layer is turquoise const rgblight_segment_t PROGMEM bb_game_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_TURQUOISE} + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_PURPLE} ); // Character overlay is chartereuse const rgblight_segment_t PROGMEM bb_char_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {0, RGBLED_NUM, HSV_CHARTREUSE} + {0, RGBLED_NUM, HSV_GOLD} ); // Right-hand layers // Media layer is orange const rgblight_segment_t PROGMEM bb_medi_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, 30, 255, 255 - } + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_MAGENTA} ); // Navigation layer is green const rgblight_segment_t PROGMEM bb_navi_layer[] = RGBLIGHT_LAYER_SEGMENTS( @@ -43,14 +42,14 @@ const rgblight_segment_t PROGMEM bb_navi_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); // Symbol layer is purple const rgblight_segment_t PROGMEM bb_symb_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_PURPLE} + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_YELLOW} ); // Left-hand layers // Number layer is blue const rgblight_segment_t PROGMEM bb_numb_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_CYAN} + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_BLUE} ); // Function layer is red const rgblight_segment_t PROGMEM bb_func_layer[] = RGBLIGHT_LAYER_SEGMENTS( @@ -58,12 +57,12 @@ const rgblight_segment_t PROGMEM bb_func_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); // Pointer layer is yellow const rgblight_segment_t PROGMEM bb_mous_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_YELLOW} + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_SPRINGGREEN} ); // Music playback layer is magenta const rgblight_segment_t PROGMEM bb_musi_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {0, RGBLED_NUM, HSV_MAGENTA} + {0, RGBLED_NUM, HSV_ORANGE} ); const rgblight_segment_t* const PROGMEM bb_rgb_layers[] = RGBLIGHT_LAYERS_LIST( @@ -109,5 +108,5 @@ void shutdown_underglow(void) { // Make the LED's red on shutdown rgblight_enable_noeeprom(); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - rgblight_sethsv(HSV_PINK); + rgblight_sethsv(HSV_WHITE); } diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 74d582641f4..96e51ec9a2e 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -227,13 +227,13 @@ layer_state_t layer_state_set_user(layer_state_t state) { // Keymap layer state setting state = layer_state_set_keymap(state); // For underglow stuff - #ifdef RGBLIGHT_ENABLE - layer_state_set_underglow(state); - #endif +# ifdef RGBLIGHT_ENABLE + state = layer_state_set_underglow(state); +# endif // Audio playback - #ifdef AUDIO_ENABLE - layer_state_set_audio(state); - #endif +# ifdef AUDIO_ENABLE + state = layer_state_set_audio(state); +# endif return state; } diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 265898c3e6b..adeac2fa47b 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -32,6 +32,10 @@ along with this program. If not, see . #ifdef BACKLIGHT_ENABLE #include "bb-backlight.h" #endif +// Underglow light using rgb LEDs +#ifdef RGBLIGHT_ENABLE + #include "bb-underglow.h" +#endif // Keycap backlight using rgb LEDs #ifdef RGB_MATRIX_ENABLE #include "bb-rgb.h" @@ -123,10 +127,6 @@ enum userspace_custom_keycodes { # ifdef ENCODER_ENABLE BB_ENC0, BB_ENC1, -# endif - // Some RGB toggles -# ifdef RGB_MATRIX_ENABLE - BB_RGBO, # endif // Oled editor # ifdef OLED_ENABLE @@ -420,7 +420,7 @@ enum userspace_layers { * ┌─────┬─────┬─────┬─────┬─────┐ * │Speed│ Mod │ Hue │ Sat │ Bri │ RGB light control * ├─────┼─────┼─────┼─────┼─────┤ - * │Media│Prev.│MuTog│MuStp│Next │ Media control + * │Togg.│Prev.│MuTog│MuStp│Next │ Media control * ├─────┼─────┼─────┼─────┼─────┤ * │Sink │Vol -│ Mut │Eject│Vol +│ Volume control * ┌─────┼─────┼─────┼─────┴─────┴─────┘ diff --git a/users/bbaserdem/keymap-bitmaps/.gitignore b/users/bbaserdem/keymap-bitmaps/.gitignore index 4f6fdcf7c15..6448f593d6a 100644 --- a/users/bbaserdem/keymap-bitmaps/.gitignore +++ b/users/bbaserdem/keymap-bitmaps/.gitignore @@ -1,3 +1,4 @@ *.bmp splitImages templates +!.gitignore diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 501c85c8aed..c52052a28b4 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -63,6 +63,11 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes) SRC += bb-encoder.c endif +# RGB LED (Underglow) code +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) +SRC += bb-underglow.c +endif + # RGB LED (Perkey) code ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) SRC += bb-rgb.c From 11f9cfdc0a61c978263b886814b321daf90c6cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 17:01:04 -0400 Subject: [PATCH 41/94] Removed obsolete code --- .../gherkin/keymaps/bbaserdem/README.md | 11 - .../gherkin/keymaps/bbaserdem/config.h | 9 - .../gherkin/keymaps/bbaserdem/keymap.c | 36 - .../gherkin/keymaps/bbaserdem/rules.mk | 13 - .../lets_split/keymaps/bbaserdem/README.md | 27 - .../lets_split/keymaps/bbaserdem/config.h | 27 - .../lets_split/keymaps/bbaserdem/keymap.c | 35 - .../lets_split/keymaps/bbaserdem/rules.mk | 8 - .../keymaps/bbaserdem_right/README.md | 5 - .../keymaps/bbaserdem_right/config.h | 9 - .../keymaps/bbaserdem_right/keymap.c | 31 - .../keymaps/bbaserdem_right/rules.mk | 19 - .../lets_split_eh/keymaps/bbaserdem/README.md | 7 - .../lets_split_eh/keymaps/bbaserdem/config.h | 4 - .../lets_split_eh/keymaps/bbaserdem/keymap.c | 27 - .../lets_split_eh/keymaps/bbaserdem/rules.mk | 8 - keyboards/planck/keymaps/bbaserdem/README.md | 15 - keyboards/planck/keymaps/bbaserdem/config.h | 24 - keyboards/planck/keymaps/bbaserdem/keymap.c | 28 - keyboards/planck/keymaps/bbaserdem/rules.mk | 7 - .../xiudi/xd75/keymaps/bbaserdem/config.h | 3 - .../xiudi/xd75/keymaps/bbaserdem/keymap.c | 21 - .../xiudi/xd75/keymaps/bbaserdem/readme.md | 14 - .../xiudi/xd75/keymaps/bbaserdem/rules.mk | 7 - users/bbaserdem/README.md | 51 -- users/bbaserdem/bbaserdem.c | 633 ------------------ users/bbaserdem/bbaserdem.h | 268 -------- users/bbaserdem/config.h | 9 - users/bbaserdem/rules.mk | 21 - 29 files changed, 1377 deletions(-) delete mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md delete mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h delete mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c delete mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/lets_split/keymaps/bbaserdem/README.md delete mode 100755 keyboards/lets_split/keymaps/bbaserdem/config.h delete mode 100755 keyboards/lets_split/keymaps/bbaserdem/keymap.c delete mode 100755 keyboards/lets_split/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/lets_split/keymaps/bbaserdem_right/README.md delete mode 100755 keyboards/lets_split/keymaps/bbaserdem_right/config.h delete mode 100755 keyboards/lets_split/keymaps/bbaserdem_right/keymap.c delete mode 100755 keyboards/lets_split/keymaps/bbaserdem_right/rules.mk delete mode 100644 keyboards/lets_split_eh/keymaps/bbaserdem/README.md delete mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/config.h delete mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c delete mode 100755 keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/planck/keymaps/bbaserdem/README.md delete mode 100755 keyboards/planck/keymaps/bbaserdem/config.h delete mode 100755 keyboards/planck/keymaps/bbaserdem/keymap.c delete mode 100755 keyboards/planck/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/xiudi/xd75/keymaps/bbaserdem/config.h delete mode 100644 keyboards/xiudi/xd75/keymaps/bbaserdem/keymap.c delete mode 100644 keyboards/xiudi/xd75/keymaps/bbaserdem/readme.md delete mode 100644 keyboards/xiudi/xd75/keymaps/bbaserdem/rules.mk delete mode 100644 users/bbaserdem/README.md delete mode 100644 users/bbaserdem/bbaserdem.c delete mode 100644 users/bbaserdem/bbaserdem.h delete mode 100644 users/bbaserdem/config.h delete mode 100644 users/bbaserdem/rules.mk diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md deleted file mode 100644 index 3c9a5e98b37..00000000000 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Gherkin Layout -This is my gherkin layout. -It is used as a game pad, and key layout is inspired by spare keys I had lying around. -The firmware is very simple, and only includes one layer keymap, and RGB effects. - -# Flashing -The following command should be used from the main qmk directory. -``` -make gherkin:bbaserdem -sudo avrdude -p atmgea34u4 -P `ls /dev/ttyACM*` -c avr109 -U flash:.build/gherkin_bbaserdem.hex -``` diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h deleted file mode 100644 index 5c9ca52d750..00000000000 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#define RGB_DI_PIN F6 -#define RGBLED_NUM 10 -#define RGBLIGHT_ANIMATIONS -#ifdef BACKLIGHT_LEVELS -#undef BACKLIGHT_LEVELS -#endif -#define BACKLIGHT_LEVELS 3 diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c deleted file mode 100644 index 0d3c8557c5c..00000000000 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,36 +0,0 @@ -// This is a game-pad gherkin layout with RGB and LED lights - -#include QMK_KEYBOARD_H - -backlight_config_t backlight_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Game pad - * ,-----------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | Ctl | Alt | ~ | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Tab | Q | W | E | R | T | |^| | ; | ' | / | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Shf | A | S | D | F | <-- | |v| | --> | , | . | - * `-----------------------------------------------------------' - */ - 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) { - // Set LED's to max - _delay_us(300); - backlight_config.level = 2; - backlight_config.enable = 1; - eeconfig_update_backlight(backlight_config.raw); - backlight_set(backlight_config.level); - // Set RGB to rainbow mood light - rgblight_enable(); - rgblight_mode(1); - rgblight_sethsv(120,255,255); - rgblight_mode(6); -} diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk deleted file mode 100644 index 07a20a42172..00000000000 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,13 +0,0 @@ -USER_NAME := bbaserdem-nouserspace - -STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER -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 -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -AUDIO_ENABLE = no # Enable audio output from keyboard - -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable RBG light strips -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/lets_split/keymaps/bbaserdem/README.md b/keyboards/lets_split/keymaps/bbaserdem/README.md deleted file mode 100644 index 4b37d735552..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Lets Split Layout - -Check out [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Usage - -**These commands depend on there being no other arduino connected!** -Also udev rules can be set instead of using sudo. -Please unplug all other usb devices. - -To make the hex files; -``` -make lets_split/rev2:bbaserdem -make lets_split/rev2:bbaserdem_right -``` - -For the left half, after plugging in and resetting; (from repo main directory) -``` -sudo avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.build/lets_split_rev2_bbaserdem.hex -sudo avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -U eeprom:w:keyboards/lets_split/eeprom-lefthand.eep -``` - -For the right half; -``` -sudo avrdude -p atmgea34u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.build/lets_split_rev2_bbaserdem_right.hex -sudo avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -U eeprom:w:keyboards/lets_split/eeprom-righhand.eep -``` diff --git a/keyboards/lets_split/keymaps/bbaserdem/config.h b/keyboards/lets_split/keymaps/bbaserdem/config.h deleted file mode 100755 index 6a90e1c356d..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H - -#include "../../config.h" - -#define USE_SERIAL -#define EE_HANDS - -// LED strip stuff -#ifdef RGBLIGHT_ENABLE - -// Who thought it was a good idea to predefine these in the rev2/config.h ??? -#ifdef RGBLED_NUM -#undef RGBLED_NUM -#endif -#define RGBLED_NUM 12 - -#define RGBLIGHT_HUE_STEP 6 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 20 -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 6 -#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 2000 -#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 -#endif - -#endif diff --git a/keyboards/lets_split/keymaps/bbaserdem/keymap.c b/keyboards/lets_split/keymaps/bbaserdem/keymap.c deleted file mode 100755 index f9eab059ef1..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Let's Split - Dvorak turkish - * Keymap by @bbaserdem - * Dvorak layout with multiple features - * Most of the code is in the "user" directory. - * Check qmk_firmware/users/bbaserdem for the main part of the code - */ - -#include "lets_split.h" -#include "bbaserdem.h" - - -void matrix_init_keymap (void) { -} - -uint32_t layer_state_set_keymap(uint32_t state) { - return state; -} - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Main Dvorak layer - [_DV] = LAYOUT_letssplit_wrapper(DVORAK), - // Turkish and special character overlay - [_AL] = LAYOUT_letssplit_wrapper(ALTCHAR), - // Gaming layer - [_GA] = LAYOUT_letssplit_wrapper(GAME), - // Numbers layer - [_NU] = LAYOUT_letssplit_wrapper(NUMBERS), - // Settings layer - [_SE] = LAYOUT_letssplit_wrapper(SETTINGS), - // Mouse emulation layer - [_MO] = LAYOUT_letssplit_wrapper(MOUSE), - // Music layer - [_MU] = LAYOUT_letssplit_wrapper(MUSIC), -}; diff --git a/keyboards/lets_split/keymaps/bbaserdem/rules.mk b/keyboards/lets_split/keymaps/bbaserdem/rules.mk deleted file mode 100755 index 7a37e989d87..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Build options - -BACKLIGHT_ENABLE = no # Switch LEDs -MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = yes # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff - diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/README.md b/keyboards/lets_split/keymaps/bbaserdem_right/README.md deleted file mode 100644 index 8608f23f79b..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem_right/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Lets Split - Right Half - -Keymap for my right half, to be used as a numpad. -Check [main readme](../bbaserdem/README.md) for flashing info. - diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/config.h b/keyboards/lets_split/keymaps/bbaserdem_right/config.h deleted file mode 100755 index 47545a059be..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem_right/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H - -#include "../../config.h" - -#define USE_SERIAL -#define EE_HANDS - -#endif diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c b/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c deleted file mode 100755 index 2dcae0dca5a..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem_right/keymap.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Let's Split - Dvorak turkish - * Keymap by @bbaserdem - * Dvorak layout with multiple features - * Most of the code is in the "user" directory. - * Check qmk_firmware/users/bbaserdem for the main part of the code - */ - -#include "lets_split.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Navigation All Supered) Numpad - * ,-----------------------. ,-----------------------. - * | F4| ` | Q |Alt| L | > | | ) | - | + | = |Ent|Bkp| - * |---+---+---+---+---+---| |---+---+---+---+---+---| - * | F3| M |Ent|Ctl| K | ^ | | ( | * | 9 | 6 | 3 | . | - * |---+---+---+---+---+---| |---+---+---+---+---+---| - * | F2| T |Spc|Shf| J | v | | % | / | 8 | 5 | 2 | , | - * |---+---+---+---+---+---| |---+---+---+---+---+---| - * | F1| F | P |Tab| H | < | |Nlc|Tab| 7 | 4 | 1 | 0 | - * `-----------------------' `-----------------------' - */ - // Main Dvorak layer - [0] = LAYOUT_ortho_4x12( - LCTL(LALT(KC_DEL)), LGUI(KC_GRV), LGUI(KC_Q), LGUI(KC_LALT), LGUI(KC_L), LGUI(KC_RGHT), KC_RPRN, KC_PMNS, KC_PPLS, KC_PEQL, KC_PENT, KC_BSPC, \ - LGUI(KC_F3), LGUI(KC_M), LGUI(KC_ENT), LGUI(KC_LCTL), LGUI(KC_K), LGUI(KC_UP), KC_LPRN, KC_PAST, KC_P9, KC_P6, KC_P3, KC_PDOT, \ - LGUI(KC_F2), LGUI(KC_T), LGUI(KC_SPC), LGUI(KC_LSFT), LGUI(KC_J), LGUI(KC_DOWN), KC_PERC, KC_PSLS, KC_P8, KC_P5, KC_P2, KC_PCMM, \ - LGUI(KC_F1), LGUI(KC_F), LGUI(KC_P), LGUI(KC_TAB), LGUI(KC_H), LGUI(KC_LEFT), KC_NLCK, KC_TAB, KC_P7, KC_P4, KC_P1, KC_P0 \ - ) -}; diff --git a/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk b/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk deleted file mode 100755 index 6886a320a59..00000000000 --- a/keyboards/lets_split/keymaps/bbaserdem_right/rules.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Build options - -USER_NAME := bbaserdem-without-userspace - -BACKLIGHT_ENABLE = no # Switch LEDs -MOUSEKEY_ENABLE = no # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = no # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff -BLUETOOTH_ENABLE = no # No bluetooth -COMMAND_ENABLE = no # Some bootmagic thing -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -CONSOLE_ENABLE = no # Allows console output with a command -SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. -NKRO_ENABLE = no # Default is 6KRO which is plenty -MIDI_ENABLE = no # Untested feature -KEY_LOCK_ENABLE = no # Allows locking any key. Not used -UNICODE_ENABLE = no # Used for unicode character emulation -EXTRAKEY_ENABLE = no # OS signals like volume control diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/README.md b/keyboards/lets_split_eh/keymaps/bbaserdem/README.md deleted file mode 100644 index fcb70379376..00000000000 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Lets Split Eh Layout - -Check out [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Usage - -Fill in after flashing diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/config.h b/keyboards/lets_split_eh/keymaps/bbaserdem/config.h deleted file mode 100755 index 47be76567e4..00000000000 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H -#include "../../config.h" -#endif diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c b/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c deleted file mode 100755 index 92e72bbf1c8..00000000000 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,27 +0,0 @@ -#include "lets_split_eh.h" -#include "bbaserdem.h" - - -void matrix_init_keymap (void) { -} - -uint32_t layer_state_set_keymap(uint32_t state) { - return state; -} - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Main Dvorak layer - [_DV] = LAYOUT_letssplit_wrapper(DVORAK), - // Turkish and special character overlay - [_AL] = LAYOUT_letssplit_wrapper(ALTCHAR), - // Gaming layer - [_GA] = LAYOUT_letssplit_wrapper(GAME), - // Numbers layer - [_NU] = LAYOUT_letssplit_wrapper(NUMBERS), - // Settings layer - [_SE] = LAYOUT_letssplit_wrapper(SETTINGS), - // Mouse emulation layer - [_MO] = LAYOUT_letssplit_wrapper(MOUSE), - // Music layer - [_MU] = LAYOUT_letssplit_wrapper(MUSIC), -}; diff --git a/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk b/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk deleted file mode 100755 index 7a37e989d87..00000000000 --- a/keyboards/lets_split_eh/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,8 +0,0 @@ -# Build options - -BACKLIGHT_ENABLE = no # Switch LEDs -MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = yes # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff - diff --git a/keyboards/planck/keymaps/bbaserdem/README.md b/keyboards/planck/keymaps/bbaserdem/README.md deleted file mode 100644 index c8e8c3963c1..00000000000 --- a/keyboards/planck/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Planck Layout - -Current keymap is for rev4. -Audio is disabled in favor of RGB. -Check out [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Build - -Get keyboard into reset mode, and then; - -``` -make planck/rev4:bbaserdem:dfu -``` - -Either use sudo or set up udev rules. diff --git a/keyboards/planck/keymaps/bbaserdem/config.h b/keyboards/planck/keymaps/bbaserdem/config.h deleted file mode 100755 index ac5460bda60..00000000000 --- a/keyboards/planck/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H - -#include "config_common.h" - -// LED strip stuff -#ifdef RGBLIGHT_ENABLE -#define RGB_DI_PIN B2 -#define RGBLED_NUM 12 -#define RGBLIGHT_HUE_STEP 6 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 20 -#define RGBLIGHT_ANIMATIONS -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 6 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 6 -#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 6 -#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 2000 -#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 -#endif - -#define ENCODER_RESOLUTION 4 - -#endif diff --git a/keyboards/planck/keymaps/bbaserdem/keymap.c b/keyboards/planck/keymaps/bbaserdem/keymap.c deleted file mode 100755 index 1fa8132ddbb..00000000000 --- a/keyboards/planck/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * PLANCK - Dvorak turkish - * Keymap by @bbaserdem - * Dvorak layout with multiple features - * Most of the code is in the "user" directory. - * Check qmk_firmware/users/bbaserdem for the main part of the code - */ - -#include "planck.h" -#include "bbaserdem.h" - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // Main Dvorak layer - [_DV] = LAYOUT_planck_wrapper(DVORAK), - // Turkish and special character overlay - [_AL] = LAYOUT_planck_wrapper(ALTCHAR), - // Gaming layer - [_GA] = LAYOUT_planck_wrapper(GAME), - // Numbers layer - [_NU] = LAYOUT_planck_wrapper(NUMBERS), - // Settings layer - [_SE] = LAYOUT_planck_wrapper(SETTINGS), - // Mouse emulation layer - [_MO] = LAYOUT_planck_wrapper(MOUSE), - // Music mode - [_MU] = LAYOUT_planck_wrapper(MUSIC), -}; diff --git a/keyboards/planck/keymaps/bbaserdem/rules.mk b/keyboards/planck/keymaps/bbaserdem/rules.mk deleted file mode 100755 index b9b589e8d2d..00000000000 --- a/keyboards/planck/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Build options - -BACKLIGHT_ENABLE = yes # Switch LEDs -MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = yes # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = yes # Audio stuff diff --git a/keyboards/xiudi/xd75/keymaps/bbaserdem/config.h b/keyboards/xiudi/xd75/keymaps/bbaserdem/config.h deleted file mode 100644 index 271f48d0011..00000000000 --- a/keyboards/xiudi/xd75/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -// place overrides here diff --git a/keyboards/xiudi/xd75/keymaps/bbaserdem/keymap.c b/keyboards/xiudi/xd75/keymaps/bbaserdem/keymap.c deleted file mode 100644 index 6f8576b09b4..00000000000 --- a/keyboards/xiudi/xd75/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,21 +0,0 @@ -#include QMK_KEYBOARD_H -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Layout - * ,-----------------------------------------------------------. - * |Blt|Lck| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | - * |---+---+-----------------------------------------------+---| - * |Int|Trm| |Cps| - * |---+---| |---| - * |Clc|Psw| | \ | - * |---+---| PLANCK |---| - * |Rev|Ffw| | [ | - * |---+---| |---| - * |Tog|Mut| | ] | - * `-----------------------------------------------------------' - */ -[0] = KM( FKLAVYE ), -[1] = KM( AYARLAR ), -}; - diff --git a/keyboards/xiudi/xd75/keymaps/bbaserdem/readme.md b/keyboards/xiudi/xd75/keymaps/bbaserdem/readme.md deleted file mode 100644 index f96c8ea976c..00000000000 --- a/keyboards/xiudi/xd75/keymaps/bbaserdem/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -# XD75RE Setup - -(WIP) F keyboard for turkish, using unicode. - -* Write down keymap in userspace -* Figure out LED indicators - -# Make - -Take the board into reset mode, then -``` -make xd75:bbaserdem:dfu -``` -Either sudo it or set permissions in udev. diff --git a/keyboards/xiudi/xd75/keymaps/bbaserdem/rules.mk b/keyboards/xiudi/xd75/keymaps/bbaserdem/rules.mk deleted file mode 100644 index 3e501cd00ee..00000000000 --- a/keyboards/xiudi/xd75/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -# Build options -BACKLIGHT_ENABLE = yes # Switch LEDs -MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses -RGBLIGHT_ENABLE = no # LED strips -TAP_DANCE_ENABLE = no # Use multi-tap features -AUDIO_ENABLE = no # Audio stuff - diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md deleted file mode 100644 index eb8f33d422d..00000000000 --- a/users/bbaserdem/README.md +++ /dev/null @@ -1,51 +0,0 @@ -# Overview - -I have mostly ortholinear keyboards, which share a lot of functions. -For this purpose, I collected them here. - -I have the following keymaps: - -* Gherkin (Does not use the user space) -* XD75RE (Uses different keymap) -* Let's Split -* Let's Split It Up -* Planck - -# Layout - -I use DVORAK with an unorthodox Turkish layout. -If you wanna grab my code, and you used a layout with a persistent base -layer change, change it to layer 0 before proceeding. - -# Layers - -* **Dvorak**: Base layer,with dvorak layout. -* **Alternative**: Has alternate characters. -* **Game**: Toggled from *Function*, comfortable for gaming use. -* **Numeric**: Has numericals and symbols. Can be locked. -* **Function**: Layer has media and function keys. -* **Mouse**: Manipulates mouse. Can be locked. -* **Music** Allows playing sounds. - -# Functionality - -* **RGB Backlight**: With layer indication, and ability to change base layer lighting mode. -* **Secrets**: By placing a secrets.h, and not tracking it, passwords can be stored. -* **Mouse**: Mouse emulation, complete with diagonal keys. -* **Turkish**: An AltGr-like overlay that allows some non-common letters, in unicode. - -I suggest checking out how I enabled Turkish keys, -how I planned out RGB lighting, -and my mouse implementation; -they might offer some insight into fringe user cases. - -# Issues - -All features are too big for the 32kB bootloader. -Offenders are audio and rgb lights; it comes down to one or the other. - -~The Proton board, and rev 6 might fix that.~ - -# Credits - -I have previously written my keymap by myself before, but I rewrote it here, diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c deleted file mode 100644 index cdacda12ee8..00000000000 --- a/users/bbaserdem/bbaserdem.c +++ /dev/null @@ -1,633 +0,0 @@ -#include "bbaserdem.h" - -/*---------------*\ -|*-----MOUSE-----*| -\*---------------*/ -#ifdef MOUSEKEY_ENABLE -#include "mousekey.h" -#endif - -/*-------------*\ -|*-----RGB-----*| -\*-------------*/ -#ifdef RGBLIGHT_ENABLE -#include "rgblight.h" -#endif - -/*-------------*\ -|*---UNICODE---*| -\*-------------*/ -#ifdef UNICODE_ENABLE -#endif - -/*-----------------*\ -|*-----SECRETS-----*| -\*-----------------*/ -// Enabled by adding a non-tracked secrets.h to this dir. -#if (__has_include("secrets.h")) -#include "secrets.h" -#endif - -/*---------------*\ -|*-----MUSIC-----*| -\*---------------*/ -#ifdef AUDIO_ENABLE -float tone_game[][2] = SONG(ZELDA_PUZZLE); -float tone_return[][2] = SONG(ZELDA_TREASURE); -float tone_linux[][2] = SONG(UNICODE_LINUX); -float tone_windows[][2] = SONG(UNICODE_WINDOWS); -#endif - -/*-------------------*\ -|*-----TAP-DANCE-----*| -\*-------------------*/ -#ifdef TAP_DANCE_ENABLE -qk_tap_dance_action_t tap_dance_actions[] = { - // Shift on double tap of semicolon - [SCL] = ACTION_TAP_DANCE_DOUBLE( KC_SCLN, KC_COLN ) -}; -#endif - -/* In keymaps, instead of writing _user functions, write _keymap functions - * The __attribute__((weak)) allows for empty definitions here, and during - * compilation, if these functions are defined elsewhere, they are written - * over. This allows to include custom code from keymaps in the generic code - * in this file. - */ -__attribute__ ((weak)) void matrix_init_keymap(void) { } -__attribute__ ((weak)) void matrix_scan_keymap(void) { } -__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__ ((weak)) uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} -__attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) { } - -/* ----------------------- *\ - * -----RGB Functions----- * -\* ----------------------- */ -#ifdef RGBLIGHT_ENABLE -// Storage variables -extern rgblight_config_t rgblight_config; -bool base_sta; // Keeps track if in saveable state -bool base_tog; // Whether base state is active or not -int base_hue; // Hue value of base state -int base_sat; // Saturation value of base state -int base_val; // Brightness value of base state -uint8_t base_mod; // Animation mode of the base state - -// Save the current state of the rgb mode -void rgblight_saveBase(void) { - base_hue = rgblight_config.hue; - base_sat = rgblight_config.sat; - base_val = rgblight_config.val; - base_mod = rgblight_config.mode; - base_tog = rgblight_config.enable; - base_sta = false; // If saving, that means base layer is being left -} - -// Load the base state back -void rgblight_loadBase(void) { - // Don't do anything if not enabled - if ( !base_sta ) { - if ( base_tog ) { - rgblight_enable(); - rgblight_mode( base_mod ); - rgblight_sethsv( base_hue, base_sat, base_val ); - } else { - rgblight_disable(); - } - } - // Mark that base is loaded, and to be saved before leaving - base_sta = true; -} - -// Set to plain HSV color -void rgblight_colorStatic( int hu, int sa, int va ) { - // First, it must be enabled or color change is not written - rgblight_enable(); - rgblight_mode(1); - rgblight_sethsv(hu,sa,va); -} -/* HSV values - * white ( 0, 0, 255) - * red ( 0, 255, 255) - * coral ( 16, 176, 255) - * orange ( 39, 255, 255) - * goldenrod ( 43, 218, 218) - * gold ( 51, 255, 255) - * yellow ( 60, 255, 255) - * chartreuse ( 90, 255, 255) - * green (120, 255, 255) - * springgreen (150, 255, 255) - * turquoise (174, 90, 112) - * teal (180, 255, 128) - * cyan (180, 255, 255) - * azure (186, 102, 255) - * blue (240, 255, 255) - * purple (270, 255, 255) - * magenta (300, 255, 255) - * pink (330, 128, 255) - */ - -// Set RGBLIGHT state depending on layer -void rgblight_change( uint8_t this_layer ) { - // Save state, if saving is requested - if ( base_sta ) { - rgblight_saveBase(); - } - // Change RGB light - switch ( this_layer ) { - case _DV: - // Load base layer - rgblight_loadBase(); - break; - case _AL: - // Do yellow for alternate - rgblight_colorStatic( 60,255,255); - break; - case _GA: - // Do purple for game - rgblight_colorStatic(285,255,255); - break; - case _NU: - // Do azure for number - rgblight_colorStatic(186,200,255); - break; - case _SE: - // Do red for settings - rgblight_colorStatic( 16,255,255); - break; - case _MO: - // Do green for mouse - rgblight_colorStatic(120,255,255); - break; - case _MU: - // Do orange for music - rgblight_colorStatic( 39,255,255); - break; - default: - // Something went wrong - rgblight_colorStatic( 0,255,255); - break; - } -} - -#endif - -/*---------------------*\ -|*-----MATRIX INIT-----*| -\*---------------------*/ -void matrix_init_user (void) { - - // Keymap specific things, do it first thing to allow for delays etc - matrix_init_keymap(); - - // Correct unicode -#ifdef UNICODE_ENABLE - set_unicode_input_mode(UC_LNX); -#endif - - // Make beginning layer DVORAK - set_single_persistent_default_layer(_DV); - -//--RGB light initialize base layer -#ifdef RGBLIGHT_ENABLE - // Base hue is white, and RGB disabled - base_hue = 100; - base_sat = 0; - base_val = 255; - base_mod = 2; - base_tog = false; - rgblight_enable(); - rgblight_mode(base_mod); - rgblight_sethsv(base_hue,base_sat,base_val); - rgblight_disable(); - rgblight_loadBase(); -#endif - -} - -/*---------------------*\ -|*-----MATRIX SCAN-----*| -\*---------------------*/ -void matrix_scan_user (void) { - // Keymap specific, do it first - matrix_scan_keymap(); -} - -/*------------------*\ -|*-----KEYCODES-----*| -\*------------------*/ -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - // Shift check - bool is_capital = ( keyboard_report->mods & (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)) ); - static bool lock_flag = false; - uint8_t layer = biton32 (layer_state); - - switch (keycode) { - // Secrets implementation -#if (__has_include("secrets.h")) - case SECRET1: - if( !record->event.pressed ) { - send_string_P( secret[ keycode - SECRET1 ] ); - } - return false; - break; - case SECRET2: - if( !record->event.pressed ) { - send_string_P( secret[ keycode - SECRET2 ] ); - } - return false; - break; - case SECRET3: - if( !record->event.pressed ) { - send_string_P( secret[ keycode - SECRET3 ] ); - } - return false; - break; -#endif - - // If these keys are pressed, load base layer config, and mark saving -#ifdef RGBLIGHT_ENABLE - case RGB_TOG: - case RGB_MOD: - case RGB_VAI: - case RGB_VAD: - case RGB_SAI: - case RGB_SAD: - case RGB_HUI: - case RGB_HUD: - if ( !base_sta ) { - rgblight_loadBase(); - } - return true; - break; -#endif - - // Lock functionality: These layers are locked if the LOCKED buttons are - // pressed. Otherwise, they are momentary toggles - case K_LOCK: - if (record->event.pressed) { - lock_flag = !lock_flag; - } - return false; - break; - case K_MOUSE: - if (record->event.pressed) { - layer_on(_MO); - lock_flag = false; - } else { - if ( lock_flag ) { - lock_flag = false; - } else { - layer_off(_MO); - } - } - return false; - break; - case K_NUMBR: - if (record->event.pressed) { - layer_on(_NU); - lock_flag = false; - } else { - if ( lock_flag ) { - lock_flag = false; - } else { - layer_off(_NU); - } - } - return false; - break; - - // Layer switches with sound - case K_GAMES: - if (record->event.pressed) { - // On press, turn off layer if active - if ( layer == _GA ) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_return); -#endif - layer_off(_GA); - } - } else { - // After click, turn on layer if accessed from setting - if ( layer == _SE ) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_game); -#endif - layer_on(_GA); - layer_off(_SE); - } - } - return false; - break; - case MU_TOG: - if (record->event.pressed) { - // On press, turn off layer if active - if ( layer == _SE ) { - layer_off(_SE); - layer_on(_MU); - } else { - layer_off(_MU); - } - } - return true; - break; - -//------UNICODE - // Unicode switches with sound -#ifdef UNICODE_ENABLE - case UNI_LI: - if (record->event.pressed) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_linux); -#endif - set_unicode_input_mode(UC_LNX); - } - return false; - break; - case UNI_WN: - if (record->event.pressed) { -#ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_windows); -#endif - set_unicode_input_mode(UC_WIN); - } - return false; - break; - - // Turkish letters, with capital functionality - case TUR_A: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x00c2); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x00e2); - unicode_input_finish(); - } - } - return false; - break; - case TUR_O: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x00d6); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x00f6); - unicode_input_finish(); - } - } - return false; - break; - case TUR_U: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x00dc); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x00fc); - unicode_input_finish(); - } - } - return false; - break; - case TUR_I: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x0130); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x0131); - unicode_input_finish(); - } - } - return false; - break; - case TUR_G: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x011e); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x011f); - unicode_input_finish(); - } - } - return false; - break; - case TUR_C: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x00c7); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x00e7); - unicode_input_finish(); - } - } - return false; - break; - case TUR_S: - if (record->event.pressed) { - if ( is_capital ) { - unicode_input_start(); - register_hex(0x015e); - unicode_input_finish(); - } else { - unicode_input_start(); - register_hex(0x015f); - unicode_input_finish(); - } - } - return false; - break; -#endif - -//-------Diagonal mouse movements -#ifdef MOUSEKEY_ENABLE - case MO_NE: - if( record->event.pressed ) { - mousekey_on(MO_N); - mousekey_on(MO_E); - mousekey_send(); - } else { - mousekey_off(MO_N); - mousekey_off(MO_E); - mousekey_send(); - } - return false; - break; - case MO_NW: - if( record->event.pressed ) { - mousekey_on(MO_N); - mousekey_on(MO_W); - mousekey_send(); - } else { - mousekey_off(MO_N); - mousekey_off(MO_W); - mousekey_send(); - } - return false; - break; - case MO_SE: - if( record->event.pressed ) { - mousekey_on(MO_S); - mousekey_on(MO_E); - mousekey_send(); - } else { - mousekey_off(MO_S); - mousekey_off(MO_E); - mousekey_send(); - } - return false; - break; - case MO_SW: - if( record->event.pressed ) { - mousekey_on(MO_S); - mousekey_on(MO_W); - mousekey_send(); - } else { - mousekey_off(MO_S); - mousekey_off(MO_W); - mousekey_send(); - } - return false; - break; - case MO_S_NE: - if( record->event.pressed ) { - mousekey_on(MO_S_N); - mousekey_on(MO_S_E); - mousekey_send(); - } else { - mousekey_off(MO_S_N); - mousekey_off(MO_S_E); - mousekey_send(); - } - return false; - break; - case MO_S_NW: - if( record->event.pressed ) { - mousekey_on(MO_S_N); - mousekey_on(MO_S_W); - mousekey_send(); - } else { - mousekey_off(MO_S_N); - mousekey_off(MO_S_W); - mousekey_send(); - } - return false; - break; - case MO_S_SE: - if( record->event.pressed ) { - mousekey_on(MO_S_S); - mousekey_on(MO_S_E); - mousekey_send(); - } else { - mousekey_off(MO_S_S); - mousekey_off(MO_S_E); - mousekey_send(); - } - return false; - break; - case MO_S_SW: - if( record->event.pressed ) { - mousekey_on(MO_S_S); - mousekey_on(MO_S_W); - mousekey_send(); - } else { - mousekey_off(MO_S_S); - mousekey_off(MO_S_W); - mousekey_send(); - } - return false; - break; -#endif - -//------DOUBLE PRESS, with added left navigation - case DBL_SPC: - if( record->event.pressed ) { - SEND_STRING(" "SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_ANG: - if( record->event.pressed ) { - SEND_STRING("<>"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_PAR: - if( record->event.pressed ) { - SEND_STRING("()"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_SQR: - if( record->event.pressed ) { - SEND_STRING("[]"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_BRC: - if( record->event.pressed ) { - SEND_STRING("{}"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_QUO: - if( record->event.pressed ) { - SEND_STRING("\'\'"SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_DQT: - if( record->event.pressed ) { - SEND_STRING("\"\""SS_TAP(X_LEFT)); - } - return false; - break; - case DBL_GRV: - if( record->event.pressed ) { - SEND_STRING("``"SS_TAP(X_LEFT)); - } - return false; - break; -// END OF KEYCODES - } - return process_record_keymap(keycode, record); -} - -/*----------------------*\ -|*-----LAYER CHANGE-----*| -\*----------------------*/ - -layer_state_t layer_state_set_user(layer_state_t state) { - - state = layer_state_set_keymap (state); -#ifdef RGBLIGHT_ENABLE - // Change RGB lighting depending on the last layer activated - rgblight_change( biton32(state) ); -#endif - return state; -} diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h deleted file mode 100644 index 3a405f2a47c..00000000000 --- a/users/bbaserdem/bbaserdem.h +++ /dev/null @@ -1,268 +0,0 @@ -#ifndef USERSPACE -#define USERSPACE - -#include "quantum.h" - -#define XXX KC_NO - -// Layers -#define _DV 0 // Base layer -#define _AL 1 // Alt char overlay -#define _GA 2 // Game layer -#define _NU 3 // Numbers layer -#define _SE 4 // Settings layer -#define _MO 5 // Mouse emulation -#define _MU 6 // Music mode - -// Define short macros -#define UNDO LCTL(KC_Z) -#define REDO LCTL(KC_Y) -#define COPY LCTL(KC_C) -#define CUT LCTL(KC_X) -#define PASTE LCTL(KC_V) - -// Rename mouse keys with 7 letters -#ifdef MOUSEKEY_ENABLE -#define MO_S_N KC_MS_WH_UP -#define MO_S_S KC_MS_WH_DOWN -#define MO_S_E KC_MS_WH_RIGHT -#define MO_S_W KC_MS_WH_LEFT -#define MO_N KC_MS_UP -#define MO_S KC_MS_DOWN -#define MO_E KC_MS_RIGHT -#define MO_W KC_MS_LEFT -#define MO_CL_L KC_MS_BTN1 -#define MO_CL_R KC_MS_BTN2 -#define MO_CL_M KC_MS_BTN3 -#define MO_CL_4 KC_MS_BTN4 -#define MO_CL_5 KC_MS_BTN5 -#define MO_AC_0 KC_MS_ACCEL0 -#define MO_AC_1 KC_MS_ACCEL1 -#define MO_AC_2 KC_MS_ACCEL2 -#else -#define MO_S_N KC_NO -#define MO_S_S KC_NO -#define MO_S_E KC_NO -#define MO_S_W KC_NO -#define MO_N KC_NO -#define MO_S KC_NO -#define MO_E KC_NO -#define MO_W KC_NO -#define MO_CL_L KC_NO -#define MO_CL_R KC_NO -#define MO_CL_M KC_NO -#define MO_CL_1 KC_NO -#define MO_CL_2 KC_NO -#define MO_AC_0 KC_NO -#define MO_AC_1 KC_NO -#define MO_AC_2 KC_NO -#endif - -// Rename music keys with <8 letters -#ifdef AUDIO_ENABLE -#define MU_REC KC_LCTL -#define MU_STOP KC_LALT -#define MU_PLAY KC_LGUI -#define MU_PLAY KC_LGUI -#define MU_FAST KC_UP -#define MU_SLOW KC_DOWN -#define MU_MASK KC_A -#else -#define MU_REC KC_NO -#define MU_STOP KC_NO -#define MU_PLAY KC_NO -#define MU_PLAY KC_NO -#define MU_FAST KC_NO -#define MU_SLOW KC_NO -#define MU_MASK KC_NO -#endif - -// Define non-capitalized UTF shortcuts here -#ifdef UNICODE_ENABLE -#define PHY_HBR UC(0x0127) -#define PHY_DEG UC(0x00b0) -#define CUR_LIR UC(0x20ba) -#define CUR_BIT UC(0x20bf) -#define CUR_EUR UC(0x20ac) -#define CUR_BPN UC(0x00a3) -#define CUR_YEN UC(0x00a5) -#else -#define PHY_HBR KC_NO -#define PHY_DEG KC_NO -#define CUR_LIR KC_NO -#define CUR_BIT KC_NO -#define CUR_EUR KC_NO -#define CUR_BPN KC_NO -#define CUR_YEN KC_NO -#endif - -// Custom keycodes -enum userspace_custom_keycodes { - // Turkish letters, with shifting - TUR_A = SAFE_RANGE, - TUR_C, - TUR_G, - TUR_I, - TUR_O, - TUR_S, - TUR_U, - // Unicode mode switch - UNI_LI, - UNI_WN, - // Double keys - DBL_SPC, - DBL_ANG, - DBL_PAR, - DBL_SQR, - DBL_BRC, - DBL_QUO, - DBL_DQT, - DBL_GRV, - // Diagonal mouse movements - MO_NE, - MO_NW, - MO_SE, - MO_SW, - MO_S_NE, - MO_S_NW, - MO_S_SE, - MO_S_SW, - // Layer switches and lock functionality - K_MOUSE, - K_NUMBR, - K_LOCK, - K_GAMES, - // Secret macros - SECRET1, - SECRET2, - SECRET3 -}; - -// Do tap dancable semicolon key if available -#ifdef TAP_DANCE_ENABLE -enum { - SCL = 0 -}; -#define MY_SCL TD(SCL) -#else -#define MY_SCL KC_SCLN -#endif - -// Shared keymaps -#define LAYOUT_planck_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) -#define LAYOUT_letssplit_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -/* Dvorak - * ,------------------------------------------------------------------------. - * | Esc | ' " | , | . | P | Y || F | G | C | R | L | Bkp | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | Tab | A | O | E | U | I || D | H | T | N | S | / ? | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | SYM | ; : | Q | J | K | X || B | M | W | V | Z | SET | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | TUR | OS | Ctrl| Alt | Shf | Spc || Ent | Lft | Dwn | Up | Rght| MSE | - * `------------------------------------------------------------------------' */ -#define DVORAK \ - KC_ESC, KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - K_NUMBR,MY_SCL, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_SE), \ - MO(_AL),KC_LGUI,KC_LCTL,KC_LALT,KC_LSFT,KC_SPC, KC_ENT, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,K_MOUSE - -/* Alternative character overlay - * ,------------------------------------------------------------------------. - * | | ' ' | Undo| Redo|Pound| Yen || | G | C | |TLira| Del | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | A | O | Euro| U | I ||Degre|Plank| | | S | Ins | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | " " | Cut | Copy|Paste| || BTC | < > | ( ) | [ ] | { } | PgUp| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | | | | | || | Home|PgDwn| PgUp| End | | - * `------------------------------------------------------------------------' */ -#define ALTCHAR \ - _______,DBL_QUO,UNDO, REDO, CUR_BPN,CUR_YEN,_______,TUR_G, TUR_C, _______,CUR_LIR,KC_DEL , \ - _______,TUR_A, TUR_O, CUR_EUR,TUR_U, TUR_I, PHY_DEG,PHY_HBR,_______,_______,TUR_S, KC_INS , \ - _______,DBL_DQT,CUT, COPY, PASTE, DBL_GRV,CUR_BIT,DBL_ANG,DBL_PAR,DBL_SQR,DBL_BRC,_______, \ - _______,_______,_______,_______,_______,DBL_SPC,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END, _______ - -/* Game layer - * ,------------------------------------------------------------------------. - * | OFF | Q | W | E | R | T || Esc | 7 | 8 | 9 |NumLk|Bkspc| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | Tab | A | S | D | F | G || F1 | 4 | 5 | 6 | \ | Ent | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | Z | X | C | V | B || F2 | 1 | 2 | 3 | ^ | | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | / | ` | | | | Spc || Spc | Ent | 0 | < | v | > | - * `------------------------------------------------------------------------' */ -#define GAME \ - K_GAMES,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_P7, KC_P8, KC_P9, KC_NLCK,KC_BSPC, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F1, KC_P4, KC_P5, KC_P6, KC_BSLS,KC_ENT , \ - _______,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_P1, KC_P2, KC_P3, KC_UP, _______, \ - KC_SLSH,KC_GRV, _______,_______,_______,KC_SPC, KC_SPC, KC_ENT, KC_P0, KC_LEFT,KC_DOWN,KC_RGHT - -/* Symbols layer - * ,------------------------------------------------------------------------. - * | OFF | ` | ~ | [ | ] | { || } | - | _ | = | + | | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | \ | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | ! | @ | # | $ | % || ^ | & | * | ( | ) | LCK | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | | | | | | || | | | | | | - * `------------------------------------------------------------------------' */ -#define NUMBERS \ - K_NUMBR,KC_GRV, KC_TILD,KC_LBRC,KC_RBRC,KC_LCBR,KC_RCBR,KC_MINS,KC_UNDS,KC_EQL, KC_PLUS,_______, \ - _______,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ - _______,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,K_LOCK , \ - KC_PIPE,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ - -/* Settings layer - * ,------------------------------------------------------------------------. - * |BLLed| F1 | F2 | F3 | F4 | Lin || Win | Wake| |Hue -|Hue +|Reset| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | F5 | F6 | F7 | F8 | || | |RGBto|Sat -|Sat +| | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | Game| F9 | F10 | F11 | F12 |Vol 0||PrtSc| |RGBan|Bri -|Bri +| | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * |Musir| | | | |Vol -||Vol +| Prev| Stop|TogMu| Next| | - * `------------------------------------------------------------------------' */ -#define SETTINGS \ - BL_STEP,KC_F1, KC_F2, KC_F3, KC_F4, UNI_LI, UNI_WN, KC_WAKE,_______,RGB_HUD,RGB_HUI,RESET , \ - _______,KC_F5, KC_F6, KC_F7, KC_F8, _______,_______,_______,RGB_TOG,RGB_SAD,RGB_SAI,_______, \ - K_GAMES,KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE,KC_PSCR,_______,RGB_MOD,RGB_VAD,RGB_VAI,_______, \ - MU_TOG, _______,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MPRV,KC_MSTP,KC_MPLY,KC_MNXT,_______ - -/* Mouse layer - * ,------------------------------------------------------------------------. - * |Ulock| \ | ^ | / |.....|.....||.....|.....| |\|.| |^| | |/|.| | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | < | Mid | > |Btn 4|.....||.....|Btn 5| <-- | Mid | --> | | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | / | v | \ |.....|.....||.....|.....| |/| | |v| | |\| | LCK | - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | | | | | | Left||Right| | |Accl0|Accl1|Accl2| - * `------------------------------------------------------------------------' */ -#define MOUSE \ - K_MOUSE,MO_NW, MO_N, MO_NE, XXX, XXX ,XXX, XXX, MO_S_NW,MO_S_N, MO_S_NE,_______, \ - _______,MO_W, MO_CL_M,MO_E, MO_CL_4,XXX ,XXX, MO_CL_5,MO_S_W, MO_CL_M,MO_S_E, _______, \ - _______,MO_SW, MO_S, MO_SE, XXX, XXX ,XXX, XXX, MO_S_SW,MO_S_S, MO_S_SE,K_LOCK , \ - _______,_______,_______,_______,_______,MO_CL_L,MO_CL_R,_______,MO_AC_0,MO_AC_1,MO_AC_2,_______ - -/* Music layer - * ,------------------------------------------------------------------------. - * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| - * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| - * | togg| rec | stop| play| slow| fast||modes|.....|.....|.....|.....|.....| - * `------------------------------------------------------------------------' - */ -#define MUSIC \ - MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ - MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ - MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ - MU_TOG, MU_REC, MU_STOP,MU_PLAY,MU_SLOW,MU_FAST,MU_MOD, MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK - -#endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h deleted file mode 100644 index 3dde5772cc0..00000000000 --- a/users/bbaserdem/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H - -#ifdef TAP_DANCE_ENABLE - #define TAPPING_TERM 300 - #define TAPPING_TOGGLE 1 -#endif - -#endif // !USERSPACE_CONFIG_H diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk deleted file mode 100644 index 9c7e78e2f8a..00000000000 --- a/users/bbaserdem/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -SRC += bbaserdem.c -EXTRAFLAGS += -flto # Used to make code smaller - -# ENABLE -UNICODE_ENABLE = yes # Used for unicode character emulation -EXTRAKEY_ENABLE = yes # OS signals like volume control - -# DISABLE -ifndef BLUETOOTH_ENABLE - BLUETOOTH_ENABLE = no # No bluetooth -endif -COMMAND_ENABLE = no # Some bootmagic thing i dont use -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite -CONSOLE_ENABLE = no # Allows console output with a command -SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. -NKRO_ENABLE = no # Default is 6KRO which is plenty -MIDI_ENABLE = no # Untested feature -KEY_LOCK_ENABLE = no # Allows locking any key. Not used - -# Disabling this makes it compile, i dont know why -# VARIABLE_TRACE = no # Allows debugging variables From b6de1876be652df76f392cc4cf9c2c6ac5ecad30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 17:07:13 -0400 Subject: [PATCH 42/94] Added code for the bigseries pcb. --- .../1key/keymaps/bbaserdem/README.md | 18 ++++++++++++ .../bigseries/1key/keymaps/bbaserdem/config.h | 19 +++++++++++++ .../bigseries/1key/keymaps/bbaserdem/keymap.c | 28 +++++++++++++++++++ .../bigseries/1key/keymaps/bbaserdem/rules.mk | 6 ++++ 4 files changed, 71 insertions(+) create mode 100644 keyboards/bigseries/1key/keymaps/bbaserdem/README.md create mode 100644 keyboards/bigseries/1key/keymaps/bbaserdem/config.h create mode 100755 keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c create mode 100755 keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md new file mode 100644 index 00000000000..f68edef54c8 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md @@ -0,0 +1,18 @@ +This file contains my [1x1](../../../default/ortho_1x1) board layouts +Check out the [user readme](../../../../users/sbp/README.md) for more info. + +# Big Series PCB + +Big switch that does tap dance, and works as a fancy light only. +The PCB was sourced from Woodkeys (Cole Markham); +Currently AWOL and scammed people out of their money (me personally for 150$) +Cannot recommend anyone try to obtain one of these PCBs. + +My PCB to USB connector broke; and could not repair it yet. +Managed to obtain a custom glow in the dark keycap for this. + +## Status + +* [x] Layout adapted +* [ ] Have not tested build yet. +* [ ] Have not confirmed on board diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/config.h b/keyboards/bigseries/1key/keymaps/bbaserdem/config.h new file mode 100644 index 00000000000..ba45696ad24 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/config.h @@ -0,0 +1,19 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif +#define TAPPING_TERM 500 diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c b/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c new file mode 100755 index 00000000000..2bb2d06e93c --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c @@ -0,0 +1,28 @@ +/* +Copyright 2019 Batuhan Baserdem + +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT(BB_BIGS) +}; + +void matrix_init_keymap(void) { + rgblight_enable(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD); + rgblight_sethsv_noeeprom(0,255,255); +} diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk b/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk new file mode 100755 index 00000000000..89651e991c8 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk @@ -0,0 +1,6 @@ +# Differences from userspace +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = yes +RGB_MATRIX_ENABLE = no +AUDIO_ENABLE = no +BLUETOOTH_ENABLE = no From d71960e03064e9cd8d6122ae8f83bebc9d8a90be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:04:19 -0400 Subject: [PATCH 43/94] Added Kyria code for bbaserdem. --- .../splitkb/kyria/keymaps/bbaserdem/README.md | 32 ++++++ .../splitkb/kyria/keymaps/bbaserdem/config.h | 53 ++++++++++ .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 98 +++++++++++++++++++ .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 19 ++++ 4 files changed, 202 insertions(+) create mode 100644 keyboards/splitkb/kyria/keymaps/bbaserdem/README.md create mode 100644 keyboards/splitkb/kyria/keymaps/bbaserdem/config.h create mode 100644 keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c create mode 100644 keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md b/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md new file mode 100644 index 00000000000..c05221c6a7a --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md @@ -0,0 +1,32 @@ +This file contains my Kyria board layout. +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Kyria + +I use a rev 1.3 PCB as a daily driver. + +## Hardware + +* Using a modified High-profile case; with metal switch plate. +* Currently using a Pro-Micro and an Elite-C as microcontrollers. +* Using Gateron Silent Black Ink with Progressive springs (100g), lubed. +* Have mill-max sockets for hotswap feature. +* All microcontrollers and OLED's are socketed for easy removal. + +## Features + +* Use two thumb keys in the 2u layout. +* Have rotary encoders in the outermost keys of the thumb cluster. +* Have underglow leds soldered. + +## Issues + +* Stabilizers squiek, and need lubing. +* The double tap buttons (home row; left leader the most) don't contact well. + +## Todo + +* Switch to Proton C conversion with a game plan. +* Lube stabilizers. +* Get tenting puck. +* (Not depending on me) migrate this code to layouts. diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h new file mode 100644 index 00000000000..85d33f61cab --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -0,0 +1,53 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +// Kyria specific +#ifdef KEYBOARD_kyria_rev1 + // Split definition; use the following to flash; + // pro-micro: avrdude-split-left/right + // elite-c: dfu-split-left/right + #define ENCODER_DIRECTION_FLIP + #define EE_HANDS + + #ifdef OLED_DRIVER_ENABLE + #define OLED_DISPLAY_128X64 + #endif + + #ifdef RGBLIGHT_ENABLE + #ifdef RGBLIGHT_LEFT_BEG + #undef RGBLIGHT_LEFT_BEG + #endif + #define RGBLIGHT_LEFT_BEG 0 + + #ifdef RGBLIGHT_LEFT_NUM + #undef RGBLIGHT_LEFT_NUM + #endif + #define RGBLIGHT_LEFT_NUM 10 + + #ifdef RGBLIGHT_RIGHT_BEG + #undef RGBLIGHT_RIGHT_BEG + #endif + #define RGBLIGHT_RIGHT_BEG 10 + + #ifdef RGBLIGHT_RIGHT_NUM + #undef RGBLIGHT_RIGHT_NUM + #endif + #define RGBLIGHT_RIGHT_NUM 10 + #endif + + // If you are using an Elite C rev3 on the slave side, uncomment the lines below: + // #define SPLIT_USB_DETECT + // #define NO_USB_STARTUP_CHECK +#endif diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c new file mode 100644 index 00000000000..8d1358bae8f --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -0,0 +1,98 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" +/* F layout + * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ + * │ W │ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ + * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ + * │ X │ A │ S │ D │ F │ G │        │ T │ K │ M │ L │ Y │ Ş │ + * ├───┼───┼───┼───┼───┼───┼───┬───┐ ┌───┬───┼───┼───┼───┼───┼───┼───┤ + * │* +│ J │ Ö │ V │ C │ Ç │   │   │ │   │   │ Z │ S │ B │. :│, ;│< >│ + * └───┴───┴───┼───┼───┼───┤Esc│Shf│ │Shf│Del├───┼───┼───┼───┴───┴───┘ + *             │En1│Tab│Ent│ │ │ │ │ │Spc│Bsp│En2│ + *             └───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┘ + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_wrapper( + _BL1_1_,_BL1_5_, _BR1_5_,_BR1_1_, + _BL2_1_,_BL2_5_, _BR2_5_,_BR2_1_, + _BL3_1_,_BL3_5_,xxx2xxx,xxx2xxx,_BR3_5_,_BR3_1_, + BB_ENC0, _BL4_3_,KC_LSFT,KC_RSFT,_BR4_3_,BB_ENC1 + ), + [_CHAR] = LAYOUT_wrapper( + XXXXXXX,_CL1_5_, _CR1_5_,XXXXXXX, + XXXXXXX,_CL2_5_, _CR2_5_,XXXXXXX, + XXXXXXX,_CL3_5_,xxx2xxx,xxx2xxx,_CR3_5_,XXXXXXX, + _______,_CL4_3_,_______,_______,_CR4_3_,_______ + ), + [_GAME] = LAYOUT_wrapper( + _GA1_1_,_GA1_5_, ___5___,___1___, + _GA2_1_,_GA2_5_, ___5___,___1___, + _GA3_1_,_GA3_5_,xxx2xxx,xxx2xxx,___5___,___1___, + _______,_GA4_3_,_______,_______,___3___,_______ + ), + [_MEDI] = LAYOUT_wrapper( + ___1___,___5___, _ME1_5_,___1___, + ___1___,___5___, _ME2_5_,___1___, + ___1___,___5___,xxx2xxx,xxx2xxx,_ME3_5_,___1___, + ___1___,___3___,_______,_______,_ME4_3_,___1___ + ), + [_NAVI] = LAYOUT_wrapper( + ___1___,___5___, _NA1_5_,___1___, + ___1___,___5___, _NA2_5_,___1___, + ___1___,___5___,xxx2xxx,xxx2xxx,_NA3_5_,___1___, + ___1___,___3___,_______,_______,_NA4_3_,___1___ + ), + [_SYMB] = LAYOUT_wrapper( + ___1___,___5___, _SY1_5_,___1___, + ___1___,___5___, _SY2_5_,___1___, + ___1___,___5___,xxx2xxx,xxx2xxx,_SY3_5_,___1___, + ___1___,___3___,_______,_______,_SY4_3_,___1___ + ), + [_NUMB] = LAYOUT_wrapper( + ___1___,_NU1_5_, ___5___,___1___, + ___1___,_NU2_5_, ___5___,___1___, + ___1___,_NU3_5_,xxx2xxx,xxx2xxx,___5___,___1___, + ___1___,_NU4_3_,_______,_______,___3___,___1___ + ), + [_FUNC] = LAYOUT_wrapper( + ___1___,_FU1_5_, ___5___,___1___, + ___1___,_FU2_5_, ___5___,___1___, + ___1___,_FU3_5_,xxx2xxx,xxx2xxx,___5___,___1___, + ___1___,_FU4_3_,_______,_______,___3___,___1___ + ), + [_MOUS] = LAYOUT_wrapper( + ___1___,_MO1_5_, ___5___,___1___, + ___1___,_MO2_5_, ___5___,___1___, + ___1___,_MO3_5_,xxx2xxx,xxx2xxx,___5___,___1___, + ___1___,_MO4_3_,_______,_______,___3___,___1___ + ), + [_MUSI] = LAYOUT_wrapper( + _MU_12_,_MU_12_, + _MU_06_,xxx2xxx,xxx2xxx,_MU_06_, + MU_TOG,_MUL_3_,_MU_02_,_MUR_3_,___1___ + ) +}; + +// Kyria specific code +#ifdef KEYBOARD_kyria_rev1 +// Rotate the display on kyria +#ifdef OLED_DRIVER_ENABLE +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} +#endif //OLED_DRIVER_ENABLE +#endif //KEYBOARD_kyria_rev1 diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk new file mode 100644 index 00000000000..f54821f1834 --- /dev/null +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -0,0 +1,19 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Kyria hardware +ifneq (,$(findstring kyria/rev1,$(KEYBOARD))) + OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays + ENCODER_ENABLE = yes # Enables the use of one or more encoders + RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much + RGB_MATRIX_ENABLE = no +endif From 2d3411ddc0b6afea277079369d04516d3cbe0ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:08:51 -0400 Subject: [PATCH 44/94] Added 3x10 layout for bbaserdem --- .../community/ortho_3x10/bbaserdem/README.md | 19 ++++ .../community/ortho_3x10/bbaserdem/config.h | 21 ++++ .../community/ortho_3x10/bbaserdem/keymap.c | 99 +++++++++++++++++++ .../community/ortho_3x10/bbaserdem/rules.mk | 22 +++++ 4 files changed, 161 insertions(+) create mode 100644 layouts/community/ortho_3x10/bbaserdem/README.md create mode 100644 layouts/community/ortho_3x10/bbaserdem/config.h create mode 100644 layouts/community/ortho_3x10/bbaserdem/keymap.c create mode 100755 layouts/community/ortho_3x10/bbaserdem/rules.mk diff --git a/layouts/community/ortho_3x10/bbaserdem/README.md b/layouts/community/ortho_3x10/bbaserdem/README.md new file mode 100644 index 00000000000..05749e81927 --- /dev/null +++ b/layouts/community/ortho_3x10/bbaserdem/README.md @@ -0,0 +1,19 @@ +This file contains my [3x10 ortho](../../../default/ortho_3x10) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Gherkin + +I use [Gherkin](../../../../keyboards/40percentclub/gherkin/readme.md). + +It is used as a game pad, and key layout is inspired by spare keys I had lying around. +The firmware is very simple, and only includes one layer keymap, and RGB effects. + +## Status + +* [x] Layout adapted +* [x] Tested build +* [x] Confirmed on board + +## Build + +Build command: `CFLAGS="-Wno-error=deprecated" ` diff --git a/layouts/community/ortho_3x10/bbaserdem/config.h b/layouts/community/ortho_3x10/bbaserdem/config.h new file mode 100644 index 00000000000..d781d344785 --- /dev/null +++ b/layouts/community/ortho_3x10/bbaserdem/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +// Gherkin specific +#ifdef KEYBOARD_40percentclub_gherkin + #define MUSIC_MAP + #define RGB_DI_PIN F6 + #define DRIVER_LED_TOTAL 10 +#endif diff --git a/layouts/community/ortho_3x10/bbaserdem/keymap.c b/layouts/community/ortho_3x10/bbaserdem/keymap.c new file mode 100644 index 00000000000..c094f526a4f --- /dev/null +++ b/layouts/community/ortho_3x10/bbaserdem/keymap.c @@ -0,0 +1,99 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +#ifdef KEYBOARD_40percentclub_gherkin + // Flip it + #undef LAYOUT_ortho_3x10 + #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 \ + ) { \ + { K45, K44, K43, K42, K41, K40 }, \ + { K35, K34, K33, K32, K31, K30 }, \ + { K25, K24, K23, K22, K21, K20 }, \ + { K15, K14, K13, K12, K11, K10 }, \ + { K05, K04, K03, K02, K01, K00 } \ + } +#endif + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Game pad + * ,-----------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | F1 | F2 | F3 | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |AdjsL| Q | W | E | R | Ent | Tab | Ctr | |^| | Alt | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Music| A | S | D | F | Spc |Shift| <-- | |v| | --> | + * `-----------------------------------------------------------' + */ + [_BASE] = LAYOUT_ortho_3x10( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F1, KC_F2, KC_F3, + MO(_MEDI), KC_Q, KC_W, KC_E, KC_R, KC_ENT, KC_TAB, KC_LCTL,KC_UP, KC_LALT, + MU_TOG, KC_A, KC_S, KC_D, KC_F, KC_SPC, KC_LSFT,KC_LEFT,KC_DOWN,KC_RGHT + ), +/* Adjust + * ,-----------------------------------------------------------. + * | Esc |RGBTg|HueUp|HueDn|SatUp|SatDn|ValUp|ValDn|ModNx|ModPr| + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | |BltTg|Breth|BriUp|BriDn| | |Veloc|SpdUp|SpdDn| + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * |Music| | | | | | | |EEprm|Reset| + * `-----------------------------------------------------------' + */ + [_MEDI] = LAYOUT_ortho_3x10( + CK_TOGG,RGB_TOG,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,RGB_MOD,RGB_RMOD, + _______,BL_TOGG,BL_BRTG,BL_INC, BL_DEC, XXXXXXX,XXXXXXX,VLK_TOG,RGB_SPI,RGB_SPD, + AU_TOG, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,EEP_RST,RESET + ), + [_MUSI] = LAYOUT_ortho_3x10_wrapper( + MU_FAST,_MU_08_,MU_REC, + MU_SLOW,_MU_08_,MU_STOP, + MU_TOG, _MU_08_,MU_PLAY + ), +}; + +// Music map, guitar like +#ifdef AUDIO_ENABLE +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_3x10( + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 +); +#endif + +// RGB matrix code +#ifdef RGB_MATRIX_ENABLE +// Gherkin +#if defined(KEYBOARD_40percentclub_gherkin) +led_config_t g_led_config = { + { // Key Matrix to LED Index + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED}, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED} +}, { // LED Index to Physical Position + {224, 0}, {168, 0}, {112, 0}, { 56, 0}, { 0, 0}, + { 0, 64}, { 56, 64}, {112, 64}, {168, 64}, {224, 64}, +}, { // LED Index to Flag + 2,2,2,2,2,2,2,2,2,2 +}}; +// Disable +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { } +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { } +#endif +#endif diff --git a/layouts/community/ortho_3x10/bbaserdem/rules.mk b/layouts/community/ortho_3x10/bbaserdem/rules.mk new file mode 100755 index 00000000000..0c668c221bf --- /dev/null +++ b/layouts/community/ortho_3x10/bbaserdem/rules.mk @@ -0,0 +1,22 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# This small layout is a macro-pad; does not need userspace + +# Gherkin has both RGB strip and LED lights +ifneq (,$(findstring 40percentclub/gherkin,$(KEYBOARD))) + CONVERT_TO_PROTON_C = yes + RGB_MATRIX_ENABLE = WS2812 + AUDIO_ENABLE = yes + BACKLIGHT_ENABLE = yes + VELOCIKEY_ENABLE = yes +endif From 90237569309712a861d23c37b9f73f76802ccca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:15:57 -0400 Subject: [PATCH 45/94] Added 4x12 layout for bbaserdem. --- .../community/ortho_4x12/bbaserdem/README.md | 37 ++++ .../community/ortho_4x12/bbaserdem/config.h | 111 ++++++++++ .../community/ortho_4x12/bbaserdem/keymap.c | 198 ++++++++++++++++++ .../community/ortho_4x12/bbaserdem/rules.mk | 24 +++ 4 files changed, 370 insertions(+) create mode 100644 layouts/community/ortho_4x12/bbaserdem/README.md create mode 100755 layouts/community/ortho_4x12/bbaserdem/config.h create mode 100755 layouts/community/ortho_4x12/bbaserdem/keymap.c create mode 100755 layouts/community/ortho_4x12/bbaserdem/rules.mk diff --git a/layouts/community/ortho_4x12/bbaserdem/README.md b/layouts/community/ortho_4x12/bbaserdem/README.md new file mode 100644 index 00000000000..a9ddc339a0a --- /dev/null +++ b/layouts/community/ortho_4x12/bbaserdem/README.md @@ -0,0 +1,37 @@ +This file contains my [4x12 ortho](../../../default/ortho_4x12) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Planck + +I use a couple [planck](../../../../keyboards/planck/readme.md) keyboards. +To sell soon; don't use them anymore. + +* Use the [light](../../../../keyboards/planck/light/readme.md) version. +* Use the [rev6](../../../../keyboards/planck/rev6/readme.md) version. + +I have a daughter board that I'm trying to use for perkey leds. +Originally, in the firmware, the underglow rgb prints are configured both for +`RGBLIGHT` and `RGBMATRIX` code. +I differentiate between these two; and use; + +* `RGBLIGHT` for underglow leds. +* `RGB_MATRIX` for the daughterboard, if I get to it at some point. (Doubtful) + +Enable in rules.mk accordingly. + +# JJ40 + +A planck rev4 replacement; for my acrylic planck case which used to host a now +defunct rev4. + +Enable in rules.mk accordingly. + +## Status + +* [x] Layout adapted +* [ ] Have not tested build yet. +* [ ] Have not confirmed on board + +# Let's Split Eh? + +I have a [let's split eh?](../../../../keyboards/lets_split_eh/README.md), unused, will sell this. diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h new file mode 100755 index 00000000000..81f77c44fb8 --- /dev/null +++ b/layouts/community/ortho_4x12/bbaserdem/config.h @@ -0,0 +1,111 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +// Code pertaining to planck rev6 +#if defined(KEYBOARD_planck_rev6) + // Encoder I use; + #ifdef RGB_DI_PIN + #undef ENCODER_RESOLUTION + #endif + #define ENCODER_RESOLUTION 2 + // Daughter board related utilities + #ifdef RGB_MATRIX_ENABLE + // Reconfigure the RGB DI Pin + #ifdef RGB_DI_PIN + #undef RGB_DI_PIN + #endif + // Change this later + #define RGB_DI_PIN A1 + // Reconfigure number of LEDS + #ifdef DRIVER_LED_TOTAL + #undef DRIVER_LED_TOTAL + #endif + #define DRIVER_LED_TOTAL 48 + #elif RGBLIGHT_ENABLE + // RGB Underglow with on-board SMD footprints + // This is for original planck led locations + // ┌────────────┐ + // │ 6 5 4 3 │ + // │ │ + // │ 0 │ + // │ 7 8 1 2 │ + // └────────────┘ + #ifdef RGBLIGHT_RIGHT_BEG + #undef RGBLIGHT_RIGHT_BEG + #endif + #define RGBLIGHT_RIGHT_BEG 1 + + #ifdef RGBLIGHT_RIGHT_NUM + #undef RGBLIGHT_RIGHT_NUM + #endif + #define RGBLIGHT_RIGHT_NUM 4 + + #ifdef RGBLIGHT_LEFT_BEG + #undef RGBLIGHT_LEFT_BEG + #endif + #define RGBLIGHT_LEFT_BEG 5 + + #ifdef RGBLIGHT_LEFT_NUM + #undef RGBLIGHT_LEFT_NUM + #endif + #define RGBLIGHT_LEFT_NUM 4 + #endif +#endif + +// Let's Split Eh! specific +#ifdef KEYBOARD_lets_split_eh_eh + #ifdef RGBLIGHT_LEFT_BEG + #undef RGBLIGHT_LEFT_BEG + #endif + #define RGBLIGHT_LEFT_BEG 0 + + #ifdef RGBLIGHT_LEFT_NUM + #undef RGBLIGHT_LEFT_NUM + #endif + #define RGBLIGHT_LEFT_NUM 6 + + #ifdef RGBLIGHT_RIGHT_BEG + #undef RGBLIGHT_RIGHT_BEG + #endif + #define RGBLIGHT_RIGHT_BEG 6 + + #ifdef RGBLIGHT_RIGHT_NUM + #undef RGBLIGHT_RIGHT_NUM + #endif + #define RGBLIGHT_RIGHT_NUM 6 +#endif + +// JJ40 specific +#ifdef KEYBOARD_jj40 + #ifdef RGBLIGHT_LEFT_BEG + #undef RGBLIGHT_LEFT_BEG + #endif + #define RGBLIGHT_LEFT_BEG 0 + + #ifdef RGBLIGHT_LEFT_NUM + #undef RGBLIGHT_LEFT_NUM + #endif + #define RGBLIGHT_LEFT_NUM 2 + + #ifdef RGBLIGHT_RIGHT_BEG + #undef RGBLIGHT_RIGHT_BEG + #endif + #define RGBLIGHT_RIGHT_BEG 3 + + #ifdef RGBLIGHT_RIGHT_NUM + #undef RGBLIGHT_RIGHT_NUM + #endif + #define RGBLIGHT_RIGHT_NUM 2 +#endif diff --git a/layouts/community/ortho_4x12/bbaserdem/keymap.c b/layouts/community/ortho_4x12/bbaserdem/keymap.c new file mode 100755 index 00000000000..654e4bfdeda --- /dev/null +++ b/layouts/community/ortho_4x12/bbaserdem/keymap.c @@ -0,0 +1,198 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Base layer + [_BASE] = LAYOUT_ortho_4x12_wrapper( + _BL1_5_,_BL1_1_,_BR1_1_,_BR1_5_, + _BL2_5_,_BL2_1_,_BR2_1_,_BR2_5_, + _BL3_5_,_BL3_1_,_BR3_1_,_BR3_5_, + BB_ENC0,KC_DOWN,KC_UP, _BL4_3_,_BR4_3_,KC_LEFT,KC_RGHT,RGB_TOG + ), + // Extra characters overlay + [_CHAR] = LAYOUT_ortho_4x12_wrapper( + _CL1_5_,xxx2xxx,_CR1_5_, + _CL2_5_,xxx2xxx,_CR2_5_, + _CL3_5_,xxx2xxx,_CR3_5_, + ___3___,_CL4_3_,_CR4_3_,___3___ + ), + // Game layer: left_half + [_GAME] = LAYOUT_ortho_4x12_wrapper( + _GA1_5_,_GA1_1_,___6___, + _GA2_5_,_GA2_1_,___6___, + _GA3_5_,_GA3_1_,___6___, + ___3___,_GA4_3_,___6___ + ), + // Media layer: right_half + [_MEDI] = LAYOUT_ortho_4x12_wrapper( + ___6___,xxx1xxx,_ME1_5_, + ___6___,xxx1xxx,_ME2_5_, + ___6___,xxx1xxx,_ME3_5_, + ___6___,_ME4_3_,___3___ + ), + // Navigation layer: right_half + [_NAVI] = LAYOUT_ortho_4x12_wrapper( + ___6___,xxx1xxx,_NA1_5_, + ___6___,xxx1xxx,_NA2_5_, + ___6___,xxx1xxx,_NA3_5_, + ___6___,_NA4_3_,___3___ + ), + // Symbol layer: right_half + [_SYMB] = LAYOUT_ortho_4x12_wrapper( + ___6___,xxx1xxx,_SY1_5_, + ___6___,xxx1xxx,_SY2_5_, + ___6___,xxx1xxx,_SY3_5_, + ___6___,_SY4_3_,___3___ + ), + // Number layer: left_half + [_NUMB] = LAYOUT_ortho_4x12_wrapper( + xxx1xxx,_NU1_5_,___6___, + xxx1xxx,_NU2_5_,___6___, + xxx1xxx,_NU3_5_,___6___, + ___3___,_NU4_3_,___6___ + ), + // Function layer: left_half + [_FUNC] = LAYOUT_ortho_4x12_wrapper( + _FU1_5_,xxx1xxx,___6___, + _FU2_5_,xxx1xxx,___6___, + _FU3_5_,xxx1xxx,___6___, + ___3___,_FU4_3_,___6___ + ), + // Mouse layer: left_half + [_MOUS] = LAYOUT_ortho_4x12_wrapper( + _MO1_5_,xxx1xxx,___6___, + _MO2_5_,xxx1xxx,___6___, + _MO3_5_,xxx1xxx,___6___, + ___3___,_MO4_3_,___6___ + ), + // Music layer: everything + [_MUSI] = LAYOUT_ortho_4x12_wrapper( + _MU_12_,_MU_12_,_MU_12_, + ___1___,_MU_02_,_MUL_3_,_MUR_3_,_MU_02_,___1___) +}; + +// RGB Matrix configuration +#ifdef RGB_MATRIX_ENABLE + +// planck:Light +#if defined(KEYBOARD_planck_light) +/* This is left-right for planck light indicator light + * - The LED 42 is for spacebar specifically, leave it out of the matrix + * - This is how it looks like + * ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ + * │00│01│02│03│04│05│06│07│08│09│10│11│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │12│13│14│15│16│17│18│19│20│21│22│23│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │24│25│26│27│28│29│30│31│32│33│34│35│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │36│37│38│39│40│41│43│44│45│46│47│48│ + * └──┴──┴──┴──┴──┴─042─┴──┴──┴──┴──┴──┘ + */ +int board_left[24] = { + 0, 1, 2, 3, 4, 5, + 12, 13, 14, 15, 16, 17, + 24, 25, 26, 27, 28, 29, + 36, 37, 38, 39, 40, 41}; +int board_right[24] = { + 6, 7, 8, 9, 10, 11, + 18, 19, 20, 21, 22, 23, + 30, 31, 32, 33, 34, 35, + 43, 44, 45, 46, 47, 48}; +// Sided color-setting +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(board_left[i], red, green, blue); + } +} +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(board_right[i], red, green, blue); + } +} + +// planck:rev6 +#elif defined(KEYBOARD_planck_rev6) +/* Rev6 has RGB matrix to the bottom LED footprints + * Breakdown of the daughter board layout that I'm planning to use + * ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ + * │35│36│37│38│39│40│41│42│43│44│45│46│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │23│24│25│26│27│28│29│30│31│32│33│34│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │12│13│14│15│16│17│18│19│20│21│22│47│ + * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ + * │00│01│02│03│04│05│06│07│08│09│10│11│ + * └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘ + */ +led_config_t g_led_config = { + { // Key Matrix to LED Index + {35, 36, 37, 38, 39, 40}, // R1: Left + {23, 24, 25, 26, 27, 28}, // R2: Left + {12, 13, 14, 15, 16, 17}, // R3: Left + { 0, 1, 2, 9, 10, 11}, // R4: 1-3, 10-12 + {41, 42, 43, 44, 45, 46}, // R1: Right + {29, 30, 31, 32, 33, 34}, // R2: Right + {18, 19, 20, 21, 22, 47}, // R3: Right + { 6, 7, 8, 3, 4, 5}, // R4: 7-9, 4-6 + }, {// LED Index to Physical Position + // R4: 12 leds + { 0, 64}, { 20, 64}, { 41, 64}, { 61, 64}, { 81, 64}, {102, 64}, + {122, 64}, {143, 64}, {163, 64}, {183, 64}, {204, 64}, {224, 64}, + // R3: 11 leds (last one in this row is the last LED) + { 0, 43}, { 20, 43}, { 41, 43}, { 61, 43}, { 81, 43}, {102, 43}, + {122, 43}, {143, 43}, {163, 43}, {183, 43}, {204, 43}, + // R2: 12 leds + { 0, 21}, { 20, 21}, { 41, 21}, { 61, 21}, { 81, 21}, {102, 21}, + {122, 21}, {143, 21}, {163, 21}, {183, 21}, {204, 21}, {224, 21}, + // R1: 12 leds + { 0, 0}, { 20, 0}, { 41, 0}, { 61, 0}, { 81, 0}, {102, 0}, + { 122, 0}, {143, 0}, {163, 0}, {183, 0}, {204, 0}, {224, 0}, + // Last led: right most R3 + {224, 43} + }, {// LED Index to Flag (4: regular key, 1: modifier) + 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4 + } +}; +int board_left[24] = { + 0, 1, 2, 3, 4, 5, + 12, 13, 14, 15, 16, 17, + 23, 24, 25, 26, 27, 28, + 35, 36, 37, 38, 39, 40}; +int board_right[24] = { + 6, 7, 8, 9, 10, 11, + 18, 19, 20, 21, 22, 47, + 29, 30, 31, 32, 33, 34, + 41, 42, 43, 44, 45, 46}; +// Sided color-setting +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(board_left[i], red, green, blue); + } +} +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(board_right[i], red, green, blue); + } +} +// End of differentiations +#endif + +// End of code for the RGB_MATRIX setup +#endif diff --git a/layouts/community/ortho_4x12/bbaserdem/rules.mk b/layouts/community/ortho_4x12/bbaserdem/rules.mk new file mode 100755 index 00000000000..fddeacc0b79 --- /dev/null +++ b/layouts/community/ortho_4x12/bbaserdem/rules.mk @@ -0,0 +1,24 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Planck rev6 has both RGBLIGHT and RGB_MATRIX enabled +# RGBLIGHT should be enabled for a board with the underglow leds +# RGB_MATRIX_ENABLE should be set to WS2812 for the daughter board +ifneq (,$(findstring planck/rev6,$(KEYBOARD))) + RGBLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = no +endif +# JJ40 here +ifneq (,$(findstring jj40,$(KEYBOARD))) + RGBLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = no +endif From ee427ff674e4ab6e3006478b74e461e8dc699bd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:19:48 -0400 Subject: [PATCH 46/94] Added 5x15 layout for bbaserdem. --- .../1key/keymaps/bbaserdem/README.md | 2 +- .../community/ortho_5x15/bbaserdem/README.md | 16 +++ .../community/ortho_5x15/bbaserdem/config.h | 15 ++ .../community/ortho_5x15/bbaserdem/keymap.c | 128 ++++++++++++++++++ .../community/ortho_5x15/bbaserdem/rules.mk | 17 +++ 5 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 layouts/community/ortho_5x15/bbaserdem/README.md create mode 100644 layouts/community/ortho_5x15/bbaserdem/config.h create mode 100644 layouts/community/ortho_5x15/bbaserdem/keymap.c create mode 100755 layouts/community/ortho_5x15/bbaserdem/rules.mk diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md index f68edef54c8..a4d8715a233 100644 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md +++ b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md @@ -1,5 +1,5 @@ This file contains my [1x1](../../../default/ortho_1x1) board layouts -Check out the [user readme](../../../../users/sbp/README.md) for more info. +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. # Big Series PCB diff --git a/layouts/community/ortho_5x15/bbaserdem/README.md b/layouts/community/ortho_5x15/bbaserdem/README.md new file mode 100644 index 00000000000..e6e15b72605 --- /dev/null +++ b/layouts/community/ortho_5x15/bbaserdem/README.md @@ -0,0 +1,16 @@ +This file contains my [5x15 ortho](../../../default/ortho_5x15) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# XD75RE + +One of my first boards, the [XD75Re](../../../../keyboards/xd75/readme.md). +(At least before the price hike.) +To be sold. + +The board has `RGBLIGHT_ENABLE` leds underneath; but I use a wooden case. +Instead; I hooked up some LED's to the three lock indicators. +I use them for layer indication. + +## Build + +Build command: `CFLAGS="-Wno-error=deprecated" TBF` diff --git a/layouts/community/ortho_5x15/bbaserdem/config.h b/layouts/community/ortho_5x15/bbaserdem/config.h new file mode 100644 index 00000000000..f51237a94d7 --- /dev/null +++ b/layouts/community/ortho_5x15/bbaserdem/config.h @@ -0,0 +1,15 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 diff --git a/layouts/community/ortho_5x15/bbaserdem/keymap.c b/layouts/community/ortho_5x15/bbaserdem/keymap.c new file mode 100644 index 00000000000..8b9b742e192 --- /dev/null +++ b/layouts/community/ortho_5x15/bbaserdem/keymap.c @@ -0,0 +1,128 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_ortho_5x15_wrapper( + xxx6xxx,KC_NLCK,KC_PSLS,KC_PAST,xxx6xxx, + _BL1_1_,_BL1_5_,KC_P7, KC_P8, KC_P9, _BR1_5_,_BR1_1_, + _BL2_1_,_BL2_5_,KC_P4, KC_P5, KC_P6, _BR2_5_,_BR2_1_, + _BL3_1_,_BL3_5_,KC_P1, KC_P2, KC_P3, _BR3_5_,_BR3_1_, + BL_STEP,XXXXXXX,KC_LEFT,KC_RGHT,_BL4_3_,KC_P0, _BL4_3_,KC_DOWN,KC_UP, MU_ON, BL_TOGG + ), + [_CHAR] = LAYOUT_ortho_5x15_wrapper( + xxx6xxx,xxx3xxx,xxx6xxx, + XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, + XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, + XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, + ___4___,_CL4_3_,XXXXXXX,_CL4_3_,___4___ + ), + [_GAME] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + _GA1_1_,_GA1_5_,___3___,___6___, + _GA2_1_,_GA2_5_,___3___,___6___, + _GA3_1_,_GA3_5_,___3___,___6___, + ___4___,_GA4_3_,___1___,___3___,___4___ + ), + [_MEDI] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + xxx1xxx,_ME1_5_,___3___,___6___, + xxx1xxx,_ME2_5_,___3___,___6___, + xxx1xxx,_ME3_5_,___3___,___6___, + ___4___,___3___,___1___,_ME4_3_,___4___ + ), + [_NAVI] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + xxx1xxx,_NA1_5_,___3___,___6___, + xxx1xxx,_NA2_5_,___3___,___6___, + xxx1xxx,_NA3_5_,___3___,___6___, + ___4___,_NA4_3_,___1___,___3___,___4___ + ), + [_SYMB] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + xxx1xxx,_SY1_5_,___3___,___6___, + xxx1xxx,_SY2_5_,___3___,___6___, + xxx1xxx,_SY3_5_,___3___,___6___, + ___4___,_SY4_3_,___1___,___3___,___4___ + ), + [_NUMB] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + ___6___,___3___,_NU1_5_,xxx1xxx, + ___6___,___3___,_NU2_5_,xxx1xxx, + ___6___,___3___,_NU3_5_,xxx1xxx, + ___4___,___3___,___1___,_NU4_3_,___4___ + ), + [_FUNC] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + ___6___,___3___,_FU1_5_,xxx1xxx, + ___6___,___3___,_FU2_5_,xxx1xxx, + ___6___,___3___,_FU3_5_,xxx1xxx, + ___4___,___3___,___1___,_FU4_3_,___4___ + ), + [_MOUS] = LAYOUT_ortho_5x15_wrapper( + ___6___,___3___,___6___, + ___6___,___3___,_MO1_5_,xxx1xxx, + ___6___,___3___,_MO2_5_,xxx1xxx, + ___6___,___3___,_MO3_5_,xxx1xxx, + ___4___,___3___,___1___,_MO4_3_,___4___ + ), + [_MUSI] = LAYOUT_ortho_5x15_wrapper( + _MU_06_,_MU_03_,_MU_06_, + _MU_06_,_MU_03_,_MU_06_, + _MU_06_,_MU_03_,_MU_06_, + _MU_06_,_MU_03_,_MU_06_, + _MU_06_,_MU_01_,_MUS_4_,MU_SLOW,MU_FAST,MU_OFF, ___1___ + ) +}; + +layer_state_t layer_state_set_keymap(layer_state_t state) { + // XD75RE layer indicator + #ifdef KEYBOARD_xd75 + if (layer_state_cmp(state, _CHAR)) { + capslock_led_on(); + gp103_led_on(); + gp100_led_on(); + } else if (layer_state_cmp(state, _MEDI)) { + capslock_led_off(); + gp103_led_off(); + gp100_led_on(); + } else if (layer_state_cmp(state, _NAVI)) { + capslock_led_off(); + gp103_led_on(); + gp100_led_off(); + } else if (layer_state_cmp(state, _NUMB)) { + capslock_led_on(); + gp103_led_off(); + gp100_led_off(); + } else if (layer_state_cmp(state, _SYMB)) { + capslock_led_off(); + gp103_led_on(); + gp100_led_on(); + } else if (layer_state_cmp(state, _FUNC)) { + capslock_led_on(); + gp103_led_off(); + gp100_led_on(); + } else if (layer_state_cmp(state, _MOUS)) { + capslock_led_on(); + gp103_led_on(); + gp100_led_off(); + } else { + capslock_led_off(); + gp103_led_off(); + gp100_led_off(); + } + #endif + return state; +}; diff --git a/layouts/community/ortho_5x15/bbaserdem/rules.mk b/layouts/community/ortho_5x15/bbaserdem/rules.mk new file mode 100755 index 00000000000..3a387185fc9 --- /dev/null +++ b/layouts/community/ortho_5x15/bbaserdem/rules.mk @@ -0,0 +1,17 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# XD75RE specific stuff +ifneq (,$(findstring xd75,$(KEYBOARD))) + RGBLIGHT_ENABLE = no + BACKLIGHT_ENABLE = yes +endif From 1509492d8c8d95728fa38b30d247c9dafed29e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:31:13 -0400 Subject: [PATCH 47/94] Added the split 3x5_3 layout. --- .../community/split_3x5_3/bbaserdem/README.md | 18 +++ .../community/split_3x5_3/bbaserdem/config.h | 32 +++++ .../community/split_3x5_3/bbaserdem/keymap.c | 123 ++++++++++++++++++ .../community/split_3x5_3/bbaserdem/rules.mk | 18 +++ 4 files changed, 191 insertions(+) create mode 100644 layouts/community/split_3x5_3/bbaserdem/README.md create mode 100644 layouts/community/split_3x5_3/bbaserdem/config.h create mode 100644 layouts/community/split_3x5_3/bbaserdem/keymap.c create mode 100644 layouts/community/split_3x5_3/bbaserdem/rules.mk diff --git a/layouts/community/split_3x5_3/bbaserdem/README.md b/layouts/community/split_3x5_3/bbaserdem/README.md new file mode 100644 index 00000000000..869b91898ce --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/README.md @@ -0,0 +1,18 @@ +This file contains my [split 3x10](../../../default/split_3x10) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Crkbd + +Using a no 6th column crkbd (rev 2.1 choc) as a mobile keyboard. + +This version uses Elite-C and ProMicro as controllers; hence no RGB and OLED. + +## Build + +Build command: `CFLAGS="-Wno-error=deprecated" TBF` + +## Todo + +* Switch PCB to the Proton-C compatible hotswap switch. +* Or use cable rerouting to make the pcb Proton-C compatible. +* Or find a way to use both OLED and LEDs. diff --git a/layouts/community/split_3x5_3/bbaserdem/config.h b/layouts/community/split_3x5_3/bbaserdem/config.h new file mode 100644 index 00000000000..75e24791eee --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/config.h @@ -0,0 +1,32 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +// Split definition; use the following to flash; +// pro-micro: avrdude-split-left/right +// elite-c: dfu-split-left/right +#define EE_HANDS + +#ifdef KEYBOARD_crkbd_rev1 + // Corne overrides + #include "../../../../keyboards/crkbd/rev1/config.h" + #ifdef RGBLED_NUM + #undef RGBLED_NUM + #endif + #ifdef DRIVER_LED_TOTAL + #undef DRIVER_LED_TOTAL + #endif + #define RGBLED_NUM 48 + #define DRIVER_LED_TOTAL RGBLED_NUM +#endif diff --git a/layouts/community/split_3x5_3/bbaserdem/keymap.c b/layouts/community/split_3x5_3/bbaserdem/keymap.c new file mode 100644 index 00000000000..36a1fa3a52d --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/keymap.c @@ -0,0 +1,123 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" + +/* D layout + * ┌───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┐ + * │' "│, <│. >│ P │ Y │        │ F │ G │ C │ R │ L │ + * ├───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┤ + * │ A │ O │ E │ U │ I │        │ D │ H │ T │ N │ S │ + * ├───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┤ + * │; :│ Q │ J │ K │ X │        │ B │ M │ W │ V │ Z │ + * └───┴───┴───┼───┼───┼───┐ ┌───┼───┼───┼───┴───┴───┘ + *            │Del│Tab│Spc│ │Ent│Esc│Bsp│ + *            └───┴───┴───┘ └───┴───┴───┘ + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_split_3x5_3_wrapper( + _BL1_5_,_BR1_5_, + _BL2_5_,_BR2_5_, + _BL3_5_,_BR3_5_, + _BL4_3_,_BR4_3_ + ), + [_CHAR] = LAYOUT_split_3x5_3_wrapper( + _CL1_5_,_CR1_5_, + _CL2_5_,_CR2_5_, + _CL3_5_,_CR3_5_, + _CL4_3_,_CR4_3_ + ), + [_GAME] = LAYOUT_split_3x5_3_wrapper( + _GA1_5_,___5___, + _GA2_5_,___5___, + _GA3_5_,___5___, + _GA4_3_,___3___ + ), + [_MEDI] = LAYOUT_split_3x5_3_wrapper( + ___5___,_ME1_5_, + ___5___,_ME2_5_, + ___5___,_ME3_5_, + ___3___,_ME4_3_ + ), + [_NAVI] = LAYOUT_split_3x5_3_wrapper( + ___5___,_NA1_5_, + ___5___,_NA2_5_, + ___5___,_NA3_5_, + ___3___,_NA4_3_ + ), + [_SYMB] = LAYOUT_split_3x5_3_wrapper( + ___5___,_SY1_5_, + ___5___,_SY2_5_, + ___5___,_SY3_5_, + ___3___,_SY4_3_ + ), + [_NUMB] = LAYOUT_split_3x5_3_wrapper( + _NU1_5_,___5___, + _NU2_5_,___5___, + _NU3_5_,___5___, + _NU4_3_,___3___ + ), + [_FUNC] = LAYOUT_split_3x5_3_wrapper( + _FU1_5_,___5___, + _FU2_5_,___5___, + _FU3_5_,___5___, + _FU4_3_,___3___ + ), + [_MOUS] = LAYOUT_split_3x5_3_wrapper( + _MO1_5_,___5___, + _MO2_5_,___5___, + _MO3_5_,___5___, + _MO4_3_,___3___ + ), + [_MUSI] = LAYOUT_split_3x5_3_wrapper( + _MU_10_, + _MU_10_, + _MU_10_, + _MUL_3_,_MUR_3_ + ) +}; + +// RGB Matrix configuration +#ifdef RGB_MATRIX_ENABLE + +// crkbd +#if defined(KEYBOARD_crkbd_rev1) +/* This is left-right for crkbd indicator light + * ┌──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┐ + * │23│18│17│10│09│      │33│34│41│42│47│ + * ├02┼──┼01┼──┼00┤      ├24┼──┼25┼──┼26┤ + * │22│19│16│11│08│     │32│35│40│43│46│ + * ├03┼──┼04┼──┼05┤      ├29┼──┼28┼──┼27┤ + * │21│20│15│12│07│     │31│36│39│44│45│ + * └──┴──┴──┼──┼──┼──┐┌──┼──┼──┼──┴──┴──┘ + *          │14│13│06││30│37│38│ + *          └──┴──┴──┘└──┴──┴──┘ + */ +// Sided color-setting +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 24; i++) { + rgb_matrix_set_color(i, red, green, blue); + } +} +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 24; i < 48; i++) { + rgb_matrix_set_color(i, red, green, blue); + } +} +// End of differentiations +#endif + +// End of code for the RGB_MATRIX setup +#endif diff --git a/layouts/community/split_3x5_3/bbaserdem/rules.mk b/layouts/community/split_3x5_3/bbaserdem/rules.mk new file mode 100644 index 00000000000..347894c26b1 --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Corne keyboard +ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) + RGBLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = yes + OLED_DRIVER_ENABLE = no +endif From 0bd5f9eff9ca120ea0d1aa755f40238586d56eb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:32:15 -0400 Subject: [PATCH 48/94] Fixed a typo referance in one of the readme files. --- layouts/community/split_3x5_3/bbaserdem/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/community/split_3x5_3/bbaserdem/README.md b/layouts/community/split_3x5_3/bbaserdem/README.md index 869b91898ce..9086172df88 100644 --- a/layouts/community/split_3x5_3/bbaserdem/README.md +++ b/layouts/community/split_3x5_3/bbaserdem/README.md @@ -1,4 +1,4 @@ -This file contains my [split 3x10](../../../default/split_3x10) board layouts +This file contains my [split 3x10 + 3](../../../default/split_3x10_3) board layouts Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. # Crkbd From a44336515e61da4d73c20f4645ca66bc40edbf71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:35:08 -0400 Subject: [PATCH 49/94] Added the last split layout for bbaserdem --- .../community/split_3x6_3/bbaserdem/README.md | 10 ++ .../community/split_3x6_3/bbaserdem/config.h | 24 ++++ .../community/split_3x6_3/bbaserdem/keymap.c | 124 ++++++++++++++++++ .../community/split_3x6_3/bbaserdem/rules.mk | 18 +++ 4 files changed, 176 insertions(+) create mode 100644 layouts/community/split_3x6_3/bbaserdem/README.md create mode 100644 layouts/community/split_3x6_3/bbaserdem/config.h create mode 100644 layouts/community/split_3x6_3/bbaserdem/keymap.c create mode 100644 layouts/community/split_3x6_3/bbaserdem/rules.mk diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem/README.md new file mode 100644 index 00000000000..dd1d0074bd3 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/README.md @@ -0,0 +1,10 @@ +This file contains my [split 3x6 + 3](../../../default/split_3x6_3) board layouts +Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. + +# Crkbd + +Using [this](https://github.com/ItsWaffIe/waffle_corne) Proton-C compatible PCB. + +## Build + +Build command: `CFLAGS="-Wno-error=deprecated" TBF` diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h new file mode 100644 index 00000000000..165249ff9af --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -0,0 +1,24 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +// Split definition; use the following to flash; +// pro-micro: avrdude-split-left/right +// elite-c: dfu-split-left/right +#define EE_HANDS + +// Code pertaining to planck rev6 +#ifdef KEYBOARD_crkbd_rev1 + // Corne overrides + #include "../../../../keyboards/crkbd/rev1/config.h" +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c new file mode 100644 index 00000000000..da6583c8b7f --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -0,0 +1,124 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 QMK_KEYBOARD_H +#include "bbaserdem.h" +/* F layout + * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ + * │+ *│ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ + * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ + * │ X │ A │ S │ D │ F │ G │        │ T │ K │ M │ L │ Y │ Ş │ + * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ + * │< >│ J │ Ö │ V │ C │ Ç │        │ Z │ S │ B │. :│, ;│ W │ + * └───┴───┴───┴───┼───┼───┼───┐ ┌───┼───┼───┼───┴───┴───┴───┘ + *                │Tab│Ent│Esc│ │Del│Spc│Bsp│ + *                └───┴───┴───┘ └───┴───┴───┘ + */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_split_3x6_3_wrapper( + _BL1_1_,_BL1_5_,_BR1_5_,_BR1_1_, + _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, + _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, + _BL4_3_,_BR4_3_ + ), + [_CHAR] = LAYOUT_split_3x6_3_wrapper( + XXXXXXX,_CL1_5_,_CR1_5_,XXXXXXX, + XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, + XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, + _CL4_3_,_CR4_3_ + ), + [_GAME] = LAYOUT_split_3x6_3_wrapper( + _GA1_1_,_GA1_5_,___6___, + _GA2_1_,_GA2_5_,___6___, + _GA3_1_,_GA3_5_,___6___, + _GA4_3_,___3___ + ), + [_MEDI] = LAYOUT_split_3x6_3_wrapper( + ___6___,_ME1_5_,xxx1xxx, + ___6___,_ME2_5_,xxx1xxx, + ___6___,_ME3_5_,xxx1xxx, + ___3___,_ME4_3_ + ), + [_NAVI] = LAYOUT_split_3x6_3_wrapper( + ___6___,_NA1_5_,xxx1xxx, + ___6___,_NA2_5_,xxx1xxx, + ___6___,_NA3_5_,xxx1xxx, + ___3___,_NA4_3_ + ), + [_SYMB] = LAYOUT_split_3x6_3_wrapper( + ___6___,_SY1_5_,xxx1xxx, + ___6___,_SY2_5_,xxx1xxx, + ___6___,_SY3_5_,xxx1xxx, + ___3___,_SY4_3_ + ), + [_NUMB] = LAYOUT_split_3x6_3_wrapper( + xxx1xxx,_NU1_5_,___6___, + xxx1xxx,_NU2_5_,___6___, + xxx1xxx,_NU3_5_,___6___, + _NU4_3_,___3___ + ), + [_FUNC] = LAYOUT_split_3x6_3_wrapper( + xxx1xxx,_FU1_5_,___6___, + xxx1xxx,_FU2_5_,___6___, + xxx1xxx,_FU3_5_,___6___, + _FU4_3_,___3___ + ), + [_MOUS] = LAYOUT_split_3x6_3_wrapper( + xxx1xxx,_MO1_5_,___6___, + xxx1xxx,_MO2_5_,___6___, + xxx1xxx,_MO3_5_,___6___, + _MO4_3_,___3___ + ), + [_MUSI] = LAYOUT_split_3x6_3_wrapper( + _MU_12_, + _MU_12_, + _MU_12_, + _MUL_3_,_MUR_3_ + ) +}; + +// RGB Matrix configuration +#ifdef RGB_MATRIX_ENABLE + +// crkbd +#if defined(KEYBOARD_crkbd_rev1) +/* This is left-right for planck light indicator light + * - The LED 42 is for spacebar specifically, leave it out of the matrix + * - This is how it looks like + * ┌──┬──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┬──┐ + * │24│23│18│17│10│09│      │36│37│44│45│50│51│ + * ├──┼02┼──┼01┼──┼00┤      ├27┼──┼28┼──┼29┼──┤ + * │25│22│19│16│11│08│     │35│38│43│46│49│52│ + * ├──┼03┼──┼04┼──┼05┤      ├32┼──┼31┼──┼30┼──┤ + * │26│21│20│15│12│07│     │34│39│42│47│48│53│ + * └──┴──┴──┴──┼──┼──┼──┐┌──┼──┼──┼──┴──┴──┴──┘ + *             │14│13│06││33│40│41│ + *             └──┴──┴──┘└──┴──┴──┘ + */ +// Sided color-setting +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 0; i < 27; i++) { + rgb_matrix_set_color(i, red, green, blue); + } +} +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { + for (int i = 28; i < 54; i++) { + rgb_matrix_set_color(i, red, green, blue); + } +} +// End of differentiations +#endif + +// End of code for the RGB_MATRIX setup +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk new file mode 100644 index 00000000000..347894c26b1 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Corne keyboard +ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) + RGBLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = yes + OLED_DRIVER_ENABLE = no +endif From bb9f95e72b30717520de43d157dac3663920982a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 18:51:28 -0400 Subject: [PATCH 50/94] Added userspace code for user bbaserdem --- users/bbaserdem/.gitignore | 2 + users/bbaserdem/README.md | 220 +++++++++++++++ users/bbaserdem/bb-audio.c | 77 ++++++ users/bbaserdem/bb-audio.h | 24 ++ users/bbaserdem/bb-backlight.c | 26 ++ users/bbaserdem/bb-backlight.h | 19 ++ users/bbaserdem/bb-encoder.c | 467 +++++++++++++++++++++++++++++++ users/bbaserdem/bb-encoder.h | 35 +++ users/bbaserdem/bb-keylight.c | 78 ++++++ users/bbaserdem/bb-keylight.h | 27 ++ users/bbaserdem/bb-macro.c | 183 +++++++++++++ users/bbaserdem/bb-macro.h | 110 ++++++++ users/bbaserdem/bb-oled.c | 162 +++++++++++ users/bbaserdem/bb-oled.h | 18 ++ users/bbaserdem/bb-underglow.c | 113 ++++++++ users/bbaserdem/bb-underglow.h | 24 ++ users/bbaserdem/bbaserdem.c | 224 +++++++++++++++ users/bbaserdem/bbaserdem.h | 484 +++++++++++++++++++++++++++++++++ users/bbaserdem/config.h | 139 ++++++++++ users/bbaserdem/rules.mk | 83 ++++++ 20 files changed, 2515 insertions(+) create mode 100644 users/bbaserdem/.gitignore create mode 100644 users/bbaserdem/README.md create mode 100644 users/bbaserdem/bb-audio.c create mode 100644 users/bbaserdem/bb-audio.h create mode 100644 users/bbaserdem/bb-backlight.c create mode 100644 users/bbaserdem/bb-backlight.h create mode 100644 users/bbaserdem/bb-encoder.c create mode 100644 users/bbaserdem/bb-encoder.h create mode 100644 users/bbaserdem/bb-keylight.c create mode 100644 users/bbaserdem/bb-keylight.h create mode 100644 users/bbaserdem/bb-macro.c create mode 100644 users/bbaserdem/bb-macro.h create mode 100644 users/bbaserdem/bb-oled.c create mode 100644 users/bbaserdem/bb-oled.h create mode 100644 users/bbaserdem/bb-underglow.c create mode 100644 users/bbaserdem/bb-underglow.h create mode 100644 users/bbaserdem/bbaserdem.c create mode 100644 users/bbaserdem/bbaserdem.h create mode 100644 users/bbaserdem/config.h create mode 100644 users/bbaserdem/rules.mk diff --git a/users/bbaserdem/.gitignore b/users/bbaserdem/.gitignore new file mode 100644 index 00000000000..57bd0e43b42 --- /dev/null +++ b/users/bbaserdem/.gitignore @@ -0,0 +1,2 @@ +/secrets.h +/secrets.c diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md new file mode 100644 index 00000000000..74a0488a451 --- /dev/null +++ b/users/bbaserdem/README.md @@ -0,0 +1,220 @@ +# BBASERDEM userspace code for qmk + +My userspace code for my various keyboards; available here. + +# Todo + +- [X] Add OLED support +- [ ] Centralize color definitions for RGB +- [ ] Document all features more extensibly +- [ ] Generate json files to be used with Keyboard-Layout-Editor to produce images. + +# Keyboards + +A list of my code accross the QMK repo accessible here. +(I will sell my built-but-not-using ones.) + +## Builds + +These are my keyboard builds and info, it allows me to plan out my builds. + +### Planck WORK + +* Board: planck/rev6 +* Switches: Zilent +* Case: Planck Hi-Pro Bottom Case: Glossy White +* Plate: Stainless steel with shiny finish (LaserBoost) +* Keycaps: Pudding PBT Doubleshot Keycap Set +* Artisan: B.O.B StoneuCarved Lotus Artisan Keycap +* Artisan: Teamwolf 304 Stainless Steel Transparent Metal Keycaps + +I use this at the workplace to not bother coworkers; focus on silence. + +### Planck HOME + +* Board: planck/rev6 +* Switches: Crystal BOX Navy +* Case: Planck Hi-Pro Bottom Case (MOD version): Matte Black +* Plate: Copper with shiny finish (LaserBoost) +* Keycaps: Buger TH01 XDA Dye-Subbed PBT +* Artisan: Sparkle Loft Reactor Artisan Keycap + +I use this at home. +Has all the extra pinouts exposed to play arounh with. + +### Planck SERVER + +* Board: jj40 +* Switches: BOX Navy +* Case: Clear Acrylic Top and Bottow, with Frosted Acrylic Diffuser (Smashing Acrylics) +* Keycaps: Datamancer Tall Deco Typewriter Keycaps + +I'm using this while I'm in between boards; but very usable. +Long term plan is to use this for the server. +The case was initially designed for planck rev4; +I'm replaced the PCB since my rev4 one was derelict +due to repeated desolderings. + +### Planck CARRY + +* Board: planck/light +* Switches: Choc Low Jade +* Case: Stock Planck light case +* Keycaps: Blanck MKB + +I carry this around; and is one of my favourite boards. +Found a better keycap profile for these as well. + +### XD75RE + +* Board: xd75 +* Switches: Zealios 67g + Silencios +* Case: Npkc 60% Wooden Case (Rosewood) +* Keycaps: Massdrop x MITO XDA Godspeed +* Artisan: Hammer Fidget Spinner Artisan Keycap +* Artisan: Waffle Key Studio Rosette (Sunset) + +My first work board; that is not seing any use due to being big. + +### Gherkin PAD + +* Board: 40percentclub/gherkin +* Case: Acrylic Case (Smashing Acrylics) +* Controller: Proton C +* Switches: Novelkeys Creams +* Keycaps: Random + +The point of this is to act like a game/macro pad. +Other than that; i just use this for bragging points. +I have been planning on using my Proton C to turn into a MIDI controller. + +### Let's Split Eh? + +* Board: lets_split_eh/eh +* Case: Acrylic Case (Smashing Acrylics) +* Switches: Novelkeys BOX Royals +* Keycaps: G20 Semiotics + +I built this; but then I realized that I really don't enjoy ortholinear split. + +### Infinity Ergodox + +* Board: ergodox_infinity +* Case: Datamancer Wooden case +* Switches: Kailh Speed Gold +* Keycaps: None + +I don't like Infinity Ergodox. +Should sell this soon cause really not seeing myself ever using this. +Lucky me got the case for free due to (then) Massdrop shipping errors. + +### Corne + +* Board: [Proton-C Compatible crkbd PCB](https://github.com/ItsWaffIe/waffle_corne) +* Case: IMK Corne Case v2 Polycarbonate +* Switches: Healios V2 +* Keycaps: POM Jelly + +I'm planning on adding a trackpad for this, as detailed +[here](https://github.com/manna-harbour/crkbd/blob/master/trackpoint/readme.org). + +### Corne Lite + +* Board: crkbd/rev1 +* Case: Custom +* Switches: Choc Low Burnt Orange +* Keycaps: [Scooped Choc Keycaps](https://mkultra.click/collections/keycaps/products/scooped-choc-keycaps?variant=31223543365730) + +### Kyria + +* Board: kyria/rev1 +* Case: Matte Black Acrylic High-Profile case +* Switches: Gateron Ink Silent Black +* Keycaps: Oblotzky SA Oblivion + +Want to add a joystick to this board for mouse control. + +### Big Switch + +* Board: bigseries/1key +* Case: WoodKeys (KNOWN SCAMMER: DO NOT RECOMMEND) +* Switches: Big Series Pale Blue +* Keycaps: Idea23 + +Got this before being scammed out of 200$ by Cole Markham: owner of WoodKeys; +The usb port got torn off; and could not fix it. +Expensive paperweight? + +# Firmware building + +## Archlinux + +On archlinux, the package *arm-none-eabi-gcc* is too new. +To fix; add to the environment `CFLAGS="-Wno-error=deprecated"` to compilation commands. +Also; try to run `avr-gcc` version `8.4.0` for smaller firmware. + +## Bootloader + +If I want to flash a new bootloader for a machine; here are steps; + +1. Flash the util/pro_micro_ISP_B6_10.hex to a spare promicro using; +`avrdude -p atmega32u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:pro_micro_ISP_B6_10.hex` +2. Wire the pins; (first is the ISP pro micro; second is the target) +``` +Pro Micro 10 (B6) <-> Keyboard RESET +Pro Micro 15 (B1) <-> Keyboard B1 (SCLK) +Pro Micro 16 (B2) <-> Keyboard B2 (MOSI) +Pro Micro 14 (B3) <-> Keyboard B3 (MISO) +Pro Micro VCC <-> Keyboard VCC +Pro Micro GND <-> Keyboard GND +``` +I do have this on hand I believe; from massdrop's planck light firmware updater. +3. Connect the flashed pro micro to my computer and run +`avrdude -c avrisp -P "$(ls /dev/ttyACM*)" -p atmega32u4 -U flash:w:bootloader_atmega32u4_1.0.0.hex:i -U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m` + +The avrisp here refers to the firmware on the ISP flasher pro micro. +The `atmega32u4` refers to the CPU used in the respective breakout boards. +The `avrdude` command interacts with catalina bootloader. +The shell call after the `-P` flag auto finds the port that the pro micro connects to. +The last few arguments are some jumpers apparently. + +# Features + +My userspace has a lot of shared code between different keyboards. +These files are prefixed with `sbp-` to remove any naming clash. + +* [bb-audio](bb-audio.c): Code dealing with audio playback using onboard sound. +Also contains stuff regarding using the devices as MIDI controllers. (WIP) +* [bb-backlight](bb-backlight.c): Controls global key single-channel LED stuff. +* [bb-keylight](bb-keylight.c): Controls per-key RGB LED matrix stuff. +* [bb-underglow](bb-underglow.c): Controls RGB underglow effects. +* [bb-process](bb-macro.c): My custom keycodes; macros, tap dances, etc. +* [bb-rotary](bb-rotary.c): Rotary encoder sutff + +# Layout + +![Corne layout](https://i.imgur.com/6VvQZ2I.png) + +My personal layout is mostly inspired by the +[Miryoku layout](../manna-harbour_miryoku/miryoku.org). +There are some changes to make it friendlier to international keyboards. +My board is compatible with software implementation of Dvorak and Turkish F. + +## Base + +Base layer uses tap-hold functionality to have access to modifiers. +The modifiers are mirrored on each half of the layout; +as to make those modifiers accessible to the keys that overlap them. +Besides the Alt key; each side has the proper L/R version of the modifier. +Since Right Alt key functions as AltGr key; +both the L and R versions are available on each side. + +# Shoutout + +* To [drashna](../drashna/readme.md), for documenting how to use userspace features; +all my code is pretty much inspired from them. +* To [Manna Harbour](../manna-harbour_miryoku/README.org) for their +amazing keymap that inspired me to recreate mine and allowed me to move to +smaller split keyboards. +* To people who taught me C and have me enjoy working with it; +Dr. Mehmet Enis Oğuz and Dr. Veysi Erkcan Özcan. diff --git a/users/bbaserdem/bb-audio.c b/users/bbaserdem/bb-audio.c new file mode 100644 index 00000000000..700e58bd1f8 --- /dev/null +++ b/users/bbaserdem/bb-audio.c @@ -0,0 +1,77 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-audio.h" +/* AUDIO + * This contains some audio related stuff. + * There is no need to wrap this up with preprocessor commands; + * This is only called if audio is enabled + */ + +float tone_game_intro[][2] = GAME_ON_SONG; +float tone_game_outro[][2] = GAME_OFF_SONG; + +// Audio playing when layer changes +uint32_t layer_state_set_audio(uint32_t state) { + // Get this layer + static bool prev_game = false; + + // If entering the game layer; play the intro sound + if (layer_state_cmp(state, _GAME) && (!prev_game)) { + stop_all_notes(); + PLAY_SONG(tone_game_intro); + prev_game = true; + } + // If exiting the game layer; play the outro sound + if ((!layer_state_cmp(state, _GAME)) && prev_game) { + stop_all_notes(); + PLAY_SONG(tone_game_outro); + prev_game = false; + } + return state; +} + +// Audio layer switch; add the music layer on top of this +bool process_record_audio(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case MU_TOG: + if (!record->event.pressed) { + // On release, exit music mode if enabled + if (layer_state_is(_MUSI)) { + layer_off(_MUSI); + // If not enabled; turn off all layers and load music layer + } else { + layer_clear(); + layer_on(_MUSI); + } + } + return true; + break; + case MU_ON: + if (!record->event.pressed) { + // On release, enter music mode + layer_clear(); + layer_on(_MUSI); + } + return true; + break; + case MU_OFF: + if (!record->event.pressed) { + // On release, exit music mode + layer_off(_MUSI); + } + return true; + break; + } + return true; +} diff --git a/users/bbaserdem/bb-audio.h b/users/bbaserdem/bb-audio.h new file mode 100644 index 00000000000..53708327536 --- /dev/null +++ b/users/bbaserdem/bb-audio.h @@ -0,0 +1,24 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* AUDIO + * Some functions to hook to some modes + */ + +// Hook to layer change effects +layer_state_t layer_state_set_audio(layer_state_t state); + +// Hook to audio keycodes +bool process_record_audio(uint16_t keycode, keyrecord_t *record); diff --git a/users/bbaserdem/bb-backlight.c b/users/bbaserdem/bb-backlight.c new file mode 100644 index 00000000000..17017d82790 --- /dev/null +++ b/users/bbaserdem/bb-backlight.c @@ -0,0 +1,26 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-backlight.h" +/* Replaced functions with noeeprom varieties; I don't need retention across + * booting. + */ + +// Backlight LEDs +void keyboard_post_init_backlight(void) { + backlight_enable(); + backlight_level(2); + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +} diff --git a/users/bbaserdem/bb-backlight.h b/users/bbaserdem/bb-backlight.h new file mode 100644 index 00000000000..3fbe1b9fb55 --- /dev/null +++ b/users/bbaserdem/bb-backlight.h @@ -0,0 +1,19 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* Hooks for backlight definitions + */ + +void keyboard_post_init_backlight(void); diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c new file mode 100644 index 00000000000..a4a1e4c3453 --- /dev/null +++ b/users/bbaserdem/bb-encoder.c @@ -0,0 +1,467 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-encoder.h" +/* ROTARY ENCODER + * This contains my general rotary encoder code + * Encoders each have a list of different modes they can be in. + * Each mode also have an on click action as well. + * Modes can be cycled using either shift-click or ctrl-click + * Modes can be reset using OS click + * Some modes are only accessible through some keymap layers + */ +//encoder_state_t encoder_state[NUMBER_OF_ENCODERS]; +encoder_state_t encoder_state[2]; +// Default state for the encoders +void reset_encoder_state(void) { +// for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { + for (int i = 0; i < 2; i++) { + encoder_state[i].base = i; + encoder_state[i].rgb = i; + encoder_state[i].point = i; + } +} + +// Initialize the encoder state beginning +void keyboard_post_init_encoder(void) { + reset_encoder_state(); +} + +// Oled string printing for given layer and index; ONLY for OLED +#ifdef OLED_DRIVER_ENABLE +void oled_encoder_state_5char(uint8_t index, uint8_t layer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + switch (encoder_state[index].rgb) { + case 0: + oled_write_P(PSTR(" mode"), false); + break; + case 1: + oled_write_P(PSTR(" hue "), false); + break; + case 2: + oled_write_P(PSTR("satur"), false); + break; + case 3: + oled_write_P(PSTR("value"), false); + break; + case 4: + oled_write_P(PSTR("speed"), false); + break; + default: + oled_write_P(PSTR("!oob!"), false); + break; + } + break; + #endif + // If pointer control is enabled + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (encoder_state[index].point) { + case 0: + oled_write_P(PSTR("m.lat"), false); + break; + case 1: + oled_write_P(PSTR("m.ver"), false); + break; + case 2: + oled_write_P(PSTR("s.ver"), false); + break; + case 3: + oled_write_P(PSTR("s.lat"), false); + break; + default: + oled_write_P(PSTR("!oob!"), false); + break; + } + break; + #endif + default: + switch (encoder_state[index].base) { + case 0: + oled_write_P(PSTR(" volm"), false); + break; + case 1: + oled_write_P(PSTR(" song"), false); + break; + case 2: + oled_write_P(PSTR(" sink"), false); + break; + case 3: + oled_write_P(PSTR("s.vol"), false); + break; + case 4: + oled_write_P(PSTR(" src "), false); + break; + case 5: + oled_write_P(PSTR(" L/R "), false); + break; + case 6: + oled_write_P(PSTR(" U/D "), false); + break; + case 7: + oled_write_P(PSTR("pgU/D"), false); + break; + case 8: + oled_write_P(PSTR(" del "), false); + break; + default: + oled_write_P(PSTR("!oob!"), false); + break; + } + break; + } +} +#endif + +// Encoder scroll functionality +void encoder_update_user(uint8_t index, bool clockwise) { + // Differentiate layer roles + switch (get_highest_layer(layer_state)) { + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + switch(encoder_state[index].rgb) { + case 0: // Effect the RGB mode + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + rgblight_step_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_step_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_step_reverse_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_step_reverse_noeeprom(); + #endif + } + break; + case 1: // Effect the RGB hue + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + rgblight_increase_hue_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_hue_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_decrease_hue_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_decrease_hue_noeeprom(); + #endif + } + break; + case 2: // Effect the RGB saturation + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + rgblight_increase_sat_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_sat_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_decrease_sat_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_decrease_sat_noeeprom(); + #endif + } + break; + case 3: // Effect the RGB brightness + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + rgblight_increase_val_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_val_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_decrease_val_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_decrease_val_noeeprom(); + #endif + } + break; + case 4: // Effect the RGB effect speed + if (clockwise) { + #ifdef RGBLIGHT_ENABLE + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_speed_noeeprom(); + #endif + } else { + #ifdef RGBLIGHT_ENABLE + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_decrease_speed_noeeprom(); + #endif + } + break; + } + break; + #endif + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch(encoder_state[index].point) { + case 0: // Move mouse on horizontal axis + if (clockwise) { + tap_code(KC_MS_R); + } else { + tap_code(KC_MS_L); + } + break; + case 1: // Move mouse on vertical axis + if (clockwise) { + tap_code(KC_MS_D); + } else { + tap_code(KC_MS_U); + } + break; + case 2: // Move mouse wheel on vertical axis + if (clockwise) { + tap_code(KC_WH_D); + } else { + tap_code(KC_WH_U); + } + break; + case 3: // Move mouse on horizontal axis + if (clockwise) { + tap_code(KC_WH_R); + } else { + tap_code(KC_WH_L); + } + break; + } + break; + #endif + default: + switch(encoder_state[index].base) { + case 0: // Volume + if (clockwise) { + tap_code16(KC_VOLU); + } else { + tap_code16(KC_VOLD); + } + break; + case 1: // Song change + if (clockwise) { + tap_code16(KC_MNXT); + } else { + tap_code16(KC_MPRV); + } + break; + case 2: // Move to audio sink + if (clockwise) { + tap_code16(KC_F13); + } else { + tap_code16(S(KC_F13)); + } + break; + case 3: // Volume of source + if (clockwise) { + tap_code16(S(KC_VOLU)); + } else { + tap_code16(C(KC_VOLD)); + } + break; + case 4: // Move to audio source + if (clockwise) { + tap_code16(C(KC_F13)); + } else { + tap_code16(C(S(KC_F13))); + } + break; + case 5: // Left-right + if (clockwise) { + tap_code16(KC_RGHT); + } else { + tap_code16(KC_LEFT); + } + break; + case 6: // Up-down + if (clockwise) { + tap_code16(KC_DOWN); + } else { + tap_code16(KC_UP); + } + break; + case 7: // Page Up-down + if (clockwise) { + tap_code16(KC_PGDN); + } else { + tap_code16(KC_PGUP); + } + break; + case 8: // Delete + if (clockwise) { + tap_code16(KC_DEL); + } else { + tap_code16(KC_BSPC); + } + break; + } + break; + } +} + +void encoder_click_action(uint8_t index) { + // Differentiate layer roles + switch (get_highest_layer(layer_state)) { + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + switch(encoder_state[index].rgb) { + case 0: // Return to no animation + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); + #endif + break; + case 1: + case 2: + case 3: // Toggle + #ifdef RGBLIGHT_ENABLE + rgblight_increase_val_noeeprom(); + #endif + #ifdef RGB_MATRIX_ENABLE + rgb_matrix_increase_val_noeeprom(); + #endif + break; + case 4: // Toggle velocikey + #ifdef VELOCIKEY_ENABLE + velocikey_toggle(); + #endif + break; + } + break; + #endif + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch(encoder_state[index].point) { + case 0: // Left click + tap_code16(KC_BTN1); + break; + case 1: // Right click + tap_code16(KC_BTN2); + break; + case 2: + case 3: // Middle click + tap_code16(KC_BTN2); + break; + } + break; + #endif + default: + switch(encoder_state[index].base) { + case 0: // Toggle mute + case 2: + tap_code16(KC_MUTE); + break; + case 1: // Pause + tap_code16(KC_MPLY); + break; + case 3: // Mute source + case 4: + tap_code16(A(KC_MUTE)); + break; + case 5: // Insert + tap_code16(KC_INS); + break; + case 6: // Capslock + tap_code16(KC_CAPS); + break; + case 7: // Redo + tap_code16(BB_REDO); + break; + case 8: // Undo + tap_code16(BB_UNDO); + break; + } + break; + } +} + +bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { + // Check if and which encoder + int encoder_index = -1; + switch (keycode) { + case BB_ENC0: + encoder_index = 0; + break; + case BB_ENC1: + encoder_index = 1; + break; + } + // Activate encoder function of button + if ((encoder_index >= 0) & (!record->event.pressed)) { + // If shifted, move mode one point forward + if (get_mods() & MOD_MASK_SHIFT) { + switch (get_highest_layer(layer_state)) { + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + encoder_state[encoder_index].rgb = + (encoder_state[encoder_index].rgb + 1) % 5; + break; + #endif + #ifdef MOUSEKEY_ENABLE + case _MOUS: + encoder_state[encoder_index].point = + (encoder_state[encoder_index].point + 1) % 4; + break; + #endif + default: + encoder_state[encoder_index].base = + (encoder_state[encoder_index].base + 1) % 9; + break; + } + // If ctrl is active, move mode one point backwards + } else if (get_mods() & MOD_MASK_CTRL) { + switch (get_highest_layer(layer_state)) { + #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + case _MEDI: + encoder_state[encoder_index].rgb = + (encoder_state[encoder_index].rgb + 5 - 1) % 5; + break; + #endif + #ifdef MOUSEKEY_ENABLE + case _MOUS: + encoder_state[encoder_index].point = + (encoder_state[encoder_index].point + 4 - 1) % 4; + break; + #endif + default: + encoder_state[encoder_index].base = + (encoder_state[encoder_index].base + 9 - 1) % 9; + break; + } + // If meta is active, reset the encoder states + } else if (get_mods() & MOD_MASK_GUI) { + reset_encoder_state(); + // If nothing else; just perform the click action + } else { + encoder_click_action(encoder_index); + } + } + return true; +} diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h new file mode 100644 index 00000000000..3a064c6295e --- /dev/null +++ b/users/bbaserdem/bb-encoder.h @@ -0,0 +1,35 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" + +// Code to print to OLED +#ifdef ENCODER_ENABLE +void oled_encoder_state_5char(uint8_t index, uint8_t layer); +#endif +// Hook to encoder stuff +void encoder_update_user(uint8_t index, bool clockwise); +// Complicated code for what the encoder keys do when pressed +bool process_record_encoder(uint16_t keycode, keyrecord_t *record); +// Initializing the encoder array +void keyboard_post_init_encoder(void); +// Clear the encoder settings +void reset_encoder_state(void); + +// Structure to keep runtime info on encoder state +typedef struct { + uint8_t base; // The encoder state on most layers; regular function + uint8_t rgb; // The encoder state on media layer; controls light settings + uint8_t point; // The encoder state on mouse layer; moves pointer +} encoder_state_t; diff --git a/users/bbaserdem/bb-keylight.c b/users/bbaserdem/bb-keylight.c new file mode 100644 index 00000000000..d52f092af79 --- /dev/null +++ b/users/bbaserdem/bb-keylight.c @@ -0,0 +1,78 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-keylight.h" +/* Code relating to per-key RGB LED stuff + */ + +// These are matrix specific so they need to be defined in the keymap code. +// BUT these are made to take RGB arguments so the color choice is central +__attribute__ ((weak)) +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { } +__attribute__ ((weak)) +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { } + +// Allow hooking into the RGB matrix indications using keymap code +__attribute__ ((weak)) void rgb_matrix_indicators_keymap(void) { } +// Set RGB state depending on layer +void rgb_matrix_indicators_user(void) { + // Do each layer seperately + switch (get_highest_layer(layer_state)) { + case _GAME: + keylight_set_left(RGB_TURQUOISE); + break; + case _CHAR: + rgb_matrix_set_color_all(RGB_CHARTREUSE); + break; + case _MEDI: + keylight_set_right(RGB_CORAL); + break; + case _NAVI: + keylight_set_right(RGB_GREEN); + break; + case _SYMB: + keylight_set_right(RGB_PURPLE); + break; + case _NUMB: + keylight_set_left(RGB_CYAN); + break; + case _FUNC: + keylight_set_left(RGB_RED); + break; + case _MOUS: + keylight_set_left(RGB_YELLOW); + break; + case _MUSI: + rgb_matrix_set_color_all(RGB_MAGENTA); + break; + } + // Load keymap hooks + rgb_matrix_indicators_keymap(); +} + +// Hook into shutdown code to make all perkey LED's red on hitting reset +void shutdown_keylight(void) { + // Flash all the key LED's red on shutdown + uint16_t timer_start = timer_read(); + rgb_matrix_set_color_all(RGB_CORAL); + // Delay until this registers + while(timer_elapsed(timer_start) < 250) {wait_ms(1);} +} + +// Hook into suspend code +void suspend_power_down_keylight(void) { + rgb_matrix_set_suspend_state(true); +} +void suspend_wakeup_init_keylight(void) { + rgb_matrix_set_suspend_state(false); +} diff --git a/users/bbaserdem/bb-keylight.h b/users/bbaserdem/bb-keylight.h new file mode 100644 index 00000000000..3297f151139 --- /dev/null +++ b/users/bbaserdem/bb-keylight.h @@ -0,0 +1,27 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* Hooks involving perkey RGB LEDs + */ + +// For custom indicators +void rgb_matrix_indicators_user(void); +// Hook into shutdown code +void shutdown_keylight(void); +void suspend_wakeup_init_keylight(void); +void suspend_power_down_keylight(void); +// These should be defined worst case on this file +void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue); +void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue); diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c new file mode 100644 index 00000000000..423ebb2525d --- /dev/null +++ b/users/bbaserdem/bb-macro.c @@ -0,0 +1,183 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-macro.h" +/* MACRO Definitions + * This file has my macros/unicodes + * Hooks for other functionality to inject itself into the process_record + */ + +// Tap dance definitons +#ifdef TAP_DANCE_ENABLE +// Bigswitch tap dance code for the last key down event. +void bigswitch_fin(qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 0: + // Change RGB mode + #ifdef RGBLIGHT_ENABLE + rgblight_step(); + #endif + break; + case 1: + // Change RGB mode; but reverse + #ifdef RGBLIGHT_ENABLE + rgblight_step_reverse(); + #endif + break; + case 2: + // Toggle RGB functions + #ifdef RGBLIGHT_ENABLE + rgblight_toggle(); + #endif + break; + case 3: + // Change RGB hue + #ifdef RGBLIGHT_ENABLE + rgblight_increase_hue(); + #endif + break; + case 4: + // Send OS + Escape; which screen locks in my OS + register_code(KC_LGUI); + register_code(KC_ESC); + break; + case 5: + // Send power keycode + register_code(KC_POWER); + break; + } +} +// Unregister the keycodes entered +void bigswitch_res (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 4: + unregister_code(KC_LGUI); + unregister_code(KC_ESC); + break; + case 5: + unregister_code(KC_POWER); + break; + } +} +qk_tap_dance_action_t tap_dance_actions[] = { + #ifdef AUDIO_ENABLE + // Music playback speed modulator + [TD_AUDIO_TEMPO] = ACTION_TAP_DANCE_DOUBLE(MU_SLOW, MU_FAST), + #endif + [TD_BIGSWITCH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, bigswitch_fin, bigswitch_res), +}; +#endif + +// Unicode definitions; for single character keys +// We mask their definitions if unicode is not enabled +#ifdef UNICODEMAP_ENABLE +const uint32_t PROGMEM unicode_map[] = { + [UPC_A_CIRC] = 0x00C2, [LOW_A_CIRC] = 0x00E2, //  â + [UPC_C_CEDI] = 0x00C7, [LOW_C_CEDI] = 0x00E7, // Ç ç + [UPC_G_BREV] = 0x011E, [LOW_G_BREV] = 0x001F, // Ğ ğ + [UPC_I_CIRC] = 0x00CE, [LOW_I_CIRC] = 0x00EE, // Î î + [UPC_I_DOTL] = 0x0049, [LOW_I_DOTL] = 0x0131, // I ı + [UPC_I_DOTT] = 0x0130, [LOW_I_DOTT] = 0x0069, // İ i + [UPC_O_DIAE] = 0x00D6, [LOW_O_DIAE] = 0x00F6, // Ö ö + [UPC_S_CEDI] = 0x015E, [LOW_S_CEDI] = 0x015F, // Ş ş + [UPC_U_CIRC] = 0x00DB, [LOW_U_CIRC] = 0x00FB, // Û û + [UPC_U_DIAE] = 0x00DC, [LOW_U_DIAE] = 0x00FC, // Ü ü + [UPC_ALPHA] = 0x0391, [LOW_ALPHA] = 0x03B1, // Α α + [UPC_BETA] = 0x0392, [LOW_BETA] = 0x03B2, // Β β + [UPC_GAMMA] = 0x0393, [LOW_GAMMA] = 0x03B3, // Γ γ + [UPC_DELTA] = 0x0394, [LOW_DELTA] = 0x03B4, // Δ δ + [UPC_EPSILON] = 0x0395, [LOW_EPSILON] = 0x03B5, // Ε ε + [UPC_ZETA] = 0x0396, [LOW_ZETA] = 0x03B6, // Ζ ζ + [UPC_ETA] = 0x0397, [LOW_ETA] = 0x03B7, // Η η + [UPC_THETA] = 0x0398, [LOW_THETA] = 0x03B8, // Θ θ + [UPC_IOTA] = 0x0399, [LOW_IOTA] = 0x03B9, // Ι ι + [UPC_KAPPA] = 0x039A, [LOW_KAPPA] = 0x03BA, // Κ κ + [UPC_LAMBDA] = 0x039B, [LOW_LAMBDA] = 0x03BB, // Λ λ + [UPC_MU] = 0x039C, [LOW_MU] = 0x03BC, // Μ μ + [UPC_NU] = 0x039D, [LOW_NU] = 0x03BD, // Ν ν + [UPC_XI] = 0x039E, [LOW_XI] = 0x03BE, // Ξ ξ + [UPC_OMICRON] = 0x039F, [LOW_OMICRON] = 0x03BF, // Ο ο + [UPC_PI] = 0x03A0, [LOW_PI] = 0x03C0, // Π π + [UPC_RHO] = 0x03A1, [LOW_RHO] = 0x03C1, // Ρ ρ + [UPC_SIGMA] = 0x03A3, [LOW_SIGMA] = 0x03C3, // Σ σ + [UPC_TAU] = 0x03A4, [LOW_TAU] = 0x03C4, // Τ τ + [UPC_UPSILON] = 0x03A5, [LOW_UPSILON] = 0x03C5, // Υ υ + [UPC_PHI] = 0x03A6, [LOW_PHI] = 0x03C6, // Φ φ + [UPC_CHI] = 0x03A7, [LOW_CHI] = 0x03C7, // Χ χ + [UPC_PSI] = 0x03A8, [LOW_PSI] = 0x03C8, // Ψ ψ + [UPC_OMEGA] = 0x03A9, [LOW_OMEGA] = 0x03C9, // Ω ω + [ELLIPSIS] = 0x2026, // … + [PLANCK_CON] = 0x210F, // ℏ + [ANGSTROM] = 0x212B, // Å + [BITCOIN] = 0x20BF // ₿ +}; +#endif + +// Keycodes +bool process_record_macro(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // Plain macros + case BB_PGPK: + // My public PGP key + if (record->event.pressed) { + SEND_STRING("0B7151C823559DD8A7A04CE36426139E2F4C6CCE"); + } + return false; break; + case DBL_ANG: + // Double angular bracket + if (record->event.pressed) { + SEND_STRING("<>"SS_TAP(X_LEFT)); + } + return false; break; + case DBL_PAR: + // Double paranthesis + if (record->event.pressed) { + SEND_STRING("()"SS_TAP(X_LEFT)); + } + return false; break; + case DBL_BRC: + // Double square brackets + if (record->event.pressed) { + SEND_STRING("[]"SS_TAP(X_LEFT)); + } + return false; break; + case DBL_CBR: + // Double curly brackets + if (record->event.pressed) { + SEND_STRING("{}"SS_TAP(X_LEFT)); + } + return false; break; + // Unicode macros + #ifdef UNICODEMAP_ENABLE + case TR_FLAG: + // Turkish flag + if (record->event.pressed) { + send_unicode_string("🇹🇷"); + } + return false; break; + case BB_LENY: + // Lenny face: ( ͡° ͜ʖ ͡°) + if (record->event.pressed) { + send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029"); + } + return false; break; + case BB_TABL: + // Table flip: ┻━┻︵ \(°□°)/ ︵ ┻━┻ + if (record->event.pressed) { + send_unicode_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); + } + return false; break; + #endif + } + return true; +} diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h new file mode 100644 index 00000000000..9a4bf437894 --- /dev/null +++ b/users/bbaserdem/bb-macro.h @@ -0,0 +1,110 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* This header file contains definitons regarding custom keycodes. + * - Both regular and unicode macros are dealt with in this file + */ + +// These will be delegated to keymap specific stuff (weak definition) +bool process_record_macro(uint16_t keycode, keyrecord_t *record); + +// Unicodemap implementation +#ifdef UNICODEMAP_ENABLE +enum userspace_unicodemap { + UPC_A_CIRC, + UPC_C_CEDI, + UPC_G_BREV, + UPC_I_CIRC, + UPC_I_DOTL, + UPC_I_DOTT, + UPC_O_DIAE, + UPC_S_CEDI, + UPC_U_CIRC, + UPC_U_DIAE, + LOW_A_CIRC, + LOW_C_CEDI, + LOW_G_BREV, + LOW_I_CIRC, + LOW_I_DOTL, + LOW_I_DOTT, + LOW_O_DIAE, + LOW_S_CEDI, + LOW_U_CIRC, + LOW_U_DIAE, + ELLIPSIS, + PLANCK_CON, + ANGSTROM, + MATHPI, + BITCOIN, + UPC_ALPHA, + UPC_BETA, + UPC_GAMMA, + UPC_DELTA, + UPC_EPSILON, + UPC_ZETA, + UPC_ETA, + UPC_THETA, + UPC_IOTA, + UPC_KAPPA, + UPC_LAMBDA, + UPC_MU, + UPC_NU, + UPC_XI, + UPC_OMICRON, + UPC_PI, + UPC_RHO, + UPC_SIGMA, + UPC_TAU, + UPC_UPSILON, + UPC_PHI, + UPC_CHI, + UPC_PSI, + UPC_OMEGA, + LOW_ALPHA, + LOW_BETA, + LOW_GAMMA, + LOW_DELTA, + LOW_EPSILON, + LOW_ZETA, + LOW_ETA, + LOW_THETA, + LOW_IOTA, + LOW_KAPPA, + LOW_LAMBDA, + LOW_MU, + LOW_NU, + LOW_XI, + LOW_OMICRON, + LOW_PI, + LOW_RHO, + LOW_SIGMA, + LOW_TAU, + LOW_UPSILON, + LOW_PHI, + LOW_CHI, + LOW_PSI, + LOW_OMEGA, +}; +#endif + +// Tap dance stuff +#ifdef TAP_DANCE_ENABLE +enum { + #ifdef AUDIO_ENABLE + TD_AUDIO_TEMPO, + #endif + TD_BIGSWITCH, +}; +#endif diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c new file mode 100644 index 00000000000..89208f363f3 --- /dev/null +++ b/users/bbaserdem/bb-oled.c @@ -0,0 +1,162 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-oled.h" +//#include +/* ROTARY ENCODER + * This contains my general rotary encoder code + * Encoders each have a list of different modes they can be in. + * Each mode also have an on click action as well. + * Modes can be cycled using either shift-click or ctrl-click + * Modes can be reset using OS click + * Some modes are only accessible through some keymap layers + */ + +// Following line imports reading of RGB settings +#if defined RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; +#elif defined RGB_MATRIX_ENABLE +extern rgb_config_t rgb_matrix_config; +#endif + +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(qmk_logo, false); +} + +static void render_status(void) { + // Function to print state information + uint8_t this_layer = get_highest_layer(layer_state); + uint8_t this_mod = get_mods(); + #if defined WPM_ENABLE + static char temp[4] = {0}; + #endif + + // Line 1: Layer State + oled_write_P(PSTR("Layer: "), false); + switch (this_layer) { + case _BASE: + oled_write_P(PSTR("Default\n"), false); + break; + case _CHAR: + oled_write_P(PSTR("Sp. Chars\n"), false); + break; + case _GAME: + oled_write_P(PSTR("Gaming\n"), false); + break; + case _MEDI: + oled_write_P(PSTR("Media Ctr\n"), false); + break; + case _NAVI: + oled_write_P(PSTR("Navigation\n"), false); + break; + case _SYMB: + oled_write_P(PSTR("Symbols\n"), false); + break; + case _NUMB: + oled_write_P(PSTR("Numpad\n"), false); + break; + case _FUNC: + oled_write_P(PSTR("Funct Keys\n"), false); + break; + case _MOUS: + oled_write_P(PSTR("Mouse Keys\n"), false); + break; + case _MUSI: + oled_write_P(PSTR("Music Mode\n"), false); + break; + default: + oled_write_P(PSTR("???\n"), false); + } + + // Line 2: Mod or info + switch (this_layer) { + // Show RGB mode as an overlay +#if defined RGBLIGHT_ENABLE + case _MEDI: + oled_write_P(PSTR("m:"), false); + itoa(rgblight_config.mode, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" h:"), false); + itoa(rgblight_config.hsv.h, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" s:"), false); + itoa(rgblight_config.hsv.s, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" v:"), false); + itoa(rgblight_config.hsv.v, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR("\n"), false); + break; +#elif defined RGB_MATRIX_ENABLE + case _MEDI: + oled_write_P(PSTR("m"), false); + itoa(rgb_matrix_config.mode, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" h"), false); + itoa(rgb_matrix_config.hsv.h, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" s"), false); + itoa(rgb_matrix_config.hsv.s, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR(" v"), false); + itoa(rgb_matrix_config.hsv.v, temp, 10); + oled_write(temp, false); + oled_write_P(PSTR("\n"), false); + break; +#endif + // Show the modifier if nothing else is doing anything + default: + oled_write_P((this_mod & MOD_MASK_SHIFT ) ? PSTR("Shft ") : PSTR(" "), false); + oled_write_P((this_mod & MOD_MASK_CTRL ) ? PSTR("Ctrl ") : PSTR(" "), false); + oled_write_P((this_mod & MOD_MASK_ALT ) ? PSTR("Alt" ) : PSTR(" "), false); + oled_write_P((this_mod & MOD_BIT(KC_RALT)) ? PSTR("G ") : PSTR(" "), false); + oled_write_P((this_mod & MOD_MASK_GUI ) ? PSTR("Meta ") : PSTR(" "), false); + oled_write_P(PSTR("\n"), false); + break; + } + + // Line 3: WPM + oled_write_P(PSTR("KM: Qwerty WPM: "), false); +#if defined WPM_ENABLE + itoa(get_current_wpm(), temp, 10); + oled_write(temp, false); +#else + oled_write_P(PSTR("N/A"), false); +#endif + oled_write_P(PSTR("\n"), false); + + // Line 4: Encoder states +#ifdef ENCODER_ENABLE + oled_write_P(PSTR("EN0:"), false); + oled_encoder_state_5char(0, this_layer); + oled_write_P(PSTR(" EN1:"), false); + oled_encoder_state_5char(1, this_layer); +#endif + oled_write_P(PSTR("\n"), false); + +} + +void oled_task_user(void) { + if (is_keyboard_master()) { + #if defined(KEYBOARD_kyria_rev1) + render_qmk_logo(); + #endif + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) + } else { + render_qmk_logo(); + } +} diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h new file mode 100644 index 00000000000..9c38d64078b --- /dev/null +++ b/users/bbaserdem/bb-oled.h @@ -0,0 +1,18 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" + +// Contain the main oled writer here +void oled_task_user(void); diff --git a/users/bbaserdem/bb-underglow.c b/users/bbaserdem/bb-underglow.c new file mode 100644 index 00000000000..937e3007591 --- /dev/null +++ b/users/bbaserdem/bb-underglow.c @@ -0,0 +1,113 @@ +/* +Copyright 2020 Batuhan Başerdem @bbaserdem +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 "bb-underglow.h" +/* UNDERGLOW IMPLEMENTATION + */ + +// Define the layer switching code + +// An empty layer on the base +const rgblight_segment_t PROGMEM bb_base_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 0, HSV_WHITE} +); +// Gaming layer is turquoise +const rgblight_segment_t PROGMEM bb_game_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_TURQUOISE} +); +// Character overlay is chartereuse +const rgblight_segment_t PROGMEM bb_char_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, RGBLED_NUM, HSV_CHARTREUSE} +); + +// Right-hand layers + +// Media layer is orange +const rgblight_segment_t PROGMEM bb_medi_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, 30, 255, 255 + } +); +// Navigation layer is green +const rgblight_segment_t PROGMEM bb_navi_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_GREEN} +); +// Symbol layer is purple +const rgblight_segment_t PROGMEM bb_symb_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_PURPLE} +); + +// Left-hand layers + +// Number layer is blue +const rgblight_segment_t PROGMEM bb_numb_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_CYAN} +); +// Function layer is red +const rgblight_segment_t PROGMEM bb_func_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_RED} +); +// Pointer layer is yellow +const rgblight_segment_t PROGMEM bb_mous_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_YELLOW} +); + +// Music playback layer is magenta +const rgblight_segment_t PROGMEM bb_musi_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, RGBLED_NUM, HSV_MAGENTA} +); + +const rgblight_segment_t* const PROGMEM bb_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + bb_base_layer, + bb_char_layer, + bb_game_layer, + bb_medi_layer, + bb_navi_layer, + bb_symb_layer, + bb_numb_layer, + bb_func_layer, + bb_mous_layer, + bb_musi_layer +); + +// Enable the LED switching layers +void keyboard_post_init_underglow(void) { + rgblight_layers = bb_rgb_layers; + // Default rgb mode is rainbow swirl; set this + rgblight_sethsv_noeeprom(100, 255, 255); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL + 0); +} + +// Set RGBLIGHT state depending on layer +layer_state_t layer_state_set_underglow(layer_state_t state) { + // Activate layers if on that region + rgblight_set_layer_state(_BASE, layer_state_cmp(state, _BASE)); + rgblight_set_layer_state(_GAME, layer_state_cmp(state, _GAME)); + rgblight_set_layer_state(_CHAR, layer_state_cmp(state, _CHAR)); + rgblight_set_layer_state(_MEDI, layer_state_cmp(state, _MEDI)); + rgblight_set_layer_state(_NAVI, layer_state_cmp(state, _NAVI)); + rgblight_set_layer_state(_SYMB, layer_state_cmp(state, _SYMB)); + rgblight_set_layer_state(_NUMB, layer_state_cmp(state, _NUMB)); + rgblight_set_layer_state(_FUNC, layer_state_cmp(state, _FUNC)); + rgblight_set_layer_state(_MOUS, layer_state_cmp(state, _MOUS)); + rgblight_set_layer_state(_MUSI, layer_state_cmp(state, _MUSI)); + // Return so other stuff can be done + return state; +} + +// Hook into shutdown code +void shutdown_underglow(void) { + // Make the LED's red on shutdown + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + rgblight_sethsv(HSV_PINK); +} diff --git a/users/bbaserdem/bb-underglow.h b/users/bbaserdem/bb-underglow.h new file mode 100644 index 00000000000..61b66efdf9e --- /dev/null +++ b/users/bbaserdem/bb-underglow.h @@ -0,0 +1,24 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* UNDERGLOW IMPLEMENTATION + */ + +// Used to initialize layer switching overlay +void keyboard_post_init_underglow(void); +// Used to change RGB underglow layers on keymap layer change +layer_state_t layer_state_set_underglow(layer_state_t state); +// Hook into shutdown to show effect on shutdown +void shutdown_underglow(void); diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c new file mode 100644 index 00000000000..f28342ddb5c --- /dev/null +++ b/users/bbaserdem/bbaserdem.c @@ -0,0 +1,224 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bbaserdem.h" +// Language imports +#include + +/*---------------------------*\ +|*-----KEYBOARD PRE INIT-----*| +\*---------------------------*/ +/* This code runs before anything is started. + * Good for early hardware setup + */ +__attribute__ ((weak)) void keyboard_pre_init_keymap(void) {} +__attribute__ ((weak)) void keyboard_pre_init_user(void) { + // Keymap specific stuff + keyboard_pre_init_keymap(); +} + +/*---------------------*\ +|*-----MATRIX INIT-----*| +\*---------------------*/ +/* This code runs once midway thru the firmware process. + * So far, sets the base layer and fixes unicode mode + */ +__attribute__ ((weak)) void matrix_init_keymap(void) {} +void matrix_init_user (void) { + // Keymap specific things + matrix_init_keymap(); +} + +/*----------------------------*\ +|*-----KEYBOARD POST INIT-----*| +\*----------------------------*/ +/* This code runs after anything is started. + * Good for late hardware setup, like setting up layer specifications + */ +__attribute__ ((weak)) void keyboard_post_init_keymap(void) {} +__attribute__ ((weak)) void keyboard_post_init_user(void) { + // Fix beginning base layer, in case some other firmware was flashed + // set_single_persistent_default_layer(_BASE); + + // Backlight LED + #ifdef BACKLIGHT_ENABLE + keyboard_post_init_backlight(); + #endif + + // RGB underglow + #ifdef RGBLIGHT_ENABLE + keyboard_post_init_underglow(); + #endif + + // Encoders + #ifdef ENCODER_ENABLE + keyboard_post_init_encoder(); + #endif + + // Unicode mode + #ifdef UNICODEMAP_ENABLE + set_unicode_input_mode(UC_LNX); + #endif + + // Keymap specific stuff + keyboard_post_init_keymap(); +} + +/*-----------------------*\ +|*-----EECONFIG INIT-----*| +\*-----------------------*/ +/* Default values to send to the eeprom on boot. + */ +__attribute__ ((weak)) void eeconfig_init_keymap(void) {} +void eeconfig_init_user(void) { + // Hook to keymap code + eeconfig_init_keymap(); +} + +/*------------------------*\ +|*-----PROCESS RECORD-----*| +\*------------------------*/ +/* Process record: custom keycodes to process here + * Allow also the following codes to hook here as well; + * Macro definitions + * Audio hooks + */ +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +bool process_record_audio(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +bool process_record_macro(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) +bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { + return true; +} +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // Return after running through all individual hooks + return + process_record_keymap(keycode, record) && + process_record_audio(keycode, record) && + process_record_encoder(keycode, record) && + process_record_macro(keycode, record); +} + +/*---------------------*\ +|*-----MATRIX SCAN-----*| +\*---------------------*/ +/* This code runs every frame + * I used to check for layer switching here, but layer state is better used. + * Try to not put anything here; as it runs hundreds time per second-ish + */ +__attribute__ ((weak)) void matrix_scan_keymap(void) { } +void matrix_scan_user (void) { + // Keymap specific scan function + matrix_scan_keymap(); +} + +/*---------------------*\ +|*-----LAYER STATE-----*| +\*---------------------*/ +/* This code runs after every layer change + * State represents the new layer state. + */ +__attribute__ ((weak)) +layer_state_t layer_state_set_keymap (layer_state_t state) { + return state; +} +layer_state_t layer_state_set_user(layer_state_t state) { + // Keymap layer state setting + state = layer_state_set_keymap(state); + // For underglow stuff + #ifdef RGBLIGHT_ENABLE + layer_state_set_underglow(state); + #endif + // Audio playback + #ifdef AUDIO_ENABLE + layer_state_set_audio(state); + #endif + + return state; +} + +/*-----------------------------*\ +|*-----DEFAULT LAYER STATE-----*| +\*-----------------------------*/ +/* This code runs after every time default base layer is changed + */ +__attribute__ ((weak)) +layer_state_t default_layer_state_set_keymap (layer_state_t state) { + return state; +} +layer_state_t default_layer_state_set_user(layer_state_t state) { + // Keymap level code + state = default_layer_state_set_keymap(state); + return state; +} + +/*------------------------*\ +|*-----LED SET KEYMAP-----*| +\*------------------------*/ +/* Code for LED indicators + * I'm not sure when exactly does this code run + */ +__attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) {} +void led_set_user(uint8_t usb_led) { + led_set_keymap(usb_led); +} + +/*-----------------*\ +|*-----SUSPEND-----*| +\*-----------------*/ +/* Suspend stuff here, mostly for the rgb lighting. + */ +__attribute__ ((weak)) void suspend_power_down_keymap (void) { } +void suspend_power_down_user(void) { + suspend_power_down_keymap(); + // RGB matrix sleep hook + #ifdef RGB_MATRIX_ENABLE + suspend_power_down_keylight(); + #endif +} +__attribute__ ((weak)) void suspend_wakeup_init_keymap (void) { } +void suspend_wakeup_init_user(void) { + suspend_wakeup_init_keymap(); + // RGB matrix sleep hook + #ifdef RGB_MATRIX_ENABLE + suspend_wakeup_init_keylight(); + #endif +} + +/*------------------*\ +|*-----SHUTDOWN-----*| +\*------------------*/ +/* Shutdown stuff here; for when entering bootmode. + */ +__attribute__ ((weak)) void shutdown_keymap (void) { } +void shutdown_user(void) { + // Underglow LED hook on boot + #ifdef RGBLIGHT_ENABLE + shutdown_underglow(); + #endif + // Perkey led hook on boot + #ifdef RGB_MATRIX_ENABLE + shutdown_keylight(); + #endif + // Keymap hooks + shutdown_keymap(); +} diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h new file mode 100644 index 00000000000..dc58ab79018 --- /dev/null +++ b/users/bbaserdem/bbaserdem.h @@ -0,0 +1,484 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include QMK_KEYBOARD_H + +/* Besides loading libraries and definitions, this file has my layout defs + * LAYOUTS: + * This file has a couple layouts I use; so that the general changes can be + * propagated by only editing this file. + */ + +// Macros to use, this has base level code so not affected by enabled features +#include "bb-macro.h" +// Audio from onboard speakers +#ifdef AUDIO_ENABLE + #include "bb-audio.h" +#endif +// Underglow using rgb LEDs +#ifdef RGBLIGHT_ENABLE + #include "bb-underglow.h" +#endif +// Keycap backlight using non-rgb LEDs +#ifdef BACKLIGHT_ENABLE + #include "bb-backlight.h" +#endif +// Keycap backlight using rgb LEDs +#ifdef RGB_MATRIX_ENABLE + #include "bb-keylight.h" +#endif +// Rotary encoder +#ifdef ENCODER_ENABLE + #include "bb-encoder.h" +#endif +// Oled screen +#ifdef OLED_DRIVER_ENABLE + #include "bb-oled.h" +#endif + +// Function definitions that can be accessed through specific keymaps +// Runs before all initialization +void keyboard_pre_init_keymap(void); +// For code that launches once midway through initialization +void matrix_init_keymap(void); +// For code that launches after initialization is finished. +void keyboard_post_init_keymap(void); +// This code also launches on boot; but used after eeprom is available to write +void eeconfig_init_keymap(void); +// These will be delegated to keymap specific stuff (weak definition) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +// This code runs on every tick +void matrix_scan_keymap(void); +// This code runs after every layer change +layer_state_t layer_state_set_keymap(layer_state_t state); +// This code runs when the default layer changes +layer_state_t default_layer_state_set_keymap (layer_state_t state); +// This code runs to set LED states +void led_set_keymap(uint8_t usb_led); +// For code that runs on suspend +void suspend_power_down_keymap(void); +void suspend_wakeup_init_keymap(void); +// For code that runs on powerdown +void shutdown_keymap(void); + +// Make it so that keymaps can use KEYMAP_SAFE_RANGE for custom keycodes +#if defined(KEYMAP_SAFE_RANGE) + #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else + #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + +// Custom macro keycode ranges +enum userspace_custom_keycodes { + // Safe stuff + BB_SAFE = PLACEHOLDER_SAFE_RANGE, + // Double entry macros + DBL_ANG, + DBL_PAR, + DBL_CBR, + DBL_BRC, + // Macro key + BB_PGPK, + // Unicode strings + #ifdef UNICODEMAP_ENABLE + BB_LENY, + BB_TABL, + TR_FLAG, + #endif + // Encoder buttons + #ifdef ENCODER_ENABLE + BB_ENC0, + BB_ENC1, + #endif + //use for keymap specific codes + KEYMAP_SAFE_RANGE +}; +// Mask these keycodes if required features are not enabled +#ifndef UNICODEMAP_ENABLE +#define BB_LENY KC_NO +#define BB_TABL KC_NO +#define TR_FLAG KC_NO +#endif +#ifndef ENCODER_ENABLE +#define BB_ENC0 KC_NO +#define BB_ENC1 KC_NO +#endif + +/// Enumerate of layers +enum userspace_layers { + _BASE = 0, // Base layer + _CHAR, // Characters layer + _GAME, // Game layer + _MEDI, // R3: Media layer + _NAVI, // R3: Navigation layer + _SYMB, // R1: Symbols layer + _NUMB, // L1: Numbers layer + _FUNC, // L2: Function keys layer + _MOUS, // L3: Mouse keys layer + _MUSI // Music overlay +}; + +// Use 7 wide characters for keymaps, to keep things aligned with 4 tabs +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// These defines allow multiple multi-parameter definitions to expand +// for these boards +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) +#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) +#define LAYOUT_ortho_3x10_wrapper(...) LAYOUT_ortho_3x10(__VA_ARGS__) +#define LAYOUT_split_3x6_3_wrapper(...) LAYOUT_split_3x6_3(__VA_ARGS__) +#define LAYOUT_split_3x5_3_wrapper(...) LAYOUT_split_3x5_3(__VA_ARGS__) + +// Masks +#define ___1___ _______ +#define ___2___ _______,_______ +#define ___3___ _______,_______,_______ +#define ___4___ _______,_______,_______,_______ +#define ___5___ _______,_______,_______,_______,_______ +#define ___6___ _______,_______,_______,_______,_______,_______ +#define xxx1xxx KC_NO +#define xxx2xxx KC_NO, KC_NO +#define xxx3xxx KC_NO, KC_NO, KC_NO +#define xxx4xxx KC_NO, KC_NO, KC_NO, KC_NO +#define xxx5xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define xxx6xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define xxx1xxx KC_NO +#define xxx3xxx KC_NO, KC_NO, KC_NO +#define xxx5xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO +#define xxx6xxx KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + +// Quick macros: in dvorak +#define BB_UNDO LCTL(KC_SLSH) // Ctrl + Z +#define BB_REDO LCTL(KC_T) // Ctrl + Y +#define BB_YANK LCTL(KC_I) // Ctrl + C +#define BB_CUT LCTL(KC_B) // Ctrl + X +#define BB_PSTE LCTL(KC_DOT) // Ctrl + V + +// Audio keys +#ifdef AUDIO_ENABLE +#define MU_REC KC_LCTL +#define MU_STOP KC_LALT +#define MU_PLAY KC_LGUI +#define MU_FAST KC_UP +#define MU_SLOW KC_DOWN +#define MU_MASK KC_A +#define BB_SND MU_ON +#ifdef TAP_DANCE_ENABLE +#define MU_TEMP TD(TD_AUDIO_TEMPO) +#else +#define MU_TEMP KC_DOWN +#endif +#else +#define MU_REC KC_NO +#define MU_STOP KC_NO +#define MU_PLAY KC_NO +#define MU_FAST KC_NO +#define MU_TEMP KC_NO +#define MU_SLOW KC_NO +#define MU_MASK KC_NO +#define BB_SND KC_MUTE +#endif + +// Unicode keys +#ifdef UNICODEMAP_ENABLE +#define TR_ACIR XP(LOW_A_CIRC, UPC_A_CIRC ) +#define TR_CCED XP(LOW_C_CEDI, UPC_C_CEDI ) +#define TR_GBRE XP(LOW_G_BREV, LOW_G_BREV ) +#define TR_ICIR XP(LOW_I_CIRC, LOW_I_CIRC ) +#define TR_I_NO XP(LOW_I_DOTL, LOW_I_DOTL ) +#define TR_IDOT XP(LOW_I_DOTT, LOW_I_DOTT ) +#define TR_ODIA XP(LOW_O_DIAE, LOW_O_DIAE ) +#define TR_SCED XP(LOW_S_CEDI, LOW_S_CEDI ) +#define TR_UCIR XP(LOW_U_CIRC, LOW_U_CIRC ) +#define TR_UDIA XP(LOW_U_DIAE, LOW_U_DIAE ) +#define GR_ALP XP(LOW_ALPHA, UPC_ALPHA ) +#define GR_BET XP(LOW_BETA, UPC_BETA ) +#define GR_GAM XP(LOW_GAMMA, UPC_GAMMA ) +#define GR_DEL XP(LOW_DELTA, UPC_DELTA ) +#define GR_EPS XP(LOW_EPSILON,UPC_EPSILON) +#define GR_ZET XP(LOW_ZETA, UPC_ZETA ) +#define GR_ETA XP(LOW_ETA, UPC_ETA ) +#define GR_THE XP(LOW_THETA, UPC_THETA ) +#define GR_IOT XP(LOW_IOTA, UPC_IOTA ) +#define GR_KAP XP(LOW_KAPPA, UPC_KAPPA ) +#define GR_LAM XP(LOW_LAMBDA, UPC_LAMBDA ) +#define GR_MU XP(LOW_MU, UPC_MU ) +#define GR_NU XP(LOW_NU, UPC_NU ) +#define GR_XI XP(LOW_XI, UPC_XI ) +#define GR_OMI XP(LOW_OMICRON,UPC_OMICRON) +#define GR_PI XP(LOW_PI, UPC_PI ) +#define GR_RHO XP(LOW_RHO, UPC_RHO ) +#define GR_SIG XP(LOW_SIGMA, UPC_SIGMA ) +#define GR_TAU XP(LOW_TAU, UPC_TAU ) +#define GR_UPS XP(LOW_UPSILON,UPC_UPSILON) +#define GR_PHI XP(LOW_PHI, UPC_PHI ) +#define GR_CHI XP(LOW_CHI, UPC_CHI ) +#define GR_PSI XP(LOW_PSI, UPC_PSI ) +#define GR_OME XP(LOW_OMEGA, UPC_OMEGA ) +#define BB_ELLI X(ELLIPSIS) +#define BB_PLNK X(PLANCK_CON) +#define BB_ANGS X(ANGSTROM) +#define BB_BITC X(BITCOIN) +#else +#define TR_ACIR KC_A +#define TR_CCED KC_C +#define TR_GBRE KC_G +#define TR_ICIR KC_I +#define TR_I_NO KC_I +#define TR_IDOT KC_I +#define TR_ODIA KC_O +#define TR_SCED KC_S +#define TR_UCIR KC_U +#define TR_UDIA KC_U +#define GR_ALP KC_NO +#define GR_BET KC_NO +#define GR_GAM KC_NO +#define GR_DEL KC_NO +#define GR_EPS KC_NO +#define GR_ZET KC_NO +#define GR_ETA KC_NO +#define GR_THE KC_NO +#define GR_IOT KC_NO +#define GR_KAP KC_NO +#define GR_LAM KC_NO +#define GR_MU KC_NO +#define GR_NU KC_NO +#define GR_XI KC_NO +#define GR_OMI KC_NO +#define GR_PI KC_NO +#define GR_RHO KC_NO +#define GR_SIG KC_NO +#define GR_TAU KC_NO +#define GR_UPS KC_NO +#define GR_PHI KC_NO +#define GR_CHI KC_NO +#define GR_PSI KC_NO +#define GR_OME KC_NO +#define BB_ELLI KC_NO +#define BB_PLNK KC_NO +#define BB_ANGS KC_NO +#define BB_BITC KC_NO +#endif + +// MOD-tap definitions +#define GUI_A MT(MOD_LGUI, KC_A) +#define ALT_S MT(MOD_LALT, KC_S) +#define CTRL_D MT(MOD_LCTL, KC_D) +#define SHIFT_F MT(MOD_LSFT, KC_F) +#define ALTGR_X MT(MOD_RALT, KC_X) +#define GUI_SCL MT(MOD_RGUI, KC_SCLN) +#define ALT_L MT(MOD_LALT, KC_L) +#define CTRL_K MT(MOD_LCTL, KC_K) +#define SHIFT_J MT(MOD_LSFT, KC_J) +#define ALTGR_D MT(MOD_RALT, KC_DOT) + +// Layer switches +#define MED_DEL LT(_MEDI, KC_DEL ) +#define NAV_TAB LT(_NAVI, KC_TAB ) +#define SYM_SPC LT(_SYMB, KC_SPC ) +#define NUM_ENT LT(_NUMB, KC_ENT ) +#define FUN_ESC LT(_FUNC, KC_ESC ) +#define MOU_BSP LT(_MOUS, KC_BSPC) + +// Layer switches +#define BB_CHAR OSL(_CHAR) +#define BB_GAME TG(_GAME) +#define BB_BIGS TD(TD_BIGSWITCH) + +/* Base layout; (shown in DVORAK) + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * │ ' " │ , < │ . > │ P │ Y │ / ? = + │ F │ G │ C │ R │ L │ + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * │ A │ O │ E │ U │ I │ \ | - _ │ D │ H │ T │ N │ S │ + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ + * │ ; : │ Q │ J │ K │ X │ ` ~ < > │ B │ M │ W │ V │ Z │ + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ + * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ + * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ + * The thing about this layout is that these will fit most boards I have. + */ +#define _BL1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _BR1_5_ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _BL2_5_ GUI_A, ALT_S, CTRL_D, SHIFT_F,KC_G +#define _BR2_5_ KC_H, SHIFT_J,CTRL_K, ALT_L, GUI_SCL +#define _BL3_5_ KC_Z, ALTGR_X,KC_C, KC_V, KC_B +#define _BR3_5_ KC_N, KC_M, KC_COMM,ALTGR_D,KC_SLSH +#define _BL4_3_ MED_DEL,NAV_TAB,SYM_SPC +#define _BR4_3_ NUM_ENT,FUN_ESC,MOU_BSP +// The extra line for the 6th (or 0th) row +#define _BL1_1_ KC_LBRC +#define _BR1_1_ KC_RBRC +#define _BL2_1_ KC_BSLS +#define _BR2_1_ KC_QUOT +#define _BL3_1_ KC_GRV +#define _BR3_1_ KC_NUBS + +/* + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * │ α │ ο │ ε │ ψ │ ι │ │ δ │ η │ τ │ ν │ σ │ + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * │ ₿ │ θ │ ℏ │ κ │ ξ │ │ β │ μ │ ω │ Å │ ζ │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │ Shf │ ... │ GPG │ │ │ │ Shf │ + * └─────┴─────┴─────┘ └─────┴─────┴─────┘ + * Extra characters layer + */ +#define _CL1_5_ TR_FLAG,BB_LENY,BB_TABL,GR_PI, GR_UPS +#define _CR1_5_ GR_PHI, GR_GAM, GR_CHI, GR_RHO, GR_LAM +#define _CL2_5_ GR_ALP, GR_OMI, GR_EPS, GR_PSI, GR_IOT +#define _CR2_5_ GR_DEL, GR_ETA, GR_TAU, GR_NU, GR_SIG +#define _CL3_5_ BB_BITC,GR_THE, BB_PLNK,GR_KAP, GR_XI +#define _CR3_5_ GR_BET, GR_MU, GR_OME, BB_ANGS,GR_ZET +#define _CL4_3_ KC_RSFT,BB_ELLI,BB_PGPK +#define _CR4_3_ XXXXXXX,XXXXXXX,KC_LSFT + +/* Game layer; just assume dvorak here + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ Q │ W │ E │ R │ T │ ` ~ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ A │ S │ D │ F │ G │ Tab + * ├─────┼─────┼─────┼─────┼─────┤ + * │ Z │ X │ C │ V │ B │Shift + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │Space│Enter│ Esc │ + * └─────┴─────┴─────┘ + */ +#define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _GA1_1_ KC_GRV +#define _GA2_5_ KC_A, KC_S, KC_D, KC_F, KC_G +#define _GA2_1_ KC_TAB +#define _GA3_5_ KC_Z, KC_X, KC_C, KC_V, KC_B +#define _GA3_1_ KC_LSFT +#define _GA4_3_ KC_SPC, KC_ENT, KC_ESC + +/* Media layer + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ Tog │ Mod │ Hue │ Sat │ Bri │ RGB + * ├─────┼─────┼─────┼─────┼─────┤ + * │Prev.│VolDn│VolUp│Next │ Mut │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ Tog │Brth.│ Val │RgbSp│Veloc│ Led + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Sink │ Tog │Music│ + * └─────┴─────┴─────┘ + */ +#define _ME1_5_ RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI +#define _ME2_5_ KC_MPRV,KC_VOLD,KC_VOLU,KC_MNXT,KC_MUTE +#define _ME3_5_ BL_TOGG,BL_BRTG,BL_STEP,RGB_SPD,VLK_TOG +#define _ME4_3_ KC_F13, KC_MPLY,MU_TOG + +/* Navigation layer + * ┌─────┬─────┬─────┬─────┬─────┐ + * │Redo │Paste│Yank │ Cut │PrScr│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │Undo │ < │ v │ ^ │ > │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ Ins │Home │PgDwn│PgUp │ End │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ + */ +#define _NA1_5_ BB_REDO,BB_PSTE,BB_YANK,BB_CUT, KC_PSCR +#define _NA2_5_ BB_UNDO,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT +#define _NA3_5_ KC_INS, KC_HOME,KC_PGDN,KC_PGUP,KC_END +#define _NA4_3_ KC_ENT, KC_ESC, KC_BSPC + +/* Symbols layer (in DVORAK) + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ ` ~ │ [ │ ] │ = + │CpsLk│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ / ? │ ( │ ) │ - _ │CharL│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ \ | │ { │ } │ < │ > │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ + */ +#define _SY1_5_ KC_GRV,KC_MINS,KC_EQL, KC_RBRC,BB_CHAR +#define _SY2_5_ KC_LBRC,KC_LPRN,KC_RPRN,KC_QUOT,KC_CAPS +#define _SY3_5_ KC_BSLS,KC_UNDS,KC_PLUS,KC_NUBS,LSFT(KC_NUBS) +#define _SY4_3_ KC_ENT, KC_ESC, KC_BSPC + +/* Numbers layer (in DVORAK) + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ , │ 7 & │ 8 * │ 9 ( │ 0 ) │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ . │ 4 $ │ 5 % │ 6 ^ │ - _ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ / ? │ 1 ! │ 2 @ │ 3 # │ = + │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ + */ +#define _NU1_5_ KC_W, KC_7, KC_8, KC_9, KC_0 +#define _NU2_5_ KC_E, KC_4, KC_5, KC_6, KC_QUOT +#define _NU3_5_ KC_LBRC,KC_1, KC_2, KC_3, KC_RBRC +#define _NU4_3_ KC_DEL, KC_TAB, KC_SPC + +/* Function layer + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ F01 │ F02 │ F03 │ F04 │RESET│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ F05 │ F06 │ F07 │ F08 │EEPRM│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ F09 │ F10 │ F11 │ F12 │GameL│ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ + */ +#define _FU1_5_ KC_F1, KC_F2, KC_F3, KC_F4, RESET +#define _FU2_5_ KC_F5, KC_F6, KC_F7, KC_F8, EEP_RST +#define _FU3_5_ KC_F9, KC_F10, KC_F11, KC_F12, BB_GAME +#define _FU4_3_ KC_DEL, KC_TAB, KC_SPC + +/* Mouse layer + * ┌─────┬─────┬─────┬─────┬─────┐ + * │Slow │Right│ Mid │ Lft │Fast │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ |<| │ |v| │ |^| │ |>| │ Bt4 │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ <<< │ vvv │ ^^^ │ >>> │ Bt5 │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ + */ +#define _MO1_5_ KC_ACL0,KC_BTN1,KC_BTN2,KC_BTN3,KC_ACL2 +#define _MO2_5_ KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,KC_BTN4 +#define _MO3_5_ KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,KC_BTN5 +#define _MO4_3_ KC_DEL, KC_TAB, KC_SPC + +/* Music layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ + * └───┴───┴───┼───┼───┼───┼───┼───┼───┼───┴───┴───┘ + * │Rec│Stp│Ply│Tmp│Mod│Off│ + * └───┴───┴───┴───┴───┴───┘ + */ +#define _MUL_3_ MU_REC, MU_STOP,MU_PLAY +#define _MUR_3_ MU_TEMP,MU_MOD, MU_TOG +#define _MU_01_ MU_MASK +#define _MU_02_ MU_MASK,MU_MASK +#define _MU_03_ MU_MASK,MU_MASK,MU_MASK +#define _MU_06_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK +#define _MU_08_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK +#define _MU_10_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK +#define _MU_12_ MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h new file mode 100644 index 00000000000..152042a2547 --- /dev/null +++ b/users/bbaserdem/config.h @@ -0,0 +1,139 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 + +/* CONFIG + * Common hardware configuration accross my boards + */ +// Space saving +#ifdef LOCKING_SUPPORT_ENABLE +# undef LOCKING_SUPPORT_ENABLE +#endif +#ifdef LOCKING_RESYNC_ENABLE +# undef LOCKING_RESYNC_ENABLE +#endif +#ifndef NO_DEBUG +#define NO_DEBUG +#endif + +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif +// Unicode entry mode +#ifdef UNICODEMAP_ENABLE + #define UNICODE_SELECTED_MODES UC_LNX + // Adapt the unicode entry mode to dvorak + #ifdef UNICODE_KEY_LNX + #undef UNICODE_KEY_LNX + #endif + #define UNICODE_KEY_LNX LCTL(LSFT(KC_F)) +#endif + +// Mousekey mode +#ifdef MOUSEKEY_ENABLE + #define MK_COMBINED +#endif + +// Tap-hold settings +#define TAPPING_TERM 200 +#define TAP_CODE_DELAY 20 +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define TAPPING_FORCE_HOLD + +// Encoder settings +#ifdef ENCODER_ENABLE + #define ENCODER_RESOLUTION 2 +#endif + +// Backlight settings +#ifdef BACKLIGHT_ENABLE + // Turn on breathing only if audio is not enabled, due to hardware stuff + #ifndef AUDIO_ENABLE + #define BACKLIGHT_BREATHING + #define BREATHING_PERIOD 5 + #endif +#endif + +// Enable RGB LED sleep mode +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #define RGB_DISABLE_WHEN_USB_SUSPENDED true +#endif + +// Audio definitions +#ifdef AUDIO_ENABLE + // Make findable songs as defaults + #ifdef HOROLOGY + #define STARTUP_SONG SONG(HOROLOGY) + #endif + #ifdef PEOPLE_VULTURES + #define GOODBYE_SONG SONG(PEOPLE_VULTURES) + #endif + #ifdef NONAGON_INFINITY + #define MUSIC_ON_SONG SONG(NONAGON_INFINITY) + #endif + #ifdef WAH_WAH + #define MUSIC_OFF_SONG SONG(WAH_WAH) + #endif + // Audio code expects these to be defined + #ifdef BIG_FIG_WASP + #define GAME_ON_SONG SONG(BIG_FIG_WASP) + #else + #define GAME_ON_SONG SONG(USSR_ANTHEM) + #endif + #ifdef POLYGONDWANALAND + #define GAME_OFF_SONG SONG(POLYGONDWANALAND) + #else + #define GAME_OFF_SONG SONG(NOCTURNE_OP_9_NO_1) + #endif +#endif + +// For underglow light +#ifdef RGBLIGHT_ENABLE + // Enable animations + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_TWINKLE + // Enable layer switching code + #define RGBLIGHT_LAYERS + #define RGBLIGHT_MAX_LAYERS 10 + #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF + // If these are not defined; just default to entire board for layer + #define RGBLIGHT_LEFT_BEG 0 + #define RGBLIGHT_LEFT_NUM RGBLED_NUM + #define RGBLIGHT_RIGHT_BEG 0 + #define RGBLIGHT_RIGHT_NUM RGBLED_NUM +#endif + +// For perkey leds +#ifdef RGB_MATRIX_ENABLE + // Start using this mode + #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON + #define RGB_MATRIX_STARTUP_HUE 100 + #define RGB_MATRIX_STARTUP_SAT 255 + #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS + // Some config options + #define RGB_MATRIX_KEYPRESSES + #define RGB_MATRIX_KEYRELEASES + // Disable some animation modes + #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT + #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL + #define DISABLE_RGB_MATRIX_BAND_RAINDROPS + #define DISABLE_RGB_MATRIX_BAND_JELLYBEAN_RAINDROPS + #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE + #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS + #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS + #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +#endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk new file mode 100644 index 00000000000..1f7129c53be --- /dev/null +++ b/users/bbaserdem/rules.mk @@ -0,0 +1,83 @@ +# Copyright 2019 Batuhan Başerdem @bbaserdem +# 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 . + +# Common compilation flags +EXTRAFLAGS += -flto # Used to make code smaller +LTO_ENABLE = yes + +# These should be enabled in all boards +MOUSEKEY_ENABLE = yes # Mouse emulation keys +EXTRAKEY_ENABLE = yes # OS signals like volume control +UNICODEMAP_ENABLE = yes # Used for unicode character emulation +KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general +TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold +VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed +WPM_ENABLE = no # Get WPM reports as you type + +# These should be disabled in all boards +BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed +CONSOLE_ENABLE = no # Allows console output with a command +COMMAND_ENABLE = no # Some bootmagic thing i dont use +SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. +NKRO_ENABLE = no # Default is 6KRO which is plenty +MIDI_ENABLE = no # Midi driver (untested) +UNICODE_ENABLE = no # We use unicodemap, not unicode +UCIS_ENABLE = no # We use unicodemap, not ucis +FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? +VARIABLE_TRACE = no # Allows debugging variables +API_SYSEX_ENABLE = no # Allows OS to send signals. + +# Manually configure these on each keyboard individually +# BLUETOOTH_ENABLE # For bluetooth +# AUDIO_ENABLE # Audio stuff +# BACKLIGHT_ENABLE # Switch LEDs +# RGBLIGHT_ENABLE # LED strip +# RGB_MATRIX_ENABLE # Per-key RGB LED +# ENCODER_ENABLE # Rotary encoder + +# Userspace code +SRC += bbaserdem.c + +# Macros +SRC += bb-macro.c + +# Audio code +ifeq ($(strip $(AUDIO_ENABLE)), yes) +SRC += bb-audio.c +endif + +# Rotary encoder stuff +ifeq ($(strip $(ENCODER_ENABLE)), yes) +SRC += bb-encoder.c +endif + +# Backlight code +ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) +SRC += bb-backlight.c +endif + +# RGB LED Underglow code +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) +SRC += bb-underglow.c +endif + +# OLED code +ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) +SRC += bb-oled.c +endif + +# RGB LED (Perkey) code +ifneq ($(strip $(RGB_MATRIX_ENABLE)),) + ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + SRC += bb-keylight.c + endif +endif From 85335ff6067d11d70bf36728d7ecb59e8148f7b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 31 Aug 2021 23:12:23 -0400 Subject: [PATCH 51/94] Changed up keymap a bit --- users/bbaserdem/bbaserdem.h | 139 +++++++++++++++++++++++++++--------- 1 file changed, 106 insertions(+), 33 deletions(-) diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index dc58ab79018..86932808103 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -298,16 +298,42 @@ enum userspace_layers { #define BB_GAME TG(_GAME) #define BB_BIGS TD(TD_BIGSWITCH) -/* Base layout; (shown in DVORAK) - * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * │ ' " │ , < │ . > │ P │ Y │ / ? = + │ F │ G │ C │ R │ L │ - * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * │ A │ O │ E │ U │ I │ \ | - _ │ D │ H │ T │ N │ S │ - * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * │ ; : │ Q │ J │ K │ X │ ` ~ < > │ B │ M │ W │ V │ Z │ - * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ - * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ - * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ +/* Depending on how the layouts change with language; the keys are shown as; + * ┌────────────────────────────────────────────────┐ + * │AltGr -none- Shift Shift+AltGr │ + * └────────────────────────────────────────────────┘ + * If there is an exclamation mark; it indicates that +/* Base layout + * QWERTY + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * [ { │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ ] } + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * \ | │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ' " + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ + * ` ~ │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ < > + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ + * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ + * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ + * DVORAK + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * / ? │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ = + + * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ + * \ | │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ - _ + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ + * ` ~ │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ < > + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ + * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ + * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ + * TURKISH F + * ! !┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * äq Qå│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │~w W + * !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ ! + * `x Xà│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│#ş Şǎ + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ + * ¬+ *±│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │|< >¦ + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ + * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ + * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * The thing about this layout is that these will fit most boards I have. */ #define _BL1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T @@ -326,7 +352,8 @@ enum userspace_layers { #define _BL3_1_ KC_GRV #define _BR3_1_ KC_NUBS -/* +/* Extra characters layer + * This is accessed using unicode; so IBus compatible apps only. * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ @@ -336,7 +363,7 @@ enum userspace_layers { * └─────┴─────┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │ Shf │ ... │ GPG │ │ │ │ Shf │ * └─────┴─────┴─────┘ └─────┴─────┴─────┘ - * Extra characters layer + * */ #define _CL1_5_ TR_FLAG,BB_LENY,BB_TABL,GR_PI, GR_UPS #define _CR1_5_ GR_PHI, GR_GAM, GR_CHI, GR_RHO, GR_LAM @@ -347,16 +374,17 @@ enum userspace_layers { #define _CL4_3_ KC_RSFT,BB_ELLI,BB_PGPK #define _CR4_3_ XXXXXXX,XXXXXXX,KC_LSFT -/* Game layer; just assume dvorak here - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ Q │ W │ E │ R │ T │ ` ~ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ A │ S │ D │ F │ G │ Tab - * ├─────┼─────┼─────┼─────┼─────┤ - * │ Z │ X │ C │ V │ B │Shift - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │Space│Enter│ Esc │ - * └─────┴─────┴─────┘ +/* Game layer + * This layer turns off the tap-hold keys for the left half. + * ┌─────┬─────┬─────┬─────┬─────┐ + * ` ~ │ Q │ W │ E │ R │ T │ + * ├─────┼─────┼─────┼─────┼─────┤ + * Tab │ A │ S │ D │ F │ G │ + * ├─────┼─────┼─────┼─────┼─────┤ + * Shift│ Z │ X │ C │ V │ B │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │Space│Enter│ Esc │ + * └─────┴─────┴─────┘ */ #define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T #define _GA1_1_ KC_GRV @@ -368,19 +396,19 @@ enum userspace_layers { /* Media layer * ┌─────┬─────┬─────┬─────┬─────┐ - * │ Tog │ Mod │ Hue │ Sat │ Bri │ RGB + * │ Tog │ Mod │ Hue │ Sat │ Bri │ RGB light control * ├─────┼─────┼─────┼─────┼─────┤ - * │Prev.│VolDn│VolUp│Next │ Mut │ + * │Media│Prev.│MuTog│MuStp│Next │ Media control * ├─────┼─────┼─────┼─────┼─────┤ - * │ Tog │Brth.│ Val │RgbSp│Veloc│ Led + * │Sink │Vol -│ Mut │Eject│Vol +│ Volume control * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Sink │ Tog │Music│ + * │ │Veloc│Music│ Feature control on keyboard * └─────┴─────┴─────┘ */ #define _ME1_5_ RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI -#define _ME2_5_ KC_MPRV,KC_VOLD,KC_VOLU,KC_MNXT,KC_MUTE -#define _ME3_5_ BL_TOGG,BL_BRTG,BL_STEP,RGB_SPD,VLK_TOG -#define _ME4_3_ KC_F13, KC_MPLY,MU_TOG +#define _ME2_5_ KC_MSEL,KC_MPRV,KC_MPLY,KC_MSTP,KC_MNXT +#define _ME3_5_ KC_F13, KC_VOLD,KC_MUTE,KC_EJCT,KC_VOLU +#define _ME4_3_ XXXXXXX,VLK_TOG,MU_TOG /* Navigation layer * ┌─────┬─────┬─────┬─────┬─────┐ @@ -398,23 +426,58 @@ enum userspace_layers { #define _NA3_5_ KC_INS, KC_HOME,KC_PGDN,KC_PGUP,KC_END #define _NA4_3_ KC_ENT, KC_ESC, KC_BSPC -/* Symbols layer (in DVORAK) +/* Symbols layer + * This layer has the central columns shifted for convenience + * QWERTY * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` ~ │ [ │ ] │ = + │CpsLk│ + * │ ` ~ │ - │ = │ ] } │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ - * │ / ? │ ( │ ) │ - _ │CharL│ + * │ [ { │ ( │ ) │ ' " │CapsL│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ \ | │ _ │ + │ < │ > │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ + * DVORAK + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ ` ~ │ [ │ ] │ = + │Char.│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ / ? │ ( │ ) │ - _ │CapsL│ * ├─────┼─────┼─────┼─────┼─────┤ * │ \ | │ { │ } │ < │ > │ * ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ + * Turkish F + * (AltGr is right on the central column, keys on main layer are omitted) + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ │ / \ │ - | │ │Char.│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │ ) ± │ = ° │ │CapsL│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │ ? ¿ │ _ │ < | │ > ¦ │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ */ #define _SY1_5_ KC_GRV,KC_MINS,KC_EQL, KC_RBRC,BB_CHAR #define _SY2_5_ KC_LBRC,KC_LPRN,KC_RPRN,KC_QUOT,KC_CAPS #define _SY3_5_ KC_BSLS,KC_UNDS,KC_PLUS,KC_NUBS,LSFT(KC_NUBS) #define _SY4_3_ KC_ENT, KC_ESC, KC_BSPC -/* Numbers layer (in DVORAK) +/* Numbers layer + * This layer contains numbers and the associated symbols. + * QWERTY + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ │ 7 & │ 8 * │ 9 ( │ 0 ) │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │ 4 $ │ 5 % │ 6 ^ │ ' " │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ [ { │ 1 ! │ 2 @ │ 3 # │ ] } │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ + * DVORAK * ┌─────┬─────┬─────┬─────┬─────┐ * │ , │ 7 & │ 8 * │ 9 ( │ 0 ) │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -424,6 +487,16 @@ enum userspace_layers { * └─────┴─────┴─────┼─────┼─────┼─────┐ * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ + * Turkish F + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ │{7 ' │[8 ( │]9 )±│}0 =°│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │¼4 $ │½5 %⅜│¾6 & │ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │¹1 !¡│²2 " │#3 ^³│ │ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ */ #define _NU1_5_ KC_W, KC_7, KC_8, KC_9, KC_0 #define _NU2_5_ KC_E, KC_4, KC_5, KC_6, KC_QUOT From d770996e7a449685332a2514c7115b9f07d935ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 14:56:47 -0400 Subject: [PATCH 52/94] Modified for ARM; cannot make the compilation detect OLED code. --- .../community/split_3x6_3/bbaserdem/README.md | 10 +++- .../community/split_3x6_3/bbaserdem/chconf.h | 10 ++++ .../community/split_3x6_3/bbaserdem/config.h | 45 +++++++++++++++-- .../community/split_3x6_3/bbaserdem/halconf.h | 8 +++ .../community/split_3x6_3/bbaserdem/keymap.c | 35 +++++++++---- .../community/split_3x6_3/bbaserdem/mcuconf.h | 9 ++++ .../community/split_3x6_3/bbaserdem/rules.mk | 23 +++++++-- users/bbaserdem/bb-audio.c | 2 +- users/bbaserdem/bb-encoder.c | 10 ++-- users/bbaserdem/bb-encoder.h | 8 +-- users/bbaserdem/bb-oled.c | 3 ++ users/bbaserdem/bbaserdem.h | 49 ++++++++++--------- users/bbaserdem/config.h | 4 ++ users/bbaserdem/rules.mk | 13 ++--- 14 files changed, 176 insertions(+), 53 deletions(-) create mode 100644 layouts/community/split_3x6_3/bbaserdem/chconf.h create mode 100644 layouts/community/split_3x6_3/bbaserdem/halconf.h create mode 100644 layouts/community/split_3x6_3/bbaserdem/mcuconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem/README.md index dd1d0074bd3..d89b13f83f6 100644 --- a/layouts/community/split_3x6_3/bbaserdem/README.md +++ b/layouts/community/split_3x6_3/bbaserdem/README.md @@ -5,6 +5,14 @@ Check out the [user readme](../../../../users/bbaserdem/README.md) for more info Using [this](https://github.com/ItsWaffIe/waffle_corne) Proton-C compatible PCB. +Applying the similar keymap to [@waffle](https://github.com/ItsWaffIe/waffle_corne); +using their `crkbd:rev1:arm` build. + ## Build -Build command: `CFLAGS="-Wno-error=deprecated" TBF` +Build commands; + +* For ARM: +`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` +* For ARM: +`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` diff --git a/layouts/community/split_3x6_3/bbaserdem/chconf.h b/layouts/community/split_3x6_3/bbaserdem/chconf.h new file mode 100644 index 00000000000..cf0e7204a52 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/chconf.h @@ -0,0 +1,10 @@ +// Code pertaining the ARM crkbd version +#ifdef KEYBOARD_crkbd_rev1 + #define CH_CFG_ST_RESOLUTION 16 + #define CH_CFG_ST_FREQUENCY 10000 + #if __has_include("platforms/chibios/common/configs/chconf.h") + # include_next "platforms/chibios/common/configs/chconf.h" + #else + # include_next "chconf.h" + #endif +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 165249ff9af..53d933ec6b9 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -17,8 +17,47 @@ along with this program. If not, see . // elite-c: dfu-split-left/right #define EE_HANDS -// Code pertaining to planck rev6 +// Code pertaining to Corne ARM; from Waffle's keymap #ifdef KEYBOARD_crkbd_rev1 - // Corne overrides - #include "../../../../keyboards/crkbd/rev1/config.h" + // Undo Eeprom handedness + #undef EE_HANDS + #include "config_common.h" + #undef PRODUCT + #undef MANUFACTURER + #define MANUFACTURER Waffles + #define PRODUCT Protorne Keyboard + #undef USE_I2C + #undef SSD1306OLED + #define MASTER_RIGHT + #ifdef AUDIO_ENABLE + #define AUDIO_PIN A5 + #endif + #define USE_SERIAL_PD2 + #ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 + #define RGB_MATRIX_SPLIT { 27, 27 } + #define SPLIT_TRANSPORT_MIRROR + #endif + #undef RGBLED_NUM + #define RGBLED_NUM 54 + #undef RGB_DI_PIN + #define RGB_DI_PIN B5 + #ifdef OLED_DRIVER_ENABLE + #define OLED_TIMEOUT 50000 + #define OLED_UPDATE_INTERVAL 100 + #endif + #define WS2812_PWM_DRIVER PWMD3 + #define WS2812_PWM_CHANNEL 3 + #define WS2812_PWM_PAL_MODE 2 + #define WS2812_DMA_STREAM STM32_DMA1_STREAM3 + #define WS2812_DMA_CHANNEL 3 + #undef SOFT_SERIAL_PIN + #define SOFT_SERIAL_PIN D3 + #define SERIAL_USART_SPEED 921600 + #define SERIAL_USART_DRIVER SD1 + #define SERIAL_USART_TX_PAL_MODE 7 + #define ENCODERS_PAD_A { B2 } + #define ENCODERS_PAD_B { B6 } + #define ENCODERS_PAD_A_RIGHT { B2 } + #define ENCODERS_PAD_B_RIGHT { B6 } #endif diff --git a/layouts/community/split_3x6_3/bbaserdem/halconf.h b/layouts/community/split_3x6_3/bbaserdem/halconf.h new file mode 100644 index 00000000000..61ebef685b5 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/halconf.h @@ -0,0 +1,8 @@ +#pragma once + +#ifdef KEYBOARD_crkbd_rev1 + // #define HAL_USE_DAC TRUE + #define HAL_USE_PWM TRUE + #define HAL_USE_SERIAL TRUE + #include_next +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index da6583c8b7f..18bb1d5154d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -27,55 +27,55 @@ along with this program. If not, see . const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( - _BL1_1_,_BL1_5_,_BR1_5_,_BR1_1_, + BB_ENC0,_BL1_5_,_BR1_5_,BB_ENC1, _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, _BL4_3_,_BR4_3_ ), [_CHAR] = LAYOUT_split_3x6_3_wrapper( - XXXXXXX,_CL1_5_,_CR1_5_,XXXXXXX, + _______,_CL1_5_,_CR1_5_,_______, XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, _CL4_3_,_CR4_3_ ), [_GAME] = LAYOUT_split_3x6_3_wrapper( - _GA1_1_,_GA1_5_,___6___, + _______,_GA1_5_,___6___, _GA2_1_,_GA2_5_,___6___, _GA3_1_,_GA3_5_,___6___, _GA4_3_,___3___ ), [_MEDI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_ME1_5_,xxx1xxx, + ___6___,_ME1_5_,_______, ___6___,_ME2_5_,xxx1xxx, ___6___,_ME3_5_,xxx1xxx, ___3___,_ME4_3_ ), [_NAVI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_NA1_5_,xxx1xxx, + ___6___,_NA1_5_,_______, ___6___,_NA2_5_,xxx1xxx, ___6___,_NA3_5_,xxx1xxx, ___3___,_NA4_3_ ), [_SYMB] = LAYOUT_split_3x6_3_wrapper( - ___6___,_SY1_5_,xxx1xxx, + ___6___,_SY1_5_,_______, ___6___,_SY2_5_,xxx1xxx, ___6___,_SY3_5_,xxx1xxx, ___3___,_SY4_3_ ), [_NUMB] = LAYOUT_split_3x6_3_wrapper( - xxx1xxx,_NU1_5_,___6___, + _______,_NU1_5_,___6___, xxx1xxx,_NU2_5_,___6___, xxx1xxx,_NU3_5_,___6___, _NU4_3_,___3___ ), [_FUNC] = LAYOUT_split_3x6_3_wrapper( - xxx1xxx,_FU1_5_,___6___, + _______,_FU1_5_,___6___, xxx1xxx,_FU2_5_,___6___, xxx1xxx,_FU3_5_,___6___, _FU4_3_,___3___ ), [_MOUS] = LAYOUT_split_3x6_3_wrapper( - xxx1xxx,_MO1_5_,___6___, + _______,_MO1_5_,___6___, xxx1xxx,_MO2_5_,___6___, xxx1xxx,_MO3_5_,___6___, _MO4_3_,___3___ @@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // crkbd #if defined(KEYBOARD_crkbd_rev1) -/* This is left-right for planck light indicator light +/* This is left-right for CRKBD indicator light * - The LED 42 is for spacebar specifically, leave it out of the matrix * - This is how it looks like * ┌──┬──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┬──┐ @@ -117,6 +117,21 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_set_color(i, red, green, blue); } } + +#ifdef AUDIO_ENABLE +// Audio requires some fixes to work on @waffle's PCB +// ! Copy pasted from ItsWaffle's waffle fork +void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this + // Set audio pins to analog mode + palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); + palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); +} + +void keyboard_post_init_keymap(void) { + // Enable OPAMP1 as A5 → B1 follower + OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; +} +#endif // End of audio specific stuff // End of differentiations #endif diff --git a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h new file mode 100644 index 00000000000..c13e6f6774a --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h @@ -0,0 +1,9 @@ +#pragma once + +#ifdef KEYBOARD_crkbd_rev1 + #include_next + #undef STM32_PWM_USE_TIM3 + #define STM32_PWM_USE_TIM3 TRUE + #undef STM32_SERIAL_USE_USART1 + #define STM32_SERIAL_USE_USART1 TRUE +#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 347894c26b1..59396b158af 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -10,9 +10,26 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# Corne keyboard +# Corne keyboard; with ARM ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) - RGBLIGHT_ENABLE = no + # My usual features + AUDIO_ENABLE = yes #breaks reset keycode + BACKLIGHT_ENABLE = no + ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes - OLED_DRIVER_ENABLE = no + RGBLIGHT_ENABLE = no + OLED_DRIVER_ENABLE = yes + # Proton C related stuff + MCU = STM32F303 + COVERT_TO_PROTON_C = yes + DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox + AUDIO_DRIVER = dac_basic + SERIAL_DRIVER = usart + WS2812_DRIVER = pwm + VIA_ENABLE = yes + SPLIT_KEYBOARD = yes + OLED_DRIVER = SSD1306 # Enables the use of OLED displays + # POINTING_DEVICE_ENABLE = no + # SRC += pimoroni_trackball.c + QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 endif diff --git a/users/bbaserdem/bb-audio.c b/users/bbaserdem/bb-audio.c index 700e58bd1f8..9b90a63cc46 100644 --- a/users/bbaserdem/bb-audio.c +++ b/users/bbaserdem/bb-audio.c @@ -22,7 +22,7 @@ float tone_game_intro[][2] = GAME_ON_SONG; float tone_game_outro[][2] = GAME_OFF_SONG; // Audio playing when layer changes -uint32_t layer_state_set_audio(uint32_t state) { +layer_state_t layer_state_set_audio(layer_state_t state) { // Get this layer static bool prev_game = false; diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index a4a1e4c3453..9d858e43023 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -12,6 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-encoder.h" +#ifdef VELOCIKEY_ENABLE + #include "velocikey.h" +#endif /* ROTARY ENCODER * This contains my general rotary encoder code * Encoders each have a list of different modes they can be in. @@ -38,8 +41,8 @@ void keyboard_post_init_encoder(void) { } // Oled string printing for given layer and index; ONLY for OLED -#ifdef OLED_DRIVER_ENABLE void oled_encoder_state_5char(uint8_t index, uint8_t layer) { +#ifdef OLED_DRIVER_ENABLE // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled @@ -124,11 +127,11 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { } break; } -} #endif +} // Encoder scroll functionality -void encoder_update_user(uint8_t index, bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) @@ -322,6 +325,7 @@ void encoder_update_user(uint8_t index, bool clockwise) { } break; } + return true; } void encoder_click_action(uint8_t index) { diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 3a064c6295e..4b668eb1fa0 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -13,13 +13,15 @@ along with this program. If not, see . */ #pragma once #include "bbaserdem.h" +#ifdef VELOCIKEY_ENABLE + #include "velocikey.h" +#endif // Code to print to OLED -#ifdef ENCODER_ENABLE void oled_encoder_state_5char(uint8_t index, uint8_t layer); -#endif + // Hook to encoder stuff -void encoder_update_user(uint8_t index, bool clockwise); +bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed bool process_record_encoder(uint16_t keycode, keyrecord_t *record); // Initializing the encoder array diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 89208f363f3..b1e3206816a 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -12,6 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-oled.h" +#ifdef ENCODER_ENABLE + #include "bb-encoder.h" +#endif //#include /* ROTARY ENCODER * This contains my general rotary encoder code diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 86932808103..6f48c876bb7 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -13,6 +13,7 @@ along with this program. If not, see . */ #pragma once #include QMK_KEYBOARD_H +#include "quantum.h" /* Besides loading libraries and definitions, this file has my layout defs * LAYOUTS: @@ -302,35 +303,37 @@ enum userspace_layers { * ┌────────────────────────────────────────────────┐ * │AltGr -none- Shift Shift+AltGr │ * └────────────────────────────────────────────────┘ - * If there is an exclamation mark; it indicates that + * If there is an exclamation mark; it indicates a dead key on this map. + */ + /* Base layout * QWERTY * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * [ { │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ ] } + * ` ~ │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ < > * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * \ | │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ' " + * [ { │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ] } * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * ` ~ │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ < > + * \ | │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ ' " * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * DVORAK * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * / ? │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ = + + * ` ~ │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ < > * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * \ | │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ - _ + * / ? │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ = + * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * ` ~ │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ < > + * \ | │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ - _ * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * TURKISH F - * ! !┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * äq Qå│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │~w W - * !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ ! - * `x Xà│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│#ş Şǎ - * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ - * ¬+ *±│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │|< >¦ + * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ + * ¬+ *±│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │|< >¦ + * ! !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ + * äq Qå│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│~w W + * !├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ ! + * `x Xà│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │#ş Şǎ * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ @@ -345,12 +348,12 @@ enum userspace_layers { #define _BL4_3_ MED_DEL,NAV_TAB,SYM_SPC #define _BR4_3_ NUM_ENT,FUN_ESC,MOU_BSP // The extra line for the 6th (or 0th) row -#define _BL1_1_ KC_LBRC -#define _BR1_1_ KC_RBRC -#define _BL2_1_ KC_BSLS -#define _BR2_1_ KC_QUOT -#define _BL3_1_ KC_GRV -#define _BR3_1_ KC_NUBS +#define _BL1_1_ KC_GRV +#define _BR1_1_ KC_NUBS +#define _BL2_1_ KC_LBRC +#define _BR2_1_ KC_RBRC +#define _BL3_1_ KC_BSLS +#define _BR3_1_ KC_QUOT /* Extra characters layer * This is accessed using unicode; so IBus compatible apps only. @@ -377,7 +380,7 @@ enum userspace_layers { /* Game layer * This layer turns off the tap-hold keys for the left half. * ┌─────┬─────┬─────┬─────┬─────┐ - * ` ~ │ Q │ W │ E │ R │ T │ + * │ Q │ W │ E │ R │ T │ * ├─────┼─────┼─────┼─────┼─────┤ * Tab │ A │ S │ D │ F │ G │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -387,7 +390,7 @@ enum userspace_layers { * └─────┴─────┴─────┘ */ #define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _GA1_1_ KC_GRV +#define _GA1_1_ _______ #define _GA2_5_ KC_A, KC_S, KC_D, KC_F, KC_G #define _GA2_1_ KC_TAB #define _GA3_5_ KC_Z, KC_X, KC_C, KC_V, KC_B @@ -449,9 +452,9 @@ enum userspace_layers { * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ * Turkish F - * (AltGr is right on the central column, keys on main layer are omitted) + * (AltGr is right on the central column, red. keys on main layer are omitted) * ┌─────┬─────┬─────┬─────┬─────┐ - * │ │ / \ │ - | │ │Char.│ + * │¬+ *±│ / \ │ - | │ │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ * │ │ ) ± │ = ° │ │CapsL│ * ├─────┼─────┼─────┼─────┼─────┤ diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 152042a2547..2bd268f592e 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -136,4 +136,8 @@ along with this program. If not, see . #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS + // Some more config options + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 // Set maximum brightness + #define RGB_MATRIX_KEYPRESSES // React to key presses + #define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects #endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 1f7129c53be..4bb0651207c 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -20,15 +20,16 @@ EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold -VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed -WPM_ENABLE = no # Get WPM reports as you type +VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed +WPM_ENABLE = yes # Get WPM reports as you type +NKRO_ENABLE = yes # Default is 6KRO which is plenty +BLUETOOTH_ENABLE = no # For bluetooth # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed CONSOLE_ENABLE = no # Allows console output with a command COMMAND_ENABLE = no # Some bootmagic thing i dont use SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. -NKRO_ENABLE = no # Default is 6KRO which is plenty MIDI_ENABLE = no # Midi driver (untested) UNICODE_ENABLE = no # We use unicodemap, not unicode UCIS_ENABLE = no # We use unicodemap, not ucis @@ -37,12 +38,12 @@ VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. # Manually configure these on each keyboard individually -# BLUETOOTH_ENABLE # For bluetooth # AUDIO_ENABLE # Audio stuff # BACKLIGHT_ENABLE # Switch LEDs -# RGBLIGHT_ENABLE # LED strip -# RGB_MATRIX_ENABLE # Per-key RGB LED # ENCODER_ENABLE # Rotary encoder +# RGB_MATRIX_ENABLE # Per-key RGB LED +# RGBLIGHT_ENABLE # LED strip; compacter code for small leds. +# OLED_DRIVER_ENABLE # For OLED # Userspace code SRC += bbaserdem.c From e5d62e7374e58d1c36de6dd1f07597f2c640ce41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 16:52:13 -0400 Subject: [PATCH 53/94] Trying things --- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 6 ++++-- layouts/community/split_3x6_3/bbaserdem/keymap.c | 2 ++ layouts/community/split_3x6_3/bbaserdem/ssd1306.c | 0 users/bbaserdem/bb-oled.c | 1 + users/bbaserdem/bbaserdem.h | 2 +- users/bbaserdem/config.h | 4 +++- users/bbaserdem/rules.mk | 8 ++++---- 7 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 layouts/community/split_3x6_3/bbaserdem/ssd1306.c diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index f54821f1834..0bf40d8a1b9 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -12,8 +12,10 @@ # Kyria hardware ifneq (,$(findstring kyria/rev1,$(KEYBOARD))) - OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays + AUDIO_ENABLE = no # No audio capability + BACKLIGHT_ENABLE = no # No diode leds on the board ENCODER_ENABLE = yes # Enables the use of one or more encoders + RGB_MATRIX_ENABLE = no # No perkey leds on the board RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much - RGB_MATRIX_ENABLE = no + OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 18bb1d5154d..439e74ae000 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -12,7 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include QMK_KEYBOARD_H +#include "quantum.h" #include "bbaserdem.h" + /* F layout * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ * │+ *│ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ diff --git a/layouts/community/split_3x6_3/bbaserdem/ssd1306.c b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c new file mode 100644 index 00000000000..e69de29bb2d diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index b1e3206816a..9c976afc30d 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -15,6 +15,7 @@ along with this program. If not, see . #ifdef ENCODER_ENABLE #include "bb-encoder.h" #endif + //#include /* ROTARY ENCODER * This contains my general rotary encoder code diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 6f48c876bb7..2d58d73e682 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -12,8 +12,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #pragma once -#include QMK_KEYBOARD_H #include "quantum.h" +#include QMK_KEYBOARD_H /* Besides loading libraries and definitions, this file has my layout defs * LAYOUTS: diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 2bd268f592e..c8e30349727 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -68,7 +68,9 @@ along with this program. If not, see . // Enable RGB LED sleep mode #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - #define RGB_DISABLE_WHEN_USB_SUSPENDED true + #ifndef RGB_DISABLE_WHEN_USB_SUSPENDED + #define RGB_DISABLE_WHEN_USB_SUSPENDED true + #endif #endif // Audio definitions diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 4bb0651207c..334edd93325 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -18,12 +18,8 @@ LTO_ENABLE = yes MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation -KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold -VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed WPM_ENABLE = yes # Get WPM reports as you type -NKRO_ENABLE = yes # Default is 6KRO which is plenty -BLUETOOTH_ENABLE = no # For bluetooth # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -36,6 +32,10 @@ UCIS_ENABLE = no # We use unicodemap, not ucis FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. +BLUETOOTH_ENABLE = no # For bluetooth +NKRO_ENABLE = no # Default is 6KRO which is plenty +VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed +KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From f4a3b707ddde49ab34b39b205548ab58b74aff53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 17:41:55 -0400 Subject: [PATCH 54/94] Revert "Trying things" This reverts commit f3829baa06b31e2eeb238195c921d1271731e8b6. --- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 6 ++---- layouts/community/split_3x6_3/bbaserdem/keymap.c | 2 -- layouts/community/split_3x6_3/bbaserdem/ssd1306.c | 0 users/bbaserdem/bb-oled.c | 1 - users/bbaserdem/bbaserdem.h | 2 +- users/bbaserdem/config.h | 4 +--- users/bbaserdem/rules.mk | 8 ++++---- 7 files changed, 8 insertions(+), 15 deletions(-) delete mode 100644 layouts/community/split_3x6_3/bbaserdem/ssd1306.c diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index 0bf40d8a1b9..f54821f1834 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -12,10 +12,8 @@ # Kyria hardware ifneq (,$(findstring kyria/rev1,$(KEYBOARD))) - AUDIO_ENABLE = no # No audio capability - BACKLIGHT_ENABLE = no # No diode leds on the board + OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays ENCODER_ENABLE = yes # Enables the use of one or more encoders - RGB_MATRIX_ENABLE = no # No perkey leds on the board RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much - OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays + RGB_MATRIX_ENABLE = no endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 439e74ae000..18bb1d5154d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -12,9 +12,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include QMK_KEYBOARD_H -#include "quantum.h" #include "bbaserdem.h" - /* F layout * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ * │+ *│ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ diff --git a/layouts/community/split_3x6_3/bbaserdem/ssd1306.c b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 9c976afc30d..b1e3206816a 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -15,7 +15,6 @@ along with this program. If not, see . #ifdef ENCODER_ENABLE #include "bb-encoder.h" #endif - //#include /* ROTARY ENCODER * This contains my general rotary encoder code diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 2d58d73e682..6f48c876bb7 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -12,8 +12,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #pragma once -#include "quantum.h" #include QMK_KEYBOARD_H +#include "quantum.h" /* Besides loading libraries and definitions, this file has my layout defs * LAYOUTS: diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index c8e30349727..2bd268f592e 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -68,9 +68,7 @@ along with this program. If not, see . // Enable RGB LED sleep mode #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - #ifndef RGB_DISABLE_WHEN_USB_SUSPENDED - #define RGB_DISABLE_WHEN_USB_SUSPENDED true - #endif + #define RGB_DISABLE_WHEN_USB_SUSPENDED true #endif // Audio definitions diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 334edd93325..4bb0651207c 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -18,8 +18,12 @@ LTO_ENABLE = yes MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation +KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold +VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed WPM_ENABLE = yes # Get WPM reports as you type +NKRO_ENABLE = yes # Default is 6KRO which is plenty +BLUETOOTH_ENABLE = no # For bluetooth # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -32,10 +36,6 @@ UCIS_ENABLE = no # We use unicodemap, not ucis FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. -BLUETOOTH_ENABLE = no # For bluetooth -NKRO_ENABLE = no # Default is 6KRO which is plenty -VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed -KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 99a804d4ea4ed7747ba36c930d1caf1c6d46e67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 17:46:01 -0400 Subject: [PATCH 55/94] Fixed up the encoder code; and reframed kyria layout to be in future layout folder. --- .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 22 ++++++++++--------- users/bbaserdem/bb-encoder.c | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 8d1358bae8f..1336e8594a5 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -13,6 +13,8 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H #include "bbaserdem.h" +#define LAYOUT_split_3x6_5_wrapper(...) LAYOUT_split_3x6_5(__VA_ARGS__) + /* F layout * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ * │ W │ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ @@ -26,61 +28,61 @@ along with this program. If not, see . */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_wrapper( + [_BASE] = LAYOUT_split_3x6_5_wrapper( _BL1_1_,_BL1_5_, _BR1_5_,_BR1_1_, _BL2_1_,_BL2_5_, _BR2_5_,_BR2_1_, _BL3_1_,_BL3_5_,xxx2xxx,xxx2xxx,_BR3_5_,_BR3_1_, BB_ENC0, _BL4_3_,KC_LSFT,KC_RSFT,_BR4_3_,BB_ENC1 ), - [_CHAR] = LAYOUT_wrapper( + [_CHAR] = LAYOUT_split_3x6_5_wrapper( XXXXXXX,_CL1_5_, _CR1_5_,XXXXXXX, XXXXXXX,_CL2_5_, _CR2_5_,XXXXXXX, XXXXXXX,_CL3_5_,xxx2xxx,xxx2xxx,_CR3_5_,XXXXXXX, _______,_CL4_3_,_______,_______,_CR4_3_,_______ ), - [_GAME] = LAYOUT_wrapper( + [_GAME] = LAYOUT_split_3x6_5_wrapper( _GA1_1_,_GA1_5_, ___5___,___1___, _GA2_1_,_GA2_5_, ___5___,___1___, _GA3_1_,_GA3_5_,xxx2xxx,xxx2xxx,___5___,___1___, _______,_GA4_3_,_______,_______,___3___,_______ ), - [_MEDI] = LAYOUT_wrapper( + [_MEDI] = LAYOUT_split_3x6_5_wrapper( ___1___,___5___, _ME1_5_,___1___, ___1___,___5___, _ME2_5_,___1___, ___1___,___5___,xxx2xxx,xxx2xxx,_ME3_5_,___1___, ___1___,___3___,_______,_______,_ME4_3_,___1___ ), - [_NAVI] = LAYOUT_wrapper( + [_NAVI] = LAYOUT_split_3x6_5_wrapper( ___1___,___5___, _NA1_5_,___1___, ___1___,___5___, _NA2_5_,___1___, ___1___,___5___,xxx2xxx,xxx2xxx,_NA3_5_,___1___, ___1___,___3___,_______,_______,_NA4_3_,___1___ ), - [_SYMB] = LAYOUT_wrapper( + [_SYMB] = LAYOUT_split_3x6_5_wrapper( ___1___,___5___, _SY1_5_,___1___, ___1___,___5___, _SY2_5_,___1___, ___1___,___5___,xxx2xxx,xxx2xxx,_SY3_5_,___1___, ___1___,___3___,_______,_______,_SY4_3_,___1___ ), - [_NUMB] = LAYOUT_wrapper( + [_NUMB] = LAYOUT_split_3x6_5_wrapper( ___1___,_NU1_5_, ___5___,___1___, ___1___,_NU2_5_, ___5___,___1___, ___1___,_NU3_5_,xxx2xxx,xxx2xxx,___5___,___1___, ___1___,_NU4_3_,_______,_______,___3___,___1___ ), - [_FUNC] = LAYOUT_wrapper( + [_FUNC] = LAYOUT_split_3x6_5_wrapper( ___1___,_FU1_5_, ___5___,___1___, ___1___,_FU2_5_, ___5___,___1___, ___1___,_FU3_5_,xxx2xxx,xxx2xxx,___5___,___1___, ___1___,_FU4_3_,_______,_______,___3___,___1___ ), - [_MOUS] = LAYOUT_wrapper( + [_MOUS] = LAYOUT_split_3x6_5_wrapper( ___1___,_MO1_5_, ___5___,___1___, ___1___,_MO2_5_, ___5___,___1___, ___1___,_MO3_5_,xxx2xxx,xxx2xxx,___5___,___1___, ___1___,_MO4_3_,_______,_______,___3___,___1___ ), - [_MUSI] = LAYOUT_wrapper( + [_MUSI] = LAYOUT_split_3x6_5_wrapper( _MU_12_,_MU_12_, _MU_06_,xxx2xxx,xxx2xxx,_MU_06_, MU_TOG,_MUL_3_,_MU_02_,_MUR_3_,___1___ diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 9d858e43023..93c8772486b 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -325,7 +325,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } break; } - return true; + return false; } void encoder_click_action(uint8_t index) { From 35730558eee53bd7aba0458b4ab4a20dff58ff13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 18:28:56 -0400 Subject: [PATCH 56/94] Fixing some build issues --- .../splitkb/kyria/keymaps/bbaserdem/README.md | 2 +- keyboards/splitkb/kyria/keymaps/bbaserdem/config.h | 2 +- keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c | 14 +++++++------- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 2 +- users/bbaserdem/bb-encoder.c | 5 +++-- users/bbaserdem/bb-encoder.h | 4 +++- users/bbaserdem/bb-oled.c | 5 +---- users/bbaserdem/bb-oled.h | 1 - users/bbaserdem/rules.mk | 8 ++++---- 9 files changed, 21 insertions(+), 22 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md b/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md index c05221c6a7a..e68d053a092 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md @@ -1,5 +1,5 @@ This file contains my Kyria board layout. -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. +Check out the [user readme](../../../../../users/bbaserdem/README.md) for more info. # Kyria diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h index 85d33f61cab..f8e1e307edd 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -14,7 +14,7 @@ along with this program. If not, see . #pragma once // Kyria specific -#ifdef KEYBOARD_kyria_rev1 +#ifdef KEYBOARD_splitkb_kyria_rev1 // Split definition; use the following to flash; // pro-micro: avrdude-split-left/right // elite-c: dfu-split-left/right diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 1336e8594a5..3723067076a 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -90,11 +90,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; // Kyria specific code -#ifdef KEYBOARD_kyria_rev1 -// Rotate the display on kyria -#ifdef OLED_DRIVER_ENABLE -oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; -} -#endif //OLED_DRIVER_ENABLE +#ifdef KEYBOARD_splitkb_kyria_rev1 + // Rotate the display on kyria + #ifdef OLED_DRIVER_ENABLE + oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; + } + #endif //OLED_DRIVER_ENABLE #endif //KEYBOARD_kyria_rev1 diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index f54821f1834..d3f17932997 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -11,7 +11,7 @@ # along with this program. If not, see . # Kyria hardware -ifneq (,$(findstring kyria/rev1,$(KEYBOARD))) +ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays ENCODER_ENABLE = yes # Enables the use of one or more encoders RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 93c8772486b..287a264c821 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -15,6 +15,7 @@ along with this program. If not, see . #ifdef VELOCIKEY_ENABLE #include "velocikey.h" #endif + /* ROTARY ENCODER * This contains my general rotary encoder code * Encoders each have a list of different modes they can be in. @@ -41,8 +42,8 @@ void keyboard_post_init_encoder(void) { } // Oled string printing for given layer and index; ONLY for OLED -void oled_encoder_state_5char(uint8_t index, uint8_t layer) { #ifdef OLED_DRIVER_ENABLE +void oled_encoder_state_5char(uint8_t index, uint8_t layer) { // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled @@ -127,8 +128,8 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { } break; } -#endif } +#endif // Encoder scroll functionality bool encoder_update_user(uint8_t index, bool clockwise) { diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 4b668eb1fa0..7d680e02862 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -18,7 +18,9 @@ along with this program. If not, see . #endif // Code to print to OLED -void oled_encoder_state_5char(uint8_t index, uint8_t layer); +#ifdef OLED_DRIVER_ENABLE + void oled_encoder_state_5char(uint8_t index, uint8_t layer); +#endif // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index b1e3206816a..a5386def8b6 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -12,9 +12,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-oled.h" -#ifdef ENCODER_ENABLE - #include "bb-encoder.h" -#endif //#include /* ROTARY ENCODER * This contains my general rotary encoder code @@ -155,7 +152,7 @@ static void render_status(void) { void oled_task_user(void) { if (is_keyboard_master()) { - #if defined(KEYBOARD_kyria_rev1) + #if defined(KEYBOARD_splitkb_kyria_rev1) render_qmk_logo(); #endif render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index 9c38d64078b..5b8a97efc3b 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -13,6 +13,5 @@ along with this program. If not, see . */ #pragma once #include "bbaserdem.h" - // Contain the main oled writer here void oled_task_user(void); diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 4bb0651207c..334edd93325 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -18,12 +18,8 @@ LTO_ENABLE = yes MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation -KEY_LOCK_ENABLE = yes # Allows locking any key. Not used in general TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold -VELOCIKEY_ENABLE = yes # Modulate speed effects with typing speed WPM_ENABLE = yes # Get WPM reports as you type -NKRO_ENABLE = yes # Default is 6KRO which is plenty -BLUETOOTH_ENABLE = no # For bluetooth # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -36,6 +32,10 @@ UCIS_ENABLE = no # We use unicodemap, not ucis FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. +BLUETOOTH_ENABLE = no # For bluetooth +NKRO_ENABLE = no # Default is 6KRO which is plenty +VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed +KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 94b7663ddf97bb9b4e932800caaa10206b9622da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 20:01:15 -0400 Subject: [PATCH 57/94] Fixed kyria code to operational --- users/bbaserdem/bb-encoder.c | 49 +++++++++++++++--------------- users/bbaserdem/bb-encoder.h | 7 ++--- users/bbaserdem/bb-oled.c | 59 ++++++++++++++++++++++-------------- users/bbaserdem/rules.mk | 2 +- 4 files changed, 64 insertions(+), 53 deletions(-) diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 287a264c821..401e5a2345f 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-encoder.h" +#include #ifdef VELOCIKEY_ENABLE #include "velocikey.h" #endif @@ -41,9 +42,8 @@ void keyboard_post_init_encoder(void) { reset_encoder_state(); } -// Oled string printing for given layer and index; ONLY for OLED -#ifdef OLED_DRIVER_ENABLE -void oled_encoder_state_5char(uint8_t index, uint8_t layer) { +// Oled string printing for given layer and index +void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled @@ -51,22 +51,22 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { case _MEDI: switch (encoder_state[index].rgb) { case 0: - oled_write_P(PSTR(" mode"), false); + strcpy(buffer, " mode"); break; case 1: - oled_write_P(PSTR(" hue "), false); + strcpy(buffer, " hue "); break; case 2: - oled_write_P(PSTR("satur"), false); + strcpy(buffer, "satur"); break; case 3: - oled_write_P(PSTR("value"), false); + strcpy(buffer, "value"); break; case 4: - oled_write_P(PSTR("speed"), false); + strcpy(buffer, "speed"); break; default: - oled_write_P(PSTR("!oob!"), false); + strcpy(buffer, "!oob!"); break; } break; @@ -76,19 +76,19 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { case _MOUS: switch (encoder_state[index].point) { case 0: - oled_write_P(PSTR("m.lat"), false); + strcpy(buffer, "m.lat"); break; case 1: - oled_write_P(PSTR("m.ver"), false); + strcpy(buffer, "m.ver"); break; case 2: - oled_write_P(PSTR("s.ver"), false); + strcpy(buffer, "s.ver"); break; case 3: - oled_write_P(PSTR("s.lat"), false); + strcpy(buffer, "s.lat"); break; default: - oled_write_P(PSTR("!oob!"), false); + strcpy(buffer, "!oob!"); break; } break; @@ -96,40 +96,39 @@ void oled_encoder_state_5char(uint8_t index, uint8_t layer) { default: switch (encoder_state[index].base) { case 0: - oled_write_P(PSTR(" volm"), false); + strcpy(buffer, " volm"); break; case 1: - oled_write_P(PSTR(" song"), false); + strcpy(buffer, " song"); break; case 2: - oled_write_P(PSTR(" sink"), false); + strcpy(buffer, " sink"); break; case 3: - oled_write_P(PSTR("s.vol"), false); + strcpy(buffer, "s.vol"); break; case 4: - oled_write_P(PSTR(" src "), false); + strcpy(buffer, " src "); break; case 5: - oled_write_P(PSTR(" L/R "), false); + strcpy(buffer, " L/R "); break; case 6: - oled_write_P(PSTR(" U/D "), false); + strcpy(buffer, " U/D "); break; case 7: - oled_write_P(PSTR("pgU/D"), false); + strcpy(buffer, "pgU/D"); break; case 8: - oled_write_P(PSTR(" del "), false); + strcpy(buffer, " del "); break; default: - oled_write_P(PSTR("!oob!"), false); + strcpy(buffer, "!oob!"); break; } break; } } -#endif // Encoder scroll functionality bool encoder_update_user(uint8_t index, bool clockwise) { diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 7d680e02862..792555ab916 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -17,11 +17,8 @@ along with this program. If not, see . #include "velocikey.h" #endif -// Code to print to OLED -#ifdef OLED_DRIVER_ENABLE - void oled_encoder_state_5char(uint8_t index, uint8_t layer); -#endif - +// Code to print status string +void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index a5386def8b6..dea42770f94 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -12,7 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-oled.h" -//#include +#ifdef ENCODER_ENABLE + #include "bb-encoder.h" +#endif /* ROTARY ENCODER * This contains my general rotary encoder code * Encoders each have a list of different modes they can be in. @@ -41,8 +43,19 @@ static void render_status(void) { // Function to print state information uint8_t this_layer = get_highest_layer(layer_state); uint8_t this_mod = get_mods(); + // Temporary variable for RGB + #if defined RGBLIGHT_ENABLE + static char rgb_temp4[4] = {0}; + #elif defined RGB_MATRIX_ENABLE + static char rgb_temp4[4] = {0}; + #endif + // Temporary variable for WPM string #if defined WPM_ENABLE - static char temp[4] = {0}; + static char wpm_temp4[4] = {0}; + #endif + // Temporary variable for encoder state + #if defined ENCODER_ENABLE + static char encoder_temp6[6] = {0}; #endif // Line 1: Layer State @@ -88,33 +101,33 @@ static void render_status(void) { #if defined RGBLIGHT_ENABLE case _MEDI: oled_write_P(PSTR("m:"), false); - itoa(rgblight_config.mode, temp, 10); - oled_write(temp, false); + itoa(rgblight_config.mode, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" h:"), false); - itoa(rgblight_config.hsv.h, temp, 10); - oled_write(temp, false); + itoa(rgblight_config.hsv.h, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" s:"), false); - itoa(rgblight_config.hsv.s, temp, 10); - oled_write(temp, false); + itoa(rgblight_config.hsv.s, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" v:"), false); - itoa(rgblight_config.hsv.v, temp, 10); - oled_write(temp, false); + itoa(rgblight_config.hsv.v, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR("\n"), false); break; #elif defined RGB_MATRIX_ENABLE case _MEDI: oled_write_P(PSTR("m"), false); - itoa(rgb_matrix_config.mode, temp, 10); - oled_write(temp, false); + itoa(rgb_matrix_config.mode, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" h"), false); - itoa(rgb_matrix_config.hsv.h, temp, 10); - oled_write(temp, false); + itoa(rgb_matrix_config.hsv.h, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" s"), false); - itoa(rgb_matrix_config.hsv.s, temp, 10); - oled_write(temp, false); + itoa(rgb_matrix_config.hsv.s, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR(" v"), false); - itoa(rgb_matrix_config.hsv.v, temp, 10); - oled_write(temp, false); + itoa(rgb_matrix_config.hsv.v, rgb_temp4, 10); + oled_write(rgb_temp4, false); oled_write_P(PSTR("\n"), false); break; #endif @@ -132,8 +145,8 @@ static void render_status(void) { // Line 3: WPM oled_write_P(PSTR("KM: Qwerty WPM: "), false); #if defined WPM_ENABLE - itoa(get_current_wpm(), temp, 10); - oled_write(temp, false); + itoa(get_current_wpm(), wpm_temp4, 10); + oled_write(wpm_temp4, false); #else oled_write_P(PSTR("N/A"), false); #endif @@ -142,9 +155,11 @@ static void render_status(void) { // Line 4: Encoder states #ifdef ENCODER_ENABLE oled_write_P(PSTR("EN0:"), false); - oled_encoder_state_5char(0, this_layer); + encoder_state_string(0, this_layer, encoder_temp6); + oled_write(encoder_temp6, false); oled_write_P(PSTR(" EN1:"), false); - oled_encoder_state_5char(1, this_layer); + encoder_state_string(1, this_layer, encoder_temp6); + oled_write(encoder_temp6, false); #endif oled_write_P(PSTR("\n"), false); diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 334edd93325..62ca1b7d14a 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -19,7 +19,6 @@ MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold -WPM_ENABLE = yes # Get WPM reports as you type # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -36,6 +35,7 @@ BLUETOOTH_ENABLE = no # For bluetooth NKRO_ENABLE = no # Default is 6KRO which is plenty VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general +WPM_ENABLE = no # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 5249512387b8bf9a9b9dfba5e9afed7ed5fbfa9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 1 Sep 2021 23:06:05 -0400 Subject: [PATCH 58/94] Moved layout a bit to ease non-confusion in build; and brought up to date. --- .../{bbaserdem => bbaserdem2}/README.md | 0 .../{bbaserdem => bbaserdem2}/config.h | 0 .../{bbaserdem => bbaserdem2}/keymap.c | 0 .../{bbaserdem => bbaserdem2}/rules.mk | 0 .../community/split_3x6_3/bbaserdem/config.h | 49 ++++++++++++------- .../community/split_3x6_3/bbaserdem/keymap.c | 23 +++------ .../community/split_3x6_3/bbaserdem/rules.mk | 12 ++--- 7 files changed, 45 insertions(+), 39 deletions(-) rename layouts/community/split_3x5_3/{bbaserdem => bbaserdem2}/README.md (100%) rename layouts/community/split_3x5_3/{bbaserdem => bbaserdem2}/config.h (100%) rename layouts/community/split_3x5_3/{bbaserdem => bbaserdem2}/keymap.c (100%) rename layouts/community/split_3x5_3/{bbaserdem => bbaserdem2}/rules.mk (100%) diff --git a/layouts/community/split_3x5_3/bbaserdem/README.md b/layouts/community/split_3x5_3/bbaserdem2/README.md similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem/README.md rename to layouts/community/split_3x5_3/bbaserdem2/README.md diff --git a/layouts/community/split_3x5_3/bbaserdem/config.h b/layouts/community/split_3x5_3/bbaserdem2/config.h similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem/config.h rename to layouts/community/split_3x5_3/bbaserdem2/config.h diff --git a/layouts/community/split_3x5_3/bbaserdem/keymap.c b/layouts/community/split_3x5_3/bbaserdem2/keymap.c similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem/keymap.c rename to layouts/community/split_3x5_3/bbaserdem2/keymap.c diff --git a/layouts/community/split_3x5_3/bbaserdem/rules.mk b/layouts/community/split_3x5_3/bbaserdem2/rules.mk similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem/rules.mk rename to layouts/community/split_3x5_3/bbaserdem2/rules.mk diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 53d933ec6b9..6dc05feb111 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -15,47 +15,62 @@ along with this program. If not, see . // Split definition; use the following to flash; // pro-micro: avrdude-split-left/right // elite-c: dfu-split-left/right -#define EE_HANDS // Code pertaining to Corne ARM; from Waffle's keymap #ifdef KEYBOARD_crkbd_rev1 - // Undo Eeprom handedness - #undef EE_HANDS #include "config_common.h" + + // Undo Eeprom handedness, try EE_HANDS later + #undef EE_HANDS + #define MASTER_RIGHT + + // Rebrand the PCB #undef PRODUCT #undef MANUFACTURER #define MANUFACTURER Waffles #define PRODUCT Protorne Keyboard + + // Remove OLED definitions? #undef USE_I2C #undef SSD1306OLED - #define MASTER_RIGHT + + // Audio output on pin A5 (actualy will be output on B1) #ifdef AUDIO_ENABLE #define AUDIO_PIN A5 #endif + + // Communication has to be serial on ARM #define USE_SERIAL_PD2 - #ifdef RGB_MATRIX_ENABLE - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 - #define RGB_MATRIX_SPLIT { 27, 27 } - #define SPLIT_TRANSPORT_MIRROR - #endif + // Set serial pin as D3 for sure + #undef SOFT_SERIAL_PIN + #define SOFT_SERIAL_PIN D3 + #define SERIAL_USART_SPEED 921600 + #define SERIAL_USART_DRIVER SD1 + #define SERIAL_USART_TX_PAL_MODE 7 + + // Things to make RGB matrix work #undef RGBLED_NUM #define RGBLED_NUM 54 #undef RGB_DI_PIN #define RGB_DI_PIN B5 - #ifdef OLED_DRIVER_ENABLE - #define OLED_TIMEOUT 50000 - #define OLED_UPDATE_INTERVAL 100 + #ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 + #define RGB_MATRIX_SPLIT { 27, 27 } + #define SPLIT_TRANSPORT_MIRROR #endif #define WS2812_PWM_DRIVER PWMD3 #define WS2812_PWM_CHANNEL 3 #define WS2812_PWM_PAL_MODE 2 #define WS2812_DMA_STREAM STM32_DMA1_STREAM3 #define WS2812_DMA_CHANNEL 3 - #undef SOFT_SERIAL_PIN - #define SOFT_SERIAL_PIN D3 - #define SERIAL_USART_SPEED 921600 - #define SERIAL_USART_DRIVER SD1 - #define SERIAL_USART_TX_PAL_MODE 7 + + // OLED related code + #ifdef OLED_DRIVER_ENABLE + #define OLED_TIMEOUT 50000 + #define OLED_UPDATE_INTERVAL 100 + #endif + + // Encoder definitons #define ENCODERS_PAD_A { B2 } #define ENCODERS_PAD_B { B6 } #define ENCODERS_PAD_A_RIGHT { B2 } diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 18bb1d5154d..48bcb92fbfb 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -13,17 +13,6 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H #include "bbaserdem.h" -/* F layout - * ┌───┬───┬───┬───┬───┬───┐        ┌───┬───┬───┬───┬───┬───┐ - * │+ *│ F │ G │ Ğ │ I │ O │        │ D │ R │ N │ H │ P │ Q │ - * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ - * │ X │ A │ S │ D │ F │ G │        │ T │ K │ M │ L │ Y │ Ş │ - * ├───┼───┼───┼───┼───┼───┤        ├───┼───┼───┼───┼───┼───┤ - * │< >│ J │ Ö │ V │ C │ Ç │        │ Z │ S │ B │. :│, ;│ W │ - * └───┴───┴───┴───┼───┼───┼───┐ ┌───┼───┼───┼───┴───┴───┴───┘ - *                │Tab│Ent│Esc│ │Del│Spc│Bsp│ - *                └───┴───┴───┘ └───┴───┴───┘ - */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -117,8 +106,14 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_set_color(i, red, green, blue); } } +// End of differentiations +#endif +// End of code for the RGB_MATRIX setup +#endif #ifdef AUDIO_ENABLE +// crkbd +#if defined(KEYBOARD_crkbd_rev1) // Audio requires some fixes to work on @waffle's PCB // ! Copy pasted from ItsWaffle's waffle fork void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this @@ -131,9 +126,5 @@ void keyboard_post_init_keymap(void) { // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } +#endif // End of differentiations #endif // End of audio specific stuff -// End of differentiations -#endif - -// End of code for the RGB_MATRIX setup -#endif diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 59396b158af..7cff38959cc 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -13,23 +13,23 @@ # Corne keyboard; with ARM ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # My usual features - AUDIO_ENABLE = yes #breaks reset keycode + AUDIO_ENABLE = yes BACKLIGHT_ENABLE = no ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes RGBLIGHT_ENABLE = no OLED_DRIVER_ENABLE = yes + OLED_DRIVER = SSD1306 + # Features that take otherwise too much space + WPM_ENABLE = yes + NKRO_ENABLE = yes # Proton C related stuff MCU = STM32F303 COVERT_TO_PROTON_C = yes DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox - AUDIO_DRIVER = dac_basic SERIAL_DRIVER = usart WS2812_DRIVER = pwm - VIA_ENABLE = yes + AUDIO_DRIVER = dac_basic SPLIT_KEYBOARD = yes - OLED_DRIVER = SSD1306 # Enables the use of OLED displays - # POINTING_DEVICE_ENABLE = no - # SRC += pimoroni_trackball.c QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 endif From 3a750a800fd185431c4ad7f6a629173df54d8cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Thu, 2 Sep 2021 01:24:50 -0400 Subject: [PATCH 59/94] Removed oled_driver_enable keyword. --- .../splitkb/kyria/keymaps/bbaserdem/config.h | 26 +++---------------- .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 2 +- .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 12 ++++++--- keyboards/splitkb/kyria/rev1/rules.mk | 1 - .../community/split_3x5_3/bbaserdem2/rules.mk | 2 +- .../community/split_3x6_3/bbaserdem/keymap.c | 3 +++ .../community/split_3x6_3/bbaserdem/rules.mk | 9 ++++--- users/bbaserdem/bbaserdem.h | 2 +- users/bbaserdem/rules.mk | 16 +++++++----- 9 files changed, 32 insertions(+), 41 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h index f8e1e307edd..3e873660a82 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -21,33 +21,13 @@ along with this program. If not, see . #define ENCODER_DIRECTION_FLIP #define EE_HANDS - #ifdef OLED_DRIVER_ENABLE + // Make sure kyria has bigger oled display + #ifdef OLED_ENABLE #define OLED_DISPLAY_128X64 #endif - #ifdef RGBLIGHT_ENABLE - #ifdef RGBLIGHT_LEFT_BEG - #undef RGBLIGHT_LEFT_BEG - #endif - #define RGBLIGHT_LEFT_BEG 0 - - #ifdef RGBLIGHT_LEFT_NUM - #undef RGBLIGHT_LEFT_NUM - #endif - #define RGBLIGHT_LEFT_NUM 10 - - #ifdef RGBLIGHT_RIGHT_BEG - #undef RGBLIGHT_RIGHT_BEG - #endif - #define RGBLIGHT_RIGHT_BEG 10 - - #ifdef RGBLIGHT_RIGHT_NUM - #undef RGBLIGHT_RIGHT_NUM - #endif - #define RGBLIGHT_RIGHT_NUM 10 - #endif - // If you are using an Elite C rev3 on the slave side, uncomment the lines below: + // However; this causes the halves to be unresponsive // #define SPLIT_USB_DETECT // #define NO_USB_STARTUP_CHECK #endif diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 3723067076a..8e6ac4d60a3 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -92,7 +92,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Kyria specific code #ifdef KEYBOARD_splitkb_kyria_rev1 // Rotate the display on kyria - #ifdef OLED_DRIVER_ENABLE + #ifdef OLED_ENABLE oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index d3f17932997..1d1db3aaa14 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -12,8 +12,14 @@ # Kyria hardware ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) - OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays - ENCODER_ENABLE = yes # Enables the use of one or more encoders - RGBLIGHT_ENABLE = no # Disable keyboard RGB underglow; can't see much + # Elective features + AUDIO_ENABLE = no + BACKLIGHT_ENABLE = no + ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = no + OLED_ENABLE = yes + # Space savers + NKRO_ENABLE = no + VELOCIKEY_ENABLE = no + WPM_ENABLE = no endif diff --git a/keyboards/splitkb/kyria/rev1/rules.mk b/keyboards/splitkb/kyria/rev1/rules.mk index cc2cbba604b..e7d6763fcd3 100644 --- a/keyboards/splitkb/kyria/rev1/rules.mk +++ b/keyboards/splitkb/kyria/rev1/rules.mk @@ -1,5 +1,4 @@ OLED_ENABLE = yes -OLED_DRIVER = SSD1306 # Enables the use of OLED displays ENCODER_ENABLE = yes # ENables the use of one or more encoders RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow RGB_MATRIX_ENABLE = no # Enable keyboard RGB matrix (do not use together with RGBLIGHT_ENABLE) diff --git a/layouts/community/split_3x5_3/bbaserdem2/rules.mk b/layouts/community/split_3x5_3/bbaserdem2/rules.mk index 347894c26b1..1d557030589 100644 --- a/layouts/community/split_3x5_3/bbaserdem2/rules.mk +++ b/layouts/community/split_3x5_3/bbaserdem2/rules.mk @@ -14,5 +14,5 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) RGBLIGHT_ENABLE = no RGB_MATRIX_ENABLE = yes - OLED_DRIVER_ENABLE = no + OLED_ENABLE = no endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 48bcb92fbfb..3b54abd75e3 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -13,6 +13,7 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H #include "bbaserdem.h" +#include const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -116,6 +117,7 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { #if defined(KEYBOARD_crkbd_rev1) // Audio requires some fixes to work on @waffle's PCB // ! Copy pasted from ItsWaffle's waffle fork +/* void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this // Set audio pins to analog mode palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); @@ -126,5 +128,6 @@ void keyboard_post_init_keymap(void) { // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } +*/ #endif // End of differentiations #endif // End of audio specific stuff diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 7cff38959cc..b005e5609fb 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -18,18 +18,19 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes RGBLIGHT_ENABLE = no - OLED_DRIVER_ENABLE = yes - OLED_DRIVER = SSD1306 + OLED_ENABLE = yes # Features that take otherwise too much space WPM_ENABLE = yes NKRO_ENABLE = yes # Proton C related stuff MCU = STM32F303 - COVERT_TO_PROTON_C = yes - DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox + BOARD = QMK_PROTON_C + # Config SERIAL_DRIVER = usart WS2812_DRIVER = pwm AUDIO_DRIVER = dac_basic SPLIT_KEYBOARD = yes + # These are from waffle + DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 endif diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 6f48c876bb7..32879e0bff7 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -44,7 +44,7 @@ along with this program. If not, see . #include "bb-encoder.h" #endif // Oled screen -#ifdef OLED_DRIVER_ENABLE +#ifdef OLED_ENABLE #include "bb-oled.h" #endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 62ca1b7d14a..d8039609097 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -32,18 +32,20 @@ FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables API_SYSEX_ENABLE = no # Allows OS to send signals. BLUETOOTH_ENABLE = no # For bluetooth -NKRO_ENABLE = no # Default is 6KRO which is plenty -VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general -WPM_ENABLE = no # Get WPM reports as you type +RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead + +# These features can be enabled on ARM boards; disabled for AVR due to space +# NKRO_ENABLE = no # Default is 6KRO which is plenty +# VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed +# WPM_ENABLE = no # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff # BACKLIGHT_ENABLE # Switch LEDs # ENCODER_ENABLE # Rotary encoder -# RGB_MATRIX_ENABLE # Per-key RGB LED -# RGBLIGHT_ENABLE # LED strip; compacter code for small leds. -# OLED_DRIVER_ENABLE # For OLED +# RGB_MATRIX_ENABLE # RGB LEDs +# OLED_ENABLE # For OLED # Userspace code SRC += bbaserdem.c @@ -72,7 +74,7 @@ SRC += bb-underglow.c endif # OLED code -ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes) +ifeq ($(strip $(OLED_ENABLE)), yes) SRC += bb-oled.c endif From d63bd1244c5961ff3e98818b412ca2cd3fd171a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Thu, 2 Sep 2021 11:44:36 -0400 Subject: [PATCH 60/94] Fixed the audio fix working --- layouts/community/split_3x6_3/bbaserdem/config.h | 3 +-- layouts/community/split_3x6_3/bbaserdem/keymap.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 6dc05feb111..471539c8ea2 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -21,8 +21,7 @@ along with this program. If not, see . #include "config_common.h" // Undo Eeprom handedness, try EE_HANDS later - #undef EE_HANDS - #define MASTER_RIGHT + #define EE_HANDS // Rebrand the PCB #undef PRODUCT diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 3b54abd75e3..7980b1ba802 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -13,6 +13,7 @@ along with this program. If not, see . */ #include QMK_KEYBOARD_H #include "bbaserdem.h" +#include "quantum.h" #include const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -117,7 +118,6 @@ void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { #if defined(KEYBOARD_crkbd_rev1) // Audio requires some fixes to work on @waffle's PCB // ! Copy pasted from ItsWaffle's waffle fork -/* void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this // Set audio pins to analog mode palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); @@ -128,6 +128,5 @@ void keyboard_post_init_keymap(void) { // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } -*/ #endif // End of differentiations #endif // End of audio specific stuff From 26181abeafc8ed675eeded60b4facbe52b4a7d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 3 Sep 2021 11:29:25 -0400 Subject: [PATCH 61/94] Changed up rules a bit --- layouts/community/split_3x6_3/bbaserdem/rules.mk | 1 + users/bbaserdem/rules.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index b005e5609fb..3d01525966c 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -33,4 +33,5 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # These are from waffle DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 + LTO_ENABLE = no endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index d8039609097..55686ea2cdf 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -12,7 +12,7 @@ # Common compilation flags EXTRAFLAGS += -flto # Used to make code smaller -LTO_ENABLE = yes +#LTO_ENABLE = yes # These should be enabled in all boards MOUSEKEY_ENABLE = yes # Mouse emulation keys From 8b7700dd27ed4f11dd02c72fd87d1d861165aae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sun, 5 Sep 2021 19:35:33 -0400 Subject: [PATCH 62/94] Made some changes. --- layouts/community/split_3x6_3/bbaserdem/rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 3d01525966c..e9fca701978 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -25,6 +25,7 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # Proton C related stuff MCU = STM32F303 BOARD = QMK_PROTON_C + BOOTLOADER = stm32-dfu # Config SERIAL_DRIVER = usart WS2812_DRIVER = pwm From 39070855a00cd088d0e260cceb9a81e103607b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 6 Sep 2021 19:35:57 -0400 Subject: [PATCH 63/94] Reformatted some code and cleaned stuff up. --- .../community/ortho_3x10/bbaserdem/keymap.c | 11 +- .../community/ortho_3x10/bbaserdem/rules.mk | 3 +- .../community/ortho_4x12/bbaserdem/README.md | 23 +-- .../community/ortho_4x12/bbaserdem/config.h | 88 ---------- .../community/ortho_4x12/bbaserdem/keymap.c | 113 ------------ .../community/ortho_4x12/bbaserdem/rules.mk | 7 +- .../community/ortho_5x15/bbaserdem/README.md | 16 -- .../community/ortho_5x15/bbaserdem/config.h | 15 -- .../community/ortho_5x15/bbaserdem/keymap.c | 128 -------------- .../community/ortho_5x15/bbaserdem/rules.mk | 17 -- .../community/split_3x6_3/bbaserdem/rules.mk | 1 - users/bbaserdem/README.md | 163 +++++------------- users/bbaserdem/bb-encoder.c | 70 +------- users/bbaserdem/bb-keylight.c | 78 --------- users/bbaserdem/bb-macro.c | 51 ------ users/bbaserdem/bb-macro.h | 1 - users/bbaserdem/bb-oled.c | 28 +-- users/bbaserdem/bb-rgb.c | 104 +++++++++++ users/bbaserdem/{bb-keylight.h => bb-rgb.h} | 5 +- users/bbaserdem/bbaserdem.h | 1 - users/bbaserdem/rules.mk | 17 +- 21 files changed, 177 insertions(+), 763 deletions(-) delete mode 100644 layouts/community/ortho_5x15/bbaserdem/README.md delete mode 100644 layouts/community/ortho_5x15/bbaserdem/config.h delete mode 100644 layouts/community/ortho_5x15/bbaserdem/keymap.c delete mode 100755 layouts/community/ortho_5x15/bbaserdem/rules.mk delete mode 100644 users/bbaserdem/bb-keylight.c create mode 100644 users/bbaserdem/bb-rgb.c rename users/bbaserdem/{bb-keylight.h => bb-rgb.h} (80%) diff --git a/layouts/community/ortho_3x10/bbaserdem/keymap.c b/layouts/community/ortho_3x10/bbaserdem/keymap.c index c094f526a4f..cf81f7036ef 100644 --- a/layouts/community/ortho_3x10/bbaserdem/keymap.c +++ b/layouts/community/ortho_3x10/bbaserdem/keymap.c @@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -// Music map, guitar like +// Music map, guitar like. #ifdef AUDIO_ENABLE const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_3x10( 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, @@ -92,8 +92,7 @@ led_config_t g_led_config = { }, { // LED Index to Flag 2,2,2,2,2,2,2,2,2,2 }}; -// Disable -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { } -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { } -#endif -#endif +// Disable layer switching +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {return true;} +#endif // Gherkin +#endif // RGB Matrix diff --git a/layouts/community/ortho_3x10/bbaserdem/rules.mk b/layouts/community/ortho_3x10/bbaserdem/rules.mk index 0c668c221bf..7232f6969d5 100755 --- a/layouts/community/ortho_3x10/bbaserdem/rules.mk +++ b/layouts/community/ortho_3x10/bbaserdem/rules.mk @@ -15,7 +15,8 @@ # Gherkin has both RGB strip and LED lights ifneq (,$(findstring 40percentclub/gherkin,$(KEYBOARD))) CONVERT_TO_PROTON_C = yes - RGB_MATRIX_ENABLE = WS2812 + RGB_MATRIX_ENABLE = yes + RGB_MATRIX_DRIVER = WS2812 AUDIO_ENABLE = yes BACKLIGHT_ENABLE = yes VELOCIKEY_ENABLE = yes diff --git a/layouts/community/ortho_4x12/bbaserdem/README.md b/layouts/community/ortho_4x12/bbaserdem/README.md index a9ddc339a0a..3e1e30cf54d 100644 --- a/layouts/community/ortho_4x12/bbaserdem/README.md +++ b/layouts/community/ortho_4x12/bbaserdem/README.md @@ -1,37 +1,18 @@ This file contains my [4x12 ortho](../../../default/ortho_4x12) board layouts Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. -# Planck +# Planck Light I use a couple [planck](../../../../keyboards/planck/readme.md) keyboards. -To sell soon; don't use them anymore. - -* Use the [light](../../../../keyboards/planck/light/readme.md) version. -* Use the [rev6](../../../../keyboards/planck/rev6/readme.md) version. - -I have a daughter board that I'm trying to use for perkey leds. -Originally, in the firmware, the underglow rgb prints are configured both for -`RGBLIGHT` and `RGBMATRIX` code. -I differentiate between these two; and use; - -* `RGBLIGHT` for underglow leds. -* `RGB_MATRIX` for the daughterboard, if I get to it at some point. (Doubtful) - -Enable in rules.mk accordingly. +To sell soon; don't use them anymore, but will keep the light version. # JJ40 A planck rev4 replacement; for my acrylic planck case which used to host a now defunct rev4. -Enable in rules.mk accordingly. - ## Status * [x] Layout adapted * [ ] Have not tested build yet. * [ ] Have not confirmed on board - -# Let's Split Eh? - -I have a [let's split eh?](../../../../keyboards/lets_split_eh/README.md), unused, will sell this. diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h index 81f77c44fb8..66ba01f27f2 100755 --- a/layouts/community/ortho_4x12/bbaserdem/config.h +++ b/layouts/community/ortho_4x12/bbaserdem/config.h @@ -20,92 +20,4 @@ along with this program. If not, see . #undef ENCODER_RESOLUTION #endif #define ENCODER_RESOLUTION 2 - // Daughter board related utilities - #ifdef RGB_MATRIX_ENABLE - // Reconfigure the RGB DI Pin - #ifdef RGB_DI_PIN - #undef RGB_DI_PIN - #endif - // Change this later - #define RGB_DI_PIN A1 - // Reconfigure number of LEDS - #ifdef DRIVER_LED_TOTAL - #undef DRIVER_LED_TOTAL - #endif - #define DRIVER_LED_TOTAL 48 - #elif RGBLIGHT_ENABLE - // RGB Underglow with on-board SMD footprints - // This is for original planck led locations - // ┌────────────┐ - // │ 6 5 4 3 │ - // │ │ - // │ 0 │ - // │ 7 8 1 2 │ - // └────────────┘ - #ifdef RGBLIGHT_RIGHT_BEG - #undef RGBLIGHT_RIGHT_BEG - #endif - #define RGBLIGHT_RIGHT_BEG 1 - - #ifdef RGBLIGHT_RIGHT_NUM - #undef RGBLIGHT_RIGHT_NUM - #endif - #define RGBLIGHT_RIGHT_NUM 4 - - #ifdef RGBLIGHT_LEFT_BEG - #undef RGBLIGHT_LEFT_BEG - #endif - #define RGBLIGHT_LEFT_BEG 5 - - #ifdef RGBLIGHT_LEFT_NUM - #undef RGBLIGHT_LEFT_NUM - #endif - #define RGBLIGHT_LEFT_NUM 4 - #endif -#endif - -// Let's Split Eh! specific -#ifdef KEYBOARD_lets_split_eh_eh - #ifdef RGBLIGHT_LEFT_BEG - #undef RGBLIGHT_LEFT_BEG - #endif - #define RGBLIGHT_LEFT_BEG 0 - - #ifdef RGBLIGHT_LEFT_NUM - #undef RGBLIGHT_LEFT_NUM - #endif - #define RGBLIGHT_LEFT_NUM 6 - - #ifdef RGBLIGHT_RIGHT_BEG - #undef RGBLIGHT_RIGHT_BEG - #endif - #define RGBLIGHT_RIGHT_BEG 6 - - #ifdef RGBLIGHT_RIGHT_NUM - #undef RGBLIGHT_RIGHT_NUM - #endif - #define RGBLIGHT_RIGHT_NUM 6 -#endif - -// JJ40 specific -#ifdef KEYBOARD_jj40 - #ifdef RGBLIGHT_LEFT_BEG - #undef RGBLIGHT_LEFT_BEG - #endif - #define RGBLIGHT_LEFT_BEG 0 - - #ifdef RGBLIGHT_LEFT_NUM - #undef RGBLIGHT_LEFT_NUM - #endif - #define RGBLIGHT_LEFT_NUM 2 - - #ifdef RGBLIGHT_RIGHT_BEG - #undef RGBLIGHT_RIGHT_BEG - #endif - #define RGBLIGHT_RIGHT_BEG 3 - - #ifdef RGBLIGHT_RIGHT_NUM - #undef RGBLIGHT_RIGHT_NUM - #endif - #define RGBLIGHT_RIGHT_NUM 2 #endif diff --git a/layouts/community/ortho_4x12/bbaserdem/keymap.c b/layouts/community/ortho_4x12/bbaserdem/keymap.c index 654e4bfdeda..3c53c83d7a3 100755 --- a/layouts/community/ortho_4x12/bbaserdem/keymap.c +++ b/layouts/community/ortho_4x12/bbaserdem/keymap.c @@ -83,116 +83,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _MU_12_,_MU_12_,_MU_12_, ___1___,_MU_02_,_MUL_3_,_MUR_3_,_MU_02_,___1___) }; - -// RGB Matrix configuration -#ifdef RGB_MATRIX_ENABLE - -// planck:Light -#if defined(KEYBOARD_planck_light) -/* This is left-right for planck light indicator light - * - The LED 42 is for spacebar specifically, leave it out of the matrix - * - This is how it looks like - * ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ - * │00│01│02│03│04│05│06│07│08│09│10│11│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │12│13│14│15│16│17│18│19│20│21│22│23│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │24│25│26│27│28│29│30│31│32│33│34│35│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │36│37│38│39│40│41│43│44│45│46│47│48│ - * └──┴──┴──┴──┴──┴─042─┴──┴──┴──┴──┴──┘ - */ -int board_left[24] = { - 0, 1, 2, 3, 4, 5, - 12, 13, 14, 15, 16, 17, - 24, 25, 26, 27, 28, 29, - 36, 37, 38, 39, 40, 41}; -int board_right[24] = { - 6, 7, 8, 9, 10, 11, - 18, 19, 20, 21, 22, 23, - 30, 31, 32, 33, 34, 35, - 43, 44, 45, 46, 47, 48}; -// Sided color-setting -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(board_left[i], red, green, blue); - } -} -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(board_right[i], red, green, blue); - } -} - -// planck:rev6 -#elif defined(KEYBOARD_planck_rev6) -/* Rev6 has RGB matrix to the bottom LED footprints - * Breakdown of the daughter board layout that I'm planning to use - * ┌──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┬──┐ - * │35│36│37│38│39│40│41│42│43│44│45│46│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │23│24│25│26│27│28│29│30│31│32│33│34│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │12│13│14│15│16│17│18│19│20│21│22│47│ - * ├──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┼──┤ - * │00│01│02│03│04│05│06│07│08│09│10│11│ - * └──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┴──┘ - */ -led_config_t g_led_config = { - { // Key Matrix to LED Index - {35, 36, 37, 38, 39, 40}, // R1: Left - {23, 24, 25, 26, 27, 28}, // R2: Left - {12, 13, 14, 15, 16, 17}, // R3: Left - { 0, 1, 2, 9, 10, 11}, // R4: 1-3, 10-12 - {41, 42, 43, 44, 45, 46}, // R1: Right - {29, 30, 31, 32, 33, 34}, // R2: Right - {18, 19, 20, 21, 22, 47}, // R3: Right - { 6, 7, 8, 3, 4, 5}, // R4: 7-9, 4-6 - }, {// LED Index to Physical Position - // R4: 12 leds - { 0, 64}, { 20, 64}, { 41, 64}, { 61, 64}, { 81, 64}, {102, 64}, - {122, 64}, {143, 64}, {163, 64}, {183, 64}, {204, 64}, {224, 64}, - // R3: 11 leds (last one in this row is the last LED) - { 0, 43}, { 20, 43}, { 41, 43}, { 61, 43}, { 81, 43}, {102, 43}, - {122, 43}, {143, 43}, {163, 43}, {183, 43}, {204, 43}, - // R2: 12 leds - { 0, 21}, { 20, 21}, { 41, 21}, { 61, 21}, { 81, 21}, {102, 21}, - {122, 21}, {143, 21}, {163, 21}, {183, 21}, {204, 21}, {224, 21}, - // R1: 12 leds - { 0, 0}, { 20, 0}, { 41, 0}, { 61, 0}, { 81, 0}, {102, 0}, - { 122, 0}, {143, 0}, {163, 0}, {183, 0}, {204, 0}, {224, 0}, - // Last led: right most R3 - {224, 43} - }, {// LED Index to Flag (4: regular key, 1: modifier) - 4, 4, 4, 1, 1, 1, 1, 1, 1, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 1, 1, 4, 4, 4, 4, 4, 4 - } -}; -int board_left[24] = { - 0, 1, 2, 3, 4, 5, - 12, 13, 14, 15, 16, 17, - 23, 24, 25, 26, 27, 28, - 35, 36, 37, 38, 39, 40}; -int board_right[24] = { - 6, 7, 8, 9, 10, 11, - 18, 19, 20, 21, 22, 47, - 29, 30, 31, 32, 33, 34, - 41, 42, 43, 44, 45, 46}; -// Sided color-setting -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(board_left[i], red, green, blue); - } -} -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(board_right[i], red, green, blue); - } -} -// End of differentiations -#endif - -// End of code for the RGB_MATRIX setup -#endif diff --git a/layouts/community/ortho_4x12/bbaserdem/rules.mk b/layouts/community/ortho_4x12/bbaserdem/rules.mk index fddeacc0b79..e8b2c793ba0 100755 --- a/layouts/community/ortho_4x12/bbaserdem/rules.mk +++ b/layouts/community/ortho_4x12/bbaserdem/rules.mk @@ -14,11 +14,10 @@ # RGBLIGHT should be enabled for a board with the underglow leds # RGB_MATRIX_ENABLE should be set to WS2812 for the daughter board ifneq (,$(findstring planck/rev6,$(KEYBOARD))) - RGBLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = no + RGB_MATRIX_ENABLE = yes + RGBLIGHT_ENABLE = no endif # JJ40 here ifneq (,$(findstring jj40,$(KEYBOARD))) - RGBLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = no + RGB_MATRIX_ENABLE = yes endif diff --git a/layouts/community/ortho_5x15/bbaserdem/README.md b/layouts/community/ortho_5x15/bbaserdem/README.md deleted file mode 100644 index e6e15b72605..00000000000 --- a/layouts/community/ortho_5x15/bbaserdem/README.md +++ /dev/null @@ -1,16 +0,0 @@ -This file contains my [5x15 ortho](../../../default/ortho_5x15) board layouts -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. - -# XD75RE - -One of my first boards, the [XD75Re](../../../../keyboards/xd75/readme.md). -(At least before the price hike.) -To be sold. - -The board has `RGBLIGHT_ENABLE` leds underneath; but I use a wooden case. -Instead; I hooked up some LED's to the three lock indicators. -I use them for layer indication. - -## Build - -Build command: `CFLAGS="-Wno-error=deprecated" TBF` diff --git a/layouts/community/ortho_5x15/bbaserdem/config.h b/layouts/community/ortho_5x15/bbaserdem/config.h deleted file mode 100644 index f51237a94d7..00000000000 --- a/layouts/community/ortho_5x15/bbaserdem/config.h +++ /dev/null @@ -1,15 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 diff --git a/layouts/community/ortho_5x15/bbaserdem/keymap.c b/layouts/community/ortho_5x15/bbaserdem/keymap.c deleted file mode 100644 index 8b9b742e192..00000000000 --- a/layouts/community/ortho_5x15/bbaserdem/keymap.c +++ /dev/null @@ -1,128 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 QMK_KEYBOARD_H -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_ortho_5x15_wrapper( - xxx6xxx,KC_NLCK,KC_PSLS,KC_PAST,xxx6xxx, - _BL1_1_,_BL1_5_,KC_P7, KC_P8, KC_P9, _BR1_5_,_BR1_1_, - _BL2_1_,_BL2_5_,KC_P4, KC_P5, KC_P6, _BR2_5_,_BR2_1_, - _BL3_1_,_BL3_5_,KC_P1, KC_P2, KC_P3, _BR3_5_,_BR3_1_, - BL_STEP,XXXXXXX,KC_LEFT,KC_RGHT,_BL4_3_,KC_P0, _BL4_3_,KC_DOWN,KC_UP, MU_ON, BL_TOGG - ), - [_CHAR] = LAYOUT_ortho_5x15_wrapper( - xxx6xxx,xxx3xxx,xxx6xxx, - XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, - XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, - XXXXXXX,_CL1_5_,xxx3xxx,_CR1_5_,XXXXXXX, - ___4___,_CL4_3_,XXXXXXX,_CL4_3_,___4___ - ), - [_GAME] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - _GA1_1_,_GA1_5_,___3___,___6___, - _GA2_1_,_GA2_5_,___3___,___6___, - _GA3_1_,_GA3_5_,___3___,___6___, - ___4___,_GA4_3_,___1___,___3___,___4___ - ), - [_MEDI] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - xxx1xxx,_ME1_5_,___3___,___6___, - xxx1xxx,_ME2_5_,___3___,___6___, - xxx1xxx,_ME3_5_,___3___,___6___, - ___4___,___3___,___1___,_ME4_3_,___4___ - ), - [_NAVI] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - xxx1xxx,_NA1_5_,___3___,___6___, - xxx1xxx,_NA2_5_,___3___,___6___, - xxx1xxx,_NA3_5_,___3___,___6___, - ___4___,_NA4_3_,___1___,___3___,___4___ - ), - [_SYMB] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - xxx1xxx,_SY1_5_,___3___,___6___, - xxx1xxx,_SY2_5_,___3___,___6___, - xxx1xxx,_SY3_5_,___3___,___6___, - ___4___,_SY4_3_,___1___,___3___,___4___ - ), - [_NUMB] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - ___6___,___3___,_NU1_5_,xxx1xxx, - ___6___,___3___,_NU2_5_,xxx1xxx, - ___6___,___3___,_NU3_5_,xxx1xxx, - ___4___,___3___,___1___,_NU4_3_,___4___ - ), - [_FUNC] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - ___6___,___3___,_FU1_5_,xxx1xxx, - ___6___,___3___,_FU2_5_,xxx1xxx, - ___6___,___3___,_FU3_5_,xxx1xxx, - ___4___,___3___,___1___,_FU4_3_,___4___ - ), - [_MOUS] = LAYOUT_ortho_5x15_wrapper( - ___6___,___3___,___6___, - ___6___,___3___,_MO1_5_,xxx1xxx, - ___6___,___3___,_MO2_5_,xxx1xxx, - ___6___,___3___,_MO3_5_,xxx1xxx, - ___4___,___3___,___1___,_MO4_3_,___4___ - ), - [_MUSI] = LAYOUT_ortho_5x15_wrapper( - _MU_06_,_MU_03_,_MU_06_, - _MU_06_,_MU_03_,_MU_06_, - _MU_06_,_MU_03_,_MU_06_, - _MU_06_,_MU_03_,_MU_06_, - _MU_06_,_MU_01_,_MUS_4_,MU_SLOW,MU_FAST,MU_OFF, ___1___ - ) -}; - -layer_state_t layer_state_set_keymap(layer_state_t state) { - // XD75RE layer indicator - #ifdef KEYBOARD_xd75 - if (layer_state_cmp(state, _CHAR)) { - capslock_led_on(); - gp103_led_on(); - gp100_led_on(); - } else if (layer_state_cmp(state, _MEDI)) { - capslock_led_off(); - gp103_led_off(); - gp100_led_on(); - } else if (layer_state_cmp(state, _NAVI)) { - capslock_led_off(); - gp103_led_on(); - gp100_led_off(); - } else if (layer_state_cmp(state, _NUMB)) { - capslock_led_on(); - gp103_led_off(); - gp100_led_off(); - } else if (layer_state_cmp(state, _SYMB)) { - capslock_led_off(); - gp103_led_on(); - gp100_led_on(); - } else if (layer_state_cmp(state, _FUNC)) { - capslock_led_on(); - gp103_led_off(); - gp100_led_on(); - } else if (layer_state_cmp(state, _MOUS)) { - capslock_led_on(); - gp103_led_on(); - gp100_led_off(); - } else { - capslock_led_off(); - gp103_led_off(); - gp100_led_off(); - } - #endif - return state; -}; diff --git a/layouts/community/ortho_5x15/bbaserdem/rules.mk b/layouts/community/ortho_5x15/bbaserdem/rules.mk deleted file mode 100755 index 3a387185fc9..00000000000 --- a/layouts/community/ortho_5x15/bbaserdem/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 2019 Batuhan Başerdem @bbaserdem -# 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 . - -# XD75RE specific stuff -ifneq (,$(findstring xd75,$(KEYBOARD))) - RGBLIGHT_ENABLE = no - BACKLIGHT_ENABLE = yes -endif diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index e9fca701978..21fd9526c0d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -17,7 +17,6 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) BACKLIGHT_ENABLE = no ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = yes - RGBLIGHT_ENABLE = no OLED_ENABLE = yes # Features that take otherwise too much space WPM_ENABLE = yes diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md index 74a0488a451..f0999c7a96d 100644 --- a/users/bbaserdem/README.md +++ b/users/bbaserdem/README.md @@ -4,146 +4,75 @@ My userspace code for my various keyboards; available here. # Todo -- [X] Add OLED support -- [ ] Centralize color definitions for RGB -- [ ] Document all features more extensibly -- [ ] Generate json files to be used with Keyboard-Layout-Editor to produce images. - -# Keyboards - -A list of my code accross the QMK repo accessible here. -(I will sell my built-but-not-using ones.) +- [ ] Convert all RGB code to use RGB matrix. +- [ ] Make workflow so that ARM and AVR are both differentiable. +- [ ] Finish README to be intelligible. +- [ ] Generate JSON files to be used with Keyboard-Layout-Editor to produce images. ## Builds These are my keyboard builds and info, it allows me to plan out my builds. -### Planck WORK - -* Board: planck/rev6 -* Switches: Zilent -* Case: Planck Hi-Pro Bottom Case: Glossy White -* Plate: Stainless steel with shiny finish (LaserBoost) -* Keycaps: Pudding PBT Doubleshot Keycap Set -* Artisan: B.O.B StoneuCarved Lotus Artisan Keycap -* Artisan: Teamwolf 304 Stainless Steel Transparent Metal Keycaps - -I use this at the workplace to not bother coworkers; focus on silence. - -### Planck HOME - -* Board: planck/rev6 -* Switches: Crystal BOX Navy -* Case: Planck Hi-Pro Bottom Case (MOD version): Matte Black -* Plate: Copper with shiny finish (LaserBoost) -* Keycaps: Buger TH01 XDA Dye-Subbed PBT -* Artisan: Sparkle Loft Reactor Artisan Keycap - -I use this at home. -Has all the extra pinouts exposed to play arounh with. - ### Planck SERVER -* Board: jj40 -* Switches: BOX Navy +* Board: `kprepublic/jj40` +* Microcontroller: Embedded +* Layout: `ortho_4x12` +* Functionality: Underglow RGB Lighting, LED diode lighting. * Case: Clear Acrylic Top and Bottow, with Frosted Acrylic Diffuser (Smashing Acrylics) +* Switches: BOX Navy * Keycaps: Datamancer Tall Deco Typewriter Keycaps -I'm using this while I'm in between boards; but very usable. -Long term plan is to use this for the server. -The case was initially designed for planck rev4; -I'm replaced the PCB since my rev4 one was derelict -due to repeated desolderings. - -### Planck CARRY - -* Board: planck/light -* Switches: Choc Low Jade -* Case: Stock Planck light case -* Keycaps: Blanck MKB - -I carry this around; and is one of my favourite boards. -Found a better keycap profile for these as well. - -### XD75RE - -* Board: xd75 -* Switches: Zealios 67g + Silencios -* Case: Npkc 60% Wooden Case (Rosewood) -* Keycaps: Massdrop x MITO XDA Godspeed -* Artisan: Hammer Fidget Spinner Artisan Keycap -* Artisan: Waffle Key Studio Rosette (Sunset) - -My first work board; that is not seing any use due to being big. - -### Gherkin PAD +Just a decorative planck replacement (for my rev4 PCB that died.) -* Board: 40percentclub/gherkin -* Case: Acrylic Case (Smashing Acrylics) -* Controller: Proton C -* Switches: Novelkeys Creams -* Keycaps: Random +### Planck Light -The point of this is to act like a game/macro pad. -Other than that; i just use this for bragging points. -I have been planning on using my Proton C to turn into a MIDI controller. - -### Let's Split Eh? - -* Board: lets_split_eh/eh -* Case: Acrylic Case (Smashing Acrylics) -* Switches: Novelkeys BOX Royals -* Keycaps: G20 Semiotics - -I built this; but then I realized that I really don't enjoy ortholinear split. - -### Infinity Ergodox - -* Board: ergodox_infinity -* Case: Datamancer Wooden case -* Switches: Kailh Speed Gold -* Keycaps: None +* Board: `planck/light` +* Microcontroller: Embedded +* Layout: `ortho_4x12` +* Functionality: Per-key RGB Lighting, Audio. +* Case: Clear Acrylic Top and Bottow, with Frosted Acrylic Diffuser (Smashing Acrylics) +* Switches: BOX Navy +* Keycaps: Datamancer Tall Deco Typewriter Keycaps -I don't like Infinity Ergodox. -Should sell this soon cause really not seeing myself ever using this. -Lucky me got the case for free due to (then) Massdrop shipping errors. +Just a decorative planck replacement (for my rev4 PCB that died.) -### Corne +### Corne ARM -* Board: [Proton-C Compatible crkbd PCB](https://github.com/ItsWaffIe/waffle_corne) +* Board: `crkbd/rev1` +* Microcontroller: Proton C (x2) +* Layout: `split_3x6_3` +* Functionality: OLED, Audio, Per-key RGB Lighting, Rotary Encoder (x2) * Case: IMK Corne Case v2 Polycarbonate * Switches: Healios V2 * Keycaps: POM Jelly -I'm planning on adding a trackpad for this, as detailed -[here](https://github.com/manna-harbour/crkbd/blob/master/trackpoint/readme.org). +PCB is actually [Proton-C Compatible crkbd PCB](https://github.com/ItsWaffIe/waffle_corne). ### Corne Lite -* Board: crkbd/rev1 +* Board: `crkbd/rev1` +* Microcontroller: Pro Micro (x2) +* Layout: `split_3x5_3` +* Functionality: Per-key RGB Lighting, OLED (No firmware space) * Case: Custom * Switches: Choc Low Burnt Orange * Keycaps: [Scooped Choc Keycaps](https://mkultra.click/collections/keycaps/products/scooped-choc-keycaps?variant=31223543365730) +Maybe try adding a trackpad for this, as detailed +[here](https://github.com/manna-harbour/crkbd/blob/master/trackpoint/readme.org). + ### Kyria -* Board: kyria/rev1 +* Board: `splitkb/kyria/rev1` +* Microcontroller: Pro Micro (x2) +* Layout: `split_3x6_6` +* Functionality: OLED, Underglow RGB Lighting (No firmware space), Rotary Encoder (x2) * Case: Matte Black Acrylic High-Profile case * Switches: Gateron Ink Silent Black * Keycaps: Oblotzky SA Oblivion -Want to add a joystick to this board for mouse control. - -### Big Switch - -* Board: bigseries/1key -* Case: WoodKeys (KNOWN SCAMMER: DO NOT RECOMMEND) -* Switches: Big Series Pale Blue -* Keycaps: Idea23 - -Got this before being scammed out of 200$ by Cole Markham: owner of WoodKeys; -The usb port got torn off; and could not fix it. -Expensive paperweight? +Main driver at work currently; love the switches and the board layout. # Firmware building @@ -151,10 +80,12 @@ Expensive paperweight? On archlinux, the package *arm-none-eabi-gcc* is too new. To fix; add to the environment `CFLAGS="-Wno-error=deprecated"` to compilation commands. -Also; try to run `avr-gcc` version `8.4.0` for smaller firmware. +Also; says to run `avr-gcc` version `8.4.0` for smaller firmware, +but I find that it only saves a few bytes. ## Bootloader +Needed to type this out from the QMK website. If I want to flash a new bootloader for a machine; here are steps; 1. Flash the util/pro_micro_ISP_B6_10.hex to a spare promicro using; @@ -184,22 +115,20 @@ My userspace has a lot of shared code between different keyboards. These files are prefixed with `sbp-` to remove any naming clash. * [bb-audio](bb-audio.c): Code dealing with audio playback using onboard sound. -Also contains stuff regarding using the devices as MIDI controllers. (WIP) -* [bb-backlight](bb-backlight.c): Controls global key single-channel LED stuff. -* [bb-keylight](bb-keylight.c): Controls per-key RGB LED matrix stuff. -* [bb-underglow](bb-underglow.c): Controls RGB underglow effects. -* [bb-process](bb-macro.c): My custom keycodes; macros, tap dances, etc. -* [bb-rotary](bb-rotary.c): Rotary encoder sutff +* [bb-encoder](bb-encoder.c): Rotary encoder sutff. +* [bb-macro](bb-macro.c): My custom keycodes; macros, tap dances, etc. +* [bb-oled](bb-oled.c): Controls OLED displays. +* [bb-rgb](bb-rgb.c): Controls per-key RGB LED matrix stuff. # Layout -![Corne layout](https://i.imgur.com/6VvQZ2I.png) - My personal layout is mostly inspired by the [Miryoku layout](../manna-harbour_miryoku/miryoku.org). There are some changes to make it friendlier to international keyboards. My board is compatible with software implementation of Dvorak and Turkish F. +WIP + ## Base Base layer uses tap-hold functionality to have access to modifiers. diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 401e5a2345f..68d87c2f8e4 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -47,7 +47,7 @@ void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: switch (encoder_state[index].rgb) { case 0: @@ -134,90 +134,42 @@ void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef(RGB_MATRIX_ENABLE) case _MEDI: switch(encoder_state[index].rgb) { case 0: // Effect the RGB mode if (clockwise) { - #ifdef RGBLIGHT_ENABLE - rgblight_step_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_step_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - rgblight_step_reverse_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_step_reverse_noeeprom(); - #endif } break; case 1: // Effect the RGB hue if (clockwise) { - #ifdef RGBLIGHT_ENABLE - rgblight_increase_hue_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_hue_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - rgblight_decrease_hue_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_decrease_hue_noeeprom(); - #endif } break; case 2: // Effect the RGB saturation if (clockwise) { - #ifdef RGBLIGHT_ENABLE - rgblight_increase_sat_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_sat_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - rgblight_decrease_sat_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_decrease_sat_noeeprom(); - #endif } break; case 3: // Effect the RGB brightness if (clockwise) { - #ifdef RGBLIGHT_ENABLE - rgblight_increase_val_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_val_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - rgblight_decrease_val_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_decrease_val_noeeprom(); - #endif } break; case 4: // Effect the RGB effect speed if (clockwise) { - #ifdef RGBLIGHT_ENABLE - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_speed_noeeprom(); - #endif } else { - #ifdef RGBLIGHT_ENABLE - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_decrease_speed_noeeprom(); - #endif } break; } @@ -331,31 +283,19 @@ bool encoder_update_user(uint8_t index, bool clockwise) { void encoder_click_action(uint8_t index) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef(RGB_MATRIX_ENABLE) case _MEDI: switch(encoder_state[index].rgb) { case 0: // Return to no animation - #ifdef RGBLIGHT_ENABLE - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); - #endif break; case 1: case 2: case 3: // Toggle - #ifdef RGBLIGHT_ENABLE - rgblight_increase_val_noeeprom(); - #endif - #ifdef RGB_MATRIX_ENABLE rgb_matrix_increase_val_noeeprom(); - #endif break; case 4: // Toggle velocikey - #ifdef VELOCIKEY_ENABLE velocikey_toggle(); - #endif break; } break; @@ -422,7 +362,7 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // If shifted, move mode one point forward if (get_mods() & MOD_MASK_SHIFT) { switch (get_highest_layer(layer_state)) { - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: encoder_state[encoder_index].rgb = (encoder_state[encoder_index].rgb + 1) % 5; @@ -442,7 +382,7 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // If ctrl is active, move mode one point backwards } else if (get_mods() & MOD_MASK_CTRL) { switch (get_highest_layer(layer_state)) { - #if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: encoder_state[encoder_index].rgb = (encoder_state[encoder_index].rgb + 5 - 1) % 5; diff --git a/users/bbaserdem/bb-keylight.c b/users/bbaserdem/bb-keylight.c deleted file mode 100644 index d52f092af79..00000000000 --- a/users/bbaserdem/bb-keylight.c +++ /dev/null @@ -1,78 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 "bb-keylight.h" -/* Code relating to per-key RGB LED stuff - */ - -// These are matrix specific so they need to be defined in the keymap code. -// BUT these are made to take RGB arguments so the color choice is central -__attribute__ ((weak)) -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { } -__attribute__ ((weak)) -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { } - -// Allow hooking into the RGB matrix indications using keymap code -__attribute__ ((weak)) void rgb_matrix_indicators_keymap(void) { } -// Set RGB state depending on layer -void rgb_matrix_indicators_user(void) { - // Do each layer seperately - switch (get_highest_layer(layer_state)) { - case _GAME: - keylight_set_left(RGB_TURQUOISE); - break; - case _CHAR: - rgb_matrix_set_color_all(RGB_CHARTREUSE); - break; - case _MEDI: - keylight_set_right(RGB_CORAL); - break; - case _NAVI: - keylight_set_right(RGB_GREEN); - break; - case _SYMB: - keylight_set_right(RGB_PURPLE); - break; - case _NUMB: - keylight_set_left(RGB_CYAN); - break; - case _FUNC: - keylight_set_left(RGB_RED); - break; - case _MOUS: - keylight_set_left(RGB_YELLOW); - break; - case _MUSI: - rgb_matrix_set_color_all(RGB_MAGENTA); - break; - } - // Load keymap hooks - rgb_matrix_indicators_keymap(); -} - -// Hook into shutdown code to make all perkey LED's red on hitting reset -void shutdown_keylight(void) { - // Flash all the key LED's red on shutdown - uint16_t timer_start = timer_read(); - rgb_matrix_set_color_all(RGB_CORAL); - // Delay until this registers - while(timer_elapsed(timer_start) < 250) {wait_ms(1);} -} - -// Hook into suspend code -void suspend_power_down_keylight(void) { - rgb_matrix_set_suspend_state(true); -} -void suspend_wakeup_init_keylight(void) { - rgb_matrix_set_suspend_state(false); -} diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 423ebb2525d..377eb33d855 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -19,62 +19,11 @@ along with this program. If not, see . // Tap dance definitons #ifdef TAP_DANCE_ENABLE -// Bigswitch tap dance code for the last key down event. -void bigswitch_fin(qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 0: - // Change RGB mode - #ifdef RGBLIGHT_ENABLE - rgblight_step(); - #endif - break; - case 1: - // Change RGB mode; but reverse - #ifdef RGBLIGHT_ENABLE - rgblight_step_reverse(); - #endif - break; - case 2: - // Toggle RGB functions - #ifdef RGBLIGHT_ENABLE - rgblight_toggle(); - #endif - break; - case 3: - // Change RGB hue - #ifdef RGBLIGHT_ENABLE - rgblight_increase_hue(); - #endif - break; - case 4: - // Send OS + Escape; which screen locks in my OS - register_code(KC_LGUI); - register_code(KC_ESC); - break; - case 5: - // Send power keycode - register_code(KC_POWER); - break; - } -} -// Unregister the keycodes entered -void bigswitch_res (qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 4: - unregister_code(KC_LGUI); - unregister_code(KC_ESC); - break; - case 5: - unregister_code(KC_POWER); - break; - } -} qk_tap_dance_action_t tap_dance_actions[] = { #ifdef AUDIO_ENABLE // Music playback speed modulator [TD_AUDIO_TEMPO] = ACTION_TAP_DANCE_DOUBLE(MU_SLOW, MU_FAST), #endif - [TD_BIGSWITCH] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, bigswitch_fin, bigswitch_res), }; #endif diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h index 9a4bf437894..ce32e8ca471 100644 --- a/users/bbaserdem/bb-macro.h +++ b/users/bbaserdem/bb-macro.h @@ -105,6 +105,5 @@ enum { #ifdef AUDIO_ENABLE TD_AUDIO_TEMPO, #endif - TD_BIGSWITCH, }; #endif diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index dea42770f94..efda79a8806 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -25,9 +25,7 @@ along with this program. If not, see . */ // Following line imports reading of RGB settings -#if defined RGBLIGHT_ENABLE -extern rgblight_config_t rgblight_config; -#elif defined RGB_MATRIX_ENABLE +#if defined RGB_MATRIX_ENABLE extern rgb_config_t rgb_matrix_config; #endif @@ -44,9 +42,7 @@ static void render_status(void) { uint8_t this_layer = get_highest_layer(layer_state); uint8_t this_mod = get_mods(); // Temporary variable for RGB - #if defined RGBLIGHT_ENABLE - static char rgb_temp4[4] = {0}; - #elif defined RGB_MATRIX_ENABLE + #if defined RGB_MATRIX_ENABLE static char rgb_temp4[4] = {0}; #endif // Temporary variable for WPM string @@ -97,24 +93,8 @@ static void render_status(void) { // Line 2: Mod or info switch (this_layer) { - // Show RGB mode as an overlay -#if defined RGBLIGHT_ENABLE - case _MEDI: - oled_write_P(PSTR("m:"), false); - itoa(rgblight_config.mode, rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write_P(PSTR(" h:"), false); - itoa(rgblight_config.hsv.h, rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write_P(PSTR(" s:"), false); - itoa(rgblight_config.hsv.s, rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write_P(PSTR(" v:"), false); - itoa(rgblight_config.hsv.v, rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write_P(PSTR("\n"), false); - break; -#elif defined RGB_MATRIX_ENABLE + // Show RGB mode as an overlay in media mode. +#if defined RGB_MATRIX_ENABLE case _MEDI: oled_write_P(PSTR("m"), false); itoa(rgb_matrix_config.mode, rgb_temp4, 10); diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c new file mode 100644 index 00000000000..ee8915031ed --- /dev/null +++ b/users/bbaserdem/bb-rgb.c @@ -0,0 +1,104 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-rgb.h" +#define SPLIT_POINT 112 +/* Code relating to per-key RGB LED stuff + */ + +// Allow hooking into the RGB matrix indications using keymap code +__attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { + return false; +} +// Set RGB state depending on layer +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + // Load keymap hooks + if(rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max)) { + return; + } + // Do each layer seperately + switch (get_highest_layer(layer_state)) { + case _GAME: // Set left side as turquoise + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x < SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_PURPLE); + } + } + break; + case _CHAR: // Set full board as chartreuse + rgb_matrix_set_color_all(RGB_GOLD); + break; + case _MEDI: // Set right side as coral + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x > SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_PINK); + } + } + break; + case _NAVI: // Set right side as green + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x > SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_GREEN); + } + } + break; + case _SYMB: // Set right side as purple + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x > SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_YELLOW); + } + } + break; + case _NUMB: // Set left side as cyan + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x < SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_CYAN); + } + } + break; + case _FUNC: // Set left side as red + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x < SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_RED); + } + } + break; + case _MOUS: // Set left side as yellow + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.point[i].x < SPLIT_POINT) { + rgb_matrix_set_color(i, RGB_SPRINGGREEN); + } + } + break; + case _MUSI: // Set full board as magenta + rgb_matrix_set_color_all(RGB_ORANGE); + break; + } +} + +// Hook into shutdown code to make all perkey LED's red on hitting reset +void shutdown_keylight(void) { + // Flash all the key LED's red on shutdown + uint16_t timer_start = timer_read(); + rgb_matrix_set_color_all(RGB_CORAL); + // Delay until this registers + while(timer_elapsed(timer_start) < 250) {wait_ms(1);} +} + +// Hook into suspend code +void suspend_power_down_keylight(void) { + rgb_matrix_set_suspend_state(true); +} +void suspend_wakeup_init_keylight(void) { + rgb_matrix_set_suspend_state(false); +} diff --git a/users/bbaserdem/bb-keylight.h b/users/bbaserdem/bb-rgb.h similarity index 80% rename from users/bbaserdem/bb-keylight.h rename to users/bbaserdem/bb-rgb.h index 3297f151139..e71c88e5585 100644 --- a/users/bbaserdem/bb-keylight.h +++ b/users/bbaserdem/bb-rgb.h @@ -17,11 +17,8 @@ along with this program. If not, see . */ // For custom indicators -void rgb_matrix_indicators_user(void); +void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); // Hook into shutdown code void shutdown_keylight(void); void suspend_wakeup_init_keylight(void); void suspend_power_down_keylight(void); -// These should be defined worst case on this file -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue); -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue); diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 32879e0bff7..eb61c3eff36 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -297,7 +297,6 @@ enum userspace_layers { // Layer switches #define BB_CHAR OSL(_CHAR) #define BB_GAME TG(_GAME) -#define BB_BIGS TD(TD_BIGSWITCH) /* Depending on how the layouts change with language; the keys are shown as; * ┌────────────────────────────────────────────────┐ diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 55686ea2cdf..41dee7322aa 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -63,24 +63,17 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes) SRC += bb-encoder.c endif +# RGB LED (Perkey) code +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) +SRC += bb-rgb.c +endif + # Backlight code ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) SRC += bb-backlight.c endif -# RGB LED Underglow code -ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) -SRC += bb-underglow.c -endif - # OLED code ifeq ($(strip $(OLED_ENABLE)), yes) SRC += bb-oled.c endif - -# RGB LED (Perkey) code -ifneq ($(strip $(RGB_MATRIX_ENABLE)),) - ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) - SRC += bb-keylight.c - endif -endif From f00cb88f2cb212721f6977752a9606d0c5a08b9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 6 Sep 2021 21:10:43 -0400 Subject: [PATCH 64/94] Checking kyria code --- keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c | 2 +- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 8e6ac4d60a3..97f942ab8fc 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -96,5 +96,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } - #endif //OLED_DRIVER_ENABLE + #endif //OLED_ENABLE #endif //KEYBOARD_kyria_rev1 diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index 1d1db3aaa14..10868450488 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -13,11 +13,12 @@ # Kyria hardware ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) # Elective features + ENCODER_ENABLE = yes + OLED_ENABLE = yes + # Nonexistent features AUDIO_ENABLE = no BACKLIGHT_ENABLE = no - ENCODER_ENABLE = yes RGB_MATRIX_ENABLE = no - OLED_ENABLE = yes # Space savers NKRO_ENABLE = no VELOCIKEY_ENABLE = no From 2364aebd0f815dd86a0495c459f1945c8ec33a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 22:23:37 -0400 Subject: [PATCH 65/94] Changed up some stuff --- .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 2 +- .../split_3x6_5/default_split_3x6_3/keymap.c | 24 ++++ layouts/default/split_3x6_5/info.json | 62 ++++++++++ layouts/default/split_3x6_5/layout.json | 12 ++ layouts/default/split_3x6_5/readme.md | 5 + users/bbaserdem/; | 109 ++++++++++++++++++ users/bbaserdem/bb-encoder.c | 4 +- users/bbaserdem/bb-macro.c | 4 +- users/bbaserdem/bb-macro.h | 4 +- users/bbaserdem/config.h | 38 +++--- users/bbaserdem/rules.mk | 4 +- 11 files changed, 235 insertions(+), 33 deletions(-) create mode 100644 layouts/default/split_3x6_5/default_split_3x6_3/keymap.c create mode 100644 layouts/default/split_3x6_5/info.json create mode 100644 layouts/default/split_3x6_5/layout.json create mode 100644 layouts/default/split_3x6_5/readme.md create mode 100644 users/bbaserdem/; diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index 10868450488..c98f1772960 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -22,5 +22,5 @@ ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) # Space savers NKRO_ENABLE = no VELOCIKEY_ENABLE = no - WPM_ENABLE = no + WPM_ENABLE = yes endif diff --git a/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c b/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c new file mode 100644 index 00000000000..4fb2bab5737 --- /dev/null +++ b/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c @@ -0,0 +1,24 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┐ + * │Tab│ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │Bsp│ + * ├───┼───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┼───┤ + * │Ctl│ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ + * ├───┼───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┼───┤ + * │Sft│ Z │ X │ C │ V │ B │ │ N │ M │ , │ . │ / │Sft│ + * └───┴───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┴───┘ + * ┌───┐ ┌───┐ + * │GUI├───┐ ┌───┤Alt│ + * └───┤Bsp├───┐ ┌───┤Ent├───┘ + * └───┤ │ │ ├───┘ + * └───┘ └───┘ + */ + [0] = 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_RSFT, + KC_LGUI, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_RALT + ) +}; diff --git a/layouts/default/split_3x6_5/info.json b/layouts/default/split_3x6_5/info.json new file mode 100644 index 00000000000..b1ca28168bf --- /dev/null +++ b/layouts/default/split_3x6_5/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "3x6+3 split layout", + "url": "", + "maintainer": "qmk", + "width": 14, + "height": 4.75, + "layouts": { + "LAYOUT_split_3x6_3": { + "layout": [ + {"x":0, "y":0.25}, + {"x":1, "y":0.25}, + {"x":2, "y":0.125}, + {"x":3, "y":0}, + {"x":4, "y":0.125}, + {"x":5, "y":0.25}, + + {"x":8, "y":0.25}, + {"x":9, "y":0.125}, + {"x":10, "y":0}, + {"x":11, "y":0.125}, + {"x":12, "y":0.25}, + {"x":13, "y":0.25}, + + {"x":0, "y":1.25}, + {"x":1, "y":1.25}, + {"x":2, "y":1.125}, + {"x":3, "y":1}, + {"x":4, "y":1.125}, + {"x":5, "y":1.25}, + + {"x":8, "y":1.25}, + {"x":9, "y":1.125}, + {"x":10, "y":1}, + {"x":11, "y":1.125}, + {"x":12, "y":1.25}, + {"x":13, "y":1.25}, + + {"x":0, "y":2.25}, + {"x":1, "y":2.25}, + {"x":2, "y":2.125}, + {"x":3, "y":2}, + {"x":4, "y":2.125}, + {"x":5, "y":2.25}, + + {"x":8, "y":2.25}, + {"x":9, "y":2.125}, + {"x":10, "y":2}, + {"x":11, "y":2.125}, + {"x":12, "y":2.25}, + {"x":13, "y":2.25}, + + {"x":3.5, "y":3.25}, + {"x":4.5, "y":3.5}, + {"x":5.5, "y":3.75}, + + {"x":7.5, "y":3.75}, + {"x":8.5, "y":3.5}, + {"x":9.5, "y":3.25} + ] + } + } +} diff --git a/layouts/default/split_3x6_5/layout.json b/layouts/default/split_3x6_5/layout.json new file mode 100644 index 00000000000..c1256eed98a --- /dev/null +++ b/layouts/default/split_3x6_5/layout.json @@ -0,0 +1,12 @@ +[{x:3,a:7},"",{x:6},""], +[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], +[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], +[{y:-0.25,x:3},"",{x:6},""], +[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], +[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], +[{y:-0.25,x:3},"",{x:6},""], +[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], +[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], +[{x:3.5},"",{x:5},""], +[{y:-0.75,x:4.5},"",{x:3},""], +[{y:-0.75,x:5.5},"",{x:1},""] diff --git a/layouts/default/split_3x6_5/readme.md b/layouts/default/split_3x6_5/readme.md new file mode 100644 index 00000000000..0e83aec2b98 --- /dev/null +++ b/layouts/default/split_3x6_5/readme.md @@ -0,0 +1,5 @@ +# split_3x6_5 + + LAYOUT_split_3x6_5 + +Layout for split keyboards with 3x6 keys and five thumb keys per hand. Examples include Kyria. diff --git a/users/bbaserdem/; b/users/bbaserdem/; new file mode 100644 index 00000000000..f3b8a2189b6 --- /dev/null +++ b/users/bbaserdem/; @@ -0,0 +1,109 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" +/* This header file contains definitons regarding custom keycodes. + * - Both regular and unicode macros are dealt with in this file + */ + +// These will be delegated to keymap specific stuff (weak definition) +bool process_record_macro(uint16_t keycode, keyrecord_t *record); + +// Unicodemap implementation +#ifdef UNICODEMAP_ENABLE +enum userspace_unicodemap { + UPC_A_CIRC, + UPC_C_CEDI, + UPC_G_BREV, + UPC_I_CIRC, + UPC_I_DOTL, + UPC_I_DOTT, + UPC_O_DIAE, + UPC_S_CEDI, + UPC_U_CIRC, + UPC_U_DIAE, + LOW_A_CIRC, + LOW_C_CEDI, + LOW_G_BREV, + LOW_I_CIRC, + LOW_I_DOTL, + LOW_I_DOTT, + LOW_O_DIAE, + LOW_S_CEDI, + LOW_U_CIRC, + LOW_U_DIAE, + ELLIPSIS, + PLANCK_CON, + ANGSTROM, + MATHPI, + BITCOIN, + UPC_ALPHA, + UPC_BETA, + UPC_GAMMA, + UPC_DELTA, + UPC_EPSILON, + UPC_ZETA, + UPC_ETA, + UPC_THETA, + UPC_IOTA, + UPC_KAPPA, + UPC_LAMBDA, + UPC_MU, + UPC_NU, + UPC_XI, + UPC_OMICRON, + UPC_PI, + UPC_RHO, + UPC_SIGMA, + UPC_TAU, + UPC_UPSILON, + UPC_PHI, + UPC_CHI, + UPC_PSI, + UPC_OMEGA, + LOW_ALPHA, + LOW_BETA, + LOW_GAMMA, + LOW_DELTA, + LOW_EPSILON, + LOW_ZETA, + LOW_ETA, + LOW_THETA, + LOW_IOTA, + LOW_KAPPA, + LOW_LAMBDA, + LOW_MU, + LOW_NU, + LOW_XI, + LOW_OMICRON, + LOW_PI, + LOW_RHO, + LOW_SIGMA, + LOW_TAU, + LOW_UPSILON, + LOW_PHI, + LOW_CHI, + LOW_PSI, + LOW_OMEGA, +}; +#endif + +// Tap dance stuff +#ifdef AUDIO_ENABLE +#ifdef TAP_DANCE_ENABLE +enum { + TD_AUDIO_TEMPO, +}; +#endif +#endif diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 68d87c2f8e4..58e6af22b50 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -134,7 +134,7 @@ void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #ifdef(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: switch(encoder_state[index].rgb) { case 0: // Effect the RGB mode @@ -283,7 +283,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { void encoder_click_action(uint8_t index) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #ifdef(RGB_MATRIX_ENABLE) + #ifdef RGB_MATRIX_ENABLE case _MEDI: switch(encoder_state[index].rgb) { case 0: // Return to no animation diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 377eb33d855..04b8a1a8c5e 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -18,14 +18,14 @@ along with this program. If not, see . */ // Tap dance definitons +#ifdef AUDIO_ENABLE #ifdef TAP_DANCE_ENABLE qk_tap_dance_action_t tap_dance_actions[] = { - #ifdef AUDIO_ENABLE // Music playback speed modulator [TD_AUDIO_TEMPO] = ACTION_TAP_DANCE_DOUBLE(MU_SLOW, MU_FAST), - #endif }; #endif +#endif // Unicode definitions; for single character keys // We mask their definitions if unicode is not enabled diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h index ce32e8ca471..f3b8a2189b6 100644 --- a/users/bbaserdem/bb-macro.h +++ b/users/bbaserdem/bb-macro.h @@ -100,10 +100,10 @@ enum userspace_unicodemap { #endif // Tap dance stuff +#ifdef AUDIO_ENABLE #ifdef TAP_DANCE_ENABLE enum { - #ifdef AUDIO_ENABLE TD_AUDIO_TEMPO, - #endif }; #endif +#endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 2bd268f592e..2da1be253bb 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -30,6 +30,17 @@ along with this program. If not, see . #if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) #define NO_PRINT #endif + +// Split transport settings +#ifdef SPLIT_KEYBOARD +#define SPLIT_TRANSPORT_MIRROR +// #define SPLIT_LAYER_STATE_ENABLE +// #define SPLIT_MODS_ENABLE +#ifdef WPM_ENABLE + // #define SPLIT_WPM_ENABLE +#endif +#endif + // Unicode entry mode #ifdef UNICODEMAP_ENABLE #define UNICODE_SELECTED_MODES UC_LNX @@ -59,15 +70,12 @@ along with this program. If not, see . // Backlight settings #ifdef BACKLIGHT_ENABLE - // Turn on breathing only if audio is not enabled, due to hardware stuff - #ifndef AUDIO_ENABLE - #define BACKLIGHT_BREATHING - #define BREATHING_PERIOD 5 - #endif + #define BACKLIGHT_BREATHING + #define BREATHING_PERIOD 5 #endif // Enable RGB LED sleep mode -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) +#ifdef RGB_MATRIX_ENABLE #define RGB_DISABLE_WHEN_USB_SUSPENDED true #endif @@ -99,24 +107,6 @@ along with this program. If not, see . #endif #endif -// For underglow light -#ifdef RGBLIGHT_ENABLE - // Enable animations - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - #define RGBLIGHT_EFFECT_TWINKLE - // Enable layer switching code - #define RGBLIGHT_LAYERS - #define RGBLIGHT_MAX_LAYERS 10 - #define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF - // If these are not defined; just default to entire board for layer - #define RGBLIGHT_LEFT_BEG 0 - #define RGBLIGHT_LEFT_NUM RGBLED_NUM - #define RGBLIGHT_RIGHT_BEG 0 - #define RGBLIGHT_RIGHT_NUM RGBLED_NUM -#endif - // For perkey leds #ifdef RGB_MATRIX_ENABLE // Start using this mode diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 41dee7322aa..0775e0a64bd 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -12,13 +12,12 @@ # Common compilation flags EXTRAFLAGS += -flto # Used to make code smaller -#LTO_ENABLE = yes +LTO_ENABLE = yes # These should be enabled in all boards MOUSEKEY_ENABLE = yes # Mouse emulation keys EXTRAKEY_ENABLE = yes # OS signals like volume control UNICODEMAP_ENABLE = yes # Used for unicode character emulation -TAP_DANCE_ENABLE = yes # Tap dance keys; i don't use tap dance but I use tap-hold # These should be disabled in all boards BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed @@ -34,6 +33,7 @@ API_SYSEX_ENABLE = no # Allows OS to send signals. BLUETOOTH_ENABLE = no # For bluetooth KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead +TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance # These features can be enabled on ARM boards; disabled for AVR due to space # NKRO_ENABLE = no # Default is 6KRO which is plenty From 553e9047e02389efa35f40181e2b3495988d6261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 22:24:22 -0400 Subject: [PATCH 66/94] Erroneous file deleted --- users/bbaserdem/; | 109 ---------------------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 users/bbaserdem/; diff --git a/users/bbaserdem/; b/users/bbaserdem/; deleted file mode 100644 index f3b8a2189b6..00000000000 --- a/users/bbaserdem/; +++ /dev/null @@ -1,109 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 -#include "bbaserdem.h" -/* This header file contains definitons regarding custom keycodes. - * - Both regular and unicode macros are dealt with in this file - */ - -// These will be delegated to keymap specific stuff (weak definition) -bool process_record_macro(uint16_t keycode, keyrecord_t *record); - -// Unicodemap implementation -#ifdef UNICODEMAP_ENABLE -enum userspace_unicodemap { - UPC_A_CIRC, - UPC_C_CEDI, - UPC_G_BREV, - UPC_I_CIRC, - UPC_I_DOTL, - UPC_I_DOTT, - UPC_O_DIAE, - UPC_S_CEDI, - UPC_U_CIRC, - UPC_U_DIAE, - LOW_A_CIRC, - LOW_C_CEDI, - LOW_G_BREV, - LOW_I_CIRC, - LOW_I_DOTL, - LOW_I_DOTT, - LOW_O_DIAE, - LOW_S_CEDI, - LOW_U_CIRC, - LOW_U_DIAE, - ELLIPSIS, - PLANCK_CON, - ANGSTROM, - MATHPI, - BITCOIN, - UPC_ALPHA, - UPC_BETA, - UPC_GAMMA, - UPC_DELTA, - UPC_EPSILON, - UPC_ZETA, - UPC_ETA, - UPC_THETA, - UPC_IOTA, - UPC_KAPPA, - UPC_LAMBDA, - UPC_MU, - UPC_NU, - UPC_XI, - UPC_OMICRON, - UPC_PI, - UPC_RHO, - UPC_SIGMA, - UPC_TAU, - UPC_UPSILON, - UPC_PHI, - UPC_CHI, - UPC_PSI, - UPC_OMEGA, - LOW_ALPHA, - LOW_BETA, - LOW_GAMMA, - LOW_DELTA, - LOW_EPSILON, - LOW_ZETA, - LOW_ETA, - LOW_THETA, - LOW_IOTA, - LOW_KAPPA, - LOW_LAMBDA, - LOW_MU, - LOW_NU, - LOW_XI, - LOW_OMICRON, - LOW_PI, - LOW_RHO, - LOW_SIGMA, - LOW_TAU, - LOW_UPSILON, - LOW_PHI, - LOW_CHI, - LOW_PSI, - LOW_OMEGA, -}; -#endif - -// Tap dance stuff -#ifdef AUDIO_ENABLE -#ifdef TAP_DANCE_ENABLE -enum { - TD_AUDIO_TEMPO, -}; -#endif -#endif From 30e793530a5e07d880ed1901f8fe95d043d76305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 22:24:56 -0400 Subject: [PATCH 67/94] Erroneous files deleted --- .../split_3x6_5/default_split_3x6_3/keymap.c | 24 ------- layouts/default/split_3x6_5/info.json | 62 ------------------- layouts/default/split_3x6_5/layout.json | 12 ---- layouts/default/split_3x6_5/readme.md | 5 -- 4 files changed, 103 deletions(-) delete mode 100644 layouts/default/split_3x6_5/default_split_3x6_3/keymap.c delete mode 100644 layouts/default/split_3x6_5/info.json delete mode 100644 layouts/default/split_3x6_5/layout.json delete mode 100644 layouts/default/split_3x6_5/readme.md diff --git a/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c b/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c deleted file mode 100644 index 4fb2bab5737..00000000000 --- a/layouts/default/split_3x6_5/default_split_3x6_3/keymap.c +++ /dev/null @@ -1,24 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * ┌───┬───┬───┬───┬───┬───┐ ┌───┬───┬───┬───┬───┬───┐ - * │Tab│ Q │ W │ E │ R │ T │ │ Y │ U │ I │ O │ P │Bsp│ - * ├───┼───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┼───┤ - * │Ctl│ A │ S │ D │ F │ G │ │ H │ J │ K │ L │ ; │ ' │ - * ├───┼───┼───┼───┼───┼───┤ ├───┼───┼───┼───┼───┼───┤ - * │Sft│ Z │ X │ C │ V │ B │ │ N │ M │ , │ . │ / │Sft│ - * └───┴───┴───┴───┴───┴───┘ └───┴───┴───┴───┴───┴───┘ - * ┌───┐ ┌───┐ - * │GUI├───┐ ┌───┤Alt│ - * └───┤Bsp├───┐ ┌───┤Ent├───┘ - * └───┤ │ │ ├───┘ - * └───┘ └───┘ - */ - [0] = 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_RSFT, - KC_LGUI, KC_BSPC, KC_SPC, KC_SPC, KC_ENT, KC_RALT - ) -}; diff --git a/layouts/default/split_3x6_5/info.json b/layouts/default/split_3x6_5/info.json deleted file mode 100644 index b1ca28168bf..00000000000 --- a/layouts/default/split_3x6_5/info.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "keyboard_name": "3x6+3 split layout", - "url": "", - "maintainer": "qmk", - "width": 14, - "height": 4.75, - "layouts": { - "LAYOUT_split_3x6_3": { - "layout": [ - {"x":0, "y":0.25}, - {"x":1, "y":0.25}, - {"x":2, "y":0.125}, - {"x":3, "y":0}, - {"x":4, "y":0.125}, - {"x":5, "y":0.25}, - - {"x":8, "y":0.25}, - {"x":9, "y":0.125}, - {"x":10, "y":0}, - {"x":11, "y":0.125}, - {"x":12, "y":0.25}, - {"x":13, "y":0.25}, - - {"x":0, "y":1.25}, - {"x":1, "y":1.25}, - {"x":2, "y":1.125}, - {"x":3, "y":1}, - {"x":4, "y":1.125}, - {"x":5, "y":1.25}, - - {"x":8, "y":1.25}, - {"x":9, "y":1.125}, - {"x":10, "y":1}, - {"x":11, "y":1.125}, - {"x":12, "y":1.25}, - {"x":13, "y":1.25}, - - {"x":0, "y":2.25}, - {"x":1, "y":2.25}, - {"x":2, "y":2.125}, - {"x":3, "y":2}, - {"x":4, "y":2.125}, - {"x":5, "y":2.25}, - - {"x":8, "y":2.25}, - {"x":9, "y":2.125}, - {"x":10, "y":2}, - {"x":11, "y":2.125}, - {"x":12, "y":2.25}, - {"x":13, "y":2.25}, - - {"x":3.5, "y":3.25}, - {"x":4.5, "y":3.5}, - {"x":5.5, "y":3.75}, - - {"x":7.5, "y":3.75}, - {"x":8.5, "y":3.5}, - {"x":9.5, "y":3.25} - ] - } - } -} diff --git a/layouts/default/split_3x6_5/layout.json b/layouts/default/split_3x6_5/layout.json deleted file mode 100644 index c1256eed98a..00000000000 --- a/layouts/default/split_3x6_5/layout.json +++ /dev/null @@ -1,12 +0,0 @@ -[{x:3,a:7},"",{x:6},""], -[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], -[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], -[{y:-0.25,x:3},"",{x:6},""], -[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], -[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], -[{y:-0.25,x:3},"",{x:6},""], -[{y:-0.875,x:2},"",{x:1},"",{x:4},"",{x:1},""], -[{y:-0.875},"","",{x:3},"",{x:2},"",{x:3},"",""], -[{x:3.5},"",{x:5},""], -[{y:-0.75,x:4.5},"",{x:3},""], -[{y:-0.75,x:5.5},"",{x:1},""] diff --git a/layouts/default/split_3x6_5/readme.md b/layouts/default/split_3x6_5/readme.md deleted file mode 100644 index 0e83aec2b98..00000000000 --- a/layouts/default/split_3x6_5/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# split_3x6_5 - - LAYOUT_split_3x6_5 - -Layout for split keyboards with 3x6 keys and five thumb keys per hand. Examples include Kyria. From 28a0891a417fa2a7889d6a3eeda9ee76b5a95458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 22:58:48 -0400 Subject: [PATCH 68/94] Made crkbd layout work with arm. --- .../crkbd/keymaps/bbaserdem-arm/chconf.h | 7 ++ .../crkbd/keymaps/bbaserdem-arm/config.h | 53 +++++++++++++ .../crkbd/keymaps/bbaserdem-arm/halconf.h | 5 ++ .../crkbd/keymaps/bbaserdem-arm/keymap.c | 79 +++++++++++++++++++ .../crkbd/keymaps/bbaserdem-arm/mcuconf.h | 6 ++ .../crkbd/keymaps/bbaserdem-arm/rules.mk | 22 ++++++ .../crkbd/keymaps/bbaserdem-arm/ssd1306.c | 0 .../README.md | 0 .../config.h | 0 .../keymap.c | 0 .../rules.mk | 0 .../README.md | 0 .../{bbaserdem => bbaserdem-disable}/chconf.h | 0 .../{bbaserdem => bbaserdem-disable}/config.h | 0 .../halconf.h | 0 .../{bbaserdem => bbaserdem-disable}/keymap.c | 34 -------- .../mcuconf.h | 0 .../{bbaserdem => bbaserdem-disable}/rules.mk | 0 users/bbaserdem/bb-encoder.c | 2 + users/bbaserdem/bb-rgb.c | 2 +- users/bbaserdem/bbaserdem.h | 6 +- users/bbaserdem/config.h | 1 - 22 files changed, 176 insertions(+), 41 deletions(-) create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/config.h create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk create mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c rename layouts/community/split_3x5_3/{bbaserdem2 => bbaserdem-disable}/README.md (100%) rename layouts/community/split_3x5_3/{bbaserdem2 => bbaserdem-disable}/config.h (100%) rename layouts/community/split_3x5_3/{bbaserdem2 => bbaserdem-disable}/keymap.c (100%) rename layouts/community/split_3x5_3/{bbaserdem2 => bbaserdem-disable}/rules.mk (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/README.md (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/chconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/config.h (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/halconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/keymap.c (67%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/mcuconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem => bbaserdem-disable}/rules.mk (100%) diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h new file mode 100644 index 00000000000..2041f2e4cd0 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h @@ -0,0 +1,7 @@ +#define CH_CFG_ST_RESOLUTION 16 +#define CH_CFG_ST_FREQUENCY 10000 +#if __has_include("platforms/chibios/common/configs/chconf.h") +# include_next "platforms/chibios/common/configs/chconf.h" +#else +# include_next "chconf.h" +#endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/config.h b/keyboards/crkbd/keymaps/bbaserdem-arm/config.h new file mode 100644 index 00000000000..27b616c1e57 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/config.h @@ -0,0 +1,53 @@ +#pragma once +#include "config_common.h" +#undef PRODUCT +#undef MANUFACTURER +#define MANUFACTURER Waffles +#define PRODUCT Protorne Keyboard +#undef USE_I2C +#undef SSD1306OLED +#define EE_HANDS +#define USE_SERIAL_PD2 +#undef RGBLED_NUM +#undef RGB_DI_PIN +#ifdef RGB_MATRIX_ENABLE +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 +#define RGB_MATRIX_SPLIT { 27, 27 } +// #define RGB_MATRIX_KEYPRESSES +// #define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// #define RGB_DISABLE_WHEN_USB_SUSPENDED true +// #define SPLIT_TRANSPORT_MIRROR +#endif +#ifdef RGBLIGHT_ENABLE +#define RGBLIGHT_ANIMATIONS +#undef RGBLED_SPLIT +#define RGBLED_SPLIT { 27, 27 } +#define RGBLIGHT_LIMIT_VAL 175 +#endif +#define RGBLED_NUM 54 +#define RGB_DI_PIN B5 +#define WS2812_PWM_DRIVER PWMD3 +#define WS2812_PWM_CHANNEL 3 +#define WS2812_PWM_PAL_MODE 2 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM3 +#define WS2812_DMA_CHANNEL 3 +#undef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D3 +#define SERIAL_USART_SPEED 921600 +#define SERIAL_USART_DRIVER SD1 +#define SERIAL_USART_TX_PAL_MODE 7 +#ifdef ENCODER_ENABLE +#define ENCODERS_PAD_A { B2 } +#define ENCODERS_PAD_B { B6 } +#define ENCODERS_PAD_A_RIGHT { B2 } +#define ENCODERS_PAD_B_RIGHT { B6 } +#define ENCODER_RESOLUTIONS { 4, 2 } +#endif +#ifdef PIMORONI_TRACKBALL +#define PIMORONI_TRACKBALL_ROTATE +#define PIMORONI_TRACKBALL_INVERT_Y +#endif +#ifdef AUDIO_ENABLE +#define AUDIO_PIN A5 +#define STARTUP_SONG SONG(ODE_TO_JOY) +#endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h new file mode 100644 index 00000000000..c144217ae45 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h @@ -0,0 +1,5 @@ +#pragma once +// #define HAL_USE_DAC TRUE +#define HAL_USE_PWM TRUE +#define HAL_USE_SERIAL TRUE +#include_next diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c b/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c new file mode 100644 index 00000000000..4f192e8fed9 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c @@ -0,0 +1,79 @@ +#include "bbaserdem.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_split_3x6_3_wrapper( + BB_ENC0,_BL1_5_,_BR1_5_,BB_ENC1, + _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, + _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, + _BL4_3_,_BR4_3_ + ), + [_CHAR] = LAYOUT_split_3x6_3_wrapper( + _______,_CL1_5_,_CR1_5_,_______, + XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, + XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, + _CL4_3_,_CR4_3_ + ), + [_GAME] = LAYOUT_split_3x6_3_wrapper( + _______,_GA1_5_,___6___, + _GA2_1_,_GA2_5_,___6___, + _GA3_1_,_GA3_5_,___6___, + _GA4_3_,___3___ + ), + [_MEDI] = LAYOUT_split_3x6_3_wrapper( + ___6___,_ME1_5_,_______, + ___6___,_ME2_5_,xxx1xxx, + ___6___,_ME3_5_,xxx1xxx, + ___3___,_ME4_3_ + ), + [_NAVI] = LAYOUT_split_3x6_3_wrapper( + ___6___,_NA1_5_,_______, + ___6___,_NA2_5_,xxx1xxx, + ___6___,_NA3_5_,xxx1xxx, + ___3___,_NA4_3_ + ), + [_SYMB] = LAYOUT_split_3x6_3_wrapper( + ___6___,_SY1_5_,_______, + ___6___,_SY2_5_,xxx1xxx, + ___6___,_SY3_5_,xxx1xxx, + ___3___,_SY4_3_ + ), + [_NUMB] = LAYOUT_split_3x6_3_wrapper( + _______,_NU1_5_,___6___, + xxx1xxx,_NU2_5_,___6___, + xxx1xxx,_NU3_5_,___6___, + _NU4_3_,___3___ + ), + [_FUNC] = LAYOUT_split_3x6_3_wrapper( + _______,_FU1_5_,___6___, + xxx1xxx,_FU2_5_,___6___, + xxx1xxx,_FU3_5_,___6___, + _FU4_3_,___3___ + ), + [_MOUS] = LAYOUT_split_3x6_3_wrapper( + _______,_MO1_5_,___6___, + xxx1xxx,_MO2_5_,___6___, + xxx1xxx,_MO3_5_,___6___, + _MO4_3_,___3___ + ), + [_MUSI] = LAYOUT_split_3x6_3_wrapper( + _MU_12_, + _MU_12_, + _MU_12_, + _MUL_3_,_MUR_3_ + ) +}; + + + +#ifdef AUDIO_ENABLE +void keyboard_pre_init_kb(void) { //thank you to @sigprof for this + // Set audio pins to analog mode + palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); + palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); +} + +void keyboard_post_init_kb(void) { + // Enable OPAMP1 as A5 → B1 follower + OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; +} +#endif //audio diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h new file mode 100644 index 00000000000..5acc7678257 --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h @@ -0,0 +1,6 @@ +#pragma once +#include_next +#undef STM32_PWM_USE_TIM3 +#define STM32_PWM_USE_TIM3 TRUE +#undef STM32_SERIAL_USE_USART1 +#define STM32_SERIAL_USE_USART1 TRUE diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk b/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk new file mode 100644 index 00000000000..f1a4e84112b --- /dev/null +++ b/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk @@ -0,0 +1,22 @@ +USER_NAME := bbaserdem +MCU = STM32F303 +CTPC = yes +DEBUG_MATRIX_SCAN_RATE_ENABLE = no +SERIAL_DRIVER = usart +WS2812_DRIVER = pwm +VIA_ENABLE = yes +OLED_ENABLE = yes +WPM_ENABLE = yes +AUDIO_ENABLE = yes #breaks reset keycode? +AUDIO_DRIVER = dac_basic +EXTRAKEY_ENABLE = yes +COMMAND_ENABLE = no +CONSOLE_ENABLE = no +BOOTMAGIC_ENABLE = lite +SPLIT_KEYBOARD = yes +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = yes +LTO_ENABLE = yes +NKRO_ENABLE = yes +ENCODER_ENABLE = yes +PIMORONI_TRACKBALL = no diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c b/keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c new file mode 100644 index 00000000000..e69de29bb2d diff --git a/layouts/community/split_3x5_3/bbaserdem2/README.md b/layouts/community/split_3x5_3/bbaserdem-disable/README.md similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem2/README.md rename to layouts/community/split_3x5_3/bbaserdem-disable/README.md diff --git a/layouts/community/split_3x5_3/bbaserdem2/config.h b/layouts/community/split_3x5_3/bbaserdem-disable/config.h similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem2/config.h rename to layouts/community/split_3x5_3/bbaserdem-disable/config.h diff --git a/layouts/community/split_3x5_3/bbaserdem2/keymap.c b/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem2/keymap.c rename to layouts/community/split_3x5_3/bbaserdem-disable/keymap.c diff --git a/layouts/community/split_3x5_3/bbaserdem2/rules.mk b/layouts/community/split_3x5_3/bbaserdem-disable/rules.mk similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem2/rules.mk rename to layouts/community/split_3x5_3/bbaserdem-disable/rules.mk diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem-disable/README.md similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/README.md rename to layouts/community/split_3x6_3/bbaserdem-disable/README.md diff --git a/layouts/community/split_3x6_3/bbaserdem/chconf.h b/layouts/community/split_3x6_3/bbaserdem-disable/chconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/chconf.h rename to layouts/community/split_3x6_3/bbaserdem-disable/chconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem-disable/config.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/config.h rename to layouts/community/split_3x6_3/bbaserdem-disable/config.h diff --git a/layouts/community/split_3x6_3/bbaserdem/halconf.h b/layouts/community/split_3x6_3/bbaserdem-disable/halconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/halconf.h rename to layouts/community/split_3x6_3/bbaserdem-disable/halconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem-disable/keymap.c similarity index 67% rename from layouts/community/split_3x6_3/bbaserdem/keymap.c rename to layouts/community/split_3x6_3/bbaserdem-disable/keymap.c index 7980b1ba802..ecddacf845e 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem-disable/keymap.c @@ -79,40 +79,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// RGB Matrix configuration -#ifdef RGB_MATRIX_ENABLE - -// crkbd -#if defined(KEYBOARD_crkbd_rev1) -/* This is left-right for CRKBD indicator light - * - The LED 42 is for spacebar specifically, leave it out of the matrix - * - This is how it looks like - * ┌──┬──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┬──┐ - * │24│23│18│17│10│09│      │36│37│44│45│50│51│ - * ├──┼02┼──┼01┼──┼00┤      ├27┼──┼28┼──┼29┼──┤ - * │25│22│19│16│11│08│     │35│38│43│46│49│52│ - * ├──┼03┼──┼04┼──┼05┤      ├32┼──┼31┼──┼30┼──┤ - * │26│21│20│15│12│07│     │34│39│42│47│48│53│ - * └──┴──┴──┴──┼──┼──┼──┐┌──┼──┼──┼──┴──┴──┴──┘ - *             │14│13│06││33│40│41│ - *             └──┴──┴──┘└──┴──┴──┘ - */ -// Sided color-setting -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 27; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -} -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 28; i < 54; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -} -// End of differentiations -#endif -// End of code for the RGB_MATRIX setup -#endif - #ifdef AUDIO_ENABLE // crkbd #if defined(KEYBOARD_crkbd_rev1) diff --git a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem-disable/mcuconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/mcuconf.h rename to layouts/community/split_3x6_3/bbaserdem-disable/mcuconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem-disable/rules.mk similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem/rules.mk rename to layouts/community/split_3x6_3/bbaserdem-disable/rules.mk diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 58e6af22b50..a9ac645e107 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -295,7 +295,9 @@ void encoder_click_action(uint8_t index) { rgb_matrix_increase_val_noeeprom(); break; case 4: // Toggle velocikey + #ifdef VELOCIKEY_ENABLE velocikey_toggle(); + #endif break; } break; diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index ee8915031ed..2b2c78e240e 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -23,7 +23,7 @@ __attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_mi // Set RGB state depending on layer void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { // Load keymap hooks - if(rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max)) { + if(rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { return; } // Do each layer seperately diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index eb61c3eff36..f9771cf1893 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -27,17 +27,13 @@ along with this program. If not, see . #ifdef AUDIO_ENABLE #include "bb-audio.h" #endif -// Underglow using rgb LEDs -#ifdef RGBLIGHT_ENABLE - #include "bb-underglow.h" -#endif // Keycap backlight using non-rgb LEDs #ifdef BACKLIGHT_ENABLE #include "bb-backlight.h" #endif // Keycap backlight using rgb LEDs #ifdef RGB_MATRIX_ENABLE - #include "bb-keylight.h" + #include "bb-rgb.h" #endif // Rotary encoder #ifdef ENCODER_ENABLE diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 2da1be253bb..ff35e8cefb1 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -127,7 +127,6 @@ along with this program. If not, see . #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Some more config options - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 // Set maximum brightness #define RGB_MATRIX_KEYPRESSES // React to key presses #define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects #endif From 8fc4822a88ec5a956cffd384693a2ac5f39d1e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 7 Sep 2021 23:18:29 -0400 Subject: [PATCH 69/94] Made layout work --- .../crkbd/keymaps/bbaserdem-arm/chconf.h | 7 -- .../crkbd/keymaps/bbaserdem-arm/config.h | 53 ------------- .../crkbd/keymaps/bbaserdem-arm/halconf.h | 5 -- .../crkbd/keymaps/bbaserdem-arm/keymap.c | 79 ------------------- .../crkbd/keymaps/bbaserdem-arm/mcuconf.h | 6 -- .../crkbd/keymaps/bbaserdem-arm/rules.mk | 22 ------ .../README.md | 0 .../{bbaserdem-disable => bbaserdem}/chconf.h | 0 .../{bbaserdem-disable => bbaserdem}/config.h | 18 ++--- .../halconf.h | 0 .../{bbaserdem-disable => bbaserdem}/keymap.c | 6 +- .../mcuconf.h | 0 .../{bbaserdem-disable => bbaserdem}/rules.mk | 16 ++-- .../split_3x6_3/bbaserdem}/ssd1306.c | 0 14 files changed, 22 insertions(+), 190 deletions(-) delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/config.h delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h delete mode 100644 keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/README.md (100%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/chconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/config.h (85%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/halconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/keymap.c (95%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/mcuconf.h (100%) rename layouts/community/split_3x6_3/{bbaserdem-disable => bbaserdem}/rules.mk (84%) rename {keyboards/crkbd/keymaps/bbaserdem-arm => layouts/community/split_3x6_3/bbaserdem}/ssd1306.c (100%) diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h deleted file mode 100644 index 2041f2e4cd0..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/chconf.h +++ /dev/null @@ -1,7 +0,0 @@ -#define CH_CFG_ST_RESOLUTION 16 -#define CH_CFG_ST_FREQUENCY 10000 -#if __has_include("platforms/chibios/common/configs/chconf.h") -# include_next "platforms/chibios/common/configs/chconf.h" -#else -# include_next "chconf.h" -#endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/config.h b/keyboards/crkbd/keymaps/bbaserdem-arm/config.h deleted file mode 100644 index 27b616c1e57..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/config.h +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once -#include "config_common.h" -#undef PRODUCT -#undef MANUFACTURER -#define MANUFACTURER Waffles -#define PRODUCT Protorne Keyboard -#undef USE_I2C -#undef SSD1306OLED -#define EE_HANDS -#define USE_SERIAL_PD2 -#undef RGBLED_NUM -#undef RGB_DI_PIN -#ifdef RGB_MATRIX_ENABLE -#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 -#define RGB_MATRIX_SPLIT { 27, 27 } -// #define RGB_MATRIX_KEYPRESSES -// #define RGB_MATRIX_FRAMEBUFFER_EFFECTS -// #define RGB_DISABLE_WHEN_USB_SUSPENDED true -// #define SPLIT_TRANSPORT_MIRROR -#endif -#ifdef RGBLIGHT_ENABLE -#define RGBLIGHT_ANIMATIONS -#undef RGBLED_SPLIT -#define RGBLED_SPLIT { 27, 27 } -#define RGBLIGHT_LIMIT_VAL 175 -#endif -#define RGBLED_NUM 54 -#define RGB_DI_PIN B5 -#define WS2812_PWM_DRIVER PWMD3 -#define WS2812_PWM_CHANNEL 3 -#define WS2812_PWM_PAL_MODE 2 -#define WS2812_DMA_STREAM STM32_DMA1_STREAM3 -#define WS2812_DMA_CHANNEL 3 -#undef SOFT_SERIAL_PIN -#define SOFT_SERIAL_PIN D3 -#define SERIAL_USART_SPEED 921600 -#define SERIAL_USART_DRIVER SD1 -#define SERIAL_USART_TX_PAL_MODE 7 -#ifdef ENCODER_ENABLE -#define ENCODERS_PAD_A { B2 } -#define ENCODERS_PAD_B { B6 } -#define ENCODERS_PAD_A_RIGHT { B2 } -#define ENCODERS_PAD_B_RIGHT { B6 } -#define ENCODER_RESOLUTIONS { 4, 2 } -#endif -#ifdef PIMORONI_TRACKBALL -#define PIMORONI_TRACKBALL_ROTATE -#define PIMORONI_TRACKBALL_INVERT_Y -#endif -#ifdef AUDIO_ENABLE -#define AUDIO_PIN A5 -#define STARTUP_SONG SONG(ODE_TO_JOY) -#endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h deleted file mode 100644 index c144217ae45..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/halconf.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -// #define HAL_USE_DAC TRUE -#define HAL_USE_PWM TRUE -#define HAL_USE_SERIAL TRUE -#include_next diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c b/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c deleted file mode 100644 index 4f192e8fed9..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/keymap.c +++ /dev/null @@ -1,79 +0,0 @@ -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_split_3x6_3_wrapper( - BB_ENC0,_BL1_5_,_BR1_5_,BB_ENC1, - _BL2_1_,_BL2_5_,_BR2_5_,_BR2_1_, - _BL3_1_,_BL3_5_,_BR3_5_,_BR3_1_, - _BL4_3_,_BR4_3_ - ), - [_CHAR] = LAYOUT_split_3x6_3_wrapper( - _______,_CL1_5_,_CR1_5_,_______, - XXXXXXX,_CL2_5_,_CR2_5_,XXXXXXX, - XXXXXXX,_CL3_5_,_CR3_5_,XXXXXXX, - _CL4_3_,_CR4_3_ - ), - [_GAME] = LAYOUT_split_3x6_3_wrapper( - _______,_GA1_5_,___6___, - _GA2_1_,_GA2_5_,___6___, - _GA3_1_,_GA3_5_,___6___, - _GA4_3_,___3___ - ), - [_MEDI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_ME1_5_,_______, - ___6___,_ME2_5_,xxx1xxx, - ___6___,_ME3_5_,xxx1xxx, - ___3___,_ME4_3_ - ), - [_NAVI] = LAYOUT_split_3x6_3_wrapper( - ___6___,_NA1_5_,_______, - ___6___,_NA2_5_,xxx1xxx, - ___6___,_NA3_5_,xxx1xxx, - ___3___,_NA4_3_ - ), - [_SYMB] = LAYOUT_split_3x6_3_wrapper( - ___6___,_SY1_5_,_______, - ___6___,_SY2_5_,xxx1xxx, - ___6___,_SY3_5_,xxx1xxx, - ___3___,_SY4_3_ - ), - [_NUMB] = LAYOUT_split_3x6_3_wrapper( - _______,_NU1_5_,___6___, - xxx1xxx,_NU2_5_,___6___, - xxx1xxx,_NU3_5_,___6___, - _NU4_3_,___3___ - ), - [_FUNC] = LAYOUT_split_3x6_3_wrapper( - _______,_FU1_5_,___6___, - xxx1xxx,_FU2_5_,___6___, - xxx1xxx,_FU3_5_,___6___, - _FU4_3_,___3___ - ), - [_MOUS] = LAYOUT_split_3x6_3_wrapper( - _______,_MO1_5_,___6___, - xxx1xxx,_MO2_5_,___6___, - xxx1xxx,_MO3_5_,___6___, - _MO4_3_,___3___ - ), - [_MUSI] = LAYOUT_split_3x6_3_wrapper( - _MU_12_, - _MU_12_, - _MU_12_, - _MUL_3_,_MUR_3_ - ) -}; - - - -#ifdef AUDIO_ENABLE -void keyboard_pre_init_kb(void) { //thank you to @sigprof for this - // Set audio pins to analog mode - palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); - palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); -} - -void keyboard_post_init_kb(void) { - // Enable OPAMP1 as A5 → B1 follower - OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; -} -#endif //audio diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h b/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h deleted file mode 100644 index 5acc7678257..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/mcuconf.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include_next -#undef STM32_PWM_USE_TIM3 -#define STM32_PWM_USE_TIM3 TRUE -#undef STM32_SERIAL_USE_USART1 -#define STM32_SERIAL_USE_USART1 TRUE diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk b/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk deleted file mode 100644 index f1a4e84112b..00000000000 --- a/keyboards/crkbd/keymaps/bbaserdem-arm/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -USER_NAME := bbaserdem -MCU = STM32F303 -CTPC = yes -DEBUG_MATRIX_SCAN_RATE_ENABLE = no -SERIAL_DRIVER = usart -WS2812_DRIVER = pwm -VIA_ENABLE = yes -OLED_ENABLE = yes -WPM_ENABLE = yes -AUDIO_ENABLE = yes #breaks reset keycode? -AUDIO_DRIVER = dac_basic -EXTRAKEY_ENABLE = yes -COMMAND_ENABLE = no -CONSOLE_ENABLE = no -BOOTMAGIC_ENABLE = lite -SPLIT_KEYBOARD = yes -RGBLIGHT_ENABLE = no -RGB_MATRIX_ENABLE = yes -LTO_ENABLE = yes -NKRO_ENABLE = yes -ENCODER_ENABLE = yes -PIMORONI_TRACKBALL = no diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/README.md b/layouts/community/split_3x6_3/bbaserdem/README.md similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem-disable/README.md rename to layouts/community/split_3x6_3/bbaserdem/README.md diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/chconf.h b/layouts/community/split_3x6_3/bbaserdem/chconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem-disable/chconf.h rename to layouts/community/split_3x6_3/bbaserdem/chconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h similarity index 85% rename from layouts/community/split_3x6_3/bbaserdem-disable/config.h rename to layouts/community/split_3x6_3/bbaserdem/config.h index 471539c8ea2..ace48a65655 100644 --- a/layouts/community/split_3x6_3/bbaserdem-disable/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -20,20 +20,20 @@ along with this program. If not, see . #ifdef KEYBOARD_crkbd_rev1 #include "config_common.h" - // Undo Eeprom handedness, try EE_HANDS later + // Use EE_HANDS to determine handedness #define EE_HANDS // Rebrand the PCB #undef PRODUCT + #define PRODUCT Protorne Keyboard #undef MANUFACTURER #define MANUFACTURER Waffles - #define PRODUCT Protorne Keyboard // Remove OLED definitions? #undef USE_I2C #undef SSD1306OLED - // Audio output on pin A5 (actualy will be output on B1) + // Audio output on pin A5 (actualy will be output on B1 using keymap init) #ifdef AUDIO_ENABLE #define AUDIO_PIN A5 #endif @@ -47,7 +47,7 @@ along with this program. If not, see . #define SERIAL_USART_DRIVER SD1 #define SERIAL_USART_TX_PAL_MODE 7 - // Things to make RGB matrix work + // Things to make RGB matrix work on the waffle board #undef RGBLED_NUM #define RGBLED_NUM 54 #undef RGB_DI_PIN @@ -55,7 +55,6 @@ along with this program. If not, see . #ifdef RGB_MATRIX_ENABLE #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 #define RGB_MATRIX_SPLIT { 27, 27 } - #define SPLIT_TRANSPORT_MIRROR #endif #define WS2812_PWM_DRIVER PWMD3 #define WS2812_PWM_CHANNEL 3 @@ -70,8 +69,9 @@ along with this program. If not, see . #endif // Encoder definitons - #define ENCODERS_PAD_A { B2 } - #define ENCODERS_PAD_B { B6 } - #define ENCODERS_PAD_A_RIGHT { B2 } - #define ENCODERS_PAD_B_RIGHT { B6 } + #define ENCODERS_PAD_A { B6 } + #define ENCODERS_PAD_B { B2 } + #define ENCODERS_PAD_A_RIGHT { B6 } + #define ENCODERS_PAD_B_RIGHT { B2 } + #define ENCODER_RESOLUTIONS { 4, 2 } #endif diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/halconf.h b/layouts/community/split_3x6_3/bbaserdem/halconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem-disable/halconf.h rename to layouts/community/split_3x6_3/bbaserdem/halconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c similarity index 95% rename from layouts/community/split_3x6_3/bbaserdem-disable/keymap.c rename to layouts/community/split_3x6_3/bbaserdem/keymap.c index ecddacf845e..5271b2ec2a5 100644 --- a/layouts/community/split_3x6_3/bbaserdem-disable/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -11,10 +11,7 @@ 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 QMK_KEYBOARD_H #include "bbaserdem.h" -#include "quantum.h" -#include const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -84,7 +81,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #if defined(KEYBOARD_crkbd_rev1) // Audio requires some fixes to work on @waffle's PCB // ! Copy pasted from ItsWaffle's waffle fork -void keyboard_pre_init_keymap(void) { //thank you to @sigprof for this +void keyboard_pre_init_keymap(void) { + //thank you to @sigprof for this // Set audio pins to analog mode palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h similarity index 100% rename from layouts/community/split_3x6_3/bbaserdem-disable/mcuconf.h rename to layouts/community/split_3x6_3/bbaserdem/mcuconf.h diff --git a/layouts/community/split_3x6_3/bbaserdem-disable/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk similarity index 84% rename from layouts/community/split_3x6_3/bbaserdem-disable/rules.mk rename to layouts/community/split_3x6_3/bbaserdem/rules.mk index 21fd9526c0d..6a7c8c1e4f2 100644 --- a/layouts/community/split_3x6_3/bbaserdem-disable/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -12,6 +12,11 @@ # Corne keyboard; with ARM ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) + # Proton C conversion + MCU = STM32F303 + CTPC = yes + # BOARD = QMK_PROTON_C + # BOOTLOADER = stm32-dfu # My usual features AUDIO_ENABLE = yes BACKLIGHT_ENABLE = no @@ -21,10 +26,6 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # Features that take otherwise too much space WPM_ENABLE = yes NKRO_ENABLE = yes - # Proton C related stuff - MCU = STM32F303 - BOARD = QMK_PROTON_C - BOOTLOADER = stm32-dfu # Config SERIAL_DRIVER = usart WS2812_DRIVER = pwm @@ -33,5 +34,10 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # These are from waffle DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 - LTO_ENABLE = no + VIA_ENABLE = yes + # COMMAND_ENABLE = no + # CONSOLE_ENABLE = no + # BOOTMAGIC_ENABLE = lite + # LTO_ENABLE = yes + # PIMORONI_TRACKBALL = no endif diff --git a/keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c similarity index 100% rename from keyboards/crkbd/keymaps/bbaserdem-arm/ssd1306.c rename to layouts/community/split_3x6_3/bbaserdem/ssd1306.c From be9b979f6efab85ecb4867ddc1c0ba7ce3ea24b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 8 Sep 2021 00:15:27 -0400 Subject: [PATCH 70/94] Fixed encoder related stuff on corne --- layouts/community/split_3x6_3/bbaserdem/config.h | 11 ++++++----- users/bbaserdem/config.h | 5 ----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index ace48a65655..1c7a0a11c1e 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -69,9 +69,10 @@ along with this program. If not, see . #endif // Encoder definitons - #define ENCODERS_PAD_A { B6 } - #define ENCODERS_PAD_B { B2 } - #define ENCODERS_PAD_A_RIGHT { B6 } - #define ENCODERS_PAD_B_RIGHT { B2 } - #define ENCODER_RESOLUTIONS { 4, 2 } + #define ENCODERS_PAD_A { B2 } + #define ENCODERS_PAD_B { B6 } + #define ENCODER_RESOLUTIONS { 4 } + #define ENCODERS_PAD_A_RIGHT { B2 } + #define ENCODERS_PAD_B_RIGHT { B6 } + #define ENCODER_RESOLUTIONS_RIGHT { 2 } #endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index ff35e8cefb1..8d849def102 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -63,11 +63,6 @@ along with this program. If not, see . #define PERMISSIVE_HOLD #define TAPPING_FORCE_HOLD -// Encoder settings -#ifdef ENCODER_ENABLE - #define ENCODER_RESOLUTION 2 -#endif - // Backlight settings #ifdef BACKLIGHT_ENABLE #define BACKLIGHT_BREATHING From 500c09c2d9549dc3f8ae0c8ac8ceea7828328282 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 8 Sep 2021 02:30:47 -0400 Subject: [PATCH 71/94] Simplified OLED code (no firmware size change) --- users/bbaserdem/bb-oled.c | 58 +++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index efda79a8806..51c7d3c1128 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -55,40 +55,40 @@ static void render_status(void) { #endif // Line 1: Layer State - oled_write_P(PSTR("Layer: "), false); + oled_write("Layer: ", false); switch (this_layer) { case _BASE: - oled_write_P(PSTR("Default\n"), false); + oled_write("Default\n", false); break; case _CHAR: - oled_write_P(PSTR("Sp. Chars\n"), false); + oled_write("Sp. Chars\n", false); break; case _GAME: - oled_write_P(PSTR("Gaming\n"), false); + oled_write("Gaming\n", false); break; case _MEDI: - oled_write_P(PSTR("Media Ctr\n"), false); + oled_write("Media Ctr\n", false); break; case _NAVI: - oled_write_P(PSTR("Navigation\n"), false); + oled_write("Navigation\n", false); break; case _SYMB: - oled_write_P(PSTR("Symbols\n"), false); + oled_write("Symbols\n", false); break; case _NUMB: - oled_write_P(PSTR("Numpad\n"), false); + oled_write("Numpad\n", false); break; case _FUNC: - oled_write_P(PSTR("Funct Keys\n"), false); + oled_write("Funct Keys\n", false); break; case _MOUS: - oled_write_P(PSTR("Mouse Keys\n"), false); + oled_write("Mouse Keys\n", false); break; case _MUSI: - oled_write_P(PSTR("Music Mode\n"), false); + oled_write("Music Mode\n", false); break; default: - oled_write_P(PSTR("???\n"), false); + oled_write("???\n", false); } // Line 2: Mod or info @@ -96,52 +96,52 @@ static void render_status(void) { // Show RGB mode as an overlay in media mode. #if defined RGB_MATRIX_ENABLE case _MEDI: - oled_write_P(PSTR("m"), false); + oled_write("m", false); itoa(rgb_matrix_config.mode, rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_write_P(PSTR(" h"), false); + oled_write(" h", false); itoa(rgb_matrix_config.hsv.h, rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_write_P(PSTR(" s"), false); + oled_write(" s", false); itoa(rgb_matrix_config.hsv.s, rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_write_P(PSTR(" v"), false); + oled_write(" v", false); itoa(rgb_matrix_config.hsv.v, rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_write_P(PSTR("\n"), false); + oled_write("\n", false); break; #endif // Show the modifier if nothing else is doing anything default: - oled_write_P((this_mod & MOD_MASK_SHIFT ) ? PSTR("Shft ") : PSTR(" "), false); - oled_write_P((this_mod & MOD_MASK_CTRL ) ? PSTR("Ctrl ") : PSTR(" "), false); - oled_write_P((this_mod & MOD_MASK_ALT ) ? PSTR("Alt" ) : PSTR(" "), false); - oled_write_P((this_mod & MOD_BIT(KC_RALT)) ? PSTR("G ") : PSTR(" "), false); - oled_write_P((this_mod & MOD_MASK_GUI ) ? PSTR("Meta ") : PSTR(" "), false); - oled_write_P(PSTR("\n"), false); + oled_write((this_mod & MOD_MASK_SHIFT ) ? "Shft " : " ", false); + oled_write((this_mod & MOD_MASK_CTRL ) ? "Ctrl " : " ", false); + oled_write((this_mod & MOD_MASK_ALT ) ? "Alt" : " ", false); + oled_write((this_mod & MOD_BIT(KC_RALT)) ? "G " : " ", false); + oled_write((this_mod & MOD_MASK_GUI ) ? "Meta " : " ", false); + oled_write("\n", false); break; } // Line 3: WPM - oled_write_P(PSTR("KM: Qwerty WPM: "), false); + oled_write("KM: Qwerty WPM: ", false); #if defined WPM_ENABLE itoa(get_current_wpm(), wpm_temp4, 10); oled_write(wpm_temp4, false); #else - oled_write_P(PSTR("N/A"), false); + oled_write("N/A", false); #endif - oled_write_P(PSTR("\n"), false); + oled_write("\n", false); // Line 4: Encoder states #ifdef ENCODER_ENABLE - oled_write_P(PSTR("EN0:"), false); + oled_write("EN0:", false); encoder_state_string(0, this_layer, encoder_temp6); oled_write(encoder_temp6, false); - oled_write_P(PSTR(" EN1:"), false); + oled_write(" EN1:", false); encoder_state_string(1, this_layer, encoder_temp6); oled_write(encoder_temp6, false); #endif - oled_write_P(PSTR("\n"), false); + oled_write("\n", false); } From ecf698c5e4df81edd3fd0e448c392d88d5d42842 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 8 Sep 2021 17:15:19 -0400 Subject: [PATCH 72/94] Removed VIA from firmware --- .../community/split_3x6_3/bbaserdem/config.h | 5 +++++ .../community/split_3x6_3/bbaserdem/rules.mk | 2 +- users/bbaserdem/bb-oled.c | 5 +++++ users/bbaserdem/config.h | 17 ++++++++++++----- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 1c7a0a11c1e..f2bbe766cad 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -33,6 +33,11 @@ along with this program. If not, see . #undef USE_I2C #undef SSD1306OLED + // Add state info transmission + #define SPLIT_LAYER_STATE_ENABLE + #define SPLIT_MODS_ENABLE + #define SPLIT_WPM_ENABLE + // Audio output on pin A5 (actualy will be output on B1 using keymap init) #ifdef AUDIO_ENABLE #define AUDIO_PIN A5 diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 6a7c8c1e4f2..49db761e4d0 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -34,7 +34,7 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # These are from waffle DEBUG_MATRIX_SCAN_RATE_ENABLE = no # output matrix scan rate in qmk console/qmk toolbox QUANTUM_LIB_SRC += i2c_master.c #drivers/chibios/i2cmaster.h needs patch - see lines 27/28 - VIA_ENABLE = yes + VIA_ENABLE = no # COMMAND_ENABLE = no # CONSOLE_ENABLE = no # BOOTMAGIC_ENABLE = lite diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 51c7d3c1128..a171d3052f8 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -29,6 +29,7 @@ along with this program. If not, see . extern rgb_config_t rgb_matrix_config; #endif +#if defined(KEYBOARD_splitkb_kyria_rev1) static void render_qmk_logo(void) { static const char PROGMEM qmk_logo[] = { 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, @@ -36,6 +37,7 @@ static void render_qmk_logo(void) { 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; oled_write_P(qmk_logo, false); } +#endif static void render_status(void) { // Function to print state information @@ -152,6 +154,9 @@ void oled_task_user(void) { #endif render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) } else { + #if defined(KEYBOARD_splitkb_kyria_rev1) render_qmk_logo(); + #endif + render_status(); } } diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 8d849def102..34e5e9488ed 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -33,7 +33,9 @@ along with this program. If not, see . // Split transport settings #ifdef SPLIT_KEYBOARD +// Enable reacting to keypresses on the other half #define SPLIT_TRANSPORT_MIRROR +// Enable communicatong layer state changes. // #define SPLIT_LAYER_STATE_ENABLE // #define SPLIT_MODS_ENABLE #ifdef WPM_ENABLE @@ -69,11 +71,6 @@ along with this program. If not, see . #define BREATHING_PERIOD 5 #endif -// Enable RGB LED sleep mode -#ifdef RGB_MATRIX_ENABLE - #define RGB_DISABLE_WHEN_USB_SUSPENDED true -#endif - // Audio definitions #ifdef AUDIO_ENABLE // Make findable songs as defaults @@ -102,8 +99,18 @@ along with this program. If not, see . #endif #endif +// OLED definitions +#ifdef OLED_ENABLE + // Timeout in one minute + #define OLED_TIMEOUT 60000 + // Fade out the screen when timing out + #define OLED_FADE_OUT + #define OLED_FADE_OUT_INTERVAL 5 +#endif + // For perkey leds #ifdef RGB_MATRIX_ENABLE + #define RGB_DISABLE_WHEN_USB_SUSPENDED true // Start using this mode #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON #define RGB_MATRIX_STARTUP_HUE 100 From b31a7968cc372dcacf5211a1e4cfe2020fd4e6ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 10 Sep 2021 03:24:49 -0400 Subject: [PATCH 73/94] Created the cropping script --- users/bbaserdem/bbaserdem.h | 86 +++++++++++++++++++---- users/bbaserdem/keymap-bitmaps/.gitignore | 3 + users/bbaserdem/keymap-bitmaps/cropBmp | 22 ++++++ 3 files changed, 98 insertions(+), 13 deletions(-) create mode 100644 users/bbaserdem/keymap-bitmaps/.gitignore create mode 100755 users/bbaserdem/keymap-bitmaps/cropBmp diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index f9771cf1893..bd9d8390e6d 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -306,9 +306,9 @@ enum userspace_layers { * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * ` ~ │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ < > * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * [ { │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ] } + * \ | │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ' " * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * \ | │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ ' " + * [ { │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ ] } * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ @@ -316,19 +316,19 @@ enum userspace_layers { * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * ` ~ │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ < > * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * / ? │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ = + + * \ | │ a A │ o O │ e E │ u U │ i I │ │ d D │ h H │ t T │ n N │ s S │ - _ * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * \ | │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ - _ + * / ? │ ; : │ q Q │ j J │ k K │ x X │ │ b B │ m M │ w W │ v V │ z Z │ = + * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * TURKISH F * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * ¬+ *±│@f F │ g G │ ğ Ğ │¶ı I │ôo OÔ│ │¥d D │®r R │ n N │°h H │£p P │|< >¦ - * ! !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ - * äq Qå│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│~w W - * !├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ ! - * `x Xà│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │#ş Şǎ + * !├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼────!┤ ! + * `x Xà│ûu UÛ│îi İÎ│€e E │âa AÂ│ûü ÜÛ│ │₺t T │ k K │µm M │ l L │´y Yá│#ş Şǎ + * ! !├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt!┼─Gui─┤ + * äq Qå│«j J<│»ö Ö>│“v V │¢c C©│”ç Ç │ │ z Z │§s S │×b B │÷. :ȧ│·, ; │~w W * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ @@ -345,15 +345,15 @@ enum userspace_layers { // The extra line for the 6th (or 0th) row #define _BL1_1_ KC_GRV #define _BR1_1_ KC_NUBS -#define _BL2_1_ KC_LBRC -#define _BR2_1_ KC_RBRC -#define _BL3_1_ KC_BSLS -#define _BR3_1_ KC_QUOT +#define _BL2_1_ KC_BSLS +#define _BR2_1_ KC_QUOT +#define _BL3_1_ KC_LBRC +#define _BR3_1_ KC_RBRC /* Extra characters layer * This is accessed using unicode; so IBus compatible apps only. * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ + * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ΙΘ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ * │ α │ ο │ ε │ ψ │ ι │ │ δ │ η │ τ │ ν │ σ │ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ @@ -427,6 +427,16 @@ enum userspace_layers { /* Symbols layer * This layer has the central columns shifted for convenience * QWERTY + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ ` │ - │ = │ { │ } │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ ~ │ _ │ + │ [ │ ] │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │CapsL│ ( │ ) │ \ │ | │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ ` ~ │ - │ = │ ] } │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ @@ -437,6 +447,16 @@ enum userspace_layers { * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ * DVORAK + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ ` │ { │ } │ / │ = │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ ~ │ [ │ ] │ ? │ + │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │CapsL│ ( │ ) │ \ │ | │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ ` ~ │ [ │ ] │ = + │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ @@ -448,6 +468,16 @@ enum userspace_layers { * └─────┴─────┴─────┘ * Turkish F * (AltGr is right on the central column, red. keys on main layer are omitted) + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ + ¬ │ / \ │ - | │ │ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ * ± │ ? ¿ │ _ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │CapsL│ │ │ │ │ + * ┌─────┼─────┼─────┼─────┴─────┴─────┘ + * │Enter│ Esc │BkSpc│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │¬+ *±│ / \ │ - | │ │Char.│ * ├─────┼─────┼─────┼─────┼─────┤ @@ -466,6 +496,16 @@ enum userspace_layers { /* Numbers layer * This layer contains numbers and the associated symbols. * QWERTY + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ " │ 4 $ │ 5 % │ 6 ^ │ ' │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ > │ 1 ! │ 2 @ │ 3 # │Char.│ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ │ 7 & │ 8 * │ 9 ( │ 0 ) │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -476,6 +516,16 @@ enum userspace_layers { * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ * DVORAK + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ _ │ 4 $ │ 5 % │ 6 ^ │ - │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ > │ 1 ! │ 2 @ │ 3 # │Char.│ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ , │ 7 & │ 8 * │ 9 ( │ 0 ) │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -486,6 +536,16 @@ enum userspace_layers { * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ * Turkish F + * - new layout + * ┌─────┬─────┬─────┬─────┬─────┐ + * │ < | │{7 ' │[8 ( │]9 )±│}0 =°│ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ │¼4 $ │½5 %⅜│¾6 & │ │ + * ├─────┼─────┼─────┼─────┼─────┤ + * │ > ¦ │¹1 !¡│²2 " │#3 ^³│Char.│ + * └─────┴─────┴─────┼─────┼─────┼─────┐ + * │ Del │ Tab │Space│ + * └─────┴─────┴─────┘ * ┌─────┬─────┬─────┬─────┬─────┐ * │ │{7 ' │[8 ( │]9 )±│}0 =°│ * ├─────┼─────┼─────┼─────┼─────┤ diff --git a/users/bbaserdem/keymap-bitmaps/.gitignore b/users/bbaserdem/keymap-bitmaps/.gitignore new file mode 100644 index 00000000000..4f6fdcf7c15 --- /dev/null +++ b/users/bbaserdem/keymap-bitmaps/.gitignore @@ -0,0 +1,3 @@ +*.bmp +splitImages +templates diff --git a/users/bbaserdem/keymap-bitmaps/cropBmp b/users/bbaserdem/keymap-bitmaps/cropBmp new file mode 100755 index 00000000000..fdb0805b910 --- /dev/null +++ b/users/bbaserdem/keymap-bitmaps/cropBmp @@ -0,0 +1,22 @@ +#!/bin/bash + +# Goes through all the files and turns them into strips in their respective folder +if [ -z "${1}" ] ; then + echo 'No argument; defaulting to script directory.' + target_dir="$(dirname "${0}")" +elif [ -d "${1}" ] ; then + echo "Targeting files in '${1}'." + target_dir="${1}" +else + echo 'Argument is not directory.' + exit 1 +fi + +output_dir="${target_dir}/splitImages" +mkdir -p "${output_dir}" + +for this_image in "${target_dir}/"*.bmp ; do + echo "Found '${this_image}'." + this_name="$(basename "${this_image%%.bmp}")" + convert "${this_image}" -crop 'x8' "${output_dir}/${this_name}"_%d.bmp +done From e0906bd6d5fbfe400c94674bc81b3663752ea0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 10 Sep 2021 15:20:59 -0400 Subject: [PATCH 74/94] Did oled testing --- users/bbaserdem/bb-oled.c | 59 +++++++++++++- users/bbaserdem/bbaserdem.h | 149 +++++++++--------------------------- 2 files changed, 92 insertions(+), 116 deletions(-) diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index a171d3052f8..70991558b75 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -39,6 +39,61 @@ static void render_qmk_logo(void) { } #endif + + +#if defined(KEYBOARD_crkbd_rev1) +// These are my images for keyboard layout +// Naming scheme is _left/right{_keyboardLayout}{_modifiers} +//static const char PROGMEM base0_L_dvor_nomod[][4] = {}; +//static const char PROGMEM base0_L_dvor_shift[][4] = {}; +//static const char PROGMEM base0_R_dvor_nomod[][4] = {}; +//static const char PROGMEM base0_R_dvor_shift[][4] = {}; +//static const char PROGMEM char1_L[][4] = {}; +//static const char PROGMEM char1_R[][4] = {}; +//static const char PROGMEM game2_L[][4] = {}; +//static const char PROGMEM medi3_R[][4] = {}; +//static const char PROGMEM navi4_R[][4] = {}; +//static const char PROGMEM symb5_R_dvor[][4] = {}; +//static const char PROGMEM numb6_L_dvor_nomod[][4] = {}; +//static const char PROGMEM numb6_L_dvor_shift[][4] = {}; +//static const char PROGMEM func7_L[][4] = {}; +//static const char PROGMEM mous8_L[][4] = {}; +//static const char PROGMEM musi9_L[][4] = {}; +static const char PROGMEM musi9_R[4][42] = { + { 0x00, 0x00, 0x00, 0xfe, 0x04, 0x18, 0x04, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x00, +0x8c, 0x12, 0x12, 0x12, 0xe4, 0x00, 0x00, 0x02, 0xfe, 0x02, 0x00, 0x00, 0xfc, 0x02, 0x02, 0x02, +0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x73, 0x00, 0x00}, { + 0x00, 0x00, 0x00, 0x81, 0x60, 0x10, 0x60, 0x81, 0x60, 0x10, 0x00, 0x01, 0x01, 0x01, 0xe0, 0xe0, +0x60, 0x61, 0x61, 0x61, 0x60, 0xf8, 0x70, 0x21, 0x01, 0x01, 0xc0, 0xe0, 0x60, 0x01, 0xf9, 0xf9, +0x00, 0x60, 0xe0, 0xc0, 0x00, 0x00, 0x9c, 0xce, 0x00, 0x00}, { + 0x18, 0x24, 0x4b, 0x48, 0x48, 0x4c, 0x4b, 0x48, 0x4b, 0x2c, 0x18, 0x00, 0x00, 0x00, 0x4f, 0xe7, +0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x7f, 0x00, 0x0f, 0x3f, 0x70, 0x60, 0xc0, 0xc1, 0xc1, +0xc0, 0x60, 0x70, 0x3f, 0x0f, 0x00, 0x73, 0x39, 0x00, 0x00}, { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, 0xf8, 0x08, 0xf0, 0x00, 0x70, 0x88, 0x88, 0x88, +0x71, 0x00, 0x70, 0x88, 0x88, 0x48, 0xff, 0x00, 0x70, 0xa8, 0xa8, 0xa8, 0xb0, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xe7, 0x00, 0x00} }; + +static void render_test(void) { + // Oled set cursor does characters; so moves in 8x6 + // Oled write raw does not advance the cursor; it has to be done seperately. + oled_write_raw_P(musi9_R[0], 42); + oled_set_cursor(8, 0); + oled_write("This text", false); + oled_advance_page(false); + oled_write_raw_P(musi9_R[1], 42); + oled_set_cursor(8, 1); + oled_write("is a test", false); + oled_advance_page(false); + oled_write_raw_P(musi9_R[2], 42); + oled_set_cursor(8, 2); + oled_write("for me to", false); + oled_advance_page(false); + oled_write_raw_P(musi9_R[3], 42); + oled_set_cursor(8, 3); + oled_write("check it.", false); +} +#endif + static void render_status(void) { // Function to print state information uint8_t this_layer = get_highest_layer(layer_state); @@ -151,12 +206,12 @@ void oled_task_user(void) { if (is_keyboard_master()) { #if defined(KEYBOARD_splitkb_kyria_rev1) render_qmk_logo(); + render_status(); #endif - render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) } else { #if defined(KEYBOARD_splitkb_kyria_rev1) render_qmk_logo(); + render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) #endif - render_status(); } } diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index bd9d8390e6d..3e9b70117e7 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -14,6 +14,7 @@ along with this program. If not, see . #pragma once #include QMK_KEYBOARD_H #include "quantum.h" +#include "keymap_dvorak.h" /* Besides loading libraries and definitions, this file has my layout defs * LAYOUTS: @@ -271,16 +272,16 @@ enum userspace_layers { #endif // MOD-tap definitions -#define GUI_A MT(MOD_LGUI, KC_A) -#define ALT_S MT(MOD_LALT, KC_S) -#define CTRL_D MT(MOD_LCTL, KC_D) -#define SHIFT_F MT(MOD_LSFT, KC_F) -#define ALTGR_X MT(MOD_RALT, KC_X) -#define GUI_SCL MT(MOD_RGUI, KC_SCLN) -#define ALT_L MT(MOD_LALT, KC_L) -#define CTRL_K MT(MOD_LCTL, KC_K) -#define SHIFT_J MT(MOD_LSFT, KC_J) -#define ALTGR_D MT(MOD_RALT, KC_DOT) +#define GUI_A MT(MOD_LGUI, DV_A) +#define ALT_O MT(MOD_LALT, DV_O) +#define CTRL_E MT(MOD_LCTL, DV_E) +#define SHIFT_U MT(MOD_LSFT, DV_U) +#define ALTGR_Q MT(MOD_RALT, DV_Q) +#define GUI_S MT(MOD_RGUI, DV_S) +#define ALT_N MT(MOD_LALT, DV_N) +#define CTRL_T MT(MOD_LCTL, DV_T) +#define SHIFT_H MT(MOD_LSFT, DV_H) +#define ALTGR_V MT(MOD_RALT, DV_V) // Layer switches #define MED_DEL LT(_MEDI, KC_DEL ) @@ -302,16 +303,6 @@ enum userspace_layers { */ /* Base layout - * QWERTY - * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * ` ~ │ q Q │ w W │ e E │ r R │ t T │ │ y Y │ u U │ i I │ o O │ p P │ < > - * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ - * \ | │ a A │ s S │ d D │ f F │ g G │ │ h H │ j J │ k K │ l L │ ; : │ ' " - * ├─Gui─┼─Alt─┼─Ctr─┼─Sft─┼─────┤ ├─────┼─Sft─┼─Ctr─┼─Alt─┼─Gui─┤ - * [ { │ z Z │ x X │ c C │ v V │ b B │ │ n N │ m M │ , < │ . > │ / ? │ ] } - * └─────┴AltGr┴─────┼─────┼─────┼─────┐ ┌─────┼─────┼─────┼─────┴AltGr┴─────┘ - * │ Del │ Tab │Space│ │Enter│ Esc │BkSpc│ - * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * DVORAK * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ * ` ~ │ ' " │ , < │ . > │ p P │ y Y │ │ f F │ g G │ c C │ r R │ l L │ < > @@ -334,26 +325,26 @@ enum userspace_layers { * └─Med─┴─Nav─┴─Sym─┘ └─Num─┴─Fun─┴─Mou─┘ * The thing about this layout is that these will fit most boards I have. */ -#define _BL1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _BR1_5_ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _BL2_5_ GUI_A, ALT_S, CTRL_D, SHIFT_F,KC_G -#define _BR2_5_ KC_H, SHIFT_J,CTRL_K, ALT_L, GUI_SCL -#define _BL3_5_ KC_Z, ALTGR_X,KC_C, KC_V, KC_B -#define _BR3_5_ KC_N, KC_M, KC_COMM,ALTGR_D,KC_SLSH +#define _BL1_5_ DV_QUOT,DV_COMM,DV_DOT, DV_P, DV_Y +#define _BR1_5_ DV_F, DV_G, DV_C, DV_R, DV_L +#define _BL2_5_ GUI_A, ALT_O, CTRL_E, SHIFT_U,DV_I +#define _BR2_5_ DV_D, SHIFT_H,CTRL_T, ALT_N, GUI_S +#define _BL3_5_ DV_SCLN,ALTGR_Q,DV_J, DV_K, DV_X +#define _BR3_5_ DV_B, DV_M, DV_W, ALTGR_V,DV_Z #define _BL4_3_ MED_DEL,NAV_TAB,SYM_SPC #define _BR4_3_ NUM_ENT,FUN_ESC,MOU_BSP // The extra line for the 6th (or 0th) row -#define _BL1_1_ KC_GRV +#define _BL1_1_ DV_GRV #define _BR1_1_ KC_NUBS -#define _BL2_1_ KC_BSLS -#define _BR2_1_ KC_QUOT -#define _BL3_1_ KC_LBRC -#define _BR3_1_ KC_RBRC +#define _BL2_1_ DV_BSLS +#define _BR2_1_ DV_MINS +#define _BL3_1_ DV_SLSH +#define _BR3_1_ DV_EQL /* Extra characters layer * This is accessed using unicode; so IBus compatible apps only. * ┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ - * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ΙΘ + * │TrFlg│Lenny│Table│ π │ υ │ │ φ │ γ │ χ │ ρ │ λ │ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ * │ α │ ο │ ε │ ψ │ ι │ │ δ │ η │ τ │ ν │ σ │ * ├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ @@ -381,7 +372,7 @@ enum userspace_layers { * ├─────┼─────┼─────┼─────┼─────┤ * Shift│ Z │ X │ C │ V │ B │ * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │Space│Enter│ Esc │ + * │ Esc │Enter│Space│ * └─────┴─────┴─────┘ */ #define _GA1_5_ KC_Q, KC_W, KC_E, KC_R, KC_T @@ -390,7 +381,7 @@ enum userspace_layers { #define _GA2_1_ KC_TAB #define _GA3_5_ KC_Z, KC_X, KC_C, KC_V, KC_B #define _GA3_1_ KC_LSFT -#define _GA4_3_ KC_SPC, KC_ENT, KC_ESC +#define _GA4_3_ KC_ESC, KC_ENT, KC_SPC /* Media layer * ┌─────┬─────┬─────┬─────┬─────┐ @@ -426,28 +417,7 @@ enum userspace_layers { /* Symbols layer * This layer has the central columns shifted for convenience - * QWERTY - * - new layout - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` │ - │ = │ { │ } │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ ~ │ _ │ + │ [ │ ] │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │CapsL│ ( │ ) │ \ │ | │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` ~ │ - │ = │ ] } │Char.│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ [ { │ ( │ ) │ ' " │CapsL│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ \ | │ _ │ + │ < │ > │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ * DVORAK - * - new layout * ┌─────┬─────┬─────┬─────┬─────┐ * │ ` │ { │ } │ / │ = │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -457,18 +427,8 @@ enum userspace_layers { * ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ ` ~ │ [ │ ] │ = + │Char.│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ / ? │ ( │ ) │ - _ │CapsL│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ \ | │ { │ } │ < │ > │ - * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │Enter│ Esc │BkSpc│ - * └─────┴─────┴─────┘ * Turkish F * (AltGr is right on the central column, red. keys on main layer are omitted) - * - new layout * ┌─────┬─────┬─────┬─────┬─────┐ * │ + ¬ │ / \ │ - | │ │ │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -478,45 +438,25 @@ enum userspace_layers { * ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ + * QWERTY * ┌─────┬─────┬─────┬─────┬─────┐ - * │¬+ *±│ / \ │ - | │ │Char.│ + * │ ` │ - │ = │ { │ } │ * ├─────┼─────┼─────┼─────┼─────┤ - * │ │ ) ± │ = ° │ │CapsL│ + * │ ~ │ _ │ + │ [ │ ] │ * ├─────┼─────┼─────┼─────┼─────┤ - * │ │ ? ¿ │ _ │ < | │ > ¦ │ + * │CapsL│ ( │ ) │ \ │ | │ * ┌─────┼─────┼─────┼─────┴─────┴─────┘ * │Enter│ Esc │BkSpc│ * └─────┴─────┴─────┘ */ -#define _SY1_5_ KC_GRV,KC_MINS,KC_EQL, KC_RBRC,BB_CHAR -#define _SY2_5_ KC_LBRC,KC_LPRN,KC_RPRN,KC_QUOT,KC_CAPS -#define _SY3_5_ KC_BSLS,KC_UNDS,KC_PLUS,KC_NUBS,LSFT(KC_NUBS) +#define _SY1_5_ DV_GRV, DV_LCBR,DV_RCBR,DV_SLSH,DV_EQL +#define _SY2_5_ DV_TILD,DV_LBRC,DV_RBRC,DV_QUES,DV_PLUS +#define _SY3_5_ KC_CAPS,DV_LPRN,DV_RPRN,DV_BSLS,DV_PIPE #define _SY4_3_ KC_ENT, KC_ESC, KC_BSPC /* Numbers layer * This layer contains numbers and the associated symbols. - * QWERTY - * - new layout - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ " │ 4 $ │ 5 % │ 6 ^ │ ' │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ > │ 1 ! │ 2 @ │ 3 # │Char.│ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ │ 7 & │ 8 * │ 9 ( │ 0 ) │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ │ 4 $ │ 5 % │ 6 ^ │ ' " │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ [ { │ 1 ! │ 2 @ │ 3 # │ ] } │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ * DVORAK - * - new layout * ┌─────┬─────┬─────┬─────┬─────┐ * │ < │ 7 & │ 8 * │ 9 ( │ 0 ) │ * ├─────┼─────┼─────┼─────┼─────┤ @@ -526,17 +466,7 @@ enum userspace_layers { * └─────┴─────┴─────┼─────┼─────┼─────┐ * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ , │ 7 & │ 8 * │ 9 ( │ 0 ) │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ . │ 4 $ │ 5 % │ 6 ^ │ - _ │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ / ? │ 1 ! │ 2 @ │ 3 # │ = + │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ * Turkish F - * - new layout * ┌─────┬─────┬─────┬─────┬─────┐ * │ < | │{7 ' │[8 ( │]9 )±│}0 =°│ * ├─────┼─────┼─────┼─────┼─────┤ @@ -546,19 +476,10 @@ enum userspace_layers { * └─────┴─────┴─────┼─────┼─────┼─────┐ * │ Del │ Tab │Space│ * └─────┴─────┴─────┘ - * ┌─────┬─────┬─────┬─────┬─────┐ - * │ │{7 ' │[8 ( │]9 )±│}0 =°│ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ │¼4 $ │½5 %⅜│¾6 & │ │ - * ├─────┼─────┼─────┼─────┼─────┤ - * │ │¹1 !¡│²2 " │#3 ^³│ │ - * └─────┴─────┴─────┼─────┼─────┼─────┐ - * │ Del │ Tab │Space│ - * └─────┴─────┴─────┘ */ -#define _NU1_5_ KC_W, KC_7, KC_8, KC_9, KC_0 -#define _NU2_5_ KC_E, KC_4, KC_5, KC_6, KC_QUOT -#define _NU3_5_ KC_LBRC,KC_1, KC_2, KC_3, KC_RBRC +#define _NU1_5_ KC_NUBS,KC_7, KC_8, KC_9, KC_0 +#define _NU2_5_ DV_UNDS,KC_4, KC_5, KC_6, DV_MINS +#define _NU3_5_ LSFT(KC_NUBS), KC_1, KC_2, KC_3, BB_CHAR #define _NU4_3_ KC_DEL, KC_TAB, KC_SPC /* Function layer From bab1a81f95d4828ea48936ad62a4c7b0aa6e3207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 11 Sep 2021 14:04:17 -0400 Subject: [PATCH 75/94] Updated OLED code --- users/bbaserdem/bb-encoder.c | 87 +++++++ users/bbaserdem/bb-encoder.h | 1 + users/bbaserdem/bb-oled.c | 431 +++++++++++++++++++++++++++++------ 3 files changed, 446 insertions(+), 73 deletions(-) diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index a9ac645e107..f63be9f931a 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -43,6 +43,93 @@ void keyboard_post_init_encoder(void) { } // Oled string printing for given layer and index +void encoder_state_string_long(uint8_t index, uint8_t layer, char* buffer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled + #ifdef RGB_MATRIX_ENABLE + case _MEDI: + switch (encoder_state[index].rgb) { + case 0: + strcpy(buffer, "ani mode"); + break; + case 1: + strcpy(buffer, "hue "); + break; + case 2: + strcpy(buffer, "saturat."); + break; + case 3: + strcpy(buffer, "bright. "); + break; + case 4: + strcpy(buffer, "ani. spd"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + #endif + // If pointer control is enabled + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (encoder_state[index].point) { + case 0: + strcpy(buffer, "Lateral "); + break; + case 1: + strcpy(buffer, "Vertical"); + break; + case 2: + strcpy(buffer, "Scr. Ver"); + break; + case 3: + strcpy(buffer, "Scr. Lat"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + #endif + default: + switch (encoder_state[index].base) { + case 0: + strcpy(buffer, "Volume "); + break; + case 1: + strcpy(buffer, "Song "); + break; + case 2: + strcpy(buffer, "Sink "); + break; + case 3: + strcpy(buffer, "Src. Vol"); + break; + case 4: + strcpy(buffer, "Source "); + break; + case 5: + strcpy(buffer, "Arrow LR"); + break; + case 6: + strcpy(buffer, "Arrow UD"); + break; + case 7: + strcpy(buffer, "Page U/D"); + break; + case 8: + strcpy(buffer, "Erase "); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + } +} + void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { // Get the layer straight from the main function switch (layer) { diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 792555ab916..92011c12b3a 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -19,6 +19,7 @@ along with this program. If not, see . // Code to print status string void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); +void encoder_state_string_long(uint8_t index, uint8_t layer, char* buffer); // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 70991558b75..2df1ceab409 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -15,13 +15,12 @@ along with this program. If not, see . #ifdef ENCODER_ENABLE #include "bb-encoder.h" #endif -/* ROTARY ENCODER - * This contains my general rotary encoder code - * Encoders each have a list of different modes they can be in. - * Each mode also have an on click action as well. - * Modes can be cycled using either shift-click or ctrl-click - * Modes can be reset using OS click - * Some modes are only accessible through some keymap layers +/* OLED ENCODER + * This contains my general oled code + * Currently I have two setups with OLEDs + * - Kyria; with 128x64 but with low memory (elite C) + * - Protorne; wh 128x32 but with excellent memory + * This file differentiates only between those two */ // Following line imports reading of RGB settings @@ -29,75 +28,367 @@ along with this program. If not, see . extern rgb_config_t rgb_matrix_config; #endif -#if defined(KEYBOARD_splitkb_kyria_rev1) -static void render_qmk_logo(void) { - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - oled_write_P(qmk_logo, false); -} -#endif - - - #if defined(KEYBOARD_crkbd_rev1) // These are my images for keyboard layout // Naming scheme is _left/right{_keyboardLayout}{_modifiers} -//static const char PROGMEM base0_L_dvor_nomod[][4] = {}; -//static const char PROGMEM base0_L_dvor_shift[][4] = {}; +static const char PROGMEM base0_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, + 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, + 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, + 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, + 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, + 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, + 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, + 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, + 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; +static const char PROGMEM base0_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, + 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, + 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, + 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, + 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, + 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, + 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, + 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, + 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; //static const char PROGMEM base0_R_dvor_nomod[][4] = {}; //static const char PROGMEM base0_R_dvor_shift[][4] = {}; -//static const char PROGMEM char1_L[][4] = {}; +static const char PROGMEM char1_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, + 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, + 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, + 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, + 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, + 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, + 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, + 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; //static const char PROGMEM char1_R[][4] = {}; -//static const char PROGMEM game2_L[][4] = {}; +static const char PROGMEM game2_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, + 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, + 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, + 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, + 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, + 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, + 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, + 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, + 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; //static const char PROGMEM medi3_R[][4] = {}; //static const char PROGMEM navi4_R[][4] = {}; //static const char PROGMEM symb5_R_dvor[][4] = {}; -//static const char PROGMEM numb6_L_dvor_nomod[][4] = {}; -//static const char PROGMEM numb6_L_dvor_shift[][4] = {}; -//static const char PROGMEM func7_L[][4] = {}; -//static const char PROGMEM mous8_L[][4] = {}; -//static const char PROGMEM musi9_L[][4] = {}; +static const char PROGMEM numb6_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; +static const char PROGMEM numb6_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, + 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, + 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, + 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, + 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; +static const char PROGMEM func7_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, + 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, + 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, + 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, + 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 + },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, + 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, + 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, + 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, + 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; +static const char PROGMEM mous8_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, + 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, + 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 + },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, + 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, + 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, + 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, + 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f + },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, + 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, + 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; +static const char PROGMEM musi9_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, + 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, + 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, + 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, + 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, + 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, + 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, + 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; static const char PROGMEM musi9_R[4][42] = { - { 0x00, 0x00, 0x00, 0xfe, 0x04, 0x18, 0x04, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x00, -0x8c, 0x12, 0x12, 0x12, 0xe4, 0x00, 0x00, 0x02, 0xfe, 0x02, 0x00, 0x00, 0xfc, 0x02, 0x02, 0x02, -0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x73, 0x00, 0x00}, { - 0x00, 0x00, 0x00, 0x81, 0x60, 0x10, 0x60, 0x81, 0x60, 0x10, 0x00, 0x01, 0x01, 0x01, 0xe0, 0xe0, -0x60, 0x61, 0x61, 0x61, 0x60, 0xf8, 0x70, 0x21, 0x01, 0x01, 0xc0, 0xe0, 0x60, 0x01, 0xf9, 0xf9, -0x00, 0x60, 0xe0, 0xc0, 0x00, 0x00, 0x9c, 0xce, 0x00, 0x00}, { - 0x18, 0x24, 0x4b, 0x48, 0x48, 0x4c, 0x4b, 0x48, 0x4b, 0x2c, 0x18, 0x00, 0x00, 0x00, 0x4f, 0xe7, -0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x7f, 0x00, 0x0f, 0x3f, 0x70, 0x60, 0xc0, 0xc1, 0xc1, -0xc0, 0x60, 0x70, 0x3f, 0x0f, 0x00, 0x73, 0x39, 0x00, 0x00}, { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x08, 0xf8, 0x08, 0xf0, 0x00, 0x70, 0x88, 0x88, 0x88, -0x71, 0x00, 0x70, 0x88, 0x88, 0x48, 0xff, 0x00, 0x70, 0xa8, 0xa8, 0xa8, 0xb0, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xe7, 0x00, 0x00} }; - -static void render_test(void) { - // Oled set cursor does characters; so moves in 8x6 - // Oled write raw does not advance the cursor; it has to be done seperately. - oled_write_raw_P(musi9_R[0], 42); - oled_set_cursor(8, 0); - oled_write("This text", false); - oled_advance_page(false); - oled_write_raw_P(musi9_R[1], 42); - oled_set_cursor(8, 1); - oled_write("is a test", false); - oled_advance_page(false); - oled_write_raw_P(musi9_R[2], 42); - oled_set_cursor(8, 2); - oled_write("for me to", false); - oled_advance_page(false); - oled_write_raw_P(musi9_R[3], 42); - oled_set_cursor(8, 3); - oled_write("check it.", false); + { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, + 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, + 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, + 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, + 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, + 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, + 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, + 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, + 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; +static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; +static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; +static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; +static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; +static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; +static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; + +void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { + // Write modifiers starting from said column and row; does 14 characters + // Looks like: + // Mods: + oled_set_cursor(col, row); + oled_write("Mods: ", false); + // Meta + if (mods & MOD_MASK_GUI) { + oled_write_raw_P(mod_meta, 12); + oled_set_cursor(col + 8, row); + } else { + oled_write(" ", false); + } + // Alt(Gr) + if (mods & MOD_BIT(KC_RALT)) { + oled_write_raw_P(mod_altR, 12); + oled_set_cursor(col + 10, row); + } else if (mods & MOD_MASK_ALT) { + oled_write_raw_P(mod_altL, 12); + oled_set_cursor(col + 10, row); + } else { + oled_write(" ", false); + } + // Ctrl + if (mods & MOD_MASK_CTRL) { + oled_write_raw_P(mod_ctrl, 12); + oled_set_cursor(col + 12, row); + } else { + oled_write(" ", false); + } + // Shift + if (mods & MOD_MASK_SHIFT) { + oled_write_raw_P(mod_shft, 12); + oled_set_cursor(col + 14, row); + } else { + oled_write(" ", false); + } +} + +void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { + // Renders the encoder state, 14 characters + static char encoder_temp9[9] = {0}; + + oled_set_cursor(col, row); + #if defined ENCODER_ENABLE + oled_write("Enc: ", false); + encoder_state_string_long(index, layer, encoder_temp9); + oled_write(encoder_temp9, false); + #else + oled_set_cursor(col, row); + oled_write("No enc. avail.", false); + #endif +} + +void render_wpm(uint8_t row, uint8_t col) { + // Renders the WPM, 14 characters + static char wpm_temp4[4] = {0}; + + oled_set_cursor(col, row); + #if defined WPM_ENABLE + oled_write("WPM: ", false); + itoa(get_current_wpm(), wpm_temp4, 10); + oled_write(wpm_temp4, false); + oled_write(" ", false); + #else + oled_write("WPM not avail.", false); + #endif +} + +void render_keymap(uint8_t row, uint8_t col) { + // Render the oled layout + oled_set_cursor(col, row); + oled_write("Layout: DVORAK", false); +} + +void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { + // Draw this image iteratively + for (int i = 0; i < 4; i++) { + oled_set_cursor(col, row + i); + oled_write_raw_P(image[i], 42); + } +} + +void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { + // Render the requested image on the given column and row + // Don't grab highest layer; instead compare from top to bottom. + // Highest layer might be on the other side + if (isLeft) { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_L); + } else if (layer_state_cmp(layer_state, _MOUS)) { + draw_image(row, col, mous8_L); + } else if (layer_state_cmp(layer_state, _FUNC)) { + draw_image(row, col, func7_L); + } else if (layer_state_cmp(layer_state, _NUMB)) { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, numb6_L_dvor_shift); + } else { + draw_image(row, col, numb6_L_dvor_nomod); + } + } else if (layer_state_cmp(layer_state, _GAME)) { + draw_image(row, col, game2_L); + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_L); + } else { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_L_dvor_shift); + } else { + draw_image(row, col, base0_L_dvor_nomod); + } + } + } else { + // WIP + draw_image(row, col, musi9_R); + } } + +void render_rgb(uint8_t row, uint8_t col) { + // Render the RGB state on the given column and row + static char rgb_temp4[4] = {0}; + static char rgb_temp3[3] = {0}; + + oled_set_cursor(col, row); +#if defined RGB_MATRIX_ENABLE + if (rgb_matrix_is_enabled()) { + oled_write_raw_P(rgb_enab, 12); + } else { + oled_write_raw_P(rgb_disa, 12); + } + oled_set_cursor(col + 2, row); + oled_write(" hue sat val", false); + oled_set_cursor(col, row + 1); + itoa(rgb_matrix_get_mode(), rgb_temp3, 10); + oled_write(rgb_temp3, false); + oled_write(" ", false); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); + oled_write(rgb_temp4, false); +#else + oled_write("-RGB disabled-", false); #endif +} + +void render_status_left(void) { + // Left side looks like this on the left half + // (Should be 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + // Right half is whatever layer image needs be + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // MODIFIERS + render_modifiers(0, 0, this_mod); + + // Encoders + render_encoder(1, 0, 0, this_layer); + + // WPM text + render_wpm(2, 0); + + // Visual layout + render_keymap(3, 0); + + // Draw the image after 14'th character + render_layout(0, 14, this_mod, true); +} + +void render_status_right(void) { + // Right half is whatever layer image needs be on the left + // Right side looks like this on the right half + // (Should be after the 12'th character; max 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // Draw the image + render_layout(0, 0, this_mod, false); + // Modifiers + render_modifiers(0, 7, this_mod); + + // Encoder + render_encoder(1, 7, 1, this_layer); + + // RGB State; WIP + render_rgb(2, 7); +} +#endif + +#if defined(KEYBOARD_splitkb_kyria_rev1) +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(qmk_logo, false); +} static void render_status(void) { // Function to print state information uint8_t this_layer = get_highest_layer(layer_state); uint8_t this_mod = get_mods(); + // Render qmk + render_qmk_logo(); // Temporary variable for RGB #if defined RGB_MATRIX_ENABLE static char rgb_temp4[4] = {0}; @@ -110,7 +401,6 @@ static void render_status(void) { #if defined ENCODER_ENABLE static char encoder_temp6[6] = {0}; #endif - // Line 1: Layer State oled_write("Layer: ", false); switch (this_layer) { @@ -147,7 +437,6 @@ static void render_status(void) { default: oled_write("???\n", false); } - // Line 2: Mod or info switch (this_layer) { // Show RGB mode as an overlay in media mode. @@ -178,7 +467,6 @@ static void render_status(void) { oled_write("\n", false); break; } - // Line 3: WPM oled_write("KM: Qwerty WPM: ", false); #if defined WPM_ENABLE @@ -188,7 +476,6 @@ static void render_status(void) { oled_write("N/A", false); #endif oled_write("\n", false); - // Line 4: Encoder states #ifdef ENCODER_ENABLE oled_write("EN0:", false); @@ -199,19 +486,17 @@ static void render_status(void) { oled_write(encoder_temp6, false); #endif oled_write("\n", false); - } +#endif void oled_task_user(void) { - if (is_keyboard_master()) { - #if defined(KEYBOARD_splitkb_kyria_rev1) - render_qmk_logo(); - render_status(); - #endif + #if defined(KEYBOARD_splitkb_kyria_rev1) + render_status(); + #elif defined(KEYBOARD_crkbd_rev1) + if (is_keyboard_left()) { + render_status_left(); } else { - #if defined(KEYBOARD_splitkb_kyria_rev1) - render_qmk_logo(); - render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc) - #endif + render_status_right(); } + #endif } From b4188bdb2b44a5122ff2cf066167a7b10161df03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 11 Sep 2021 16:27:55 -0400 Subject: [PATCH 76/94] Refactored OLED code --- .../splitkb/kyria/keymaps/bbaserdem/config.h | 5 - .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 30 +- .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 2 +- .../community/split_3x6_3/bbaserdem/README.md | 5 +- .../split_3x6_3/bbaserdem/bb-crkbdarm-oled.c | 447 ++++++++++++++ .../split_3x6_3/bbaserdem/bb-crkbdarm-oled.h | 19 + .../community/split_3x6_3/bbaserdem/keymap.c | 10 + .../community/split_3x6_3/bbaserdem/rules.mk | 1 + users/bbaserdem/bb-encoder.c | 179 +----- users/bbaserdem/bb-encoder.h | 6 +- users/bbaserdem/bb-oled.c | 567 ++++++------------ users/bbaserdem/bb-oled.h | 6 + users/bbaserdem/config.h | 2 +- users/bbaserdem/rules.mk | 2 +- 14 files changed, 705 insertions(+), 576 deletions(-) create mode 100644 layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c create mode 100644 layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h index 3e873660a82..e06a6144d0d 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -25,9 +25,4 @@ along with this program. If not, see . #ifdef OLED_ENABLE #define OLED_DISPLAY_128X64 #endif - - // If you are using an Elite C rev3 on the slave side, uncomment the lines below: - // However; this causes the halves to be unresponsive - // #define SPLIT_USB_DETECT - // #define NO_USB_STARTUP_CHECK #endif diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 97f942ab8fc..8b540057c71 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -89,12 +89,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -// Kyria specific code -#ifdef KEYBOARD_splitkb_kyria_rev1 - // Rotate the display on kyria - #ifdef OLED_ENABLE - oled_rotation_t oled_init_user(oled_rotation_t rotation) { - return OLED_ROTATION_180; - } - #endif //OLED_ENABLE -#endif //KEYBOARD_kyria_rev1 +#ifdef KEYBOARD_splitkb_kyria_rev1 // Kyria specific code +#ifdef OLED_ENABLE // Kyria's oled screen +// Rotate the display on kyria +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + return OLED_ROTATION_180; +} +// QMK logo screen renderer; will render 126x32 image; but on the default font. +static void render_qmk_logo(void) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_write_P(qmk_logo, false); +} +// For kyria; print logo, and allow default status printing +bool oled_task_keymap(void) { + render_qmk_logo(); + return true; +} +#endif //OLED_ENABLE +#endif //KEYBOARD_splitkb_kyria_rev1 diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index c98f1772960..ec18b9b1949 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -22,5 +22,5 @@ ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) # Space savers NKRO_ENABLE = no VELOCIKEY_ENABLE = no - WPM_ENABLE = yes + # WPM_ENABLE = no endif diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem/README.md index d89b13f83f6..6d0cda270ad 100644 --- a/layouts/community/split_3x6_3/bbaserdem/README.md +++ b/layouts/community/split_3x6_3/bbaserdem/README.md @@ -12,7 +12,4 @@ using their `crkbd:rev1:arm` build. Build commands; -* For ARM: -`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` -* For ARM: -`CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` +* For ARM: `CFLAGS="-Wno-error=deprecated" qmk flash -kb crkdb/rev1 -km bbaserdem -bl dfu-util-split-{left,right}` diff --git a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c new file mode 100644 index 00000000000..c869458b952 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c @@ -0,0 +1,447 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-oled.h" +#include "bb-crkbdarm-oled.h" +#ifdef ENCODER_ENABLE + #include "bb-encoder.h" +#endif + +// PROGMEM images +// Naming scheme is _left/right{_keyboardLayout}{_modifiers} +static const char PROGMEM base0_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, + 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, + 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, + 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, + 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, + 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, + 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, + 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, + 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; +static const char PROGMEM base0_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, + 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, + 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, + 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, + 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, + 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, + 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, + 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, + 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; +static const char PROGMEM base0_R_dvor_nomod[4][42] = { + { 0x00,0xfc,0x12,0x12,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x70,0x88, + 0x88,0x88,0x88,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x00,0x02,0x7e,0x80, + 0x80,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x80,0x80,0xf0,0x00,0xf0,0x02,0x82,0x82,0x01,0x00,0x00,0x80, + 0xf0,0x80,0x80,0x00,0xc0,0x40,0x40,0x40,0x80,0x00,0x80,0x40,0x40,0x40, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x83,0x04,0x04,0x02,0x07,0x00,0x07,0x01,0x00,0x00,0x07,0x00,0x00,0x00, + 0x03,0x04,0x04,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x04,0x05,0x05,0x05, + 0x02,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x3f,0x24,0x22,0x22,0x1c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x1e,0x20, + 0x1c,0x20,0x1e,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x22,0x32,0x2a,0x26, + 0x22,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM base0_R_dvor_shift[4][42] = { + { 0xfe,0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xfc,0x02, + 0x02,0x02,0x84,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x00,0x04,0x88,0x50,0x20,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xf1,0x10,0x10,0x10,0xe0,0x00,0xf0,0x81,0x81,0x81,0xf0,0x00,0x10,0x11, + 0xf1,0x11,0x10,0x00,0xf1,0x60,0x80,0x00,0xf1,0x00,0x61,0x91,0x91,0x91, + 0x21,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x8f,0x88,0x88,0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x8f,0x00,0x80,0x00, + 0x0f,0x00,0x80,0x00,0x8f,0x00,0x01,0x06,0x8f,0x00,0x84,0x88,0x88,0x88, + 0x87,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x7f,0x44,0x44,0x44,0x3b,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x1f,0x60, + 0x1c,0x60,0x1f,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x70,0x48,0x44,0x42, + 0x41,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM char1_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, + 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, + 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, + 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, + 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, + 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, + 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, + 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; +static const char PROGMEM char1_R[4][42] = { + { 0x70,0x88,0xf0,0x88,0x70,0x00,0xfe,0x02,0x02,0x02,0x06,0x00,0x88,0x48, + 0x70,0x90,0x88,0x00,0xf0,0x88,0x88,0x88,0x70,0x00,0xc0,0x30,0x0c,0x30, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xa0,0x50,0x53,0x90,0x20,0x00,0xc0,0x80,0x40,0x40,0x80,0x00,0x40,0x40, + 0xc0,0x40,0x40,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x80,0x40,0xc0,0x40, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x03,0x84,0x84,0x04,0x03,0x00,0x07,0x00,0x00,0x00,0x1f,0x00,0x00,0x80, + 0x83,0x84,0x00,0x00,0x00,0x83,0x54,0x8b,0x00,0x00,0x83,0x84,0x84,0x83, + 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0xff,0x24,0x24,0x27,0x18,0x00,0x7e,0x10,0x20,0x20,0x1e,0x00,0x2f,0x30, + 0x00,0x30,0x2f,0x00,0xe0,0x38,0x25,0x38,0xe0,0x00,0x18,0x26,0xa1,0xa0, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM game2_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, + 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, + 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, + 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, + 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, + 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, + 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, + 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, + 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; +static const char PROGMEM medi3_R[4][42] = { + { 0xe0,0x00,0x38,0x00,0xe0,0x00,0x7f,0x02,0x9c,0x02,0x7f,0x00,0x7f,0x08, + 0x88,0x08,0x7f,0x00,0x26,0x49,0xc9,0x49,0x32,0x00,0x07,0x18,0xa0,0x18, + 0x07,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x01,0x01,0xf1,0x70,0x00,0xf0,0x81,0xc3,0xe1,0xf0,0x00,0x00,0x71, + 0x03,0x71,0x00,0x00,0x00,0xc1,0xc3,0xc1,0x00,0x00,0xf0,0xe1,0xc3,0x81, + 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 + },{ 0x0e,0x0a,0x0c,0x0f,0x00,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, + 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, + 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 + },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, + 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, + 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM navi4_R[4][42] = { + { 0xe0,0x10,0x54,0x38,0x10,0x00,0xfc,0x24,0x24,0x24,0x18,0x00,0x0c,0x10, + 0xe0,0x10,0x0c,0x00,0x8c,0x50,0x20,0x50,0x8c,0x00,0xc0,0xbe,0xa2,0xbe, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0xc1,0xa1,0x81,0x00,0x00,0x01,0x80,0x40,0x20,0x00,0x00,0x00,0x00, + 0xf1,0x00,0x00,0x00,0x41,0x20,0xd0,0x20,0x41,0x00,0x01,0x21,0x41,0x81, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x00,0x49,0x4a,0x48,0x87,0x00,0x81,0x82,0x85,0x89,0x01,0x00,0x01,0x02, + 0x85,0x02,0x01,0x00,0x40,0x40,0x47,0x40,0x40,0x00,0x81,0x09,0x05,0x02, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x12,0x65,0x85,0x65,0x17,0x00,0x07,0x01,0x06,0x18,0x60,0x00,0x88,0x90, + 0xaf,0x90,0x88,0x00,0x04,0x02,0x7d,0x02,0x04,0x00,0x01,0x46,0x58,0x60, + 0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM symb5_R_dvor[4][42] = { + { 0x00,0x02,0x04,0x08,0x00,0x00,0x20,0x20,0xdc,0x02,0x02,0x00,0x02,0x02, + 0xdc,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x50,0x50,0x50,0x50, + 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xf0,0x11,0x12,0x02,0x00,0x02,0x12, + 0x11,0xf0,0x00,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00,0xc0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x00,0x1f,0x10,0x90,0x00,0x00,0x00,0x90, + 0x10,0x1f,0x00,0x00,0xc0,0x00,0x14,0x03,0x00,0x00,0x01,0x01,0x87,0x01, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1c,0x63,0x80,0x00,0x00,0x00,0x80, + 0x63,0x1c,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x7f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +static const char PROGMEM numb6_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; +static const char PROGMEM numb6_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, + 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, + 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, + 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, + 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; +static const char PROGMEM func7_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, + 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, + 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, + 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, + 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 + },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, + 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, + 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, + 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, + 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; +static const char PROGMEM mous8_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, + 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, + 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 + },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, + 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, + 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, + 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, + 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f + },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, + 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, + 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; +static const char PROGMEM musi9_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, + 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, + 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, + 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, + 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, + 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, + 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, + 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; +static const char PROGMEM musi9_R[4][42] = { + { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, + 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, + 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, + 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, + 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, + 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, + 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, + 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, + 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; +// Helper function that draws these images +void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { + // Draw this image iteratively + for (int i = 0; i < 4; i++) { + oled_set_cursor(col, row + i); + oled_write_raw_P(image[i], 42); + } +} +// Custom 2 character wide icons +static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; +static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; +static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; +static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; +static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; +static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; +static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; + + +// Write modifiers to the screen +void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { + // Looks like Mods: + oled_set_cursor(col, row); + oled_write("Mods: ", false); + // Meta + if (mods & MOD_MASK_GUI) { + oled_write_raw_P(mod_meta, 12); + oled_set_cursor(col + 8, row); + } else { + oled_write(" ", false); + } + // Alt(Gr) + if (mods & MOD_BIT(KC_RALT)) { + oled_write_raw_P(mod_altR, 12); + oled_set_cursor(col + 10, row); + } else if (mods & MOD_MASK_ALT) { + oled_write_raw_P(mod_altL, 12); + oled_set_cursor(col + 10, row); + } else { + oled_write(" ", false); + } + // Ctrl + if (mods & MOD_MASK_CTRL) { + oled_write_raw_P(mod_ctrl, 12); + oled_set_cursor(col + 12, row); + } else { + oled_write(" ", false); + } + // Shift + if (mods & MOD_MASK_SHIFT) { + oled_write_raw_P(mod_shft, 12); + oled_set_cursor(col + 14, row); + } else { + oled_write(" ", false); + } +} + +// Renders the encoder state, 14 characters +void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { + static char encoder_temp9[9] = {0}; + + oled_set_cursor(col, row); + #if defined ENCODER_ENABLE + oled_write("Enc: ", false); + encoder_state_string8(index, layer, encoder_temp9); + oled_write(encoder_temp9, false); + #else + oled_set_cursor(col, row); + oled_write("No enc. avail.", false); + #endif +} + +// Writes WPM on the screen +void render_wpm(uint8_t row, uint8_t col) { + // Renders the WPM, 14 characters + static char wpm_temp4[4] = {0}; + + oled_set_cursor(col, row); + #if defined WPM_ENABLE + oled_write("WPM: ", false); + itoa(get_current_wpm(), wpm_temp4, 10); + oled_write(wpm_temp4, false); + oled_write(" ", false); + #else + oled_write("WPM not avail.", false); + #endif +} + +// Writes the currently used OLED display layout +void render_keymap(uint8_t row, uint8_t col) { + // Render the oled layout + oled_set_cursor(col, row); + oled_write("Layout: DVORAK", false); +} + +// Draws the image of the currently used layout +void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { + // Render the requested image on the given column and row + // Don't grab highest layer; instead compare from top to bottom. + // Highest layer might be on the other side + if (isLeft) { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_L); + } else if (layer_state_cmp(layer_state, _MOUS)) { + draw_image(row, col, mous8_L); + } else if (layer_state_cmp(layer_state, _FUNC)) { + draw_image(row, col, func7_L); + } else if (layer_state_cmp(layer_state, _NUMB)) { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, numb6_L_dvor_shift); + } else { + draw_image(row, col, numb6_L_dvor_nomod); + } + } else if (layer_state_cmp(layer_state, _GAME)) { + draw_image(row, col, game2_L); + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_L); + } else { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_L_dvor_shift); + } else { + draw_image(row, col, base0_L_dvor_nomod); + } + } + } else { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_R); + } else if (layer_state_cmp(layer_state, _SYMB)) { + draw_image(row, col, symb5_R_dvor); + } else if (layer_state_cmp(layer_state, _NAVI)) { + draw_image(row, col, navi4_R); + } else if (layer_state_cmp(layer_state, _MEDI)) { + draw_image(row, col, medi3_R); + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_R); + } else { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_R_dvor_shift); + } else { + draw_image(row, col, base0_R_dvor_nomod); + } + } + } +} + +// Render the RGB state on the given column and row +void render_rgb(uint8_t row, uint8_t col) { + static char rgb_temp4[4] = {0}; + static char rgb_temp3[3] = {0}; + + oled_set_cursor(col, row); +#if defined RGB_MATRIX_ENABLE + if (rgb_matrix_is_enabled()) { + oled_write_raw_P(rgb_enab, 12); + } else { + oled_write_raw_P(rgb_disa, 12); + } + oled_set_cursor(col + 2, row); + oled_write(" hue sat val", false); + oled_set_cursor(col, row + 1); + itoa(rgb_matrix_get_mode(), rgb_temp3, 10); + oled_write(rgb_temp3, false); + oled_write(" ", false); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); + oled_write(rgb_temp4, false); +#else + oled_write("-RGB disabled-", false); +#endif +} + +void render_status_left(void) { + // Left side looks like this on the left half + // (Should be 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + // Right half is whatever layer image needs be + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // MODIFIERS + render_modifiers(0, 0, this_mod); + // Encoders + render_encoder(1, 0, 0, this_layer); + // WPM text + render_wpm(2, 0); + // Visual layout + render_keymap(3, 0); + // Draw the image after 14'th character + render_layout(0, 14, this_mod, true); +} + +void render_status_right(void) { + // Right half is whatever layer image needs be on the left + // Right side looks like this on the right half + // (Should be after the 12'th character; max 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // Draw the image + render_layout(0, 0, this_mod, false); + // Modifiers + render_modifiers(0, 7, this_mod); + // Encoder + render_encoder(1, 7, 1, this_layer); + // RGB State + render_rgb(2, 7); +} diff --git a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h new file mode 100644 index 00000000000..f9f549a8757 --- /dev/null +++ b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h @@ -0,0 +1,19 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 +#include "bbaserdem.h" + +// These are protorne specific functions to be called for drawing +void render_status_left(void); +void render_status_right(void); diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index 5271b2ec2a5..d4efa027b8f 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -12,6 +12,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bbaserdem.h" +#include "bb-crkbdarm-oled.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -92,5 +93,14 @@ void keyboard_post_init_keymap(void) { // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } + +bool oled_task_keymap(void) { + if (is_keyboard_left()) { + render_status_left(); + } else { + render_status_right(); + } + return false; +} #endif // End of differentiations #endif // End of audio specific stuff diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 49db761e4d0..3ad7da01ef2 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -40,4 +40,5 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # BOOTMAGIC_ENABLE = lite # LTO_ENABLE = yes # PIMORONI_TRACKBALL = no + SRC += bb-crkbdarm-oled.c endif diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index f63be9f931a..b83d6b7c11e 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -25,8 +25,10 @@ along with this program. If not, see . * Modes can be reset using OS click * Some modes are only accessible through some keymap layers */ -//encoder_state_t encoder_state[NUMBER_OF_ENCODERS]; + +// Initialize the encoder state variable encoder_state_t encoder_state[2]; + // Default state for the encoders void reset_encoder_state(void) { // for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { @@ -42,181 +44,6 @@ void keyboard_post_init_encoder(void) { reset_encoder_state(); } -// Oled string printing for given layer and index -void encoder_state_string_long(uint8_t index, uint8_t layer, char* buffer) { - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled - #ifdef RGB_MATRIX_ENABLE - case _MEDI: - switch (encoder_state[index].rgb) { - case 0: - strcpy(buffer, "ani mode"); - break; - case 1: - strcpy(buffer, "hue "); - break; - case 2: - strcpy(buffer, "saturat."); - break; - case 3: - strcpy(buffer, "bright. "); - break; - case 4: - strcpy(buffer, "ani. spd"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - #endif - // If pointer control is enabled - #ifdef MOUSEKEY_ENABLE - case _MOUS: - switch (encoder_state[index].point) { - case 0: - strcpy(buffer, "Lateral "); - break; - case 1: - strcpy(buffer, "Vertical"); - break; - case 2: - strcpy(buffer, "Scr. Ver"); - break; - case 3: - strcpy(buffer, "Scr. Lat"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - #endif - default: - switch (encoder_state[index].base) { - case 0: - strcpy(buffer, "Volume "); - break; - case 1: - strcpy(buffer, "Song "); - break; - case 2: - strcpy(buffer, "Sink "); - break; - case 3: - strcpy(buffer, "Src. Vol"); - break; - case 4: - strcpy(buffer, "Source "); - break; - case 5: - strcpy(buffer, "Arrow LR"); - break; - case 6: - strcpy(buffer, "Arrow UD"); - break; - case 7: - strcpy(buffer, "Page U/D"); - break; - case 8: - strcpy(buffer, "Erase "); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - } -} - -void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled - #ifdef RGB_MATRIX_ENABLE - case _MEDI: - switch (encoder_state[index].rgb) { - case 0: - strcpy(buffer, " mode"); - break; - case 1: - strcpy(buffer, " hue "); - break; - case 2: - strcpy(buffer, "satur"); - break; - case 3: - strcpy(buffer, "value"); - break; - case 4: - strcpy(buffer, "speed"); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - #endif - // If pointer control is enabled - #ifdef MOUSEKEY_ENABLE - case _MOUS: - switch (encoder_state[index].point) { - case 0: - strcpy(buffer, "m.lat"); - break; - case 1: - strcpy(buffer, "m.ver"); - break; - case 2: - strcpy(buffer, "s.ver"); - break; - case 3: - strcpy(buffer, "s.lat"); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - #endif - default: - switch (encoder_state[index].base) { - case 0: - strcpy(buffer, " volm"); - break; - case 1: - strcpy(buffer, " song"); - break; - case 2: - strcpy(buffer, " sink"); - break; - case 3: - strcpy(buffer, "s.vol"); - break; - case 4: - strcpy(buffer, " src "); - break; - case 5: - strcpy(buffer, " L/R "); - break; - case 6: - strcpy(buffer, " U/D "); - break; - case 7: - strcpy(buffer, "pgU/D"); - break; - case 8: - strcpy(buffer, " del "); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - } -} - // Encoder scroll functionality bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 92011c12b3a..5591f298568 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -17,9 +17,6 @@ along with this program. If not, see . #include "velocikey.h" #endif -// Code to print status string -void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); -void encoder_state_string_long(uint8_t index, uint8_t layer, char* buffer); // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed @@ -35,3 +32,6 @@ typedef struct { uint8_t rgb; // The encoder state on media layer; controls light settings uint8_t point; // The encoder state on mouse layer; moves pointer } encoder_state_t; + +// Make this available to all that declare us +extern encoder_state_t encoder_state[2]; diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 2df1ceab409..a5801ad733d 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -12,383 +12,199 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-oled.h" +#include +// Allow access to encoder_state #ifdef ENCODER_ENABLE - #include "bb-encoder.h" -#endif -/* OLED ENCODER - * This contains my general oled code - * Currently I have two setups with OLEDs - * - Kyria; with 128x64 but with low memory (elite C) - * - Protorne; wh 128x32 but with excellent memory - * This file differentiates only between those two - */ - -// Following line imports reading of RGB settings -#if defined RGB_MATRIX_ENABLE -extern rgb_config_t rgb_matrix_config; -#endif - -#if defined(KEYBOARD_crkbd_rev1) -// These are my images for keyboard layout -// Naming scheme is _left/right{_keyboardLayout}{_modifiers} -static const char PROGMEM base0_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, - 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, - 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, - 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, - 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, - 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, - 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, - 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, - 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; -static const char PROGMEM base0_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, - 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, - 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, - 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, - 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, - 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, - 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, - 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, - 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; -//static const char PROGMEM base0_R_dvor_nomod[][4] = {}; -//static const char PROGMEM base0_R_dvor_shift[][4] = {}; -static const char PROGMEM char1_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, - 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, - 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, - 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, - 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, - 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, - 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, - 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; -//static const char PROGMEM char1_R[][4] = {}; -static const char PROGMEM game2_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, - 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, - 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, - 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, - 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, - 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, - 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, - 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, - 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; -//static const char PROGMEM medi3_R[][4] = {}; -//static const char PROGMEM navi4_R[][4] = {}; -//static const char PROGMEM symb5_R_dvor[][4] = {}; -static const char PROGMEM numb6_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, - 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, - 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, - 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, - 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, - 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, - 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; -static const char PROGMEM numb6_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, - 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, - 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, - 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, - 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; -static const char PROGMEM func7_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, - 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, - 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 - },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, - 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, - 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 - },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, - 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, - 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, - 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, - 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; -static const char PROGMEM mous8_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, - 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, - 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 - },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, - 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, - 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, - 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, - 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f - },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, - 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, - 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; -static const char PROGMEM musi9_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, - 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, - 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, - 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, - 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, - 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, - 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, - 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; -static const char PROGMEM musi9_R[4][42] = { - { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, - 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, - 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, - 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, - 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, - 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, - 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, - 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, - 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; -static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; -static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; -static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; -static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; -static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; -static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; - -void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { - // Write modifiers starting from said column and row; does 14 characters - // Looks like: - // Mods: - oled_set_cursor(col, row); - oled_write("Mods: ", false); - // Meta - if (mods & MOD_MASK_GUI) { - oled_write_raw_P(mod_meta, 12); - oled_set_cursor(col + 8, row); - } else { - oled_write(" ", false); - } - // Alt(Gr) - if (mods & MOD_BIT(KC_RALT)) { - oled_write_raw_P(mod_altR, 12); - oled_set_cursor(col + 10, row); - } else if (mods & MOD_MASK_ALT) { - oled_write_raw_P(mod_altL, 12); - oled_set_cursor(col + 10, row); - } else { - oled_write(" ", false); - } - // Ctrl - if (mods & MOD_MASK_CTRL) { - oled_write_raw_P(mod_ctrl, 12); - oled_set_cursor(col + 12, row); - } else { - oled_write(" ", false); - } - // Shift - if (mods & MOD_MASK_SHIFT) { - oled_write_raw_P(mod_shft, 12); - oled_set_cursor(col + 14, row); - } else { - oled_write(" ", false); - } -} - -void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { - // Renders the encoder state, 14 characters - static char encoder_temp9[9] = {0}; - - oled_set_cursor(col, row); - #if defined ENCODER_ENABLE - oled_write("Enc: ", false); - encoder_state_string_long(index, layer, encoder_temp9); - oled_write(encoder_temp9, false); - #else - oled_set_cursor(col, row); - oled_write("No enc. avail.", false); - #endif -} - -void render_wpm(uint8_t row, uint8_t col) { - // Renders the WPM, 14 characters - static char wpm_temp4[4] = {0}; +#include "bb-encoder.h" +#endif // ENCODER_ENABLE - oled_set_cursor(col, row); - #if defined WPM_ENABLE - oled_write("WPM: ", false); - itoa(get_current_wpm(), wpm_temp4, 10); - oled_write(wpm_temp4, false); - oled_write(" ", false); - #else - oled_write("WPM not avail.", false); - #endif -} - -void render_keymap(uint8_t row, uint8_t col) { - // Render the oled layout - oled_set_cursor(col, row); - oled_write("Layout: DVORAK", false); -} +/* OLED + * This contains general purpose oled code + */ -void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { - // Draw this image iteratively - for (int i = 0; i < 4; i++) { - oled_set_cursor(col, row + i); - oled_write_raw_P(image[i], 42); - } -} +#ifdef ENCODER_ENABLE -void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { - // Render the requested image on the given column and row - // Don't grab highest layer; instead compare from top to bottom. - // Highest layer might be on the other side - if (isLeft) { - if (layer_state_cmp(layer_state, _MUSI)) { - draw_image(row, col, musi9_L); - } else if (layer_state_cmp(layer_state, _MOUS)) { - draw_image(row, col, mous8_L); - } else if (layer_state_cmp(layer_state, _FUNC)) { - draw_image(row, col, func7_L); - } else if (layer_state_cmp(layer_state, _NUMB)) { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, numb6_L_dvor_shift); - } else { - draw_image(row, col, numb6_L_dvor_nomod); +#if !defined KEYBOARD_splitkb_kyria_rev1 // Don't include in kyria; space +void encoder_state_string8(uint8_t index, uint8_t layer, char* buffer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled + #ifdef RGB_MATRIX_ENABLE + case _MEDI: + switch (encoder_state[index].rgb) { + case 0: + strcpy(buffer, "ani mode"); + break; + case 1: + strcpy(buffer, "hue "); + break; + case 2: + strcpy(buffer, "saturat."); + break; + case 3: + strcpy(buffer, "bright. "); + break; + case 4: + strcpy(buffer, "ani. spd"); + break; + default: + strcpy(buffer, " -N/A- "); + break; } - } else if (layer_state_cmp(layer_state, _GAME)) { - draw_image(row, col, game2_L); - } else if (layer_state_cmp(layer_state, _CHAR)) { - draw_image(row, col, char1_L); - } else { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_L_dvor_shift); - } else { - draw_image(row, col, base0_L_dvor_nomod); + break; + #endif + // If pointer control is enabled + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (encoder_state[index].point) { + case 0: + strcpy(buffer, "Lateral "); + break; + case 1: + strcpy(buffer, "Vertical"); + break; + case 2: + strcpy(buffer, "Scr. Ver"); + break; + case 3: + strcpy(buffer, "Scr. Lat"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + #endif + default: + switch (encoder_state[index].base) { + case 0: + strcpy(buffer, "Volume "); + break; + case 1: + strcpy(buffer, "Song "); + break; + case 2: + strcpy(buffer, "Sink "); + break; + case 3: + strcpy(buffer, "Src. Vol"); + break; + case 4: + strcpy(buffer, "Source "); + break; + case 5: + strcpy(buffer, "Arrow LR"); + break; + case 6: + strcpy(buffer, "Arrow UD"); + break; + case 7: + strcpy(buffer, "Page U/D"); + break; + case 8: + strcpy(buffer, "Erase "); + break; + default: + strcpy(buffer, " -N/A- "); + break; } - } - } else { - // WIP - draw_image(row, col, musi9_R); + break; } } +#endif // !KEYBOARD_splitkb_kyria_rev1 -void render_rgb(uint8_t row, uint8_t col) { - // Render the RGB state on the given column and row - static char rgb_temp4[4] = {0}; - static char rgb_temp3[3] = {0}; - - oled_set_cursor(col, row); -#if defined RGB_MATRIX_ENABLE - if (rgb_matrix_is_enabled()) { - oled_write_raw_P(rgb_enab, 12); - } else { - oled_write_raw_P(rgb_disa, 12); +void encoder_state_string5(uint8_t index, uint8_t layer, char* buffer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled + #ifdef RGB_MATRIX_ENABLE + case _MEDI: + switch (encoder_state[index].rgb) { + case 0: + strcpy(buffer, " mode"); + break; + case 1: + strcpy(buffer, " hue "); + break; + case 2: + strcpy(buffer, "satur"); + break; + case 3: + strcpy(buffer, "value"); + break; + case 4: + strcpy(buffer, "speed"); + break; + default: + strcpy(buffer, "!oob!"); + break; + } + break; + #endif + // If pointer control is enabled + #ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (encoder_state[index].point) { + case 0: + strcpy(buffer, "m.lat"); + break; + case 1: + strcpy(buffer, "m.ver"); + break; + case 2: + strcpy(buffer, "s.ver"); + break; + case 3: + strcpy(buffer, "s.lat"); + break; + default: + strcpy(buffer, "!oob!"); + break; + } + break; + #endif + default: + switch (encoder_state[index].base) { + case 0: + strcpy(buffer, " volm"); + break; + case 1: + strcpy(buffer, " song"); + break; + case 2: + strcpy(buffer, " sink"); + break; + case 3: + strcpy(buffer, "s.vol"); + break; + case 4: + strcpy(buffer, " src "); + break; + case 5: + strcpy(buffer, " L/R "); + break; + case 6: + strcpy(buffer, " U/D "); + break; + case 7: + strcpy(buffer, "pgU/D"); + break; + case 8: + strcpy(buffer, " del "); + break; + default: + strcpy(buffer, "!oob!"); + break; + } + break; } - oled_set_cursor(col + 2, row); - oled_write(" hue sat val", false); - oled_set_cursor(col, row + 1); - itoa(rgb_matrix_get_mode(), rgb_temp3, 10); - oled_write(rgb_temp3, false); - oled_write(" ", false); - itoa(rgb_matrix_get_hue(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_sat(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_val(), rgb_temp4, 10); - oled_write(rgb_temp4, false); -#else - oled_write("-RGB disabled-", false); -#endif -} - -void render_status_left(void) { - // Left side looks like this on the left half - // (Should be 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - // Right half is whatever layer image needs be - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // MODIFIERS - render_modifiers(0, 0, this_mod); - - // Encoders - render_encoder(1, 0, 0, this_layer); - - // WPM text - render_wpm(2, 0); - - // Visual layout - render_keymap(3, 0); - - // Draw the image after 14'th character - render_layout(0, 14, this_mod, true); -} - -void render_status_right(void) { - // Right half is whatever layer image needs be on the left - // Right side looks like this on the right half - // (Should be after the 12'th character; max 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // Draw the image - render_layout(0, 0, this_mod, false); - - // Modifiers - render_modifiers(0, 7, this_mod); - - // Encoder - render_encoder(1, 7, 1, this_layer); - - // RGB State; WIP - render_rgb(2, 7); } -#endif +#endif // ENCODER_ENABLE -#if defined(KEYBOARD_splitkb_kyria_rev1) -static void render_qmk_logo(void) { - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - oled_write_P(qmk_logo, false); -} static void render_status(void) { // Function to print state information uint8_t this_layer = get_highest_layer(layer_state); uint8_t this_mod = get_mods(); - // Render qmk - render_qmk_logo(); // Temporary variable for RGB #if defined RGB_MATRIX_ENABLE static char rgb_temp4[4] = {0}; @@ -443,16 +259,16 @@ static void render_status(void) { #if defined RGB_MATRIX_ENABLE case _MEDI: oled_write("m", false); - itoa(rgb_matrix_config.mode, rgb_temp4, 10); + itoa(rgb_matrix_get_mode(), rgb_temp4, 10); oled_write(rgb_temp4, false); oled_write(" h", false); - itoa(rgb_matrix_config.hsv.h, rgb_temp4, 10); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); oled_write(rgb_temp4, false); oled_write(" s", false); - itoa(rgb_matrix_config.hsv.s, rgb_temp4, 10); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); oled_write(rgb_temp4, false); oled_write(" v", false); - itoa(rgb_matrix_config.hsv.v, rgb_temp4, 10); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); oled_write(rgb_temp4, false); oled_write("\n", false); break; @@ -479,24 +295,23 @@ static void render_status(void) { // Line 4: Encoder states #ifdef ENCODER_ENABLE oled_write("EN0:", false); - encoder_state_string(0, this_layer, encoder_temp6); + encoder_state_string5(0, this_layer, encoder_temp6); oled_write(encoder_temp6, false); oled_write(" EN1:", false); - encoder_state_string(1, this_layer, encoder_temp6); + encoder_state_string5(1, this_layer, encoder_temp6); oled_write(encoder_temp6, false); +#else + oled_write("-Encoder unavailable-", false); #endif oled_write("\n", false); } -#endif +// Allow default to be overwritten by keymap if they return false +__attribute__ ((weak)) bool oled_task_keymap(void) {return true;} + +// Do sane defaults for regular oled rendering void oled_task_user(void) { - #if defined(KEYBOARD_splitkb_kyria_rev1) - render_status(); - #elif defined(KEYBOARD_crkbd_rev1) - if (is_keyboard_left()) { - render_status_left(); - } else { - render_status_right(); + if (oled_task_keymap()) { + render_status(); } - #endif } diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index 5b8a97efc3b..6e88cfc1cb1 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -15,3 +15,9 @@ along with this program. If not, see . #include "bbaserdem.h" // Contain the main oled writer here void oled_task_user(void); +bool oled_task_keymap(void); +// This is only neccessary for oled; hence here +#ifdef ENCODER_ENABLE +void encoder_state_string5(uint8_t index, uint8_t layer, char* buffer); +void encoder_state_string8(uint8_t index, uint8_t layer, char* buffer); +#endif diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 34e5e9488ed..7ed5af06798 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -35,7 +35,7 @@ along with this program. If not, see . #ifdef SPLIT_KEYBOARD // Enable reacting to keypresses on the other half #define SPLIT_TRANSPORT_MIRROR -// Enable communicatong layer state changes. +// Enable communicating layer state changes. // #define SPLIT_LAYER_STATE_ENABLE // #define SPLIT_MODS_ENABLE #ifdef WPM_ENABLE diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 0775e0a64bd..facc61a3f09 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -38,7 +38,7 @@ TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance # These features can be enabled on ARM boards; disabled for AVR due to space # NKRO_ENABLE = no # Default is 6KRO which is plenty # VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed -# WPM_ENABLE = no # Get WPM reports as you type +WPM_ENABLE = yes # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 13f6794827fb976c978201a63b1022e75e2a7759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 11 Sep 2021 16:37:22 -0400 Subject: [PATCH 77/94] Changed colors a bit --- layouts/community/split_3x6_3/bbaserdem/keymap.c | 9 +++++++++ users/bbaserdem/bb-rgb.c | 16 ++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index d4efa027b8f..ee98f58fbf3 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -94,6 +94,15 @@ void keyboard_post_init_keymap(void) { OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } +// Flip the display on the right half +oled_rotation_t oled_init_user(oled_rotation_t rotation) { + if (!is_keyboard_left()) { + return OLED_ROTATION_180; + } + + return rotation; +} + bool oled_task_keymap(void) { if (is_keyboard_left()) { render_status_left(); diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index 2b2c78e240e..e21f47ece42 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -28,17 +28,17 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } // Do each layer seperately switch (get_highest_layer(layer_state)) { - case _GAME: // Set left side as turquoise + case _GAME: // Set left side as purple for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x < SPLIT_POINT) { rgb_matrix_set_color(i, RGB_PURPLE); } } break; - case _CHAR: // Set full board as chartreuse + case _CHAR: // Set full board as gold rgb_matrix_set_color_all(RGB_GOLD); break; - case _MEDI: // Set right side as coral + case _MEDI: // Set right side as pink for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x > SPLIT_POINT) { rgb_matrix_set_color(i, RGB_PINK); @@ -52,17 +52,17 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } } break; - case _SYMB: // Set right side as purple + case _SYMB: // Set right side as yellow for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x > SPLIT_POINT) { rgb_matrix_set_color(i, RGB_YELLOW); } } break; - case _NUMB: // Set left side as cyan + case _NUMB: // Set left side as blue for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_CYAN); + rgb_matrix_set_color(i, RGB_BLUE); } } break; @@ -73,14 +73,14 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } } break; - case _MOUS: // Set left side as yellow + case _MOUS: // Set left side as blue-green for(uint8_t i = led_min; i <= led_max; i++) { if(g_led_config.point[i].x < SPLIT_POINT) { rgb_matrix_set_color(i, RGB_SPRINGGREEN); } } break; - case _MUSI: // Set full board as magenta + case _MUSI: // Set full board as orange rgb_matrix_set_color_all(RGB_ORANGE); break; } From 9bf37759f9dbaeb1e24dc43ae4dac1bc5b87567d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Wed, 15 Sep 2021 23:54:59 -0400 Subject: [PATCH 78/94] Working keeb --- .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 13 +- .../split_3x6_3/bbaserdem/bb-crkbdarm-oled.c | 447 ----------- .../community/split_3x6_3/bbaserdem/config.h | 87 +-- .../community/split_3x6_3/bbaserdem/keymap.c | 93 ++- .../community/split_3x6_3/bbaserdem/rules.mk | 1 - users/bbaserdem/bb-encoder.c | 144 +++- users/bbaserdem/bb-encoder.h | 17 +- users/bbaserdem/bb-macro.c | 22 +- users/bbaserdem/bb-oled-extra.c | 700 ++++++++++++++++++ .../bbaserdem/bb-oled-extra.h | 10 +- users/bbaserdem/bb-oled.c | 406 ++++------ users/bbaserdem/bb-oled.h | 17 +- users/bbaserdem/bb-rgb.c | 100 ++- users/bbaserdem/bbaserdem.c | 122 ++- users/bbaserdem/bbaserdem.h | 53 +- users/bbaserdem/config.h | 112 ++- users/bbaserdem/rules.mk | 13 +- 17 files changed, 1408 insertions(+), 949 deletions(-) delete mode 100644 layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c create mode 100644 users/bbaserdem/bb-oled-extra.c rename layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h => users/bbaserdem/bb-oled-extra.h (69%) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 8b540057c71..4c76884c76a 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -95,18 +95,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { oled_rotation_t oled_init_user(oled_rotation_t rotation) { return OLED_ROTATION_180; } -// QMK logo screen renderer; will render 126x32 image; but on the default font. -static void render_qmk_logo(void) { - static const char PROGMEM qmk_logo[] = { - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; - oled_write_P(qmk_logo, false); -} // For kyria; print logo, and allow default status printing bool oled_task_keymap(void) { - render_qmk_logo(); - return true; + render_qmk_logo(0, 0); + render_status_lite(4, 0); + return false; } #endif //OLED_ENABLE #endif //KEYBOARD_splitkb_kyria_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c b/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c deleted file mode 100644 index c869458b952..00000000000 --- a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c +++ /dev/null @@ -1,447 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 "bb-oled.h" -#include "bb-crkbdarm-oled.h" -#ifdef ENCODER_ENABLE - #include "bb-encoder.h" -#endif - -// PROGMEM images -// Naming scheme is _left/right{_keyboardLayout}{_modifiers} -static const char PROGMEM base0_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, - 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, - 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, - 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, - 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, - 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, - 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, - 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, - 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; -static const char PROGMEM base0_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, - 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, - 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, - 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, - 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, - 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, - 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, - 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, - 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; -static const char PROGMEM base0_R_dvor_nomod[4][42] = { - { 0x00,0xfc,0x12,0x12,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x70,0x88, - 0x88,0x88,0x88,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x00,0x02,0x7e,0x80, - 0x80,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x80,0x80,0x80,0xf0,0x00,0xf0,0x02,0x82,0x82,0x01,0x00,0x00,0x80, - 0xf0,0x80,0x80,0x00,0xc0,0x40,0x40,0x40,0x80,0x00,0x80,0x40,0x40,0x40, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x83,0x04,0x04,0x02,0x07,0x00,0x07,0x01,0x00,0x00,0x07,0x00,0x00,0x00, - 0x03,0x04,0x04,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x04,0x05,0x05,0x05, - 0x02,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x3f,0x24,0x22,0x22,0x1c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x1e,0x20, - 0x1c,0x20,0x1e,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x22,0x32,0x2a,0x26, - 0x22,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM base0_R_dvor_shift[4][42] = { - { 0xfe,0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xfc,0x02, - 0x02,0x02,0x84,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x00,0x00,0x00, - 0x00,0x00,0x04,0x88,0x50,0x20,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0xf1,0x10,0x10,0x10,0xe0,0x00,0xf0,0x81,0x81,0x81,0xf0,0x00,0x10,0x11, - 0xf1,0x11,0x10,0x00,0xf1,0x60,0x80,0x00,0xf1,0x00,0x61,0x91,0x91,0x91, - 0x21,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x8f,0x88,0x88,0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x8f,0x00,0x80,0x00, - 0x0f,0x00,0x80,0x00,0x8f,0x00,0x01,0x06,0x8f,0x00,0x84,0x88,0x88,0x88, - 0x87,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x7f,0x44,0x44,0x44,0x3b,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x1f,0x60, - 0x1c,0x60,0x1f,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x70,0x48,0x44,0x42, - 0x41,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM char1_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, - 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, - 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, - 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, - 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, - 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, - 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, - 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; -static const char PROGMEM char1_R[4][42] = { - { 0x70,0x88,0xf0,0x88,0x70,0x00,0xfe,0x02,0x02,0x02,0x06,0x00,0x88,0x48, - 0x70,0x90,0x88,0x00,0xf0,0x88,0x88,0x88,0x70,0x00,0xc0,0x30,0x0c,0x30, - 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0xa0,0x50,0x53,0x90,0x20,0x00,0xc0,0x80,0x40,0x40,0x80,0x00,0x40,0x40, - 0xc0,0x40,0x40,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x80,0x40,0xc0,0x40, - 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x03,0x84,0x84,0x04,0x03,0x00,0x07,0x00,0x00,0x00,0x1f,0x00,0x00,0x80, - 0x83,0x84,0x00,0x00,0x00,0x83,0x54,0x8b,0x00,0x00,0x83,0x84,0x84,0x83, - 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0xff,0x24,0x24,0x27,0x18,0x00,0x7e,0x10,0x20,0x20,0x1e,0x00,0x2f,0x30, - 0x00,0x30,0x2f,0x00,0xe0,0x38,0x25,0x38,0xe0,0x00,0x18,0x26,0xa1,0xa0, - 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM game2_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, - 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, - 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, - 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, - 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, - 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, - 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, - 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, - 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; -static const char PROGMEM medi3_R[4][42] = { - { 0xe0,0x00,0x38,0x00,0xe0,0x00,0x7f,0x02,0x9c,0x02,0x7f,0x00,0x7f,0x08, - 0x88,0x08,0x7f,0x00,0x26,0x49,0xc9,0x49,0x32,0x00,0x07,0x18,0xa0,0x18, - 0x07,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x01,0x01,0xf1,0x70,0x00,0xf0,0x81,0xc3,0xe1,0xf0,0x00,0x00,0x71, - 0x03,0x71,0x00,0x00,0x00,0xc1,0xc3,0xc1,0x00,0x00,0xf0,0xe1,0xc3,0x81, - 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 - },{ 0x0e,0x0a,0x0c,0x0f,0x00,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, - 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, - 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 - },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, - 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, - 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM navi4_R[4][42] = { - { 0xe0,0x10,0x54,0x38,0x10,0x00,0xfc,0x24,0x24,0x24,0x18,0x00,0x0c,0x10, - 0xe0,0x10,0x0c,0x00,0x8c,0x50,0x20,0x50,0x8c,0x00,0xc0,0xbe,0xa2,0xbe, - 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x80,0xc1,0xa1,0x81,0x00,0x00,0x01,0x80,0x40,0x20,0x00,0x00,0x00,0x00, - 0xf1,0x00,0x00,0x00,0x41,0x20,0xd0,0x20,0x41,0x00,0x01,0x21,0x41,0x81, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x00,0x49,0x4a,0x48,0x87,0x00,0x81,0x82,0x85,0x89,0x01,0x00,0x01,0x02, - 0x85,0x02,0x01,0x00,0x40,0x40,0x47,0x40,0x40,0x00,0x81,0x09,0x05,0x02, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x12,0x65,0x85,0x65,0x17,0x00,0x07,0x01,0x06,0x18,0x60,0x00,0x88,0x90, - 0xaf,0x90,0x88,0x00,0x04,0x02,0x7d,0x02,0x04,0x00,0x01,0x46,0x58,0x60, - 0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM symb5_R_dvor[4][42] = { - { 0x00,0x02,0x04,0x08,0x00,0x00,0x20,0x20,0xdc,0x02,0x02,0x00,0x02,0x02, - 0xdc,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x50,0x50,0x50,0x50, - 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xf0,0x11,0x12,0x02,0x00,0x02,0x12, - 0x11,0xf0,0x00,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00,0xc0,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x00,0x1f,0x10,0x90,0x00,0x00,0x00,0x90, - 0x10,0x1f,0x00,0x00,0xc0,0x00,0x14,0x03,0x00,0x00,0x01,0x01,0x87,0x01, - 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 - },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1c,0x63,0x80,0x00,0x00,0x00,0x80, - 0x63,0x1c,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x7f,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -static const char PROGMEM numb6_L_dvor_nomod[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, - 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, - 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, - 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, - 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, - 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, - 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, - 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; -static const char PROGMEM numb6_L_dvor_shift[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, - 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, - 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, - 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, - 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; -static const char PROGMEM func7_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, - 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, - 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 - },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, - 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, - 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 - },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, - 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, - 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, - 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, - 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; -static const char PROGMEM mous8_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, - 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, - 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 - },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, - 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, - 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, - 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, - 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f - },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, - 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, - 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; -static const char PROGMEM musi9_L[4][42] = { - { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, - 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, - 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 - },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, - 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, - 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 - },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, - 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 - },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, - 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, - 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; -static const char PROGMEM musi9_R[4][42] = { - { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, - 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, - 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 - },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, - 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, - 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 - },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, - 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, - 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 - },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, - 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, - 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; -// Helper function that draws these images -void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { - // Draw this image iteratively - for (int i = 0; i < 4; i++) { - oled_set_cursor(col, row + i); - oled_write_raw_P(image[i], 42); - } -} -// Custom 2 character wide icons -static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; -static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; -static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; -static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; -static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; -static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; -static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; - - -// Write modifiers to the screen -void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { - // Looks like Mods: - oled_set_cursor(col, row); - oled_write("Mods: ", false); - // Meta - if (mods & MOD_MASK_GUI) { - oled_write_raw_P(mod_meta, 12); - oled_set_cursor(col + 8, row); - } else { - oled_write(" ", false); - } - // Alt(Gr) - if (mods & MOD_BIT(KC_RALT)) { - oled_write_raw_P(mod_altR, 12); - oled_set_cursor(col + 10, row); - } else if (mods & MOD_MASK_ALT) { - oled_write_raw_P(mod_altL, 12); - oled_set_cursor(col + 10, row); - } else { - oled_write(" ", false); - } - // Ctrl - if (mods & MOD_MASK_CTRL) { - oled_write_raw_P(mod_ctrl, 12); - oled_set_cursor(col + 12, row); - } else { - oled_write(" ", false); - } - // Shift - if (mods & MOD_MASK_SHIFT) { - oled_write_raw_P(mod_shft, 12); - oled_set_cursor(col + 14, row); - } else { - oled_write(" ", false); - } -} - -// Renders the encoder state, 14 characters -void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { - static char encoder_temp9[9] = {0}; - - oled_set_cursor(col, row); - #if defined ENCODER_ENABLE - oled_write("Enc: ", false); - encoder_state_string8(index, layer, encoder_temp9); - oled_write(encoder_temp9, false); - #else - oled_set_cursor(col, row); - oled_write("No enc. avail.", false); - #endif -} - -// Writes WPM on the screen -void render_wpm(uint8_t row, uint8_t col) { - // Renders the WPM, 14 characters - static char wpm_temp4[4] = {0}; - - oled_set_cursor(col, row); - #if defined WPM_ENABLE - oled_write("WPM: ", false); - itoa(get_current_wpm(), wpm_temp4, 10); - oled_write(wpm_temp4, false); - oled_write(" ", false); - #else - oled_write("WPM not avail.", false); - #endif -} - -// Writes the currently used OLED display layout -void render_keymap(uint8_t row, uint8_t col) { - // Render the oled layout - oled_set_cursor(col, row); - oled_write("Layout: DVORAK", false); -} - -// Draws the image of the currently used layout -void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { - // Render the requested image on the given column and row - // Don't grab highest layer; instead compare from top to bottom. - // Highest layer might be on the other side - if (isLeft) { - if (layer_state_cmp(layer_state, _MUSI)) { - draw_image(row, col, musi9_L); - } else if (layer_state_cmp(layer_state, _MOUS)) { - draw_image(row, col, mous8_L); - } else if (layer_state_cmp(layer_state, _FUNC)) { - draw_image(row, col, func7_L); - } else if (layer_state_cmp(layer_state, _NUMB)) { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, numb6_L_dvor_shift); - } else { - draw_image(row, col, numb6_L_dvor_nomod); - } - } else if (layer_state_cmp(layer_state, _GAME)) { - draw_image(row, col, game2_L); - } else if (layer_state_cmp(layer_state, _CHAR)) { - draw_image(row, col, char1_L); - } else { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_L_dvor_shift); - } else { - draw_image(row, col, base0_L_dvor_nomod); - } - } - } else { - if (layer_state_cmp(layer_state, _MUSI)) { - draw_image(row, col, musi9_R); - } else if (layer_state_cmp(layer_state, _SYMB)) { - draw_image(row, col, symb5_R_dvor); - } else if (layer_state_cmp(layer_state, _NAVI)) { - draw_image(row, col, navi4_R); - } else if (layer_state_cmp(layer_state, _MEDI)) { - draw_image(row, col, medi3_R); - } else if (layer_state_cmp(layer_state, _CHAR)) { - draw_image(row, col, char1_R); - } else { - if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_R_dvor_shift); - } else { - draw_image(row, col, base0_R_dvor_nomod); - } - } - } -} - -// Render the RGB state on the given column and row -void render_rgb(uint8_t row, uint8_t col) { - static char rgb_temp4[4] = {0}; - static char rgb_temp3[3] = {0}; - - oled_set_cursor(col, row); -#if defined RGB_MATRIX_ENABLE - if (rgb_matrix_is_enabled()) { - oled_write_raw_P(rgb_enab, 12); - } else { - oled_write_raw_P(rgb_disa, 12); - } - oled_set_cursor(col + 2, row); - oled_write(" hue sat val", false); - oled_set_cursor(col, row + 1); - itoa(rgb_matrix_get_mode(), rgb_temp3, 10); - oled_write(rgb_temp3, false); - oled_write(" ", false); - itoa(rgb_matrix_get_hue(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_sat(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" ", false); - itoa(rgb_matrix_get_val(), rgb_temp4, 10); - oled_write(rgb_temp4, false); -#else - oled_write("-RGB disabled-", false); -#endif -} - -void render_status_left(void) { - // Left side looks like this on the left half - // (Should be 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - // Right half is whatever layer image needs be - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // MODIFIERS - render_modifiers(0, 0, this_mod); - // Encoders - render_encoder(1, 0, 0, this_layer); - // WPM text - render_wpm(2, 0); - // Visual layout - render_keymap(3, 0); - // Draw the image after 14'th character - render_layout(0, 14, this_mod, true); -} - -void render_status_right(void) { - // Right half is whatever layer image needs be on the left - // Right side looks like this on the right half - // (Should be after the 12'th character; max 14 characters per line) - // Mods: - // Enc: <8 len str> - // Wpm: - // Layout: - uint8_t this_mod = get_mods(); - uint8_t this_layer = get_highest_layer(layer_state); - - // Draw the image - render_layout(0, 0, this_mod, false); - // Modifiers - render_modifiers(0, 7, this_mod); - // Encoder - render_encoder(1, 7, 1, this_layer); - // RGB State - render_rgb(2, 7); -} diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index f2bbe766cad..8316408548d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -18,66 +18,67 @@ along with this program. If not, see . // Code pertaining to Corne ARM; from Waffle's keymap #ifdef KEYBOARD_crkbd_rev1 - #include "config_common.h" +# include "config_common.h" // Use EE_HANDS to determine handedness - #define EE_HANDS +# define EE_HANDS // Rebrand the PCB - #undef PRODUCT - #define PRODUCT Protorne Keyboard - #undef MANUFACTURER - #define MANUFACTURER Waffles +# undef PRODUCT +# define PRODUCT Protorne Keyboard +# undef MANUFACTURER +# define MANUFACTURER Waffles // Remove OLED definitions? - #undef USE_I2C - #undef SSD1306OLED +# undef USE_I2C +# undef SSD1306OLED // Add state info transmission - #define SPLIT_LAYER_STATE_ENABLE - #define SPLIT_MODS_ENABLE - #define SPLIT_WPM_ENABLE +# define SPLIT_LAYER_STATE_ENABLE +# define SPLIT_MODS_ENABLE +# define SPLIT_WPM_ENABLE // Audio output on pin A5 (actualy will be output on B1 using keymap init) - #ifdef AUDIO_ENABLE - #define AUDIO_PIN A5 - #endif +# ifdef AUDIO_ENABLE +# define AUDIO_PIN A5 +# define MUSIC_MAP +# endif // Communication has to be serial on ARM - #define USE_SERIAL_PD2 +# define USE_SERIAL_PD2 // Set serial pin as D3 for sure - #undef SOFT_SERIAL_PIN - #define SOFT_SERIAL_PIN D3 - #define SERIAL_USART_SPEED 921600 - #define SERIAL_USART_DRIVER SD1 - #define SERIAL_USART_TX_PAL_MODE 7 +# undef SOFT_SERIAL_PIN +# define SOFT_SERIAL_PIN D3 +# define SERIAL_USART_SPEED 921600 +# define SERIAL_USART_DRIVER SD1 +# define SERIAL_USART_TX_PAL_MODE 7 // Things to make RGB matrix work on the waffle board - #undef RGBLED_NUM - #define RGBLED_NUM 54 - #undef RGB_DI_PIN - #define RGB_DI_PIN B5 - #ifdef RGB_MATRIX_ENABLE - #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 - #define RGB_MATRIX_SPLIT { 27, 27 } - #endif - #define WS2812_PWM_DRIVER PWMD3 - #define WS2812_PWM_CHANNEL 3 - #define WS2812_PWM_PAL_MODE 2 - #define WS2812_DMA_STREAM STM32_DMA1_STREAM3 - #define WS2812_DMA_CHANNEL 3 +# undef RGBLED_NUM +# define RGBLED_NUM 54 +# undef RGB_DI_PIN +# define RGB_DI_PIN B5 +# ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100 +# define RGB_MATRIX_SPLIT { 27, 27 } +# endif +# define WS2812_PWM_DRIVER PWMD3 +# define WS2812_PWM_CHANNEL 3 +# define WS2812_PWM_PAL_MODE 2 +# define WS2812_DMA_STREAM STM32_DMA1_STREAM3 +# define WS2812_DMA_CHANNEL 3 // OLED related code - #ifdef OLED_DRIVER_ENABLE - #define OLED_TIMEOUT 50000 - #define OLED_UPDATE_INTERVAL 100 - #endif +# ifdef OLED_DRIVER_ENABLE +# define OLED_TIMEOUT 50000 +# define OLED_UPDATE_INTERVAL 100 +# endif // Encoder definitons - #define ENCODERS_PAD_A { B2 } - #define ENCODERS_PAD_B { B6 } - #define ENCODER_RESOLUTIONS { 4 } - #define ENCODERS_PAD_A_RIGHT { B2 } - #define ENCODERS_PAD_B_RIGHT { B6 } - #define ENCODER_RESOLUTIONS_RIGHT { 2 } +# define ENCODERS_PAD_A { B2 } +# define ENCODERS_PAD_B { B6 } +# define ENCODER_RESOLUTIONS { 4 } +# define ENCODERS_PAD_A_RIGHT { B2 } +# define ENCODERS_PAD_B_RIGHT { B6 } +# define ENCODER_RESOLUTIONS_RIGHT { 2 } #endif diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index ee98f58fbf3..ed969c7877b 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -12,7 +12,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bbaserdem.h" -#include "bb-crkbdarm-oled.h" +#ifdef KEYBOARD_crkbd_rev1 +# include "bb-oled-extra.h" +#endif // KEYBOARD_crkbd_rev1 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_split_3x6_3_wrapper( @@ -77,39 +79,108 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ) }; -#ifdef AUDIO_ENABLE // crkbd -#if defined(KEYBOARD_crkbd_rev1) -// Audio requires some fixes to work on @waffle's PCB -// ! Copy pasted from ItsWaffle's waffle fork +#ifdef KEYBOARD_crkbd_rev1 +#ifdef AUDIO_ENABLE +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_split_3x6_3( + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 0, 0, 0, 0, 0, 0 +); +#endif // AUDIO_ENABLE void keyboard_pre_init_keymap(void) { +# ifdef AUDIO_ENABLE //thank you to @sigprof for this // Set audio pins to analog mode palSetLineMode(A5, PAL_MODE_INPUT_ANALOG); palSetLineMode(B1, PAL_MODE_INPUT_ANALOG); +# endif // AUDIO_ENABLE +# ifdef RGB_MATRIX_ENABLE + // Led locations are different on protorne; need to be fixed + g_led_config = (led_config_t) { { + // Logical Layout + // 0 1 2 3 4 5 COLS + // -LEFT ROWS + // 16 17 18 19 20 21 0 + // 15 14 13 12 11 10 1 + // 04 05 06 07 08 09 2 + // 03 02 01 3 + // -Right + // 21 20 19 18 17 16 4 + // 10 11 12 13 14 15 5 + // 09 08 07 06 05 04 6 + // 01 02 03 7 + { 15, 16, 17, 18, 19, 20}, + { 14, 13, 12, 11, 10, 9 }, + { 3, 4, 5, 6, 7, 8 }, + { NO_LED, NO_LED, NO_LED, 2, 1, 0 }, + { 47, 46, 45, 44, 43, 42 }, + { 36, 37, 38, 39, 40, 41 }, + { 35, 34, 33, 32, 31, 30 }, + { NO_LED, NO_LED, NO_LED, 27, 28, 29 } + }, { + // Physical Layout + // LEFT RIGHT + // 16 17 18 19 20 21 16 17 18 19 20 21 + // 24 23 22 24 23 22 + // 15 14 13 12 11 10 15 14 13 12 11 10 + // 25 27 + // 04 05 06 07 08 09 04 05 06 07 08 09 + // 26 27 25 26 + // 03 02 01 03 02 01 + { 95, 63 }, { 80, 58 }, { 60, 55 }, + { 0, 41 }, { 16, 42 }, { 33, 37 }, { 50, 35 }, { 68, 37 }, { 85, 39 }, + { 85, 21 }, { 68, 19 }, { 50, 13 }, { 33, 20 }, { 16, 24 }, { 0, 24 }, + { 0, 7 }, { 16, 7 }, { 33, 3 }, { 50, 0 }, { 68, 2 }, { 85, 4 }, + { 85, 16 }, { 50, 13 }, { 16, 20 }, { 16, 38 }, { 50, 48 }, { 85, 52 }, + { 164, 55 }, { 144, 58 }, { 129, 63 }, + { 139, 39 }, { 156, 37 }, { 174, 35 }, { 191, 37 }, { 208, 42 }, { 224, 41 }, + { 224, 24 }, { 208, 24 }, { 191, 20 }, { 174, 13 }, { 156, 19 }, { 139, 21 }, + { 139, 4 }, { 156, 2 }, { 174, 0 }, { 191, 3 }, { 208, 7 }, { 224, 7 }, + { 208, 20 }, { 174, 13 }, { 139, 16 }, { 139, 52 }, { 174, 48 }, { 208, 38 } + }, { + // (x---)8 stands for indicator + // (-x--)4 stands for per-key led + // (--x-)2 stands for underglow led + // (---1)1 stands for modifier key + 12, 12, 12, + 4, 4, 5, 4, 4, 4, + 4, 5, 5, 5, 5, 4, + 4, 4, 4, 4, 4, 4, + 10, 10, 10, 10, 10, 10, + 12, 12, 12, + 4, 4, 4, 5, 4, 4, + 4, 5, 5, 5, 5, 4, + 4, 4, 4, 4, 4, 4, + 10, 10, 10, 10, 10, 10 + } }; +# endif // RGB_MATRIX_ENABLE } +// Enable OPAMP1 as A5 → B1 follower +#ifdef AUDIO_ENABLE void keyboard_post_init_keymap(void) { - // Enable OPAMP1 as A5 → B1 follower OPAMP3->CSR = OPAMP3_CSR_VMSEL_1 | OPAMP3_CSR_VMSEL_0 | OPAMP3_CSR_VPSEL_0 | OPAMP3_CSR_OPAMP3EN; } +#endif // AUDIO_ENABLE +#ifdef OLED_ENABLE // Flip the display on the right half oled_rotation_t oled_init_user(oled_rotation_t rotation) { if (!is_keyboard_left()) { return OLED_ROTATION_180; } - return rotation; } bool oled_task_keymap(void) { if (is_keyboard_left()) { - render_status_left(); + render_status_left(0, 0); } else { - render_status_right(); + render_status_right(0, 0); } return false; } -#endif // End of differentiations -#endif // End of audio specific stuff +#endif // OLED_ENABLE +#endif // KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 3ad7da01ef2..49db761e4d0 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -40,5 +40,4 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD))) # BOOTMAGIC_ENABLE = lite # LTO_ENABLE = yes # PIMORONI_TRACKBALL = no - SRC += bb-crkbdarm-oled.c endif diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index b83d6b7c11e..38f4163a86a 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -12,10 +12,15 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-encoder.h" -#include +// Need this to call velocikey activation #ifdef VELOCIKEY_ENABLE - #include "velocikey.h" +# include "velocikey.h" #endif +// Need memcpy and memcmp from string.h along with transfer stuff +#ifdef OLED_ENABLE +# include +#endif + /* ROTARY ENCODER * This contains my general rotary encoder code @@ -26,16 +31,13 @@ along with this program. If not, see . * Some modes are only accessible through some keymap layers */ -// Initialize the encoder state variable -encoder_state_t encoder_state[2]; - // Default state for the encoders void reset_encoder_state(void) { // for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { for (int i = 0; i < 2; i++) { - encoder_state[i].base = i; - encoder_state[i].rgb = i; - encoder_state[i].point = i; + userspace_config.encoder[i].base = i; + userspace_config.encoder[i].rgb = i; + userspace_config.encoder[i].point = i; } } @@ -50,7 +52,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { switch (get_highest_layer(layer_state)) { #ifdef RGB_MATRIX_ENABLE case _MEDI: - switch(encoder_state[index].rgb) { + switch(userspace_config.encoder[index].rgb) { case 0: // Effect the RGB mode if (clockwise) { rgb_matrix_step_noeeprom(); @@ -91,7 +93,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { #endif #ifdef MOUSEKEY_ENABLE case _MOUS: - switch(encoder_state[index].point) { + switch(userspace_config.encoder[index].point) { case 0: // Move mouse on horizontal axis if (clockwise) { tap_code(KC_MS_R); @@ -124,7 +126,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { break; #endif default: - switch(encoder_state[index].base) { + switch(userspace_config.encoder[index].base) { case 0: // Volume if (clockwise) { tap_code16(KC_VOLU); @@ -199,7 +201,7 @@ void encoder_click_action(uint8_t index) { switch (get_highest_layer(layer_state)) { #ifdef RGB_MATRIX_ENABLE case _MEDI: - switch(encoder_state[index].rgb) { + switch(userspace_config.encoder[index].rgb) { case 0: // Return to no animation rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); break; @@ -218,7 +220,7 @@ void encoder_click_action(uint8_t index) { #endif #ifdef MOUSEKEY_ENABLE case _MOUS: - switch(encoder_state[index].point) { + switch(userspace_config.encoder[index].point) { case 0: // Left click tap_code16(KC_BTN1); break; @@ -233,7 +235,7 @@ void encoder_click_action(uint8_t index) { break; #endif default: - switch(encoder_state[index].base) { + switch(userspace_config.encoder[index].base) { case 0: // Toggle mute case 2: tap_code16(KC_MUTE); @@ -280,19 +282,19 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { switch (get_highest_layer(layer_state)) { #ifdef RGB_MATRIX_ENABLE case _MEDI: - encoder_state[encoder_index].rgb = - (encoder_state[encoder_index].rgb + 1) % 5; + userspace_config.encoder[encoder_index].rgb = + (userspace_config.encoder[encoder_index].rgb + 1) % 5; break; #endif #ifdef MOUSEKEY_ENABLE case _MOUS: - encoder_state[encoder_index].point = - (encoder_state[encoder_index].point + 1) % 4; + userspace_config.encoder[encoder_index].point = + (userspace_config.encoder[encoder_index].point + 1) % 4; break; #endif default: - encoder_state[encoder_index].base = - (encoder_state[encoder_index].base + 1) % 9; + userspace_config.encoder[encoder_index].base = + (userspace_config.encoder[encoder_index].base + 1) % 9; break; } // If ctrl is active, move mode one point backwards @@ -300,19 +302,19 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { switch (get_highest_layer(layer_state)) { #ifdef RGB_MATRIX_ENABLE case _MEDI: - encoder_state[encoder_index].rgb = - (encoder_state[encoder_index].rgb + 5 - 1) % 5; + userspace_config.encoder[encoder_index].rgb = + (userspace_config.encoder[encoder_index].rgb + 5 - 1) % 5; break; #endif #ifdef MOUSEKEY_ENABLE case _MOUS: - encoder_state[encoder_index].point = - (encoder_state[encoder_index].point + 4 - 1) % 4; + userspace_config.encoder[encoder_index].point = + (userspace_config.encoder[encoder_index].point + 4 - 1) % 4; break; #endif default: - encoder_state[encoder_index].base = - (encoder_state[encoder_index].base + 9 - 1) % 9; + userspace_config.encoder[encoder_index].base = + (userspace_config.encoder[encoder_index].base + 9 - 1) % 9; break; } // If meta is active, reset the encoder states @@ -325,3 +327,93 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { } return true; } + +// For printing status to OLED +#ifdef OLED_ENABLE +void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { + // Get the layer straight from the main function + switch (layer) { + // If RGB control mode is enabled +# ifdef RGB_MATRIX_ENABLE + case _MEDI: + switch (userspace_config.encoder[index].rgb) { + case 0: + strcpy(buffer, "ani mode"); + break; + case 1: + strcpy(buffer, "hue "); + break; + case 2: + strcpy(buffer, "saturat."); + break; + case 3: + strcpy(buffer, "bright. "); + break; + case 4: + strcpy(buffer, "ani. spd"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; +# endif // RGB_MATRIX_ENABLE + // If pointer control is enabled +# ifdef MOUSEKEY_ENABLE + case _MOUS: + switch (userspace_config.encoder[index].point) { + case 0: + strcpy(buffer, "Lateral "); + break; + case 1: + strcpy(buffer, "Vertical"); + break; + case 2: + strcpy(buffer, "Scr. Ver"); + break; + case 3: + strcpy(buffer, "Scr. Lat"); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; +# endif // MOUSEKEY_ENABLE + default: + switch (userspace_config.encoder[index].base) { + case 0: + strcpy(buffer, "Volume "); + break; + case 1: + strcpy(buffer, "Song "); + break; + case 2: + strcpy(buffer, "Sink "); + break; + case 3: + strcpy(buffer, "Src. Vol"); + break; + case 4: + strcpy(buffer, "Source "); + break; + case 5: + strcpy(buffer, "Arrow LR"); + break; + case 6: + strcpy(buffer, "Arrow UD"); + break; + case 7: + strcpy(buffer, "Page U/D"); + break; + case 8: + strcpy(buffer, "Erase "); + break; + default: + strcpy(buffer, " -N/A- "); + break; + } + break; + } +} +#endif // OLED_ENABLE diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 5591f298568..121f10e095a 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -13,9 +13,6 @@ along with this program. If not, see . */ #pragma once #include "bbaserdem.h" -#ifdef VELOCIKEY_ENABLE - #include "velocikey.h" -#endif // Hook to encoder stuff bool encoder_update_user(uint8_t index, bool clockwise); @@ -25,13 +22,7 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record); void keyboard_post_init_encoder(void); // Clear the encoder settings void reset_encoder_state(void); - -// Structure to keep runtime info on encoder state -typedef struct { - uint8_t base; // The encoder state on most layers; regular function - uint8_t rgb; // The encoder state on media layer; controls light settings - uint8_t point; // The encoder state on mouse layer; moves pointer -} encoder_state_t; - -// Make this available to all that declare us -extern encoder_state_t encoder_state[2]; +// This is so that encoder state is synched between two halves +void housekeeping_task_encoder(void); +// This is purely for oled; should it want to use it +void encoder_state_string(uint8_t index, uint8_t layer, char* buffer); diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 04b8a1a8c5e..7dbd0aa5c5d 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -75,6 +75,26 @@ const uint32_t PROGMEM unicode_map[] = { // Keycodes bool process_record_macro(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + // AltGr + Caps should change the oled layout variable + case KC_CAPSLOCK: + if (record->event.pressed) { + if (get_mods() & MOD_BIT(KC_RALT)) { + userspace_config.layout = (userspace_config.layout + 1) % 3; + } + } + return true; + break; + case BB_OLED: + if (record->event.pressed) { + if (get_mods() & MOD_MASK_SHIFT) { + // Scroll in opposite direction + userspace_config.layout = (userspace_config.layout + 4) % 3; + } else { + userspace_config.layout = (userspace_config.layout + 1) % 3; + } + } + return false; + break; // Plain macros case BB_PGPK: // My public PGP key @@ -123,7 +143,7 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { case BB_TABL: // Table flip: ┻━┻︵ \(°□°)/ ︵ ┻━┻ if (record->event.pressed) { - send_unicode_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); + send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); } return false; break; #endif diff --git a/users/bbaserdem/bb-oled-extra.c b/users/bbaserdem/bb-oled-extra.c new file mode 100644 index 00000000000..ece65054f2f --- /dev/null +++ b/users/bbaserdem/bb-oled-extra.c @@ -0,0 +1,700 @@ +/* +Copyright 2019 Batuhan Başerdem @bbaserdem +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 "bb-oled.h" +#include "bb-oled-extra.h" + +// Helper function that draws images +void draw_image(uint8_t row, uint8_t col, const char image[4][42]) { + // Draw this image iteratively + for (int i = 0; i < 4; i++) { + oled_set_cursor(col, row + i); + oled_write_raw_P(image[i], 42); + } +} + +// Write modifiers to the screen +void render_modifiers(uint8_t row, uint8_t col, uint8_t mods) { + static const char PROGMEM mod_meta[12] = {0x00,0x01,0x01,0x01,0x01,0x06,0x18,0x60,0x81,0x81,0x81,0x81}; + static const char PROGMEM mod_altL[12] = {0x00,0x80,0x80,0x80,0x40,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; + static const char PROGMEM mod_altR[12] = {0x00,0x86,0x8f,0x8f,0x46,0x20,0x10,0x08,0x84,0x95,0x8e,0x84}; + static const char PROGMEM mod_ctrl[12] = {0x00,0x00,0xbd,0x42,0xa5,0x99,0x99,0xa5,0x42,0xbd,0x00,0x00}; + static const char PROGMEM mod_shft[12] = {0x00,0x20,0x30,0x28,0xe4,0x02,0x01,0x02,0xe4,0x28,0x30,0x20}; + // Looks like Mods: + oled_set_cursor(col, row); + oled_write("Mods: ", false); + // Meta + if (mods & MOD_MASK_GUI) { + oled_write_raw_P(mod_meta, 12); + oled_set_cursor(col + 8, row); + } else { + oled_write(" ", false); + } + // Alt(Gr) + if (mods & MOD_BIT(KC_RALT)) { + oled_write_raw_P(mod_altR, 12); + oled_set_cursor(col + 10, row); + } else if (mods & MOD_MASK_ALT) { + oled_write_raw_P(mod_altL, 12); + oled_set_cursor(col + 10, row); + } else { + oled_write(" ", false); + } + // Ctrl + if (mods & MOD_MASK_CTRL) { + oled_write_raw_P(mod_ctrl, 12); + oled_set_cursor(col + 12, row); + } else { + oled_write(" ", false); + } + // Shift + if (mods & MOD_MASK_SHIFT) { + oled_write_raw_P(mod_shft, 12); + oled_set_cursor(col + 14, row); + } else { + oled_write(" ", false); + } +} + +// Draws the image of the currently used layout +void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { + // DVORAK + static const char PROGMEM base0_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x00, + 0x00,0x0e,0x00,0x00,0x00,0x00,0x60,0xe0,0x00,0x00,0x00,0x00,0xc0,0xc0, + 0x00,0x00,0x00,0xf8,0x90,0x88,0x88,0x70,0x00,0x78,0x80,0x80,0x40,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x18,0x00,0x00, + 0x40,0x40,0x40,0x80,0x00,0x80,0x41,0x40,0x40,0x80,0x00,0x80,0x40,0x40, + 0x40,0x80,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0xd8,0x06,0x01,0x00,0x00,0x00,0x02, + 0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x03,0x05,0x05, + 0x85,0x05,0x00,0xc3,0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x04,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00, + 0xb6,0x76,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00,0x80,0x82, + 0x7e,0x00,0x00,0x3f,0x08,0x0c,0x12,0x20,0x00,0x22,0x14,0x08,0x14,0x22}}; + static const char PROGMEM base0_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0x00, + 0x07,0x00,0x07,0x00,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x82,0x44,0x28, + 0x10,0x00,0x00,0xfe,0x12,0x12,0x12,0x0c,0x00,0x06,0x08,0xf0,0x08,0x06 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0xe0, + 0x90,0x90,0x90,0xe0,0x00,0xe0,0x10,0x10,0x10,0xe0,0x00,0xf0,0x90,0x90, + 0x90,0x10,0x00,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x10,0xf0,0x10,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x87,0x80,0x00,0x00,0x07, + 0x00,0x00,0x00,0x07,0x00,0x03,0x84,0x84,0x84,0x03,0x00,0x07,0x04,0x04, + 0x04,0x84,0x00,0x83,0x04,0x04,0x04,0x83,0x00,0x80,0x04,0x07,0x04,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x01,0x00,0x28,0x04,0x03,0x00,0x00, + 0x36,0x36,0x00,0x00,0x00,0x1f,0x20,0x28,0x10,0x6f,0x00,0x18,0x20,0x20, + 0x20,0x1f,0x00,0x3f,0x04,0x0a,0x11,0x20,0x00,0x31,0x0a,0x04,0x0a,0x31}}; + static const char PROGMEM base0_R_dvor_nomod[4][42] = { + { 0x00,0xfc,0x12,0x12,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x70,0x88, + 0x88,0x88,0x88,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x00,0x02,0x7e,0x80, + 0x80,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x80,0x80,0xf0,0x00,0xf0,0x02,0x82,0x82,0x01,0x00,0x00,0x80, + 0xf0,0x80,0x80,0x00,0xc0,0x40,0x40,0x40,0x80,0x00,0x80,0x40,0x40,0x40, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x83,0x04,0x04,0x02,0x07,0x00,0x07,0x01,0x00,0x00,0x07,0x00,0x00,0x00, + 0x03,0x04,0x04,0x00,0x07,0x00,0x00,0x00,0x07,0x00,0x04,0x05,0x05,0x05, + 0x02,0x00,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x3f,0x24,0x22,0x22,0x1c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x1e,0x20, + 0x1c,0x20,0x1e,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x22,0x32,0x2a,0x26, + 0x22,0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_dvor_shift[4][42] = { + { 0xfe,0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xfc,0x02, + 0x02,0x02,0x84,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x00,0x00,0x00, + 0x00,0x00,0x04,0x88,0x50,0x20,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xf1,0x10,0x10,0x10,0xe0,0x00,0xf0,0x81,0x81,0x81,0xf0,0x00,0x10,0x11, + 0xf1,0x11,0x10,0x00,0xf1,0x60,0x80,0x00,0xf1,0x00,0x61,0x91,0x91,0x91, + 0x21,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x8f,0x88,0x88,0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x8f,0x00,0x80,0x00, + 0x0f,0x00,0x80,0x00,0x8f,0x00,0x01,0x06,0x8f,0x00,0x84,0x88,0x88,0x88, + 0x87,0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x7f,0x44,0x44,0x44,0x3b,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x1f,0x60, + 0x1c,0x60,0x1f,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x70,0x48,0x44,0x42, + 0x41,0x00,0x08,0x08,0x3e,0x08,0x08,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM symb5_R_dvor[4][42] = { + { 0x00,0x02,0x04,0x08,0x00,0x00,0x20,0x20,0xdc,0x02,0x02,0x00,0x02,0x02, + 0xdc,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x50,0x50,0x50,0x50, + 0x50,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0xf0,0x11,0x12,0x02,0x00,0x02,0x12, + 0x11,0xf0,0x00,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00,0xc0,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x00,0x1f,0x10,0x90,0x00,0x00,0x00,0x90, + 0x10,0x1f,0x00,0x00,0xc0,0x00,0x14,0x03,0x00,0x00,0x01,0x01,0x87,0x01, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1c,0x63,0x80,0x00,0x00,0x00,0x80, + 0x63,0x1c,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x7f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM numb6_L_dvor_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08, + 0x08,0x08,0x08,0x08,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x01,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_dvor_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, + 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, + 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x01,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, + 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, + 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; + // Turkish F + static const char PROGMEM base0_L_turf_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x10,0x10,0x7c,0x10,0x10,0x00,0x00, + 0xfe,0x09,0x09,0x00,0x00,0x70,0x88,0x88,0x48,0xf8,0x00,0x51,0xaa,0xaa, + 0x92,0x09,0x00,0x00,0x88,0xf8,0x80,0x00,0x00,0x70,0x88,0x88,0x88,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x80,0x00,0x80,0x40,0x00,0xc0, + 0x00,0x00,0x00,0xc0,0x00,0x00,0x42,0xd2,0x02,0x01,0x00,0x81,0x42,0x42, + 0x42,0x81,0x00,0x00,0x40,0x40,0x40,0x80,0x00,0xc0,0x10,0x00,0x10,0xc0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x04,0x02,0x01,0x02,0x04,0x00,0x03, + 0x04,0x04,0x82,0x07,0x00,0x00,0x80,0x07,0x84,0x00,0x00,0x03,0x05,0x05, + 0x05,0x05,0x00,0x02,0x05,0x05,0x05,0x07,0x00,0x03,0x04,0x04,0x02,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x1c,0x22,0x22,0x12,0xfe,0x00,0x00, + 0x80,0x82,0x7e,0x00,0x00,0x1c,0x22,0x22,0x22,0x1c,0x00,0x06,0x18,0x20, + 0x18,0x06,0x00,0x1c,0x22,0x22,0x22,0x22,0x00,0x1c,0xa2,0x62,0x22,0x22}}; + static const char PROGMEM base0_L_turf_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x28,0x10,0x7c,0x10,0x28,0x00,0xfe, + 0x12,0x12,0x12,0x02,0x00,0xfc,0x02,0x12,0x12,0xf4,0x00,0xf1,0x0a,0x4a, + 0x4a,0xd1,0x00,0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0xfc + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x30,0x40,0x80,0x40,0x30,0x00,0xf1, + 0x00,0x00,0x00,0xf0,0x00,0x00,0x21,0xe9,0x21,0x00,0x00,0xf1,0x92,0x92, + 0x92,0x11,0x00,0xe0,0x91,0x91,0x91,0xe0,0x00,0xe0,0x09,0x01,0x09,0xe0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x0e,0x81,0x80,0x81,0x0e,0x00,0x07, + 0x08,0x08,0x08,0x87,0x00,0x00,0x50,0x1f,0x50,0x00,0x00,0x8f,0x08,0x08, + 0x08,0x88,0x00,0x0f,0x80,0x80,0x80,0x0f,0x00,0x8f,0x50,0x50,0x50,0x8f + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x3f,0x40,0x50,0x20,0xdf,0x00,0x30, + 0x40,0x40,0x40,0x3f,0x00,0x7e,0x81,0x81,0x81,0x7e,0x00,0x07,0x18,0x60, + 0x18,0x07,0x00,0x3f,0x40,0x40,0x40,0x21,0x00,0x1f,0xa0,0x60,0x20,0x10}}; + static const char PROGMEM base0_L_turf_altgr[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x10,0x10,0x10,0x30,0x00,0x00,0xf0, + 0x08,0xe8,0xa8,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x0c,0x1e,0xfe,0x02,0xfe,0x00,0x70,0x8a,0x89,0x8a,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x10,0x20,0x40,0x00,0x00,0xc1, + 0x12,0x0a,0x12,0xc2,0x00,0x00,0x10,0xc8,0x10,0x00,0x00,0x40,0xe0,0x50, + 0x10,0x20,0x00,0x00,0x50,0x48,0x50,0x80,0x00,0xc0,0x10,0x08,0x10,0xc0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x80,0x00,0x80,0x00,0x00,0x03, + 0x04,0x04,0x02,0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x01,0x83,0x05, + 0x04,0x82,0x00,0x02,0x05,0x05,0x05,0x07,0x00,0x83,0x84,0x04,0x82,0x87 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x3e,0x3e,0x3e,0x00,0x08,0x14, + 0x22,0x08,0x14,0x22,0x00,0x22,0x14,0x08,0x22,0x14,0x08,0x03,0x02,0x00, + 0x03,0x02,0x00,0x1c,0x22,0x7f,0x22,0x22,0x00,0x02,0x01,0x00,0x02,0x01}}; + static const char PROGMEM base0_L_turf_shfgr[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x90,0x90,0xfc,0x90,0x90,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x0a,0x09,0x0a,0xf0 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x88,0x90,0xa0,0x00,0x00,0xc0, + 0x10,0x08,0x10,0xc0,0x00,0x00,0x50,0xc8,0x50,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x80,0x50,0x48,0x50,0x80,0x00,0xc1,0x12,0x0a,0x12,0xc1 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x8f,0x4f,0x8f,0x00,0x00,0x0f, + 0x10,0x10,0x90,0x0f,0x00,0x80,0x10,0x1f,0x10,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x1f,0x82,0x82,0x82,0x1f,0x00,0x0f,0x10,0x10,0x10,0x0f + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x7c,0x7d,0x7c,0x00,0x00,0x04, + 0x0a,0x11,0x20,0x00,0x00,0x20,0x11,0x0a,0x04,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x1f,0x24,0x2a,0x20,0x1f,0x00,0x00,0x00,0x00,0x00,0x00}}; + static const char PROGMEM base0_R_turf_nomod[4][42] = { + { 0x70,0x88,0x88,0x48,0xff,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0xf8,0x08, + 0x08,0x08,0xf0,0x00,0xff,0x10,0x08,0x08,0xf0,0x00,0xf8,0x90,0x88,0x88, + 0x70,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x40,0xf8,0x40,0x40,0x00,0x00,0xf8,0x00,0x80,0x40,0x00,0x00,0xc0,0x40, + 0xc0,0x40,0x80,0x00,0x08,0xf8,0x00,0x00,0x00,0x00,0xc3,0x00,0x00,0x00, + 0xc0,0x00,0x80,0x40,0x40,0x40,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x00,0x03,0x04,0x04,0x00,0x00,0x07,0x01,0x01,0x02,0x04,0x00,0xc7,0x00, + 0x07,0x00,0x07,0x00,0x00,0x03,0x04,0x04,0x00,0x00,0x03,0x14,0x14,0x12, + 0x0f,0x00,0x04,0x15,0x0d,0x05,0x02,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0x32,0x2a,0x26,0x22,0x00,0x24,0x2a,0x2a,0x2a,0x10,0x00,0x3f,0x24, + 0x22,0x22,0x1c,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0xb0,0x70,0x00, + 0x00,0x00,0x1e,0x20,0x1c,0x20,0x1e,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_turf_shift[4][42] = { + { 0xfe,0x02,0x02,0x02,0xfc,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0xfe,0x0c, + 0x30,0xc0,0xfe,0x00,0xfe,0x10,0x10,0x10,0xfe,0x00,0xfe,0x12,0x12,0x12, + 0x0c,0x00,0x82,0x44,0x28,0x10,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x11,0x11,0xf1,0x11,0x10,0x00,0xf1,0x80,0x40,0x20,0x11,0x00,0xf1,0x20, + 0xc0,0x20,0xf1,0x00,0xf1,0x00,0x00,0x00,0x01,0x00,0x31,0x40,0x80,0x40, + 0x30,0x00,0x30,0x48,0x48,0x48,0x90,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x80,0x80,0x8f,0x80,0x80,0x00,0x0f,0x80,0x81,0x82,0x0c,0x00,0x8f,0x80, + 0x80,0x80,0x0f,0x00,0x0f,0x08,0x08,0x08,0x08,0x00,0x00,0x00,0x0f,0x00, + 0x00,0x00,0x82,0x14,0x0c,0x04,0x83,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x70,0x48,0x44,0x42,0x41,0x00,0x23,0x44,0x44,0x44,0x39,0x00,0x7f,0x44, + 0x44,0x44,0x3b,0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x00,0xb6,0x76,0x00, + 0x00,0x00,0x1f,0x60,0x1c,0x60,0x1f,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_turf_altgr[4][42] = { + { 0x53,0x54,0xf8,0x54,0x53,0x00,0x7c,0xba,0x8a,0x8a,0x7c,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x0c,0x12,0x12,0x0c,0x00,0x00,0x20,0xfc,0x22,0x02, + 0x84,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0x80,0xf1,0xa0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x00, + 0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x20,0x11,0x01, + 0x00,0x00,0x40,0xf0,0x41,0xf0,0x40,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x02,0x01,0x0f,0x08,0x08,0x06,0x83,0x40,0x40,0x40,0x00,0x00,0x0f,0x02, + 0x04,0x04,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x07,0x01,0x07,0x01,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x47,0x4a,0x4a,0x3c,0x00,0x00,0x11,0x0a, + 0x04,0x0a,0x11,0x00,0x04,0x04,0x15,0x04,0x04,0x00,0x00,0x00,0x04,0x00, + 0x00,0x00,0x04,0x02,0x04,0x08,0x04,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_turf_shfgr[4][42] = { + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xef,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x90,0x88, + 0x00,0x00,0x00,0x90,0xa1,0x90,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x0f,0x0f, + 0x00,0x00,0x00,0x0f,0x0f,0x0f,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x7d,0x7c, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM symb5_R_turf_nomod[4][42] = { + { 0x20,0x20,0xf8,0x20,0x20,0x00,0x00,0xc0,0x30,0x0c,0x03,0x00,0x20,0x20, + 0x20,0x20,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0x00,0xc0,0x00,0x80,0x00,0x43,0x20,0x20,0x20,0xc0,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x02,0x81,0x47,0x81,0x02,0x00,0x00,0x00,0x0a,0x01,0x00,0x00,0x04,0x04, + 0x04,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM symb5_R_turf_altgr[4][42] = { + { 0x10,0x10,0x10,0x30,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0x00, + 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0x80,0xe0,0x80,0x80,0x00,0x00,0x00,0xa0,0x00,0x03,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x04,0x84,0x47,0x84,0x04,0x00,0x06,0x09,0x08,0x08,0x04,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM numb6_L_turf_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x01,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_turf_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04, + 0x88,0x50,0x20,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x38,0xc6, + 0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00,0x00,0x50,0x50,0x50,0x50,0x50 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01, + 0x00,0x00,0x00,0x00,0x00,0x60,0x90,0xf8,0x90,0x20,0x00,0x20,0x50,0x20, + 0x81,0x60,0x00,0x70,0x89,0x48,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x82,0x09, + 0x94,0x08,0x00,0x07,0x08,0x89,0x06,0x09,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x00,0x03,0x00, + 0x03,0x00,0x00,0x02,0x01,0x00,0x01,0x02,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_turf_altgr[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0xff,0x00,0x00,0x00,0x10,0x10,0xee,0x01,0x01,0x00,0x00,0xff,0x01, + 0x01,0x00,0x00,0x00,0x01,0x01,0xff,0x00,0x00,0x01,0x01,0xee,0x10,0x10 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x01,0x00,0x00,0x00,0x10,0xf8,0x00,0x01,0x01,0x00,0x10,0xf9,0x01, + 0x01,0x00,0x00,0x88,0xa9,0x51,0x01,0x00,0x00,0x01,0x01,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0xc0,0x00,0x00,0x00,0x00,0x08,0x8c,0x0a,0x1f,0x00,0x00,0x00,0x90, + 0x90,0x10,0x00,0x00,0x08,0x0c,0x0a,0x1f,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x7b,0x00,0x00,0x00,0x00,0x09,0x0f,0x08,0x00,0x00,0x00,0x09,0x0c, + 0x0a,0x09,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_turf_shfgr[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0xef,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x90,0x90,0xfc, + 0x90,0x90,0x00,0x06,0x09,0x09,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x88,0xa8,0x50, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x0a, + 0x15,0x0a,0x00,0x40,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x7b,0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x04,0x05,0x05,0x02,0x00,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + + // UNIVERSAL + static const char PROGMEM char1_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe2,0xae,0x42,0x00,0x00,0x20,0x44,0x40,0x4c,0x20,0x00,0x12,0xa4,0x88, + 0xa4,0x12,0x00,0x08,0xf8,0x08,0xf8,0x08,0x00,0x78,0x80,0x80,0x80,0x78 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80, + 0x41,0x40,0x41,0x80,0x00,0x80,0x40,0x40,0x40,0x80,0x00,0x81,0x40,0x40, + 0x40,0x81,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x83, + 0xc4,0x84,0xc2,0x07,0x00,0x03,0x04,0x04,0x04,0x03,0x00,0x02,0x85,0x05, + 0x04,0x82,0x00,0x03,0x04,0x1f,0x04,0x03,0x00,0x80,0x83,0x84,0x82,0x80 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f, + 0xc4,0x44,0xef,0x3b,0x00,0x3e,0x49,0x49,0x49,0x3e,0x00,0x02,0x7f,0x09, + 0x09,0x78,0x00,0x3e,0x08,0x08,0x14,0x22,0x00,0x20,0x24,0x24,0x24,0x20}}; + static const char PROGMEM char1_R[4][42] = { + { 0x70,0x88,0xf0,0x88,0x70,0x00,0xfe,0x02,0x02,0x02,0x06,0x00,0x88,0x48, + 0x70,0x90,0x88,0x00,0xf0,0x88,0x88,0x88,0x70,0x00,0xc0,0x30,0x0c,0x30, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xa0,0x50,0x53,0x90,0x20,0x00,0xc0,0x80,0x40,0x40,0x80,0x00,0x40,0x40, + 0xc0,0x40,0x40,0x00,0xc3,0x00,0x00,0x00,0xc0,0x00,0x80,0x40,0xc0,0x40, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x03,0x84,0x84,0x04,0x03,0x00,0x07,0x00,0x00,0x00,0x1f,0x00,0x00,0x80, + 0x83,0x84,0x00,0x00,0x00,0x83,0x54,0x8b,0x00,0x00,0x83,0x84,0x84,0x83, + 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0xff,0x24,0x24,0x27,0x18,0x00,0x7e,0x10,0x20,0x20,0x1e,0x00,0x2f,0x30, + 0x00,0x30,0x2f,0x00,0xe0,0x38,0x25,0x38,0xe0,0x00,0x18,0x26,0xa1,0xa0, + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM game2_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c, + 0x82,0xa2,0x42,0xbc,0x00,0x3e,0xc0,0x30,0xc0,0x3e,0x00,0xfe,0x92,0x92, + 0x92,0x82,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x40,0x40,0x40,0x40,0xe0,0x00,0xe0, + 0x90,0x90,0x90,0xe1,0x00,0x60,0x90,0x90,0x90,0x20,0x00,0xf0,0x10,0x10, + 0x10,0xe0,0x00,0xf0,0x90,0x90,0x90,0x10,0x00,0xe0,0x10,0x90,0x90,0xa0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x07,0x02,0x02,0x02,0x02,0x00,0x87, + 0x80,0x80,0x80,0x87,0x00,0x82,0x04,0x04,0x04,0x83,0x00,0x07,0x84,0x84, + 0x84,0x03,0x00,0x87,0x00,0x00,0x00,0x80,0x00,0x83,0x84,0x84,0x84,0x03 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x08,0x3c,0x02,0x3c,0x08,0x00,0x30, + 0x28,0x24,0x22,0x21,0x00,0x31,0x0a,0x04,0x0a,0x31,0x00,0x1f,0x20,0x20, + 0x20,0x11,0x00,0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x24,0x24,0x24,0x1b}}; + static const char PROGMEM medi3_R_nomod[4][42] = { + { 0x03,0x0c,0xb0,0x0c,0x03,0x00,0x3f,0x02,0x9c,0x02,0x3f,0x00,0x3f,0x04, + 0x84,0x04,0x3f,0x00,0x22,0x25,0xa5,0x25,0x18,0x00,0x3f,0x25,0xa5,0x25, + 0x1a,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 + },{ 0xc0,0x01,0x73,0x01,0xc0,0x00,0xf0,0x81,0xc3,0xe1,0xf0,0x00,0x00,0x71, + 0x03,0x71,0x00,0x00,0x00,0xc1,0xc3,0xc1,0x00,0x00,0xf0,0xe1,0xc3,0x81, + 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x02,0x02,0x02,0x01,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, + 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, + 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 + },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, + 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, + 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM medi3_R_shift[4][42] = { + { 0x03,0x0c,0x30,0x0c,0x03,0x00,0x3f,0x02,0x1c,0x02,0x3f,0x00,0x3f,0x04, + 0x04,0x04,0x3f,0x00,0x22,0x25,0x25,0x25,0x18,0x00,0x3f,0x25,0x25,0x25, + 0x1a,0x00,0x00,0xe0,0x8f,0x02,0x31,0x49,0xfa,0x00,0xe7,0x73,0x00,0x00 + },{ 0xc0,0x01,0x71,0x01,0xc0,0x00,0xf0,0x81,0xc1,0xe1,0xf0,0x00,0x00,0x71, + 0x01,0x71,0x00,0x00,0x00,0xc1,0xc1,0xc1,0x00,0x00,0xf0,0xe1,0xc1,0x81, + 0xf0,0x00,0x00,0x03,0xe2,0x21,0xe0,0x21,0xc0,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x02,0x02,0x02,0x01,0x00,0x07,0x00,0x01,0x03,0x87,0x00,0x00,0x1f, + 0x0e,0x04,0x80,0x00,0x00,0x03,0x03,0x03,0x00,0x00,0x07,0x03,0x01,0x00, + 0x87,0x00,0x00,0x40,0xa6,0xa8,0x08,0x04,0x8e,0x00,0x73,0x39,0x00,0x00 + },{ 0x3e,0x31,0x01,0x31,0x3e,0x00,0x00,0x46,0x46,0x4f,0x1f,0x00,0x00,0xa6, + 0x46,0xaf,0x1f,0x00,0x28,0x2c,0x2e,0x2c,0x28,0x00,0x00,0x46,0xe6,0x4f, + 0x1f,0x00,0x00,0x02,0x72,0x8a,0x89,0x00,0x1e,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM navi4_R[4][42] = { + { 0xe0,0x10,0x54,0x38,0x10,0x00,0xfc,0x24,0x24,0x24,0x18,0x00,0x0c,0x10, + 0xe0,0x10,0x0c,0x00,0x8c,0x50,0x20,0x50,0x8c,0x00,0xc0,0xbe,0xa2,0xbe, + 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x80,0xc1,0xa1,0x81,0x00,0x00,0x01,0x80,0x40,0x20,0x00,0x00,0x00,0x00, + 0xf1,0x00,0x00,0x00,0x41,0x20,0xd0,0x20,0x41,0x00,0x01,0x21,0x41,0x81, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x00,0x49,0x4a,0x48,0x87,0x00,0x81,0x82,0x85,0x89,0x01,0x00,0x01,0x02, + 0x85,0x02,0x01,0x00,0x40,0x40,0x47,0x40,0x40,0x00,0x81,0x09,0x05,0x02, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x12,0x65,0x85,0x65,0x17,0x00,0x07,0x01,0x06,0x18,0x60,0x00,0x88,0x90, + 0xaf,0x90,0x88,0x00,0x04,0x02,0x7d,0x02,0x04,0x00,0x01,0x46,0x58,0x60, + 0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM func7_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0xff,0x09,0xe9,0xc9,0x01,0x00,0xe0,0x00, + 0x10,0x08,0xfc,0x00,0x00,0x08,0x84,0x44,0x24,0x18,0x00,0x88,0x04,0x24, + 0x24,0xd8,0x00,0x60,0x50,0x48,0xfc,0x40,0x00,0x70,0x80,0x9c,0x80,0x70 + },{ 0x00,0x00,0xce,0x9c,0x00,0xf0,0x00,0x00,0x9f,0x00,0x03,0x0c,0x1f,0x00, + 0xe0,0xa0,0xa1,0x20,0x00,0xc1,0xa1,0xa1,0xa1,0x01,0x00,0x20,0x21,0x21, + 0xa1,0x60,0x00,0xc0,0x20,0x20,0x21,0xc0,0x00,0x40,0xe0,0x50,0x40,0x80 + },{ 0x00,0x00,0x39,0x73,0x00,0xef,0x02,0x83,0xe4,0x00,0x0e,0x15,0x16,0x00, + 0x04,0x08,0x08,0x07,0x00,0x07,0x48,0xc8,0x08,0x07,0x00,0x00,0x40,0xce, + 0x01,0x00,0x00,0x06,0x49,0xc9,0x09,0x06,0x00,0x06,0x08,0x49,0x08,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x05,0x04,0x03,0x90,0xa8,0xa8,0x40,0x06, + 0x49,0x49,0x49,0x3e,0x00,0x7c,0xa2,0x93,0x8a,0x7c,0x00,0x00,0x08,0x07, + 0xfe,0x00,0x00,0x84,0xc2,0xa3,0x92,0x8c,0x00,0x70,0x38,0x0d,0x38,0x70}}; + static const char PROGMEM mous8_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x3c,0x84,0xbc,0x84,0x38,0x00,0x00,0x00,0x10, + 0x28,0x92,0xc5,0x82,0x00,0xfe,0x1f,0x1f,0x01,0xfe,0x00,0xfe,0x01,0x19, + 0x01,0xfe,0x00,0xfe,0x01,0x1f,0x1f,0xfe,0x00,0x10,0x38,0x92,0xc7,0x82 + },{ 0x00,0x00,0xce,0x9c,0x00,0xe7,0x08,0x08,0x08,0xe7,0x00,0x00,0x00,0x00, + 0x00,0x80,0x01,0x00,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x01,0x01,0x81, + 0x01,0x01,0x00,0x01,0x01,0x81,0x01,0x01,0x00,0x60,0x50,0xf8,0x41,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x91,0xaa,0xaa,0xa9,0x43,0x00,0x00,0x00,0x02, + 0x07,0xca,0x02,0x02,0x00,0x02,0x01,0xcf,0x01,0x02,0x00,0x02,0x04,0x0f, + 0x04,0x02,0x00,0x02,0x02,0xca,0x07,0x02,0x00,0xdc,0x58,0x5c,0x18,0x1f + },{ 0x00,0x00,0xe7,0xce,0x00,0x1c,0x2a,0x2a,0x2a,0x2c,0x00,0x00,0x00,0x0c, + 0x33,0xc0,0x00,0x00,0x00,0x0c,0x03,0x00,0x03,0x0c,0x00,0x0c,0x30,0xc0, + 0x30,0x0c,0x00,0x00,0x00,0xc0,0x33,0x0c,0x00,0xe5,0xc9,0xe6,0xc0,0xf8}}; + static const char PROGMEM musi9_L[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe, + 0x00,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00, + 0x00,0x02,0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0xc0,0xe0,0xf0,0xf9,0xf8,0xf8,0xf8,0xf9, + 0xf0,0xe0,0xc0,0x01,0x01,0x01,0x00,0xf0,0xf0,0x01,0x01,0xf1,0xf0,0x00, + 0x00,0x01,0x01,0x01,0x00,0x00,0xf8,0xf1,0xe1,0xc1,0x80,0x00,0x00,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x07,0x0f,0x1f,0x3f,0x3f,0x3f,0x3f,0x3f, + 0x1f,0x0f,0x07,0x00,0x00,0x00,0x00,0x1f,0x1f,0x00,0x00,0x1f,0x1f,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0x0f,0x07,0x03,0x01,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08, + 0xf8,0x08,0xf0,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0x70,0x88,0x88,0x48, + 0xff,0x00,0x70,0xa8,0xa8,0xa8,0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}; + static const char PROGMEM musi9_R[4][42] = { + { 0x00,0x00,0x00,0xfe,0x04,0x18,0x04,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00, + 0xfe,0x00,0x8c,0x12,0x12,0x12,0xe4,0x00,0x00,0x02,0xfe,0x02,0x00,0x00, + 0xfc,0x02,0x02,0x02,0x84,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x00,0x00,0x81,0x60,0x10,0x60,0x81,0x60,0x10,0x00,0x01,0x01,0x01, + 0xe0,0xe0,0x60,0x61,0x61,0x61,0x60,0xf8,0x70,0x21,0x01,0x01,0xc0,0xe0, + 0x60,0x01,0xf9,0xf9,0x00,0x60,0xe0,0xc0,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x18,0x24,0x4b,0x48,0x48,0x4c,0x4b,0x48,0x4b,0x2c,0x18,0x00,0x00,0x00, + 0x4f,0xe7,0xf0,0x60,0x60,0x60,0x60,0x60,0x7e,0x7f,0x00,0x0f,0x3f,0x70, + 0x60,0xc0,0xc1,0xc1,0xc0,0x60,0x70,0x3f,0x0f,0x00,0x73,0x39,0x00,0x00 + },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, + 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, + 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + + // Render the requested image on the given column and row + // Don't grab highest layer; instead compare from top to bottom. + // Highest layer might be on the other side + if (isLeft) { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_L); + } else if (layer_state_cmp(layer_state, _MOUS)) { + draw_image(row, col, mous8_L); + } else if (layer_state_cmp(layer_state, _FUNC)) { + draw_image(row, col, func7_L); + } else if (layer_state_cmp(layer_state, _NUMB)) { + switch (userspace_config.layout % 3) { + case 0: // Dvorak + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, numb6_L_dvor_shift); + } else { + draw_image(row, col, numb6_L_dvor_nomod); + } + break; + case 1: // Turkish F + if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { + // Shift + AltGr + draw_image(row, col, numb6_L_turf_shfgr); + } else if (mods & MOD_MASK_SHIFT) { + // Shift + draw_image(row, col, numb6_L_turf_shift); + } else if (mods & MOD_BIT(KC_RALT)) { + // AltGr + draw_image(row, col, numb6_L_turf_altgr); + } else { + // Normal + draw_image(row, col, numb6_L_turf_nomod); + } + break; + case 3: // Qwerty + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, numb6_L_dvor_shift); + } else { + draw_image(row, col, numb6_L_dvor_nomod); + } + break; + } + } else if (layer_state_cmp(layer_state, _GAME)) { + draw_image(row, col, game2_L); + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_L); + } else { + switch (userspace_config.layout % 3) { + case 0: // Dvorak + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_L_dvor_shift); + } else { + draw_image(row, col, base0_L_dvor_nomod); + } + break; + case 1: // Turkish F + if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { + // Shift + AltGr + draw_image(row, col, base0_L_turf_shfgr); + } else if (mods & MOD_MASK_SHIFT) { + // Shift + draw_image(row, col, base0_L_turf_shift); + } else if (mods & MOD_BIT(KC_RALT)) { + // AltGr + draw_image(row, col, base0_L_turf_altgr); + } else { + // Normal + draw_image(row, col, base0_L_turf_nomod); + } + break; + case 2: // Qwerty + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_L_dvor_shift); + } else { + draw_image(row, col, base0_L_dvor_nomod); + } + break; + } + } + } else { + if (layer_state_cmp(layer_state, _MUSI)) { + draw_image(row, col, musi9_R); + } else if (layer_state_cmp(layer_state, _SYMB)) { + switch (userspace_config.layout % 3) { + case 0: // Dvorak + draw_image(row, col, symb5_R_dvor); + break; + case 1: // Turkish f + if (mods & MOD_BIT(KC_RALT)) { + // AltGr + draw_image(row, col, symb5_R_turf_altgr); + } else { + // Normal + draw_image(row, col, symb5_R_turf_nomod); + } + break; + case 2: // Qwerty + draw_image(row, col, symb5_R_dvor); + break; + } + } else if (layer_state_cmp(layer_state, _NAVI)) { + draw_image(row, col, navi4_R); + } else if (layer_state_cmp(layer_state, _MEDI)) { + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, medi3_R_shift); + } else { + draw_image(row, col, medi3_R_nomod); + } + } else if (layer_state_cmp(layer_state, _CHAR)) { + draw_image(row, col, char1_R); + } else { + switch (userspace_config.layout % 3) { + case 0: // Dvorak + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_R_dvor_shift); + } else { + draw_image(row, col, base0_R_dvor_nomod); + } + break; + case 1: // Turkish F + if ((mods & MOD_MASK_SHIFT) && (mods & MOD_BIT(KC_RALT))) { + // Shift + AltGr + draw_image(row, col, base0_R_turf_shfgr); + } else if (mods & MOD_MASK_SHIFT) { + // Shift + draw_image(row, col, base0_R_turf_shift); + } else if (mods & MOD_BIT(KC_RALT)) { + // AltGr + draw_image(row, col, base0_R_turf_altgr); + } else { + // Normal + draw_image(row, col, base0_R_turf_nomod); + } + break; + case 2: // Qwerty + if (mods & MOD_MASK_SHIFT) { + draw_image(row, col, base0_R_dvor_shift); + } else { + draw_image(row, col, base0_R_dvor_nomod); + } + break; + } + } + } +} + +// Render the RGB state on the given column and row +void render_rgb(uint8_t row, uint8_t col) { + static const char PROGMEM rgb_enab[12] = {0x08,0x81,0x3c,0x42,0x99,0xbd,0xbd,0x99,0x42,0x3c,0x81,0x10}; + static const char PROGMEM rgb_disa[12] = {0x08,0x81,0x3c,0x42,0x81,0x81,0x81,0x81,0x42,0x3c,0x81,0x10}; + static char rgb_temp4[4] = {0}; + static char rgb_temp3[3] = {0}; + + oled_set_cursor(col, row); +# ifdef RGB_MATRIX_ENABLE + if (rgb_matrix_is_enabled()) { + oled_write_raw_P(rgb_enab, 12); + } else { + oled_write_raw_P(rgb_disa, 12); + } + oled_set_cursor(col + 2, row); + oled_write(" hue sat val", false); + oled_set_cursor(col, row + 1); + itoa(rgb_matrix_get_mode(), rgb_temp3, 10); + oled_write(rgb_temp3, false); + oled_write(" ", false); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" ", false); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); + oled_write(rgb_temp4, false); +# else // RGB_MATRIX_ENABLE + oled_write("-RGB disabled-", false); +# endif // RGB_MATRIX_ENABLE +} + +void render_status_left(uint8_t row, uint8_t col) { + // Left side looks like this on the left half + // (Should be 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + // Right half is whatever layer image needs be + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // MODIFIERS + render_modifiers(row + 0, col + 0, this_mod); + // Encoders + render_encoder(row + 1, col + 0, 0, this_layer); + // WPM text + render_wpm(row + 2, col + 0); + // Visual layout + render_keymap(row + 3, col + 0, false); + // Draw the image after 14'th character + render_layout(row + 0, col + 14, this_mod, true); +} + +void render_status_right(uint8_t row, uint8_t col) { + // Right half is whatever layer image needs be on the left + // Right side looks like this on the right half + // (Should be after the 12'th character; max 14 characters per line) + // Mods: + // Enc: <8 len str> + // Wpm: + // Layout: + uint8_t this_mod = get_mods(); + uint8_t this_layer = get_highest_layer(layer_state); + + // Draw the image + render_layout(row + 0, col + 0, this_mod, false); + // Modifiers + render_modifiers(row + 0, col + 7, this_mod); + // Encoder + render_encoder(row + 1, col + 7, 1, this_layer); + // RGB State (2 rows) + render_rgb(row + 2, col + 7); +} diff --git a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h b/users/bbaserdem/bb-oled-extra.h similarity index 69% rename from layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h rename to users/bbaserdem/bb-oled-extra.h index f9f549a8757..7584cb4fe2d 100644 --- a/layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h +++ b/users/bbaserdem/bb-oled-extra.h @@ -13,7 +13,9 @@ along with this program. If not, see . */ #pragma once #include "bbaserdem.h" - -// These are protorne specific functions to be called for drawing -void render_status_left(void); -void render_status_right(void); +// OLED layout images writer function +void render_modifiers(uint8_t row, uint8_t col, uint8_t mods); +void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft); +void render_rgb(uint8_t row, uint8_t col); +void render_status_left(uint8_t row, uint8_t col); +void render_status_right(uint8_t row, uint8_t col); diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index a5801ad733d..1d7231a5fdc 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -13,305 +13,205 @@ along with this program. If not, see . */ #include "bb-oled.h" #include -// Allow access to encoder_state +// Grab the print function #ifdef ENCODER_ENABLE -#include "bb-encoder.h" +# include "bb-encoder.h" #endif // ENCODER_ENABLE /* OLED * This contains general purpose oled code */ -#ifdef ENCODER_ENABLE +// Allow default to be overwritten by keymap if they return false +__attribute__ ((weak)) bool oled_task_keymap(void) {return true;} -#if !defined KEYBOARD_splitkb_kyria_rev1 // Don't include in kyria; space -void encoder_state_string8(uint8_t index, uint8_t layer, char* buffer) { - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled - #ifdef RGB_MATRIX_ENABLE - case _MEDI: - switch (encoder_state[index].rgb) { - case 0: - strcpy(buffer, "ani mode"); - break; - case 1: - strcpy(buffer, "hue "); - break; - case 2: - strcpy(buffer, "saturat."); - break; - case 3: - strcpy(buffer, "bright. "); - break; - case 4: - strcpy(buffer, "ani. spd"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - #endif - // If pointer control is enabled - #ifdef MOUSEKEY_ENABLE - case _MOUS: - switch (encoder_state[index].point) { - case 0: - strcpy(buffer, "Lateral "); - break; - case 1: - strcpy(buffer, "Vertical"); - break; - case 2: - strcpy(buffer, "Scr. Ver"); - break; - case 3: - strcpy(buffer, "Scr. Lat"); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; - #endif - default: - switch (encoder_state[index].base) { - case 0: - strcpy(buffer, "Volume "); - break; - case 1: - strcpy(buffer, "Song "); - break; - case 2: - strcpy(buffer, "Sink "); - break; - case 3: - strcpy(buffer, "Src. Vol"); - break; - case 4: - strcpy(buffer, "Source "); - break; - case 5: - strcpy(buffer, "Arrow LR"); - break; - case 6: - strcpy(buffer, "Arrow UD"); - break; - case 7: - strcpy(buffer, "Page U/D"); - break; - case 8: - strcpy(buffer, "Erase "); - break; - default: - strcpy(buffer, " -N/A- "); - break; - } - break; +// Do sane defaults for regular oled rendering +void oled_task_user(void) { + if (oled_task_keymap()) { + render_status_lite(0, 0); } } -#endif // !KEYBOARD_splitkb_kyria_rev1 -void encoder_state_string5(uint8_t index, uint8_t layer, char* buffer) { - // Get the layer straight from the main function - switch (layer) { - // If RGB control mode is enabled - #ifdef RGB_MATRIX_ENABLE - case _MEDI: - switch (encoder_state[index].rgb) { - case 0: - strcpy(buffer, " mode"); - break; - case 1: - strcpy(buffer, " hue "); - break; - case 2: - strcpy(buffer, "satur"); - break; - case 3: - strcpy(buffer, "value"); - break; - case 4: - strcpy(buffer, "speed"); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - #endif - // If pointer control is enabled - #ifdef MOUSEKEY_ENABLE - case _MOUS: - switch (encoder_state[index].point) { - case 0: - strcpy(buffer, "m.lat"); - break; - case 1: - strcpy(buffer, "m.ver"); - break; - case 2: - strcpy(buffer, "s.ver"); - break; - case 3: - strcpy(buffer, "s.lat"); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - #endif - default: - switch (encoder_state[index].base) { - case 0: - strcpy(buffer, " volm"); - break; - case 1: - strcpy(buffer, " song"); - break; - case 2: - strcpy(buffer, " sink"); - break; - case 3: - strcpy(buffer, "s.vol"); - break; - case 4: - strcpy(buffer, " src "); - break; - case 5: - strcpy(buffer, " L/R "); - break; - case 6: - strcpy(buffer, " U/D "); - break; - case 7: - strcpy(buffer, "pgU/D"); - break; - case 8: - strcpy(buffer, " del "); - break; - default: - strcpy(buffer, "!oob!"); - break; - } - break; - } +/*-------------------------*\ +|*---RENDERING FUNCTIONS---*| +\*-------------------------*/ +void render_qmk_logo(uint8_t row, uint8_t col) { + static const char PROGMEM qmk_logo[] = { + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d, + 0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6, + 0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd, + 0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0}; + oled_set_cursor(col, row); + oled_write_P(qmk_logo, false); } -#endif // ENCODER_ENABLE -static void render_status(void) { - // Function to print state information - uint8_t this_layer = get_highest_layer(layer_state); - uint8_t this_mod = get_mods(); - // Temporary variable for RGB - #if defined RGB_MATRIX_ENABLE - static char rgb_temp4[4] = {0}; - #endif - // Temporary variable for WPM string - #if defined WPM_ENABLE - static char wpm_temp4[4] = {0}; - #endif - // Temporary variable for encoder state - #if defined ENCODER_ENABLE - static char encoder_temp6[6] = {0}; - #endif - // Line 1: Layer State +void render_layer(uint8_t row, uint8_t col, uint8_t top_layer) { + // Write the layer state + oled_set_cursor(col, row); oled_write("Layer: ", false); - switch (this_layer) { + switch (top_layer) { case _BASE: - oled_write("Default\n", false); + oled_write("Default", false); break; case _CHAR: - oled_write("Sp. Chars\n", false); + oled_write("Sp. Chars", false); break; case _GAME: - oled_write("Gaming\n", false); + oled_write("Gaming", false); break; case _MEDI: - oled_write("Media Ctr\n", false); + oled_write("Media Ctr", false); break; case _NAVI: - oled_write("Navigation\n", false); + oled_write("Navigation", false); break; case _SYMB: - oled_write("Symbols\n", false); + oled_write("Symbols", false); break; case _NUMB: - oled_write("Numpad\n", false); + oled_write("Numpad", false); break; case _FUNC: - oled_write("Funct Keys\n", false); + oled_write("Funct Keys", false); break; case _MOUS: - oled_write("Mouse Keys\n", false); + oled_write("Mouse Keys", false); break; case _MUSI: - oled_write("Music Mode\n", false); + oled_write("Music Mode", false); break; default: - oled_write("???\n", false); + oled_write("???", false); } + oled_advance_page(true); +} + +void render_modifiers_lite(uint8_t row, uint8_t col, uint8_t mods) { + // Write the modifier state + oled_set_cursor(col, row); + oled_write((mods & MOD_MASK_SHIFT ) ? "Shft " : " ", false); + oled_write((mods & MOD_MASK_CTRL ) ? "Ctrl " : " ", false); + oled_write((mods & MOD_MASK_ALT ) ? "Alt" : " ", false); + oled_write((mods & MOD_BIT(KC_RALT)) ? "G " : " ", false); + oled_write((mods & MOD_MASK_GUI ) ? "Meta " : " ", false); + oled_advance_page(true); +} + +// Renders the encoder state, 14 characters +void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { + oled_set_cursor(col, row); + +# ifdef ENCODER_ENABLE + static char encoder_temp9[9] = {0}; + oled_write("Enc: ", false); + encoder_state_string(index, layer, encoder_temp9); + oled_write(encoder_temp9, false); +# else // ENCODER_ENABLE + oled_write("No enc. avail.", false); +# endif // ENCODER_ENABLE + oled_advance_page(true); +} + +void render_wpm(uint8_t row, uint8_t col) { + // Renders the WPM, 8 characters + oled_set_cursor(col, row); +# ifdef WPM_ENABLE + static char wpm_temp4[4] = {0}; + oled_write("WPM: ", false); + itoa(get_current_wpm(), wpm_temp4, 10); + oled_write(wpm_temp4, false); + oled_write(" ", false); +# else // WPM_ENABLE + oled_write("WPM: N/A", false); +# endif // WPM_ENABLE + oled_advance_page(true); +} + +// Writes the currently used OLED display layout +void render_keymap(uint8_t row, uint8_t col, bool isLite) { + // Render the oled layout + oled_set_cursor(col, row); + if (isLite) { + oled_write("KM: ", false); + } else { + oled_write("Layout: ", false); + } + switch (userspace_config.layout % 3) { + case 0: + oled_write("Dvorak", false); + break; + case 1: + oled_write("Tur. F", false); + break; + case 2: + oled_write("Qwerty", false); + break; + } + if (isLite) { + oled_write(" ", false); + } else { + oled_advance_page(true); + } +} + +// Writes the currently used OLED display layout +#ifdef RGB_MATRIX_ENABLE +void render_rgb_lite(uint8_t row, uint8_t col) { + static char rgb_temp4[4] = {0}; + // Render the oled layout + oled_set_cursor(col, row); + oled_write("m", false); + itoa(rgb_matrix_get_mode(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" h", false); + itoa(rgb_matrix_get_hue(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" s", false); + itoa(rgb_matrix_get_sat(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_write(" v", false); + itoa(rgb_matrix_get_val(), rgb_temp4, 10); + oled_write(rgb_temp4, false); + oled_advance_page(true); +} +#endif // RGB_MATRIX_ENABLE + +void render_status_lite(uint8_t row, uint8_t col) { + // Function to print state information; for low flash memory + uint8_t this_layer = get_highest_layer(layer_state); + uint8_t this_mod = get_mods(); + + // Line 1: Layer State + render_layer(row + 0, col + 0, this_layer); + // Line 2: Mod or info switch (this_layer) { // Show RGB mode as an overlay in media mode. -#if defined RGB_MATRIX_ENABLE +# ifdef RGB_MATRIX_ENABLE case _MEDI: - oled_write("m", false); - itoa(rgb_matrix_get_mode(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" h", false); - itoa(rgb_matrix_get_hue(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" s", false); - itoa(rgb_matrix_get_sat(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write(" v", false); - itoa(rgb_matrix_get_val(), rgb_temp4, 10); - oled_write(rgb_temp4, false); - oled_write("\n", false); + render_rgb_lite(row + 1, col + 0); break; -#endif +# endif // RGB_MATRIX_ENABLE // Show the modifier if nothing else is doing anything default: - oled_write((this_mod & MOD_MASK_SHIFT ) ? "Shft " : " ", false); - oled_write((this_mod & MOD_MASK_CTRL ) ? "Ctrl " : " ", false); - oled_write((this_mod & MOD_MASK_ALT ) ? "Alt" : " ", false); - oled_write((this_mod & MOD_BIT(KC_RALT)) ? "G " : " ", false); - oled_write((this_mod & MOD_MASK_GUI ) ? "Meta " : " ", false); - oled_write("\n", false); + render_modifiers_lite(row + 1, col + 0, this_mod); break; } - // Line 3: WPM - oled_write("KM: Qwerty WPM: ", false); -#if defined WPM_ENABLE - itoa(get_current_wpm(), wpm_temp4, 10); - oled_write(wpm_temp4, false); -#else - oled_write("N/A", false); -#endif - oled_write("\n", false); - // Line 4: Encoder states -#ifdef ENCODER_ENABLE - oled_write("EN0:", false); - encoder_state_string5(0, this_layer, encoder_temp6); - oled_write(encoder_temp6, false); - oled_write(" EN1:", false); - encoder_state_string5(1, this_layer, encoder_temp6); - oled_write(encoder_temp6, false); -#else - oled_write("-Encoder unavailable-", false); -#endif - oled_write("\n", false); -} -// Allow default to be overwritten by keymap if they return false -__attribute__ ((weak)) bool oled_task_keymap(void) {return true;} + // Line 3: WPM and layout + render_keymap(row + 2, col + 0, true); + render_wpm(row + 2, col + 11); -// Do sane defaults for regular oled rendering -void oled_task_user(void) { - if (oled_task_keymap()) { - render_status(); + // Line 4: Encoder states + oled_write("Encoder: ", false); +# ifdef SPLIT_KEYBOARD + if (is_keyboard_left()) { + render_encoder(row + 3, col + 0, 0, this_layer); + } else { + render_encoder(row + 3, col + 0, 1, this_layer); } +# else // SPLIT_KEYBOARD + render_encoder(row + 3, col + 0, 0, this_layer); +# endif // SPLIT_KEYBOARD } diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index 6e88cfc1cb1..c403e4c96aa 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -15,9 +15,14 @@ along with this program. If not, see . #include "bbaserdem.h" // Contain the main oled writer here void oled_task_user(void); -bool oled_task_keymap(void); -// This is only neccessary for oled; hence here -#ifdef ENCODER_ENABLE -void encoder_state_string5(uint8_t index, uint8_t layer, char* buffer); -void encoder_state_string8(uint8_t index, uint8_t layer, char* buffer); -#endif +// Some generic rendering functions +void render_qmk_logo(uint8_t row, uint8_t col); +void render_layer(uint8_t row, uint8_t col, uint8_t top_layer); +void render_modifiers_lite(uint8_t row, uint8_t col, uint8_t mods); +void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer); +void render_wpm(uint8_t row, uint8_t col); +void render_keymap(uint8_t row, uint8_t col, bool isLite); +#ifdef RGB_MATRIX_ENABLE +void render_rgb_lite(uint8_t row, uint8_t col); +#endif // RGB_MATRIX_ENABLE +void render_status_lite(uint8_t row, uint8_t col); diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index e21f47ece42..81f58cb52c8 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -12,78 +12,100 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "bb-rgb.h" -#define SPLIT_POINT 112 +#include "color.h" +#define X_DIV 224/2 /* Code relating to per-key RGB LED stuff */ // Allow hooking into the RGB matrix indications using keymap code +// Allow to turn off global handling __attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { return false; } + +// Modulates the brightness of indicator +RGB helper_dimmer(uint8_t r, uint8_t g, uint8_t b) { + RGB output; + output.r = r / 2; + output.g = g / 2; + output.b = b / 2; + return output; +} +// x range from 0-left to 224-right +// y range from 0-top to 64-bottom +void helper_painter(uint8_t led_min, uint8_t led_max, RGB col, uint8_t side) { + if (side == 1) { + // Left + for(uint8_t i = led_min; i <= led_max; i++) { + if((g_led_config.point[i].x < X_DIV) && (g_led_config.flags[i] & LED_FLAG_INDICATOR)) { + rgb_matrix_set_color(i, col.r, col.g, col.b); + } + } + } else if (side == 2) { + // Right + for(uint8_t i = led_min; i <= led_max; i++) { + if((g_led_config.point[i].x > X_DIV) && (g_led_config.flags[i] & LED_FLAG_INDICATOR)) { + rgb_matrix_set_color(i, col.r, col.g, col.b); + } + } + } else if (side == 0) { + // Both + for(uint8_t i = led_min; i <= led_max; i++) { + if(g_led_config.flags[i] & LED_FLAG_INDICATOR) { + rgb_matrix_set_color(i, col.r, col.g, col.b); + } + } + } +} + // Set RGB state depending on layer void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + uint8_t thisInd = 3; + RGB thisCol; // Load keymap hooks if(rgb_matrix_indicators_advanced_keymap(led_min, led_max)) { return; } - // Do each layer seperately + // Grab color info switch (get_highest_layer(layer_state)) { case _GAME: // Set left side as purple - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_PURPLE); - } - } + thisCol = helper_dimmer(RGB_PURPLE); + thisInd = 1; break; case _CHAR: // Set full board as gold - rgb_matrix_set_color_all(RGB_GOLD); + thisCol = helper_dimmer(RGB_GOLD); + thisInd = 0; break; case _MEDI: // Set right side as pink - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x > SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_PINK); - } - } + thisCol = helper_dimmer(RGB_MAGENTA); + thisInd = 2; break; case _NAVI: // Set right side as green - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x > SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_GREEN); - } - } + thisCol = helper_dimmer(RGB_GREEN); + thisInd = 2; break; case _SYMB: // Set right side as yellow - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x > SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_YELLOW); - } - } + thisCol = helper_dimmer(RGB_YELLOW); + thisInd = 2; break; case _NUMB: // Set left side as blue - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_BLUE); - } - } + thisCol = helper_dimmer(RGB_BLUE); + thisInd = 1; break; case _FUNC: // Set left side as red - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_RED); - } - } + thisCol = helper_dimmer(RGB_RED); + thisInd = 1; break; case _MOUS: // Set left side as blue-green - for(uint8_t i = led_min; i <= led_max; i++) { - if(g_led_config.point[i].x < SPLIT_POINT) { - rgb_matrix_set_color(i, RGB_SPRINGGREEN); - } - } + thisCol = helper_dimmer(RGB_SPRINGGREEN); + thisInd = 1; break; case _MUSI: // Set full board as orange - rgb_matrix_set_color_all(RGB_ORANGE); + thisCol = helper_dimmer(RGB_ORANGE); + thisInd = 0; break; } + helper_painter(led_min, led_max, thisCol, thisInd); } // Hook into shutdown code to make all perkey LED's red on hitting reset diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index f28342ddb5c..74d582641f4 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -14,6 +14,72 @@ along with this program. If not, see . #include "bbaserdem.h" // Language imports #include +// Need memcpy and memcmp from string.h along with transfer stuff +#ifdef SPLIT_KEYBOARD +#include "transactions.h" +#include +#endif // SPLIT_KEYBOARD + +/*-------------------------*\ +|*-----KEYBOARD CONFIG-----*| +\*-------------------------*/ +userspace_config_t userspace_config; + +/*---------------------------------*\ +|*----SPLIT KEYBOARD TRANSPORT-----*| +\*---------------------------------*/ +#ifdef SPLIT_KEYBOARD +userspace_config_t transport_userspace_config; + +// Translate the RPC data to the local variable +void userspace_config_sync(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { + // Copy incoming data to local variable + if (in_buflen == sizeof(transport_userspace_config)) { + memcpy(&transport_userspace_config, in_data, in_buflen); + } + // There is no data to send back; so no output handling +} + +// Either send or receive the correct data +void userspace_config_transport_update(void) { + if (is_keyboard_master()) { + // If we are the main device; we want to send info. + transport_userspace_config.raw = userspace_config.raw; + } else { + // If we are the secondary device; we want to receive info. + userspace_config.raw = transport_userspace_config.raw; + } +} + +// Initiate the protocol on sync +void userspace_config_transport_sync(void) { + if (is_keyboard_master()) { + // Keep track of the last state + static userspace_config_t last_userspace_config; + static uint32_t last_sync; + bool needs_sync = false; + + // Check if the state values are different + if (memcmp(&transport_userspace_config, &last_userspace_config, sizeof(transport_userspace_config))) { + needs_sync = true; + memcpy(&last_userspace_config, &transport_userspace_config, sizeof(transport_userspace_config)); + } + + // Send to secondary every 500ms regardless of state change + if (timer_elapsed32(last_sync) > 500) { + needs_sync = true; + } + + // Perform the sync if requested + if (needs_sync) { + if (transaction_rpc_send(RPC_ID_USERSPACE_SYNC, sizeof(transport_userspace_config), &transport_userspace_config)) { + last_sync = timer_read32(); + } + needs_sync = false; + } + } +} +#endif // SPLIT_KEYBOARD /*---------------------------*\ |*-----KEYBOARD PRE INIT-----*| @@ -50,30 +116,54 @@ __attribute__ ((weak)) void keyboard_post_init_user(void) { // Fix beginning base layer, in case some other firmware was flashed // set_single_persistent_default_layer(_BASE); + // Initialize userspace config + userspace_config.layout = 0; + + // Split keyboard halves communication +# ifdef SPLIT_KEYBOARD + transaction_register_rpc(RPC_ID_USERSPACE_SYNC, userspace_config_sync); +# endif // SPLIT_KEYBOARD + // Backlight LED - #ifdef BACKLIGHT_ENABLE +# ifdef BACKLIGHT_ENABLE keyboard_post_init_backlight(); - #endif +# endif // RGB underglow - #ifdef RGBLIGHT_ENABLE +# ifdef RGBLIGHT_ENABLE keyboard_post_init_underglow(); - #endif +# endif // Encoders - #ifdef ENCODER_ENABLE +# ifdef ENCODER_ENABLE keyboard_post_init_encoder(); - #endif +# endif // Unicode mode - #ifdef UNICODEMAP_ENABLE +# ifdef UNICODEMAP_ENABLE set_unicode_input_mode(UC_LNX); - #endif +# endif // Keymap specific stuff keyboard_post_init_keymap(); } +/*---------------------------*\ +|*-----HOUSEKEEPING TASK-----*| +\*---------------------------*/ +/* I have no idea what this does + */ +__attribute__ ((weak)) void housekeeping_task_keymap(void) {} +void housekeeping_task_user(void) { +# ifdef SPLIT_KEYBOARD + userspace_config_transport_update(); + userspace_config_transport_sync(); +# endif // SPLIT_KEYBOARD + + // Hook to keymap code + housekeeping_task_keymap(); +} + /*-----------------------*\ |*-----EECONFIG INIT-----*| \*-----------------------*/ @@ -97,24 +187,16 @@ __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } -__attribute__ ((weak)) -bool process_record_audio(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__ ((weak)) -bool process_record_macro(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__ ((weak)) -bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { - return true; -} bool process_record_user(uint16_t keycode, keyrecord_t *record) { // Return after running through all individual hooks return process_record_keymap(keycode, record) && +# ifdef AUDIO_ENABLE process_record_audio(keycode, record) && +# endif // AUDIO_ENABLE +# ifdef ENCODER_ENABLE process_record_encoder(keycode, record) && +# endif // ENCODER_ENABLE process_record_macro(keycode, record); } diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 3e9b70117e7..265898c3e6b 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -45,6 +45,29 @@ along with this program. If not, see . #include "bb-oled.h" #endif +// Structure to keep runtime info on encoder state +typedef union { + uint16_t raw; + struct { + uint8_t base :4; // (9) The encoder state on most layers; regular function + uint8_t rgb :4; // (5) The encoder state on media layer; controls light + uint8_t point :4; // (4) The encoder state on mouse layer; moves pointer + uint8_t :4; // Padding + }; +} encoder_state_t; + +// Structure to contain userspace config in total +typedef union { + uint64_t raw; + struct { + encoder_state_t encoder[2]; + uint8_t layout; + }; +} userspace_config_t; + +// Broadcast us to everyone else +extern userspace_config_t userspace_config; + // Function definitions that can be accessed through specific keymaps // Runs before all initialization void keyboard_pre_init_keymap(void); @@ -62,6 +85,8 @@ void matrix_scan_keymap(void); layer_state_t layer_state_set_keymap(layer_state_t state); // This code runs when the default layer changes layer_state_t default_layer_state_set_keymap (layer_state_t state); +// Some code +void housekeeping_task_user(void); // This code runs to set LED states void led_set_keymap(uint8_t usb_led); // For code that runs on suspend @@ -89,16 +114,24 @@ enum userspace_custom_keycodes { // Macro key BB_PGPK, // Unicode strings - #ifdef UNICODEMAP_ENABLE +# ifdef UNICODEMAP_ENABLE BB_LENY, BB_TABL, TR_FLAG, - #endif +# endif // Encoder buttons - #ifdef ENCODER_ENABLE +# ifdef ENCODER_ENABLE BB_ENC0, BB_ENC1, - #endif +# endif + // Some RGB toggles +# ifdef RGB_MATRIX_ENABLE + BB_RGBO, +# endif + // Oled editor +# ifdef OLED_ENABLE + BB_OLED, +# endif //use for keymap specific codes KEYMAP_SAFE_RANGE }; @@ -385,19 +418,19 @@ enum userspace_layers { /* Media layer * ┌─────┬─────┬─────┬─────┬─────┐ - * │ Tog │ Mod │ Hue │ Sat │ Bri │ RGB light control + * │Speed│ Mod │ Hue │ Sat │ Bri │ RGB light control * ├─────┼─────┼─────┼─────┼─────┤ * │Media│Prev.│MuTog│MuStp│Next │ Media control * ├─────┼─────┼─────┼─────┼─────┤ * │Sink │Vol -│ Mut │Eject│Vol +│ Volume control * ┌─────┼─────┼─────┼─────┴─────┴─────┘ - * │ │Veloc│Music│ Feature control on keyboard + * │OledL│Veloc│Music│ Feature control on keyboard * └─────┴─────┴─────┘ */ -#define _ME1_5_ RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI -#define _ME2_5_ KC_MSEL,KC_MPRV,KC_MPLY,KC_MSTP,KC_MNXT +#define _ME1_5_ RGB_SPI,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI +#define _ME2_5_ RGB_TOG,KC_MPRV,KC_MPLY,KC_MSTP,KC_MNXT #define _ME3_5_ KC_F13, KC_VOLD,KC_MUTE,KC_EJCT,KC_VOLU -#define _ME4_3_ XXXXXXX,VLK_TOG,MU_TOG +#define _ME4_3_ BB_OLED,VLK_TOG,MU_TOG /* Navigation layer * ┌─────┬─────┬─────┬─────┬─────┐ @@ -484,7 +517,7 @@ enum userspace_layers { /* Function layer * ┌─────┬─────┬─────┬─────┬─────┐ - * │ F01 │ F02 │ F03 │ F04 │RESET│ + * │ F01 │ F02 │ F03 │ F04 │EEPRM│ * ├─────┼─────┼─────┼─────┼─────┤ * │ F05 │ F06 │ F07 │ F08 │EEPRM│ * ├─────┼─────┼─────┼─────┼─────┤ diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 7ed5af06798..8c497da88e6 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -33,29 +33,32 @@ along with this program. If not, see . // Split transport settings #ifdef SPLIT_KEYBOARD -// Enable reacting to keypresses on the other half -#define SPLIT_TRANSPORT_MIRROR -// Enable communicating layer state changes. -// #define SPLIT_LAYER_STATE_ENABLE -// #define SPLIT_MODS_ENABLE -#ifdef WPM_ENABLE - // #define SPLIT_WPM_ENABLE -#endif +# define SPLIT_TRANSPORT_MIRROR +# define SPLIT_LAYER_STATE_ENABLE +# define SPLIT_MODS_ENABLE +# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USERSPACE_SYNC, USER_SYNC_OLED, USER_SYNC_UNUSED +# define SPLIT_LED_STATE_ENABLE +# ifdef WPM_ENABLE +# define SPLIT_WPM_ENABLE +# endif +# ifdef OLED_ENABLE +# define SPLIT_OLED_ENABLE +# endif #endif // Unicode entry mode #ifdef UNICODEMAP_ENABLE - #define UNICODE_SELECTED_MODES UC_LNX +# define UNICODE_SELECTED_MODES UC_LNX // Adapt the unicode entry mode to dvorak - #ifdef UNICODE_KEY_LNX - #undef UNICODE_KEY_LNX - #endif - #define UNICODE_KEY_LNX LCTL(LSFT(KC_F)) +# ifdef UNICODE_KEY_LNX +# undef UNICODE_KEY_LNX +# endif +# define UNICODE_KEY_LNX LCTL(LSFT(KC_F)) #endif // Mousekey mode #ifdef MOUSEKEY_ENABLE - #define MK_COMBINED +# define MK_COMBINED #endif // Tap-hold settings @@ -67,68 +70,57 @@ along with this program. If not, see . // Backlight settings #ifdef BACKLIGHT_ENABLE - #define BACKLIGHT_BREATHING - #define BREATHING_PERIOD 5 +# define BACKLIGHT_BREATHING +# define BREATHING_PERIOD 5 #endif // Audio definitions #ifdef AUDIO_ENABLE +//# define AUDIO_ENABLE_TONE_MULTIPLEXING // Make findable songs as defaults - #ifdef HOROLOGY - #define STARTUP_SONG SONG(HOROLOGY) - #endif - #ifdef PEOPLE_VULTURES - #define GOODBYE_SONG SONG(PEOPLE_VULTURES) - #endif - #ifdef NONAGON_INFINITY - #define MUSIC_ON_SONG SONG(NONAGON_INFINITY) - #endif - #ifdef WAH_WAH - #define MUSIC_OFF_SONG SONG(WAH_WAH) - #endif +# ifdef HOROLOGY +# define STARTUP_SONG SONG(HOROLOGY) +# endif +# ifdef PEOPLE_VULTURES +# define GOODBYE_SONG SONG(PEOPLE_VULTURES) +# endif +# ifdef NONAGON_INFINITY +# define MUSIC_ON_SONG SONG(NONAGON_INFINITY) +# endif +# ifdef WAH_WAH +# define MUSIC_OFF_SONG SONG(WAH_WAH) +# endif // Audio code expects these to be defined - #ifdef BIG_FIG_WASP - #define GAME_ON_SONG SONG(BIG_FIG_WASP) - #else - #define GAME_ON_SONG SONG(USSR_ANTHEM) - #endif - #ifdef POLYGONDWANALAND - #define GAME_OFF_SONG SONG(POLYGONDWANALAND) - #else - #define GAME_OFF_SONG SONG(NOCTURNE_OP_9_NO_1) - #endif +# ifdef BIG_FIG_WASP +# define GAME_ON_SONG SONG(BIG_FIG_WASP) +# else +# define GAME_ON_SONG SONG(USSR_ANTHEM) +# endif +# ifdef POLYGONDWANALAND +# define GAME_OFF_SONG SONG(POLYGONDWANALAND) +# else +# define GAME_OFF_SONG SONG(NOCTURNE_OP_9_NO_1) +# endif #endif // OLED definitions #ifdef OLED_ENABLE // Timeout in one minute - #define OLED_TIMEOUT 60000 +# define OLED_TIMEOUT 60000 // Fade out the screen when timing out - #define OLED_FADE_OUT - #define OLED_FADE_OUT_INTERVAL 5 +# define OLED_FADE_OUT +# define OLED_FADE_OUT_INTERVAL 5 #endif // For perkey leds #ifdef RGB_MATRIX_ENABLE - #define RGB_DISABLE_WHEN_USB_SUSPENDED true +# define RGB_DISABLE_WHEN_USB_SUSPENDED true // Start using this mode - #define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON - #define RGB_MATRIX_STARTUP_HUE 100 - #define RGB_MATRIX_STARTUP_SAT 255 - #define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS +# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON +# define RGB_MATRIX_STARTUP_HUE 100 +# define RGB_MATRIX_STARTUP_SAT 255 +# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS // Some config options - #define RGB_MATRIX_KEYPRESSES - #define RGB_MATRIX_KEYRELEASES - // Disable some animation modes - #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT - #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL - #define DISABLE_RGB_MATRIX_BAND_RAINDROPS - #define DISABLE_RGB_MATRIX_BAND_JELLYBEAN_RAINDROPS - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS - #define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS - // Some more config options - #define RGB_MATRIX_KEYPRESSES // React to key presses - #define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects +# define RGB_MATRIX_KEYRELEASES +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects #endif diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index facc61a3f09..501c85c8aed 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -35,10 +35,10 @@ KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance -# These features can be enabled on ARM boards; disabled for AVR due to space -# NKRO_ENABLE = no # Default is 6KRO which is plenty -# VELOCIKEY_ENABLE = no # Modulate speed effects with typing speed -WPM_ENABLE = yes # Get WPM reports as you type +# These features can be disabled at whim +NKRO_ENABLE ?= yes # Default is 6KRO +VELOCIKEY_ENABLE ?= yes # Speed effects change with typing speed +WPM_ENABLE = ?yes # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff @@ -75,5 +75,8 @@ endif # OLED code ifeq ($(strip $(OLED_ENABLE)), yes) -SRC += bb-oled.c + SRC += bb-oled.c + ifeq ($(strip $(CTPC)), yes) + SRC += bb-oled-extra.c + endif endif From bf6ac25ca7713761f57016586f1d385245672ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 17 Sep 2021 12:20:22 -0400 Subject: [PATCH 79/94] Fully did changes --- users/bbaserdem/bb-oled-extra.c | 108 +++++++++++++++++++++++++++++--- users/bbaserdem/config.h | 1 + 2 files changed, 101 insertions(+), 8 deletions(-) diff --git a/users/bbaserdem/bb-oled-extra.c b/users/bbaserdem/bb-oled-extra.c index ece65054f2f..3f648baa295 100644 --- a/users/bbaserdem/bb-oled-extra.c +++ b/users/bbaserdem/bb-oled-extra.c @@ -343,6 +343,98 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x7b,0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x04,0x05,0x05,0x02,0x00,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + // QWERTY + static const char PROGMEM base0_L_qwer_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x04,0x08,0x10,0x00,0x00,0x70, + 0x88,0x88,0x48,0xf8,0x00,0x78,0x80,0x70,0x80,0x78,0x00,0x70,0xa8,0xa8, + 0xa8,0xb0,0x00,0xf8,0x10,0x08,0x08,0x10,0x00,0x08,0x7f,0x88,0x88,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x18,0x60,0x80,0x00,0x00,0x00,0x00, + 0x40,0x40,0x40,0x83,0x00,0x80,0x40,0x40,0x40,0x00,0x00,0x80,0x40,0x40, + 0x40,0xf8,0x00,0x00,0xf0,0x48,0x48,0x00,0x00,0x80,0x40,0x40,0x40,0xc0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0xc0,0x41,0x46,0x18,0x00,0x02, + 0x05,0x05,0x05,0x07,0x00,0x04,0x05,0x05,0x05,0x02,0x00,0x03,0x04,0x04, + 0x02,0x07,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0xc3,0x14,0x14,0x12,0x0f + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0xff,0x80,0x80,0x00,0x00,0x22, + 0x32,0x2a,0x26,0x22,0x00,0x22,0x14,0x08,0x14,0x22,0x00,0x1c,0x22,0x22, + 0x22,0x22,0x00,0x06,0x18,0x20,0x18,0x06,0x00,0x3f,0x24,0x22,0x22,0x1c}}; + static const char PROGMEM base0_L_qwer_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x20,0x10,0x20,0x40,0x20,0x00,0xfc, + 0x02,0x42,0x82,0x7c,0x00,0x7e,0x80,0x70,0x80,0x7e,0x00,0xfe,0x12,0x12, + 0x12,0x02,0x00,0xfe,0x12,0x12,0x32,0xcc,0x00,0x02,0x02,0xfe,0x02,0x02 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0xe0, + 0x91,0x91,0x90,0xe3,0x00,0x60,0x91,0x90,0x91,0x20,0x00,0xf1,0x11,0x11, + 0x11,0xe1,0x00,0xf1,0x90,0x90,0x90,0x11,0x00,0xe0,0x10,0x91,0x90,0xa0 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x9f,0x40,0x40,0x00,0x8f, + 0x80,0x80,0x80,0x8f,0x00,0x84,0x08,0x08,0x08,0x87,0x00,0x0f,0x88,0x88, + 0x88,0x07,0x00,0x8f,0x00,0x00,0x00,0x80,0x00,0x87,0x88,0x88,0x88,0x07 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x04,0x04,0x7b,0x80,0x80,0x00,0x70, + 0x48,0x44,0x42,0x41,0x00,0x71,0x0a,0x04,0x0a,0x71,0x00,0x3f,0x40,0x40, + 0x40,0x21,0x00,0x07,0x18,0x60,0x18,0x07,0x00,0x7f,0x44,0x44,0x44,0x3b}}; + static const char PROGMEM base0_R_qwer_nomod[4][42] = { + { 0x78,0x80,0x80,0x40,0xf8,0x00,0x78,0x80,0x80,0x40,0xf8,0x00,0x00,0x08, + 0xfa,0x80,0x00,0x00,0x70,0x88,0x88,0x88,0x70,0x00,0xf8,0x90,0x88,0x88, + 0x70,0x00,0x10,0x28,0x44,0x82,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xf8,0x82,0x42,0x42,0x81,0x00,0x00,0x00,0x40,0xd0,0x00,0x00,0xf8,0x00, + 0x80,0x40,0x00,0x00,0x08,0xf8,0x00,0x00,0x00,0x00,0x03,0xc0,0xc0,0x00, + 0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x07,0x00,0x00,0x00,0x07,0x00,0x00,0x10,0x10,0x0f,0x00,0x00,0x07,0x01, + 0x01,0x02,0x04,0x00,0x00,0x03,0x04,0x04,0x00,0x00,0x00,0x16,0x0e,0x00, + 0xc0,0x00,0x00,0x40,0x40,0xc0,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x3e,0x02,0x02,0x02,0x3c,0x00,0x3e,0x02,0x3e,0x02,0x3c,0x00,0x00,0xb0, + 0x70,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0xc0,0x30,0x0c,0x03, + 0x00,0x00,0x00,0x80,0x80,0xff,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM base0_R_qwer_shift[4][42] = { + { 0x06,0x08,0xf0,0x08,0x06,0x00,0xfe,0x00,0x00,0x00,0xfe,0x00,0x00,0x02, + 0xfe,0x02,0x00,0x00,0xfc,0x02,0x02,0x02,0xfc,0x00,0xfe,0x12,0x12,0x12, + 0x0c,0x00,0x82,0x44,0x28,0x10,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0xf0,0x80,0x81,0x80,0xf0,0x00,0x00,0x01,0x01,0x01,0xf0,0x00,0xf0,0x81, + 0x41,0x21,0x10,0x00,0xf0,0x01,0x01,0x01,0x00,0x00,0x01,0xc0,0xc0,0x00, + 0x00,0x00,0x00,0x70,0x00,0x70,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x8f,0x00,0x00,0x00,0x8f,0x00,0x86,0x08,0x08,0x08,0x87,0x00,0x0f,0x00, + 0x01,0x82,0x0c,0x00,0x8f,0x08,0x08,0x08,0x08,0x00,0x00,0x86,0x86,0x80, + 0x00,0x00,0x00,0x40,0x40,0x80,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x7f,0x03,0x0c,0x30,0x7f,0x00,0x7f,0x01,0x06,0x01,0x7f,0x00,0x04,0x0a, + 0x11,0x20,0x00,0x00,0x20,0x11,0x0a,0x04,0x00,0x00,0x01,0x00,0x28,0x04, + 0x03,0x00,0x00,0x80,0x80,0x7b,0x04,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM symb5_R_qwer[4][42] = { + { 0x00,0x04,0x08,0x10,0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x00,0x50,0x50, + 0x50,0x50,0x50,0x00,0x10,0x10,0xee,0x01,0x01,0x00,0x01,0x01,0xee,0x10, + 0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe7,0x73,0x00,0x00 + },{ 0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xc0,0x00,0x00,0x00,0x00,0xf8,0x09,0x0a,0x02,0x00,0x02,0x0a,0x09,0xf8, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x9c,0xce,0x00,0x00 + },{ 0x01,0x80,0x41,0x82,0x01,0x00,0x04,0x04,0x84,0x44,0x04,0x00,0x01,0x41, + 0x87,0x01,0x01,0x00,0xc0,0x1f,0x10,0x10,0x00,0x00,0x00,0x10,0xd0,0x1f, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x73,0x39,0x00,0x00 + },{ 0x22,0xf3,0x0a,0xf3,0x22,0x00,0x00,0x1e,0x61,0x80,0x00,0x00,0x00,0x80, + 0x61,0x1e,0x00,0x00,0x00,0x03,0x0c,0x30,0xc0,0x00,0x00,0x00,0xff,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + static const char PROGMEM numb6_L_qwer_nomod[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, + 0x50,0x88,0x04,0x00,0x00,0x04,0x04,0xc4,0x34,0x0c,0x00,0xd8,0x24,0x24, + 0x24,0xd8,0x00,0x18,0x24,0x24,0x24,0xf8,0x00,0xf8,0x44,0x24,0x14,0xf8 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x70,0x00,0x71,0x00,0x00,0x00,0x80,0x41,0xe0,0x00,0x00,0xe0,0xa1,0xa1, + 0xa1,0x20,0x00,0xc0,0xa1,0xa1,0xa1,0x00,0x00,0x00,0x01,0x71,0x01,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0x02,0x02,0x0f,0x02,0x00,0x04,0x08,0x08, + 0x08,0x07,0x00,0x07,0x08,0x08,0x08,0x07,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x41, + 0x22,0x14,0x08,0x00,0x00,0x00,0x04,0x02,0x7f,0x00,0x00,0x42,0x61,0x51, + 0x49,0x46,0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x5e,0x61,0x01,0x61,0x5e}}; + static const char PROGMEM numb6_L_qwer_shift[4][42] = { + { 0x00,0x00,0x73,0xe7,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xd8,0x24,0x54,0x88,0x40,0x00,0x50,0x20,0xf8, + 0x20,0x50,0x00,0x00,0x38,0xc6,0x01,0x00,0x00,0x00,0x01,0xc6,0x38,0x00 + },{ 0x00,0x00,0xce,0x9c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x70,0x00,0x70,0x00,0x00,0x60,0x91,0xf9,0x90,0x21,0x00,0x20,0x50,0x20, + 0x80,0x60,0x00,0x40,0x20,0x10,0x21,0x40,0x00,0x00,0x71,0x00,0x70,0x00 + },{ 0x00,0x00,0x39,0x73,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x04,0x8f,0x04,0x03,0x00,0x0c,0x02,0x09, + 0x14,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + },{ 0x00,0x00,0xe7,0xce,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x5f,0x00,0x00,0x00,0x3e,0x41,0x5d, + 0x55,0x5e,0x00,0x14,0x7f,0x14,0x7f,0x14,0x00,0x00,0x00,0x00,0x00,0x00}}; // UNIVERSAL static const char PROGMEM char1_L[4][42] = { @@ -510,11 +602,11 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { draw_image(row, col, numb6_L_turf_nomod); } break; - case 3: // Qwerty + case 2: // Qwerty if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, numb6_L_dvor_shift); + draw_image(row, col, numb6_L_qwer_shift); } else { - draw_image(row, col, numb6_L_dvor_nomod); + draw_image(row, col, numb6_L_qwer_nomod); } break; } @@ -548,9 +640,9 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { break; case 2: // Qwerty if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_L_dvor_shift); + draw_image(row, col, base0_L_qwer_shift); } else { - draw_image(row, col, base0_L_dvor_nomod); + draw_image(row, col, base0_L_qwer_nomod); } break; } @@ -573,7 +665,7 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { } break; case 2: // Qwerty - draw_image(row, col, symb5_R_dvor); + draw_image(row, col, symb5_R_qwer); break; } } else if (layer_state_cmp(layer_state, _NAVI)) { @@ -612,9 +704,9 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { break; case 2: // Qwerty if (mods & MOD_MASK_SHIFT) { - draw_image(row, col, base0_R_dvor_shift); + draw_image(row, col, base0_R_qwer_shift); } else { - draw_image(row, col, base0_R_dvor_nomod); + draw_image(row, col, base0_R_qwer_nomod); } break; } diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 8c497da88e6..b86d859d098 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -35,6 +35,7 @@ along with this program. If not, see . #ifdef SPLIT_KEYBOARD # define SPLIT_TRANSPORT_MIRROR # define SPLIT_LAYER_STATE_ENABLE +# define SPLIT_OLED_ENABLE # define SPLIT_MODS_ENABLE # define SPLIT_TRANSACTION_IDS_USER RPC_ID_USERSPACE_SYNC, USER_SYNC_OLED, USER_SYNC_UNUSED # define SPLIT_LED_STATE_ENABLE From 051eae7940cd69bc9b01e8635fab192f6b0f4174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Fri, 17 Sep 2021 18:10:06 -0400 Subject: [PATCH 80/94] Finalized the config --- .../1key/keymaps/bbaserdem/README.md | 18 ------------ .../bigseries/1key/keymaps/bbaserdem/config.h | 19 ------------- .../bigseries/1key/keymaps/bbaserdem/keymap.c | 28 ------------------- .../bigseries/1key/keymaps/bbaserdem/rules.mk | 6 ---- .../community/ortho_4x12/bbaserdem/README.md | 6 ---- .../community/ortho_4x12/bbaserdem/config.h | 2 +- .../split_3x5_3/bbaserdem-disable/README.md | 12 ++++---- .../split_3x5_3/bbaserdem-disable/keymap.c | 12 +------- users/bbaserdem/README.md | 24 ++-------------- users/bbaserdem/bb-underglow.c | 17 ++++++----- users/bbaserdem/bbaserdem.c | 12 ++++---- users/bbaserdem/bbaserdem.h | 10 +++---- users/bbaserdem/keymap-bitmaps/.gitignore | 1 + users/bbaserdem/rules.mk | 5 ++++ 14 files changed, 36 insertions(+), 136 deletions(-) delete mode 100644 keyboards/bigseries/1key/keymaps/bbaserdem/README.md delete mode 100644 keyboards/bigseries/1key/keymaps/bbaserdem/config.h delete mode 100755 keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c delete mode 100755 keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md b/keyboards/bigseries/1key/keymaps/bbaserdem/README.md deleted file mode 100644 index a4d8715a233..00000000000 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,18 +0,0 @@ -This file contains my [1x1](../../../default/ortho_1x1) board layouts -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Big Series PCB - -Big switch that does tap dance, and works as a fancy light only. -The PCB was sourced from Woodkeys (Cole Markham); -Currently AWOL and scammed people out of their money (me personally for 150$) -Cannot recommend anyone try to obtain one of these PCBs. - -My PCB to USB connector broke; and could not repair it yet. -Managed to obtain a custom glow in the dark keycap for this. - -## Status - -* [x] Layout adapted -* [ ] Have not tested build yet. -* [ ] Have not confirmed on board diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/config.h b/keyboards/bigseries/1key/keymaps/bbaserdem/config.h deleted file mode 100644 index ba45696ad24..00000000000 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 - -#ifdef TAPPING_TERM -#undef TAPPING_TERM -#endif -#define TAPPING_TERM 500 diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c b/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c deleted file mode 100755 index 2bb2d06e93c..00000000000 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2019 Batuhan Baserdem - -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 QMK_KEYBOARD_H -#include "bbaserdem.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT(BB_BIGS) -}; - -void matrix_init_keymap(void) { - rgblight_enable(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_MOOD); - rgblight_sethsv_noeeprom(0,255,255); -} diff --git a/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk b/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk deleted file mode 100755 index 89651e991c8..00000000000 --- a/keyboards/bigseries/1key/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -# Differences from userspace -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes -RGB_MATRIX_ENABLE = no -AUDIO_ENABLE = no -BLUETOOTH_ENABLE = no diff --git a/layouts/community/ortho_4x12/bbaserdem/README.md b/layouts/community/ortho_4x12/bbaserdem/README.md index 3e1e30cf54d..992da3b58bd 100644 --- a/layouts/community/ortho_4x12/bbaserdem/README.md +++ b/layouts/community/ortho_4x12/bbaserdem/README.md @@ -10,9 +10,3 @@ To sell soon; don't use them anymore, but will keep the light version. A planck rev4 replacement; for my acrylic planck case which used to host a now defunct rev4. - -## Status - -* [x] Layout adapted -* [ ] Have not tested build yet. -* [ ] Have not confirmed on board diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h index 66ba01f27f2..bc70788cd3c 100755 --- a/layouts/community/ortho_4x12/bbaserdem/config.h +++ b/layouts/community/ortho_4x12/bbaserdem/config.h @@ -16,7 +16,7 @@ along with this program. If not, see . // Code pertaining to planck rev6 #if defined(KEYBOARD_planck_rev6) // Encoder I use; - #ifdef RGB_DI_PIN + #ifdef ENCODER_RESOLUTION #undef ENCODER_RESOLUTION #endif #define ENCODER_RESOLUTION 2 diff --git a/layouts/community/split_3x5_3/bbaserdem-disable/README.md b/layouts/community/split_3x5_3/bbaserdem-disable/README.md index 9086172df88..f32f72feb5f 100644 --- a/layouts/community/split_3x5_3/bbaserdem-disable/README.md +++ b/layouts/community/split_3x5_3/bbaserdem-disable/README.md @@ -5,14 +5,14 @@ Check out the [user readme](../../../../users/bbaserdem/README.md) for more info Using a no 6th column crkbd (rev 2.1 choc) as a mobile keyboard. -This version uses Elite-C and ProMicro as controllers; hence no RGB and OLED. +This version uses ProMicro as controllers; can't have OLED and RGB at the same time. ## Build -Build command: `CFLAGS="-Wno-error=deprecated" TBF` +Used to flash Pro Micro explicitly using the following line; -## Todo +``` +sudo avrdude -p atmgea34u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.build/.hex +``` -* Switch PCB to the Proton-C compatible hotswap switch. -* Or use cable rerouting to make the pcb Proton-C compatible. -* Or find a way to use both OLED and LEDs. +But it does not work anymore in Archlinux. diff --git a/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c b/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c index 36a1fa3a52d..b5169e638a6 100644 --- a/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c +++ b/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c @@ -105,17 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { *          │14│13│06││30│37│38│ *          └──┴──┴──┘└──┴──┴──┘ */ -// Sided color-setting -void keylight_set_left(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 0; i < 24; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -} -void keylight_set_right(uint8_t red, uint8_t green, uint8_t blue) { - for (int i = 24; i < 48; i++) { - rgb_matrix_set_color(i, red, green, blue); - } -} + // End of differentiations #endif diff --git a/users/bbaserdem/README.md b/users/bbaserdem/README.md index f0999c7a96d..0a1b80cc74a 100644 --- a/users/bbaserdem/README.md +++ b/users/bbaserdem/README.md @@ -2,13 +2,6 @@ My userspace code for my various keyboards; available here. -# Todo - -- [ ] Convert all RGB code to use RGB matrix. -- [ ] Make workflow so that ARM and AVR are both differentiable. -- [ ] Finish README to be intelligible. -- [ ] Generate JSON files to be used with Keyboard-Layout-Editor to produce images. - ## Builds These are my keyboard builds and info, it allows me to plan out my builds. @@ -117,8 +110,9 @@ These files are prefixed with `sbp-` to remove any naming clash. * [bb-audio](bb-audio.c): Code dealing with audio playback using onboard sound. * [bb-encoder](bb-encoder.c): Rotary encoder sutff. * [bb-macro](bb-macro.c): My custom keycodes; macros, tap dances, etc. -* [bb-oled](bb-oled.c): Controls OLED displays. -* [bb-rgb](bb-rgb.c): Controls per-key RGB LED matrix stuff. +* [bb-oled](bb-oled.c): Controls OLED displays. For higher memory; there is also [bb-oled-extra](bb-oled-extra.c). +* [bb-rgb](bb-rgb.c): Controls per-key RGB LED matrix stuff, and layer indication. Uses `RGB_MATRIX`. +* [bb-underglaw](bb-underglow.c): Controls RGB LED strip, and layer indication. Uses `RGBLIGHT`. # Layout @@ -127,8 +121,6 @@ My personal layout is mostly inspired by the There are some changes to make it friendlier to international keyboards. My board is compatible with software implementation of Dvorak and Turkish F. -WIP - ## Base Base layer uses tap-hold functionality to have access to modifiers. @@ -137,13 +129,3 @@ as to make those modifiers accessible to the keys that overlap them. Besides the Alt key; each side has the proper L/R version of the modifier. Since Right Alt key functions as AltGr key; both the L and R versions are available on each side. - -# Shoutout - -* To [drashna](../drashna/readme.md), for documenting how to use userspace features; -all my code is pretty much inspired from them. -* To [Manna Harbour](../manna-harbour_miryoku/README.org) for their -amazing keymap that inspired me to recreate mine and allowed me to move to -smaller split keyboards. -* To people who taught me C and have me enjoy working with it; -Dr. Mehmet Enis Oğuz and Dr. Veysi Erkcan Özcan. diff --git a/users/bbaserdem/bb-underglow.c b/users/bbaserdem/bb-underglow.c index 937e3007591..6b74c4a3f41 100644 --- a/users/bbaserdem/bb-underglow.c +++ b/users/bbaserdem/bb-underglow.c @@ -23,19 +23,18 @@ const rgblight_segment_t PROGMEM bb_base_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); // Gaming layer is turquoise const rgblight_segment_t PROGMEM bb_game_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_TURQUOISE} + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_PURPLE} ); // Character overlay is chartereuse const rgblight_segment_t PROGMEM bb_char_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {0, RGBLED_NUM, HSV_CHARTREUSE} + {0, RGBLED_NUM, HSV_GOLD} ); // Right-hand layers // Media layer is orange const rgblight_segment_t PROGMEM bb_medi_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, 30, 255, 255 - } + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_MAGENTA} ); // Navigation layer is green const rgblight_segment_t PROGMEM bb_navi_layer[] = RGBLIGHT_LAYER_SEGMENTS( @@ -43,14 +42,14 @@ const rgblight_segment_t PROGMEM bb_navi_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); // Symbol layer is purple const rgblight_segment_t PROGMEM bb_symb_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_PURPLE} + {RGBLIGHT_RIGHT_BEG, RGBLIGHT_RIGHT_NUM, HSV_YELLOW} ); // Left-hand layers // Number layer is blue const rgblight_segment_t PROGMEM bb_numb_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_CYAN} + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_BLUE} ); // Function layer is red const rgblight_segment_t PROGMEM bb_func_layer[] = RGBLIGHT_LAYER_SEGMENTS( @@ -58,12 +57,12 @@ const rgblight_segment_t PROGMEM bb_func_layer[] = RGBLIGHT_LAYER_SEGMENTS( ); // Pointer layer is yellow const rgblight_segment_t PROGMEM bb_mous_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_YELLOW} + {RGBLIGHT_LEFT_BEG, RGBLIGHT_LEFT_NUM, HSV_SPRINGGREEN} ); // Music playback layer is magenta const rgblight_segment_t PROGMEM bb_musi_layer[] = RGBLIGHT_LAYER_SEGMENTS( - {0, RGBLED_NUM, HSV_MAGENTA} + {0, RGBLED_NUM, HSV_ORANGE} ); const rgblight_segment_t* const PROGMEM bb_rgb_layers[] = RGBLIGHT_LAYERS_LIST( @@ -109,5 +108,5 @@ void shutdown_underglow(void) { // Make the LED's red on shutdown rgblight_enable_noeeprom(); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - rgblight_sethsv(HSV_PINK); + rgblight_sethsv(HSV_WHITE); } diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 74d582641f4..96e51ec9a2e 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -227,13 +227,13 @@ layer_state_t layer_state_set_user(layer_state_t state) { // Keymap layer state setting state = layer_state_set_keymap(state); // For underglow stuff - #ifdef RGBLIGHT_ENABLE - layer_state_set_underglow(state); - #endif +# ifdef RGBLIGHT_ENABLE + state = layer_state_set_underglow(state); +# endif // Audio playback - #ifdef AUDIO_ENABLE - layer_state_set_audio(state); - #endif +# ifdef AUDIO_ENABLE + state = layer_state_set_audio(state); +# endif return state; } diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 265898c3e6b..adeac2fa47b 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -32,6 +32,10 @@ along with this program. If not, see . #ifdef BACKLIGHT_ENABLE #include "bb-backlight.h" #endif +// Underglow light using rgb LEDs +#ifdef RGBLIGHT_ENABLE + #include "bb-underglow.h" +#endif // Keycap backlight using rgb LEDs #ifdef RGB_MATRIX_ENABLE #include "bb-rgb.h" @@ -123,10 +127,6 @@ enum userspace_custom_keycodes { # ifdef ENCODER_ENABLE BB_ENC0, BB_ENC1, -# endif - // Some RGB toggles -# ifdef RGB_MATRIX_ENABLE - BB_RGBO, # endif // Oled editor # ifdef OLED_ENABLE @@ -420,7 +420,7 @@ enum userspace_layers { * ┌─────┬─────┬─────┬─────┬─────┐ * │Speed│ Mod │ Hue │ Sat │ Bri │ RGB light control * ├─────┼─────┼─────┼─────┼─────┤ - * │Media│Prev.│MuTog│MuStp│Next │ Media control + * │Togg.│Prev.│MuTog│MuStp│Next │ Media control * ├─────┼─────┼─────┼─────┼─────┤ * │Sink │Vol -│ Mut │Eject│Vol +│ Volume control * ┌─────┼─────┼─────┼─────┴─────┴─────┘ diff --git a/users/bbaserdem/keymap-bitmaps/.gitignore b/users/bbaserdem/keymap-bitmaps/.gitignore index 4f6fdcf7c15..6448f593d6a 100644 --- a/users/bbaserdem/keymap-bitmaps/.gitignore +++ b/users/bbaserdem/keymap-bitmaps/.gitignore @@ -1,3 +1,4 @@ *.bmp splitImages templates +!.gitignore diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 501c85c8aed..c52052a28b4 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -63,6 +63,11 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes) SRC += bb-encoder.c endif +# RGB LED (Underglow) code +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) +SRC += bb-underglow.c +endif + # RGB LED (Perkey) code ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) SRC += bb-rgb.c From dd3e2360ec15d1a14eb34262c384d79527dc0495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 18 Sep 2021 17:41:29 -0400 Subject: [PATCH 81/94] Fixed and refreshed all licence headers --- .../splitkb/kyria/keymaps/bbaserdem/config.h | 30 +++++++++------- .../splitkb/kyria/keymaps/bbaserdem/keymap.c | 30 +++++++++------- .../splitkb/kyria/keymaps/bbaserdem/rules.mk | 6 +++- .../community/ortho_4x12/bbaserdem/config.h | 29 ++++++++------- .../community/ortho_4x12/bbaserdem/keymap.c | 29 ++++++++------- .../community/ortho_4x12/bbaserdem/rules.mk | 9 +++-- .../split_3x5_3/bbaserdem-disable/config.h | 32 ----------------- .../README.md | 0 .../community/split_3x5_3/bbaserdem/config.h | 36 +++++++++++++++++++ .../{bbaserdem-disable => bbaserdem}/keymap.c | 30 +++++++++------- .../{bbaserdem-disable => bbaserdem}/rules.mk | 6 +++- .../community/split_3x6_3/bbaserdem/chconf.h | 17 +++++++++ .../community/split_3x6_3/bbaserdem/config.h | 29 ++++++++------- .../community/split_3x6_3/bbaserdem/halconf.h | 16 +++++++++ .../community/split_3x6_3/bbaserdem/keymap.c | 31 +++++++++------- .../community/split_3x6_3/bbaserdem/mcuconf.h | 16 +++++++++ .../community/split_3x6_3/bbaserdem/rules.mk | 6 +++- .../community/split_3x6_3/bbaserdem/ssd1306.c | 16 +++++++++ users/bbaserdem/bb-audio.c | 31 +++++++++------- users/bbaserdem/bb-audio.h | 31 +++++++++------- users/bbaserdem/bb-backlight.c | 30 +++++++++------- users/bbaserdem/bb-backlight.h | 30 +++++++++------- users/bbaserdem/bb-encoder.c | 30 +++++++++------- users/bbaserdem/bb-encoder.h | 30 +++++++++------- users/bbaserdem/bb-macro.c | 30 +++++++++------- users/bbaserdem/bb-macro.h | 30 +++++++++------- users/bbaserdem/bb-oled-extra.c | 30 +++++++++------- users/bbaserdem/bb-oled-extra.h | 30 +++++++++------- users/bbaserdem/bb-oled.c | 30 +++++++++------- users/bbaserdem/bb-oled.h | 30 +++++++++------- users/bbaserdem/bb-rgb.c | 30 +++++++++------- users/bbaserdem/bb-rgb.h | 30 +++++++++------- users/bbaserdem/bb-underglow.c | 30 +++++++++------- users/bbaserdem/bb-underglow.h | 30 +++++++++------- users/bbaserdem/bbaserdem.c | 30 +++++++++------- users/bbaserdem/bbaserdem.h | 30 +++++++++------- users/bbaserdem/config.h | 29 ++++++++------- users/bbaserdem/keymap-bitmaps/cropBmp | 16 +++++++++ users/bbaserdem/rules.mk | 6 +++- 39 files changed, 584 insertions(+), 377 deletions(-) delete mode 100644 layouts/community/split_3x5_3/bbaserdem-disable/config.h rename layouts/community/split_3x5_3/{bbaserdem-disable => bbaserdem}/README.md (100%) create mode 100644 layouts/community/split_3x5_3/bbaserdem/config.h rename layouts/community/split_3x5_3/{bbaserdem-disable => bbaserdem}/keymap.c (83%) rename layouts/community/split_3x5_3/{bbaserdem-disable => bbaserdem}/rules.mk (90%) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h index e06a6144d0d..7929b7b4ab7 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 // Kyria specific diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c index 4c76884c76a..d3720ea7649 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c @@ -1,18 +1,22 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 QMK_KEYBOARD_H #include "bbaserdem.h" + #define LAYOUT_split_3x6_5_wrapper(...) LAYOUT_split_3x6_5(__VA_ARGS__) /* F layout diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index ec18b9b1949..a83d5d95193 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -1,12 +1,16 @@ -# Copyright 2019 Batuhan Başerdem @bbaserdem +# Copyright 2021 Batuhan Başerdem +# @bbaserdem +# # 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 . diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h index bc70788cd3c..b21125736f7 100755 --- a/layouts/community/ortho_4x12/bbaserdem/config.h +++ b/layouts/community/ortho_4x12/bbaserdem/config.h @@ -1,16 +1,19 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 // Code pertaining to planck rev6 diff --git a/layouts/community/ortho_4x12/bbaserdem/keymap.c b/layouts/community/ortho_4x12/bbaserdem/keymap.c index 3c53c83d7a3..91ddc617642 100755 --- a/layouts/community/ortho_4x12/bbaserdem/keymap.c +++ b/layouts/community/ortho_4x12/bbaserdem/keymap.c @@ -1,16 +1,19 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 QMK_KEYBOARD_H #include "bbaserdem.h" diff --git a/layouts/community/ortho_4x12/bbaserdem/rules.mk b/layouts/community/ortho_4x12/bbaserdem/rules.mk index e8b2c793ba0..b3ce684315a 100755 --- a/layouts/community/ortho_4x12/bbaserdem/rules.mk +++ b/layouts/community/ortho_4x12/bbaserdem/rules.mk @@ -1,18 +1,21 @@ -# Copyright 2019 Batuhan Başerdem @bbaserdem + +# Copyright 2021 Batuhan Başerdem +# @bbaserdem +# # 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 . # Planck rev6 has both RGBLIGHT and RGB_MATRIX enabled -# RGBLIGHT should be enabled for a board with the underglow leds -# RGB_MATRIX_ENABLE should be set to WS2812 for the daughter board ifneq (,$(findstring planck/rev6,$(KEYBOARD))) RGB_MATRIX_ENABLE = yes RGBLIGHT_ENABLE = no diff --git a/layouts/community/split_3x5_3/bbaserdem-disable/config.h b/layouts/community/split_3x5_3/bbaserdem-disable/config.h deleted file mode 100644 index 75e24791eee..00000000000 --- a/layouts/community/split_3x5_3/bbaserdem-disable/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 - -// Split definition; use the following to flash; -// pro-micro: avrdude-split-left/right -// elite-c: dfu-split-left/right -#define EE_HANDS - -#ifdef KEYBOARD_crkbd_rev1 - // Corne overrides - #include "../../../../keyboards/crkbd/rev1/config.h" - #ifdef RGBLED_NUM - #undef RGBLED_NUM - #endif - #ifdef DRIVER_LED_TOTAL - #undef DRIVER_LED_TOTAL - #endif - #define RGBLED_NUM 48 - #define DRIVER_LED_TOTAL RGBLED_NUM -#endif diff --git a/layouts/community/split_3x5_3/bbaserdem-disable/README.md b/layouts/community/split_3x5_3/bbaserdem/README.md similarity index 100% rename from layouts/community/split_3x5_3/bbaserdem-disable/README.md rename to layouts/community/split_3x5_3/bbaserdem/README.md diff --git a/layouts/community/split_3x5_3/bbaserdem/config.h b/layouts/community/split_3x5_3/bbaserdem/config.h new file mode 100644 index 00000000000..f30038504a7 --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/config.h @@ -0,0 +1,36 @@ + +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 + +// Split definition; use the following to flash; +// pro-micro: avrdude-split-left/right +// elite-c: dfu-split-left/right +#define EE_HANDS + +#ifdef KEYBOARD_crkbd_rev1 + // Corne overrides + #include "../../../../keyboards/crkbd/rev1/config.h" + #ifdef RGBLED_NUM + #undef RGBLED_NUM + #endif + #ifdef DRIVER_LED_TOTAL + #undef DRIVER_LED_TOTAL + #endif + #define RGBLED_NUM 48 + #define DRIVER_LED_TOTAL RGBLED_NUM +#endif diff --git a/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c b/layouts/community/split_3x5_3/bbaserdem/keymap.c similarity index 83% rename from layouts/community/split_3x5_3/bbaserdem-disable/keymap.c rename to layouts/community/split_3x5_3/bbaserdem/keymap.c index b5169e638a6..72d261aefba 100644 --- a/layouts/community/split_3x5_3/bbaserdem-disable/keymap.c +++ b/layouts/community/split_3x5_3/bbaserdem/keymap.c @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 QMK_KEYBOARD_H #include "bbaserdem.h" diff --git a/layouts/community/split_3x5_3/bbaserdem-disable/rules.mk b/layouts/community/split_3x5_3/bbaserdem/rules.mk similarity index 90% rename from layouts/community/split_3x5_3/bbaserdem-disable/rules.mk rename to layouts/community/split_3x5_3/bbaserdem/rules.mk index 1d557030589..047629b4016 100644 --- a/layouts/community/split_3x5_3/bbaserdem-disable/rules.mk +++ b/layouts/community/split_3x5_3/bbaserdem/rules.mk @@ -1,12 +1,16 @@ -# Copyright 2019 Batuhan Başerdem @bbaserdem +# Copyright 2021 Batuhan Başerdem +# @bbaserdem +# # 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 . diff --git a/layouts/community/split_3x6_3/bbaserdem/chconf.h b/layouts/community/split_3x6_3/bbaserdem/chconf.h index cf0e7204a52..500e16eb894 100644 --- a/layouts/community/split_3x6_3/bbaserdem/chconf.h +++ b/layouts/community/split_3x6_3/bbaserdem/chconf.h @@ -1,3 +1,20 @@ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 . + */ + // Code pertaining the ARM crkbd version #ifdef KEYBOARD_crkbd_rev1 #define CH_CFG_ST_RESOLUTION 16 diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 8316408548d..62514b02c49 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -1,16 +1,19 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 // Split definition; use the following to flash; // pro-micro: avrdude-split-left/right diff --git a/layouts/community/split_3x6_3/bbaserdem/halconf.h b/layouts/community/split_3x6_3/bbaserdem/halconf.h index 61ebef685b5..56f59321fd3 100644 --- a/layouts/community/split_3x6_3/bbaserdem/halconf.h +++ b/layouts/community/split_3x6_3/bbaserdem/halconf.h @@ -1,3 +1,19 @@ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #ifdef KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/keymap.c b/layouts/community/split_3x6_3/bbaserdem/keymap.c index ed969c7877b..589b8eda0c8 100644 --- a/layouts/community/split_3x6_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x6_3/bbaserdem/keymap.c @@ -1,17 +1,22 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 QMK_KEYBOARD_H #include "bbaserdem.h" + #ifdef KEYBOARD_crkbd_rev1 # include "bb-oled-extra.h" #endif // KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h index c13e6f6774a..d2e1f736e5a 100644 --- a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h +++ b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h @@ -1,3 +1,19 @@ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #ifdef KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/rules.mk b/layouts/community/split_3x6_3/bbaserdem/rules.mk index 49db761e4d0..09619936da2 100644 --- a/layouts/community/split_3x6_3/bbaserdem/rules.mk +++ b/layouts/community/split_3x6_3/bbaserdem/rules.mk @@ -1,12 +1,16 @@ -# Copyright 2019 Batuhan Başerdem @bbaserdem +# Copyright 2021 Batuhan Başerdem +# @bbaserdem +# # 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 . diff --git a/layouts/community/split_3x6_3/bbaserdem/ssd1306.c b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c index e69de29bb2d..49832485554 100644 --- a/layouts/community/split_3x6_3/bbaserdem/ssd1306.c +++ b/layouts/community/split_3x6_3/bbaserdem/ssd1306.c @@ -0,0 +1,16 @@ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 . + */ diff --git a/users/bbaserdem/bb-audio.c b/users/bbaserdem/bb-audio.c index 9b90a63cc46..eef0cdf2f6e 100644 --- a/users/bbaserdem/bb-audio.c +++ b/users/bbaserdem/bb-audio.c @@ -1,16 +1,21 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bb-audio.h" /* AUDIO * This contains some audio related stuff. diff --git a/users/bbaserdem/bb-audio.h b/users/bbaserdem/bb-audio.h index 53708327536..07de435f79c 100644 --- a/users/bbaserdem/bb-audio.h +++ b/users/bbaserdem/bb-audio.h @@ -1,16 +1,21 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include "bbaserdem.h" /* AUDIO diff --git a/users/bbaserdem/bb-backlight.c b/users/bbaserdem/bb-backlight.c index 17017d82790..0c8e9021485 100644 --- a/users/bbaserdem/bb-backlight.c +++ b/users/bbaserdem/bb-backlight.c @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bb-backlight.h" /* Replaced functions with noeeprom varieties; I don't need retention across * booting. diff --git a/users/bbaserdem/bb-backlight.h b/users/bbaserdem/bb-backlight.h index 3fbe1b9fb55..23d649f610d 100644 --- a/users/bbaserdem/bb-backlight.h +++ b/users/bbaserdem/bb-backlight.h @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include "bbaserdem.h" /* Hooks for backlight definitions diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 38f4163a86a..f222ff5dacb 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bb-encoder.h" // Need this to call velocikey activation #ifdef VELOCIKEY_ENABLE diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 121f10e095a..5613558407b 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include "bbaserdem.h" diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 7dbd0aa5c5d..9f69108f2c4 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bb-macro.h" /* MACRO Definitions * This file has my macros/unicodes diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h index f3b8a2189b6..5220a7ef834 100644 --- a/users/bbaserdem/bb-macro.h +++ b/users/bbaserdem/bb-macro.h @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include "bbaserdem.h" /* This header file contains definitons regarding custom keycodes. diff --git a/users/bbaserdem/bb-oled-extra.c b/users/bbaserdem/bb-oled-extra.c index 3f648baa295..3259bf52236 100644 --- a/users/bbaserdem/bb-oled-extra.c +++ b/users/bbaserdem/bb-oled-extra.c @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bb-oled.h" #include "bb-oled-extra.h" diff --git a/users/bbaserdem/bb-oled-extra.h b/users/bbaserdem/bb-oled-extra.h index 7584cb4fe2d..c051e6226c1 100644 --- a/users/bbaserdem/bb-oled-extra.h +++ b/users/bbaserdem/bb-oled-extra.h @@ -1,18 +1,22 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include "bbaserdem.h" + // OLED layout images writer function void render_modifiers(uint8_t row, uint8_t col, uint8_t mods); void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft); diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 1d7231a5fdc..6c18043e537 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bb-oled.h" #include // Grab the print function diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index c403e4c96aa..a355c88ca91 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -1,18 +1,22 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include "bbaserdem.h" + // Contain the main oled writer here void oled_task_user(void); // Some generic rendering functions diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index 81f58cb52c8..4aa0e94b951 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -1,18 +1,22 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bb-rgb.h" #include "color.h" + #define X_DIV 224/2 /* Code relating to per-key RGB LED stuff */ diff --git a/users/bbaserdem/bb-rgb.h b/users/bbaserdem/bb-rgb.h index e71c88e5585..cc02b831d09 100644 --- a/users/bbaserdem/bb-rgb.h +++ b/users/bbaserdem/bb-rgb.h @@ -1,18 +1,22 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include "bbaserdem.h" + /* Hooks involving perkey RGB LEDs */ diff --git a/users/bbaserdem/bb-underglow.c b/users/bbaserdem/bb-underglow.c index 6b74c4a3f41..69aae439f4f 100644 --- a/users/bbaserdem/bb-underglow.c +++ b/users/bbaserdem/bb-underglow.c @@ -1,17 +1,21 @@ -/* -Copyright 2020 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bb-underglow.h" + /* UNDERGLOW IMPLEMENTATION */ diff --git a/users/bbaserdem/bb-underglow.h b/users/bbaserdem/bb-underglow.h index 61b66efdf9e..9cc1db37570 100644 --- a/users/bbaserdem/bb-underglow.h +++ b/users/bbaserdem/bb-underglow.h @@ -1,18 +1,22 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include "bbaserdem.h" + /* UNDERGLOW IMPLEMENTATION */ diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 96e51ec9a2e..ff80fc20f5f 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 "bbaserdem.h" // Language imports #include diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index adeac2fa47b..b1bf1867870 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -1,16 +1,20 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 #include QMK_KEYBOARD_H #include "quantum.h" diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index b86d859d098..5118c33c693 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -1,16 +1,19 @@ -/* -Copyright 2019 Batuhan Başerdem @bbaserdem -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 . -*/ +/* Copyright 2021 Batuhan Başerdem + * @bbaserdem + * + * 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 /* CONFIG diff --git a/users/bbaserdem/keymap-bitmaps/cropBmp b/users/bbaserdem/keymap-bitmaps/cropBmp index fdb0805b910..4a322b4175c 100755 --- a/users/bbaserdem/keymap-bitmaps/cropBmp +++ b/users/bbaserdem/keymap-bitmaps/cropBmp @@ -1,5 +1,21 @@ #!/bin/bash +# Copyright 2021 Batuhan Başerdem +# @bbaserdem +# +# 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 . + # Goes through all the files and turns them into strips in their respective folder if [ -z "${1}" ] ; then echo 'No argument; defaulting to script directory.' diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index c52052a28b4..cdf065df6fb 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -1,12 +1,16 @@ -# Copyright 2019 Batuhan Başerdem @bbaserdem +# Copyright 2021 Batuhan Başerdem +# @bbaserdem +# # 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 . From 269d5a9d8a7bfa29ea65e40040beeae54be13162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 18 Sep 2021 17:42:48 -0400 Subject: [PATCH 82/94] Removed define that does not do anything --- layouts/community/split_3x6_3/bbaserdem/config.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 62514b02c49..4ae977af509 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -47,8 +47,6 @@ # define MUSIC_MAP # endif - // Communication has to be serial on ARM -# define USE_SERIAL_PD2 // Set serial pin as D3 for sure # undef SOFT_SERIAL_PIN # define SOFT_SERIAL_PIN D3 From 3121afc7baa9658affeb819d45895cd56159f293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sat, 18 Sep 2021 19:55:57 -0400 Subject: [PATCH 83/94] Made style more consistent; and removed some lines. --- .../splitkb/kyria/keymaps/bbaserdem/config.h | 10 ++-- .../community/ortho_4x12/bbaserdem/config.h | 10 ++-- .../community/split_3x5_3/bbaserdem/config.h | 19 ++++--- .../community/split_3x5_3/bbaserdem/keymap.c | 6 +-- .../community/split_3x6_3/bbaserdem/chconf.h | 12 ++--- .../community/split_3x6_3/bbaserdem/config.h | 2 - .../community/split_3x6_3/bbaserdem/halconf.h | 6 +-- .../community/split_3x6_3/bbaserdem/mcuconf.h | 10 ++-- users/bbaserdem/bb-audio.h | 3 +- users/bbaserdem/bb-backlight.c | 4 +- users/bbaserdem/bb-backlight.h | 2 +- users/bbaserdem/bb-encoder.c | 43 ++++++++------- users/bbaserdem/bb-encoder.h | 1 - users/bbaserdem/bb-macro.c | 12 ++--- users/bbaserdem/bb-macro.h | 8 +-- users/bbaserdem/bb-oled-extra.c | 1 - users/bbaserdem/bb-oled.c | 2 +- users/bbaserdem/bb-rgb.c | 6 +-- users/bbaserdem/bb-rgb.h | 6 +-- users/bbaserdem/bbaserdem.c | 34 ++++++------ users/bbaserdem/bbaserdem.h | 52 +++++++++---------- users/bbaserdem/config.h | 22 ++++---- 22 files changed, 130 insertions(+), 141 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h index 7929b7b4ab7..b7b883d3bd8 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/config.h @@ -22,11 +22,11 @@ // Split definition; use the following to flash; // pro-micro: avrdude-split-left/right // elite-c: dfu-split-left/right - #define ENCODER_DIRECTION_FLIP - #define EE_HANDS +# define ENCODER_DIRECTION_FLIP +# define EE_HANDS // Make sure kyria has bigger oled display - #ifdef OLED_ENABLE - #define OLED_DISPLAY_128X64 - #endif +# ifdef OLED_ENABLE +# define OLED_DISPLAY_128X64 +# endif #endif diff --git a/layouts/community/ortho_4x12/bbaserdem/config.h b/layouts/community/ortho_4x12/bbaserdem/config.h index b21125736f7..fb3ec1371b0 100755 --- a/layouts/community/ortho_4x12/bbaserdem/config.h +++ b/layouts/community/ortho_4x12/bbaserdem/config.h @@ -17,10 +17,10 @@ #pragma once // Code pertaining to planck rev6 -#if defined(KEYBOARD_planck_rev6) +#ifdef KEYBOARD_planck_rev6 // Encoder I use; - #ifdef ENCODER_RESOLUTION - #undef ENCODER_RESOLUTION - #endif - #define ENCODER_RESOLUTION 2 +# ifdef ENCODER_RESOLUTION +# undef ENCODER_RESOLUTION +# endif +# define ENCODER_RESOLUTION 2 #endif diff --git a/layouts/community/split_3x5_3/bbaserdem/config.h b/layouts/community/split_3x5_3/bbaserdem/config.h index f30038504a7..6bb3515b9ec 100644 --- a/layouts/community/split_3x5_3/bbaserdem/config.h +++ b/layouts/community/split_3x5_3/bbaserdem/config.h @@ -24,13 +24,12 @@ #ifdef KEYBOARD_crkbd_rev1 // Corne overrides - #include "../../../../keyboards/crkbd/rev1/config.h" - #ifdef RGBLED_NUM - #undef RGBLED_NUM - #endif - #ifdef DRIVER_LED_TOTAL - #undef DRIVER_LED_TOTAL - #endif - #define RGBLED_NUM 48 - #define DRIVER_LED_TOTAL RGBLED_NUM -#endif +# ifdef RGBLED_NUM +# undef RGBLED_NUM +# endif +# ifdef DRIVER_LED_TOTAL +# undef DRIVER_LED_TOTAL +# endif +# define RGBLED_NUM 48 +# define DRIVER_LED_TOTAL RGBLED_NUM +#endif // KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x5_3/bbaserdem/keymap.c b/layouts/community/split_3x5_3/bbaserdem/keymap.c index 72d261aefba..f39a81082e0 100644 --- a/layouts/community/split_3x5_3/bbaserdem/keymap.c +++ b/layouts/community/split_3x5_3/bbaserdem/keymap.c @@ -97,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #ifdef RGB_MATRIX_ENABLE // crkbd -#if defined(KEYBOARD_crkbd_rev1) +#ifdef KEYBOARD_crkbd_rev1 /* This is left-right for crkbd indicator light * ┌──┬──┬──┬──┬──┐      ┌──┬──┬──┬──┬──┐ * │23│18│17│10│09│      │33│34│41│42│47│ @@ -111,7 +111,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // End of differentiations -#endif +#endif // KEYBOARD_crkbd_rev1 // End of code for the RGB_MATRIX setup -#endif +#endif // RGB_MATRIX_ENABLE diff --git a/layouts/community/split_3x6_3/bbaserdem/chconf.h b/layouts/community/split_3x6_3/bbaserdem/chconf.h index 500e16eb894..4c6d15441f3 100644 --- a/layouts/community/split_3x6_3/bbaserdem/chconf.h +++ b/layouts/community/split_3x6_3/bbaserdem/chconf.h @@ -17,11 +17,7 @@ // Code pertaining the ARM crkbd version #ifdef KEYBOARD_crkbd_rev1 - #define CH_CFG_ST_RESOLUTION 16 - #define CH_CFG_ST_FREQUENCY 10000 - #if __has_include("platforms/chibios/common/configs/chconf.h") - # include_next "platforms/chibios/common/configs/chconf.h" - #else - # include_next "chconf.h" - #endif -#endif +# define CH_CFG_ST_RESOLUTION 16 +# define CH_CFG_ST_FREQUENCY 10000 +# include_next "chconf.h" +#endif // KEYBOARD_crkbd_rev1 diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 4ae977af509..03473c5ae72 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -21,8 +21,6 @@ // Code pertaining to Corne ARM; from Waffle's keymap #ifdef KEYBOARD_crkbd_rev1 -# include "config_common.h" - // Use EE_HANDS to determine handedness # define EE_HANDS diff --git a/layouts/community/split_3x6_3/bbaserdem/halconf.h b/layouts/community/split_3x6_3/bbaserdem/halconf.h index 56f59321fd3..f3978c4175c 100644 --- a/layouts/community/split_3x6_3/bbaserdem/halconf.h +++ b/layouts/community/split_3x6_3/bbaserdem/halconf.h @@ -18,7 +18,7 @@ #ifdef KEYBOARD_crkbd_rev1 // #define HAL_USE_DAC TRUE - #define HAL_USE_PWM TRUE - #define HAL_USE_SERIAL TRUE - #include_next +# define HAL_USE_PWM TRUE +# define HAL_USE_SERIAL TRUE +# include_next #endif diff --git a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h index d2e1f736e5a..bde80b316ff 100644 --- a/layouts/community/split_3x6_3/bbaserdem/mcuconf.h +++ b/layouts/community/split_3x6_3/bbaserdem/mcuconf.h @@ -17,9 +17,9 @@ #pragma once #ifdef KEYBOARD_crkbd_rev1 - #include_next - #undef STM32_PWM_USE_TIM3 - #define STM32_PWM_USE_TIM3 TRUE - #undef STM32_SERIAL_USE_USART1 - #define STM32_SERIAL_USE_USART1 TRUE +# include_next +# undef STM32_PWM_USE_TIM3 +# define STM32_PWM_USE_TIM3 TRUE +# undef STM32_SERIAL_USE_USART1 +# define STM32_SERIAL_USE_USART1 TRUE #endif diff --git a/users/bbaserdem/bb-audio.h b/users/bbaserdem/bb-audio.h index 07de435f79c..351061ab9a7 100644 --- a/users/bbaserdem/bb-audio.h +++ b/users/bbaserdem/bb-audio.h @@ -14,10 +14,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - - #pragma once #include "bbaserdem.h" + /* AUDIO * Some functions to hook to some modes */ diff --git a/users/bbaserdem/bb-backlight.c b/users/bbaserdem/bb-backlight.c index 0c8e9021485..5eca1f2c114 100644 --- a/users/bbaserdem/bb-backlight.c +++ b/users/bbaserdem/bb-backlight.c @@ -24,7 +24,7 @@ void keyboard_post_init_backlight(void) { backlight_enable(); backlight_level(2); - #ifdef BACKLIGHT_BREATHING +# ifdef BACKLIGHT_BREATHING breathing_enable(); - #endif +# endif // BACKLIGHT_BREATHING } diff --git a/users/bbaserdem/bb-backlight.h b/users/bbaserdem/bb-backlight.h index 23d649f610d..3af3137d9ad 100644 --- a/users/bbaserdem/bb-backlight.h +++ b/users/bbaserdem/bb-backlight.h @@ -14,9 +14,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #pragma once #include "bbaserdem.h" + /* Hooks for backlight definitions */ diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index f222ff5dacb..fa96e8d4256 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -14,17 +14,16 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #include "bb-encoder.h" + // Need this to call velocikey activation #ifdef VELOCIKEY_ENABLE # include "velocikey.h" -#endif +#endif // VELOCIKEY_ENABLE // Need memcpy and memcmp from string.h along with transfer stuff #ifdef OLED_ENABLE # include -#endif - +#endif // OLED_ENABLE /* ROTARY ENCODER * This contains my general rotary encoder code @@ -54,7 +53,7 @@ void keyboard_post_init_encoder(void) { bool encoder_update_user(uint8_t index, bool clockwise) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #ifdef RGB_MATRIX_ENABLE +# ifdef RGB_MATRIX_ENABLE case _MEDI: switch(userspace_config.encoder[index].rgb) { case 0: // Effect the RGB mode @@ -94,8 +93,8 @@ bool encoder_update_user(uint8_t index, bool clockwise) { break; } break; - #endif - #ifdef MOUSEKEY_ENABLE +# endif // RGB_MATRIX_ENABLE +# ifdef MOUSEKEY_ENABLE case _MOUS: switch(userspace_config.encoder[index].point) { case 0: // Move mouse on horizontal axis @@ -128,7 +127,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { break; } break; - #endif +# endif // MOUSEKEY_ENABLE default: switch(userspace_config.encoder[index].base) { case 0: // Volume @@ -203,7 +202,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { void encoder_click_action(uint8_t index) { // Differentiate layer roles switch (get_highest_layer(layer_state)) { - #ifdef RGB_MATRIX_ENABLE +# ifdef RGB_MATRIX_ENABLE case _MEDI: switch(userspace_config.encoder[index].rgb) { case 0: // Return to no animation @@ -215,14 +214,14 @@ void encoder_click_action(uint8_t index) { rgb_matrix_increase_val_noeeprom(); break; case 4: // Toggle velocikey - #ifdef VELOCIKEY_ENABLE +# ifdef VELOCIKEY_ENABLE velocikey_toggle(); - #endif +# endif // VELOCIKEY_ENABLE break; } break; - #endif - #ifdef MOUSEKEY_ENABLE +# endif // RGB_MATRIX_ENABLE +# ifdef MOUSEKEY_ENABLE case _MOUS: switch(userspace_config.encoder[index].point) { case 0: // Left click @@ -237,7 +236,7 @@ void encoder_click_action(uint8_t index) { break; } break; - #endif +# endif // MOUSEKEY_ENABLE default: switch(userspace_config.encoder[index].base) { case 0: // Toggle mute @@ -284,18 +283,18 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // If shifted, move mode one point forward if (get_mods() & MOD_MASK_SHIFT) { switch (get_highest_layer(layer_state)) { - #ifdef RGB_MATRIX_ENABLE +# ifdef RGB_MATRIX_ENABLE case _MEDI: userspace_config.encoder[encoder_index].rgb = (userspace_config.encoder[encoder_index].rgb + 1) % 5; break; - #endif - #ifdef MOUSEKEY_ENABLE +# endif // RGB_MATRIX_ENABLE +# ifdef MOUSEKEY_ENABLE case _MOUS: userspace_config.encoder[encoder_index].point = (userspace_config.encoder[encoder_index].point + 1) % 4; break; - #endif +# endif // MOUSEKEY_ENABLE default: userspace_config.encoder[encoder_index].base = (userspace_config.encoder[encoder_index].base + 1) % 9; @@ -304,18 +303,18 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // If ctrl is active, move mode one point backwards } else if (get_mods() & MOD_MASK_CTRL) { switch (get_highest_layer(layer_state)) { - #ifdef RGB_MATRIX_ENABLE +# ifdef RGB_MATRIX_ENABLE case _MEDI: userspace_config.encoder[encoder_index].rgb = (userspace_config.encoder[encoder_index].rgb + 5 - 1) % 5; break; - #endif - #ifdef MOUSEKEY_ENABLE +# endif // RGB_MATRIX_ENABLE +# ifdef MOUSEKEY_ENABLE case _MOUS: userspace_config.encoder[encoder_index].point = (userspace_config.encoder[encoder_index].point + 4 - 1) % 4; break; - #endif +# endif // MOUSEKEY_ENABLE default: userspace_config.encoder[encoder_index].base = (userspace_config.encoder[encoder_index].base + 9 - 1) % 9; diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 5613558407b..5c4db5ed7ee 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -14,7 +14,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #pragma once #include "bbaserdem.h" diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 9f69108f2c4..e27874b1ff9 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -14,8 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #include "bb-macro.h" + /* MACRO Definitions * This file has my macros/unicodes * Hooks for other functionality to inject itself into the process_record @@ -28,8 +28,8 @@ qk_tap_dance_action_t tap_dance_actions[] = { // Music playback speed modulator [TD_AUDIO_TEMPO] = ACTION_TAP_DANCE_DOUBLE(MU_SLOW, MU_FAST), }; -#endif -#endif +#endif // AUDIO_ENABLE +#endif // TAP_DANCE_ENABLE // Unicode definitions; for single character keys // We mask their definitions if unicode is not enabled @@ -74,7 +74,7 @@ const uint32_t PROGMEM unicode_map[] = { [ANGSTROM] = 0x212B, // Å [BITCOIN] = 0x20BF // ₿ }; -#endif +#endif // UNICODEMAP_ENABLE // Keycodes bool process_record_macro(uint16_t keycode, keyrecord_t *record) { @@ -131,7 +131,7 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { } return false; break; // Unicode macros - #ifdef UNICODEMAP_ENABLE +# ifdef UNICODEMAP_ENABLE case TR_FLAG: // Turkish flag if (record->event.pressed) { @@ -150,7 +150,7 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); } return false; break; - #endif +# endif // UNICODEMAP_ENABLE } return true; } diff --git a/users/bbaserdem/bb-macro.h b/users/bbaserdem/bb-macro.h index 5220a7ef834..3dc14e7a8ad 100644 --- a/users/bbaserdem/bb-macro.h +++ b/users/bbaserdem/bb-macro.h @@ -14,9 +14,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #pragma once #include "bbaserdem.h" + /* This header file contains definitons regarding custom keycodes. * - Both regular and unicode macros are dealt with in this file */ @@ -101,7 +101,7 @@ enum userspace_unicodemap { LOW_PSI, LOW_OMEGA, }; -#endif +#endif // UNICODEMAP_ENABLE // Tap dance stuff #ifdef AUDIO_ENABLE @@ -109,5 +109,5 @@ enum userspace_unicodemap { enum { TD_AUDIO_TEMPO, }; -#endif -#endif +#endif // AUDIO_ENABLE +#endif // TAP_DANCE_ENABLE diff --git a/users/bbaserdem/bb-oled-extra.c b/users/bbaserdem/bb-oled-extra.c index 3259bf52236..69cfe520e7f 100644 --- a/users/bbaserdem/bb-oled-extra.c +++ b/users/bbaserdem/bb-oled-extra.c @@ -14,7 +14,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #include "bb-oled.h" #include "bb-oled-extra.h" diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 6c18043e537..4661cfc2a51 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -14,8 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #include "bb-oled.h" + #include // Grab the print function #ifdef ENCODER_ENABLE diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index 4aa0e94b951..ba8290eb791 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -113,7 +113,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } // Hook into shutdown code to make all perkey LED's red on hitting reset -void shutdown_keylight(void) { +void shutdown_rgb(void) { // Flash all the key LED's red on shutdown uint16_t timer_start = timer_read(); rgb_matrix_set_color_all(RGB_CORAL); @@ -122,9 +122,9 @@ void shutdown_keylight(void) { } // Hook into suspend code -void suspend_power_down_keylight(void) { +void suspend_power_down_rgb(void) { rgb_matrix_set_suspend_state(true); } -void suspend_wakeup_init_keylight(void) { +void suspend_wakeup_init_rgb(void) { rgb_matrix_set_suspend_state(false); } diff --git a/users/bbaserdem/bb-rgb.h b/users/bbaserdem/bb-rgb.h index cc02b831d09..03713ca8e5d 100644 --- a/users/bbaserdem/bb-rgb.h +++ b/users/bbaserdem/bb-rgb.h @@ -23,6 +23,6 @@ // For custom indicators void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); // Hook into shutdown code -void shutdown_keylight(void); -void suspend_wakeup_init_keylight(void); -void suspend_power_down_keylight(void); +void shutdown_rgm(void); +void suspend_wakeup_init_rgb(void); +void suspend_power_down_rgb(void); diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index ff80fc20f5f..fdd58a8ed98 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -131,22 +131,22 @@ __attribute__ ((weak)) void keyboard_post_init_user(void) { // Backlight LED # ifdef BACKLIGHT_ENABLE keyboard_post_init_backlight(); -# endif +# endif // BACKLIGHT_ENABLE // RGB underglow # ifdef RGBLIGHT_ENABLE keyboard_post_init_underglow(); -# endif +# endif // RGBLIGHT_ENABLE // Encoders # ifdef ENCODER_ENABLE keyboard_post_init_encoder(); -# endif +# endif // ENCODER_ENABLE // Unicode mode # ifdef UNICODEMAP_ENABLE set_unicode_input_mode(UC_LNX); -# endif +# endif // UNICODEMAP_ENABLE // Keymap specific stuff keyboard_post_init_keymap(); @@ -233,11 +233,11 @@ layer_state_t layer_state_set_user(layer_state_t state) { // For underglow stuff # ifdef RGBLIGHT_ENABLE state = layer_state_set_underglow(state); -# endif +# endif // RGBLIGHT_ENABLE // Audio playback # ifdef AUDIO_ENABLE state = layer_state_set_audio(state); -# endif +# endif // AUDIO_ENABLE return state; } @@ -277,17 +277,17 @@ __attribute__ ((weak)) void suspend_power_down_keymap (void) { } void suspend_power_down_user(void) { suspend_power_down_keymap(); // RGB matrix sleep hook - #ifdef RGB_MATRIX_ENABLE - suspend_power_down_keylight(); - #endif +# ifdef RGB_MATRIX_ENABLE + suspend_power_down_rgb(); +# endif // RGB_MATRIX_ENABLE } __attribute__ ((weak)) void suspend_wakeup_init_keymap (void) { } void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); // RGB matrix sleep hook - #ifdef RGB_MATRIX_ENABLE - suspend_wakeup_init_keylight(); - #endif +# ifdef RGB_MATRIX_ENABLE + suspend_wakeup_init_rgb(); +# endif // RGB_MATRIX_ENABLE } /*------------------*\ @@ -298,13 +298,13 @@ void suspend_wakeup_init_user(void) { __attribute__ ((weak)) void shutdown_keymap (void) { } void shutdown_user(void) { // Underglow LED hook on boot - #ifdef RGBLIGHT_ENABLE +# ifdef RGBLIGHT_ENABLE shutdown_underglow(); - #endif +# endif // RGBLIGHT_ENABLE // Perkey led hook on boot - #ifdef RGB_MATRIX_ENABLE - shutdown_keylight(); - #endif +# ifdef RGB_MATRIX_ENABLE + shutdown_rgb(); +# endif // RGB_MATRIX_ENABLE // Keymap hooks shutdown_keymap(); } diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index b1bf1867870..bc955193798 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -30,28 +30,28 @@ #include "bb-macro.h" // Audio from onboard speakers #ifdef AUDIO_ENABLE - #include "bb-audio.h" -#endif +#include "bb-audio.h" +#endif // AUDIO_ENABLE // Keycap backlight using non-rgb LEDs #ifdef BACKLIGHT_ENABLE - #include "bb-backlight.h" -#endif +#include "bb-backlight.h" +#endif // BACKLIGHT_ENABLE // Underglow light using rgb LEDs #ifdef RGBLIGHT_ENABLE - #include "bb-underglow.h" -#endif +#include "bb-underglow.h" +#endif // RGBLIGHT_ENABLE // Keycap backlight using rgb LEDs #ifdef RGB_MATRIX_ENABLE - #include "bb-rgb.h" -#endif +#include "bb-rgb.h" +#endif // RGB_MATRIX_ENABLE // Rotary encoder #ifdef ENCODER_ENABLE - #include "bb-encoder.h" -#endif +#include "bb-encoder.h" +#endif // ENCODER_ENABLE // Oled screen #ifdef OLED_ENABLE - #include "bb-oled.h" -#endif +#include "bb-oled.h" +#endif // OLED_ENABLE // Structure to keep runtime info on encoder state typedef union { @@ -104,10 +104,10 @@ void suspend_wakeup_init_keymap(void); void shutdown_keymap(void); // Make it so that keymaps can use KEYMAP_SAFE_RANGE for custom keycodes -#if defined(KEYMAP_SAFE_RANGE) - #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#ifdef KEYMAP_SAFE_RANGE +#define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE #else - #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#define PLACEHOLDER_SAFE_RANGE SAFE_RANGE #endif // Custom macro keycode ranges @@ -126,16 +126,16 @@ enum userspace_custom_keycodes { BB_LENY, BB_TABL, TR_FLAG, -# endif +# endif // UNICODEMAP_ENABLE // Encoder buttons # ifdef ENCODER_ENABLE BB_ENC0, BB_ENC1, -# endif +# endif // ENCODER_ENABLE // Oled editor # ifdef OLED_ENABLE BB_OLED, -# endif +# endif // OLED_ENABLE //use for keymap specific codes KEYMAP_SAFE_RANGE }; @@ -144,11 +144,11 @@ enum userspace_custom_keycodes { #define BB_LENY KC_NO #define BB_TABL KC_NO #define TR_FLAG KC_NO -#endif +#endif // UNICODEMAP_ENABLE #ifndef ENCODER_ENABLE #define BB_ENC0 KC_NO #define BB_ENC1 KC_NO -#endif +#endif // ENCODER_ENABLE /// Enumerate of layers enum userspace_layers { @@ -213,10 +213,10 @@ enum userspace_layers { #define BB_SND MU_ON #ifdef TAP_DANCE_ENABLE #define MU_TEMP TD(TD_AUDIO_TEMPO) -#else +#else // TAP_DANCE_ENABLE #define MU_TEMP KC_DOWN -#endif -#else +#endif // TAP_DANCE_ENABLE +#else // AUDIO_ENABLE #define MU_REC KC_NO #define MU_STOP KC_NO #define MU_PLAY KC_NO @@ -225,7 +225,7 @@ enum userspace_layers { #define MU_SLOW KC_NO #define MU_MASK KC_NO #define BB_SND KC_MUTE -#endif +#endif // AUDIO_ENABLE // Unicode keys #ifdef UNICODEMAP_ENABLE @@ -267,7 +267,7 @@ enum userspace_layers { #define BB_PLNK X(PLANCK_CON) #define BB_ANGS X(ANGSTROM) #define BB_BITC X(BITCOIN) -#else +#else // UNICODEMAP_ENABLE #define TR_ACIR KC_A #define TR_CCED KC_C #define TR_GBRE KC_G @@ -306,7 +306,7 @@ enum userspace_layers { #define BB_PLNK KC_NO #define BB_ANGS KC_NO #define BB_BITC KC_NO -#endif +#endif // UNICODEMAP_ENABLE // MOD-tap definitions #define GUI_A MT(MOD_LGUI, DV_A) diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 5118c33c693..8fbf761ce92 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -27,11 +27,11 @@ # undef LOCKING_RESYNC_ENABLE #endif #ifndef NO_DEBUG -#define NO_DEBUG +# define NO_DEBUG #endif #if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) -#define NO_PRINT +# define NO_PRINT #endif // Split transport settings @@ -44,11 +44,11 @@ # define SPLIT_LED_STATE_ENABLE # ifdef WPM_ENABLE # define SPLIT_WPM_ENABLE -# endif +# endif // WPM_ENABLE # ifdef OLED_ENABLE # define SPLIT_OLED_ENABLE -# endif -#endif +# endif // OLED_ENABLE +#endif // SPLIT_KEYBOARD // Unicode entry mode #ifdef UNICODEMAP_ENABLE @@ -58,12 +58,12 @@ # undef UNICODE_KEY_LNX # endif # define UNICODE_KEY_LNX LCTL(LSFT(KC_F)) -#endif +#endif // UNICODEMAP_ENABLE // Mousekey mode #ifdef MOUSEKEY_ENABLE # define MK_COMBINED -#endif +#endif // MOUSEKEY_ENABLE // Tap-hold settings #define TAPPING_TERM 200 @@ -76,7 +76,7 @@ #ifdef BACKLIGHT_ENABLE # define BACKLIGHT_BREATHING # define BREATHING_PERIOD 5 -#endif +#endif // BACKLIGHT_ENABLE // Audio definitions #ifdef AUDIO_ENABLE @@ -105,7 +105,7 @@ # else # define GAME_OFF_SONG SONG(NOCTURNE_OP_9_NO_1) # endif -#endif +#endif // AUDIO_ENABLE // OLED definitions #ifdef OLED_ENABLE @@ -114,7 +114,7 @@ // Fade out the screen when timing out # define OLED_FADE_OUT # define OLED_FADE_OUT_INTERVAL 5 -#endif +#endif // OLED_ENABLE // For perkey leds #ifdef RGB_MATRIX_ENABLE @@ -127,4 +127,4 @@ // Some config options # define RGB_MATRIX_KEYRELEASES # define RGB_MATRIX_FRAMEBUFFER_EFFECTS // Enable framebuffer effects -#endif +#endif // RGB_MATRIX_ENABLE From b66d12f3ac748d63ec25107df34ed90f260609d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sun, 19 Sep 2021 12:22:31 -0400 Subject: [PATCH 84/94] Applied changes suggested by @fauxpark --- .../keymaps/bbaserdem/{README.md => readme.md} | 4 ++-- .../bbaserdem/{README.md => readme.md} | 4 ++-- .../bbaserdem/{README.md => readme.md} | 4 ++-- .../community/split_3x5_3/bbaserdem/README.md | 18 ------------------ .../community/split_3x5_3/bbaserdem/readme.md | 18 ++++++++++++++++++ .../bbaserdem/{README.md => readme.md} | 4 ++-- users/bbaserdem/bb-macro.c | 6 ++++-- users/bbaserdem/bb-rgb.h | 2 +- users/bbaserdem/{README.md => readme.md} | 0 users/bbaserdem/rules.mk | 2 -- 10 files changed, 31 insertions(+), 31 deletions(-) rename keyboards/splitkb/kyria/keymaps/bbaserdem/{README.md => readme.md} (84%) rename layouts/community/ortho_3x10/bbaserdem/{README.md => readme.md} (74%) rename layouts/community/ortho_4x12/bbaserdem/{README.md => readme.md} (66%) delete mode 100644 layouts/community/split_3x5_3/bbaserdem/README.md create mode 100644 layouts/community/split_3x5_3/bbaserdem/readme.md rename layouts/community/split_3x6_3/bbaserdem/{README.md => readme.md} (71%) rename users/bbaserdem/{README.md => readme.md} (100%) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md b/keyboards/splitkb/kyria/keymaps/bbaserdem/readme.md similarity index 84% rename from keyboards/splitkb/kyria/keymaps/bbaserdem/README.md rename to keyboards/splitkb/kyria/keymaps/bbaserdem/readme.md index e68d053a092..6381612978c 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/README.md +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/readme.md @@ -1,5 +1,5 @@ -This file contains my Kyria board layout. -Check out the [user readme](../../../../../users/bbaserdem/README.md) for more info. +This folder contains my Kyria (`split_3x6_5`) board layout. +Check out the [user readme](../../../../../users/bbaserdem/readme.md) for more info. # Kyria diff --git a/layouts/community/ortho_3x10/bbaserdem/README.md b/layouts/community/ortho_3x10/bbaserdem/readme.md similarity index 74% rename from layouts/community/ortho_3x10/bbaserdem/README.md rename to layouts/community/ortho_3x10/bbaserdem/readme.md index 05749e81927..3681eb840a9 100644 --- a/layouts/community/ortho_3x10/bbaserdem/README.md +++ b/layouts/community/ortho_3x10/bbaserdem/readme.md @@ -1,5 +1,5 @@ -This file contains my [3x10 ortho](../../../default/ortho_3x10) board layouts -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. +This folder contains my [3x10\_ortho](../../../default/ortho_3x10) board layouts +Check out the [user readme](../../../../users/bbaserdem/readme.md) for more info. # Gherkin diff --git a/layouts/community/ortho_4x12/bbaserdem/README.md b/layouts/community/ortho_4x12/bbaserdem/readme.md similarity index 66% rename from layouts/community/ortho_4x12/bbaserdem/README.md rename to layouts/community/ortho_4x12/bbaserdem/readme.md index 992da3b58bd..5eb6548574e 100644 --- a/layouts/community/ortho_4x12/bbaserdem/README.md +++ b/layouts/community/ortho_4x12/bbaserdem/readme.md @@ -1,5 +1,5 @@ -This file contains my [4x12 ortho](../../../default/ortho_4x12) board layouts -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. +This folder contains my [4x12\_ortho](../../../default/ortho_4x12) board layouts +Check out the [user readme](../../../../users/bbaserdem/readme.md) for more info. # Planck Light diff --git a/layouts/community/split_3x5_3/bbaserdem/README.md b/layouts/community/split_3x5_3/bbaserdem/README.md deleted file mode 100644 index f32f72feb5f..00000000000 --- a/layouts/community/split_3x5_3/bbaserdem/README.md +++ /dev/null @@ -1,18 +0,0 @@ -This file contains my [split 3x10 + 3](../../../default/split_3x10_3) board layouts -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. - -# Crkbd - -Using a no 6th column crkbd (rev 2.1 choc) as a mobile keyboard. - -This version uses ProMicro as controllers; can't have OLED and RGB at the same time. - -## Build - -Used to flash Pro Micro explicitly using the following line; - -``` -sudo avrdude -p atmgea34u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.build/.hex -``` - -But it does not work anymore in Archlinux. diff --git a/layouts/community/split_3x5_3/bbaserdem/readme.md b/layouts/community/split_3x5_3/bbaserdem/readme.md new file mode 100644 index 00000000000..30cacd85eaa --- /dev/null +++ b/layouts/community/split_3x5_3/bbaserdem/readme.md @@ -0,0 +1,18 @@ +This folder contains my [split\_3x5\_3](../../../default/split_3x5_3) board layouts +Check out the [user readme](../../../../users/bbaserdem/readme.md) for more info. + +# Crkbd + +Using a no 6th column crkbd (rev 2.1 choc) as a mobile keyboard. + +This version uses ProMicro as controllers; can't have OLED and RGB at the same time. + +## Build + +QMK cli commands no longer works with Archlinux (2021 Sep.) on my PC for flashing promicro. +In the past; I used to flash Pro Micro explicitly using the following line, for referance. + +``` +sudo avrdude -p atmgea34u4 -P "$(ls /dev/ttyACM*)" -c avr109 -D -U flash:w:.hex +``` + diff --git a/layouts/community/split_3x6_3/bbaserdem/README.md b/layouts/community/split_3x6_3/bbaserdem/readme.md similarity index 71% rename from layouts/community/split_3x6_3/bbaserdem/README.md rename to layouts/community/split_3x6_3/bbaserdem/readme.md index 6d0cda270ad..c3dea2882f2 100644 --- a/layouts/community/split_3x6_3/bbaserdem/README.md +++ b/layouts/community/split_3x6_3/bbaserdem/readme.md @@ -1,5 +1,5 @@ -This file contains my [split 3x6 + 3](../../../default/split_3x6_3) board layouts -Check out the [user readme](../../../../users/bbaserdem/README.md) for more info. +This folder contains my [split\_3x6\_3](../../../default/split_3x6_3) board layouts +Check out the [user readme](../../../../users/bbaserdem/readme.md) for more info. # Crkbd diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index e27874b1ff9..4c461ab90a4 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -141,13 +141,15 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { case BB_LENY: // Lenny face: ( ͡° ͜ʖ ͡°) if (record->event.pressed) { - send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029"); + //send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029"); + send_unicode_string("( ͡° ͜ʖ ͡°)"); } return false; break; case BB_TABL: // Table flip: ┻━┻︵ \(°□°)/ ︵ ┻━┻ if (record->event.pressed) { - send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); + // send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); + send_unicode_string("┻━┻︵ \\(°□°)/ ︵ ┻━┻"); } return false; break; # endif // UNICODEMAP_ENABLE diff --git a/users/bbaserdem/bb-rgb.h b/users/bbaserdem/bb-rgb.h index 03713ca8e5d..62b6da9f2f2 100644 --- a/users/bbaserdem/bb-rgb.h +++ b/users/bbaserdem/bb-rgb.h @@ -23,6 +23,6 @@ // For custom indicators void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); // Hook into shutdown code -void shutdown_rgm(void); +void shutdown_rgb(void); void suspend_wakeup_init_rgb(void); void suspend_power_down_rgb(void); diff --git a/users/bbaserdem/README.md b/users/bbaserdem/readme.md similarity index 100% rename from users/bbaserdem/README.md rename to users/bbaserdem/readme.md diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index cdf065df6fb..a51e8c17216 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -33,8 +33,6 @@ UNICODE_ENABLE = no # We use unicodemap, not unicode UCIS_ENABLE = no # We use unicodemap, not ucis FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables -API_SYSEX_ENABLE = no # Allows OS to send signals. -BLUETOOTH_ENABLE = no # For bluetooth KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance From c1189961e05e6fe63a4c33a46debd31e815dc20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sun, 19 Sep 2021 12:25:17 -0400 Subject: [PATCH 85/94] Finalized changes. --- users/bbaserdem/bb-macro.c | 2 -- users/bbaserdem/rules.mk | 2 -- 2 files changed, 4 deletions(-) diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 4c461ab90a4..a84a7bbc219 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -141,14 +141,12 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { case BB_LENY: // Lenny face: ( ͡° ͜ʖ ͡°) if (record->event.pressed) { - //send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029"); send_unicode_string("( ͡° ͜ʖ ͡°)"); } return false; break; case BB_TABL: // Table flip: ┻━┻︵ \(°□°)/ ︵ ┻━┻ if (record->event.pressed) { - // send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); send_unicode_string("┻━┻︵ \\(°□°)/ ︵ ┻━┻"); } return false; break; diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index a51e8c17216..e30c77051ed 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -15,7 +15,6 @@ # along with this program. If not, see . # Common compilation flags -EXTRAFLAGS += -flto # Used to make code smaller LTO_ENABLE = yes # These should be enabled in all boards @@ -31,7 +30,6 @@ SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. MIDI_ENABLE = no # Midi driver (untested) UNICODE_ENABLE = no # We use unicodemap, not unicode UCIS_ENABLE = no # We use unicodemap, not ucis -FAUXCLICKY_ENABLE = no # Emulates clicks using speaker, who would want this? VARIABLE_TRACE = no # Allows debugging variables KEY_LOCK_ENABLE = no # Allows locking any key. Not used in general RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead From daa678b20ab08739a4330f6f53b7c093277c5a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sun, 19 Sep 2021 15:38:55 -0400 Subject: [PATCH 86/94] EEconfig implementation --- users/bbaserdem/bb-encoder.c | 153 ++++++++++++++++++++++++++++------- users/bbaserdem/bb-macro.c | 2 + users/bbaserdem/bbaserdem.h | 22 ++++- 3 files changed, 146 insertions(+), 31 deletions(-) diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index fa96e8d4256..92d7d60f0fb 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -36,12 +36,12 @@ // Default state for the encoders void reset_encoder_state(void) { -// for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { - for (int i = 0; i < 2; i++) { - userspace_config.encoder[i].base = i; - userspace_config.encoder[i].rgb = i; - userspace_config.encoder[i].point = i; - } + userspace_config.e0base = 0; + userspace_config.e0point = 0; + userspace_config.e0rgb = 0; + userspace_config.e1base = 1; + userspace_config.e1point = 1; + userspace_config.e1rgb = 1; } // Initialize the encoder state beginning @@ -51,11 +51,20 @@ void keyboard_post_init_encoder(void) { // Encoder scroll functionality bool encoder_update_user(uint8_t index, bool clockwise) { + uint8_t this_number; // Differentiate layer roles switch (get_highest_layer(layer_state)) { # ifdef RGB_MATRIX_ENABLE case _MEDI: - switch(userspace_config.encoder[index].rgb) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0rgb; + } else if (index == 1) { + this_number = userspace_config.e1rgb; + } else { + this_number = 128; + } + switch(this_number) { case 0: // Effect the RGB mode if (clockwise) { rgb_matrix_step_noeeprom(); @@ -96,7 +105,15 @@ bool encoder_update_user(uint8_t index, bool clockwise) { # endif // RGB_MATRIX_ENABLE # ifdef MOUSEKEY_ENABLE case _MOUS: - switch(userspace_config.encoder[index].point) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0point; + } else if (index == 1) { + this_number = userspace_config.e1point; + } else { + this_number = 128; + } + switch(this_number) { case 0: // Move mouse on horizontal axis if (clockwise) { tap_code(KC_MS_R); @@ -129,7 +146,15 @@ bool encoder_update_user(uint8_t index, bool clockwise) { break; # endif // MOUSEKEY_ENABLE default: - switch(userspace_config.encoder[index].base) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0base; + } else if (index == 1) { + this_number = userspace_config.e1base; + } else { + this_number = 128; + } + switch(this_number) { case 0: // Volume if (clockwise) { tap_code16(KC_VOLU); @@ -200,11 +225,20 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } void encoder_click_action(uint8_t index) { + uint8_t this_number; // Differentiate layer roles switch (get_highest_layer(layer_state)) { # ifdef RGB_MATRIX_ENABLE case _MEDI: - switch(userspace_config.encoder[index].rgb) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0rgb; + } else if (index == 1) { + this_number = userspace_config.e1rgb; + } else { + this_number = 128; + } + switch(this_number) { case 0: // Return to no animation rgb_matrix_mode_noeeprom(RGB_MATRIX_SOLID_COLOR); break; @@ -223,7 +257,15 @@ void encoder_click_action(uint8_t index) { # endif // RGB_MATRIX_ENABLE # ifdef MOUSEKEY_ENABLE case _MOUS: - switch(userspace_config.encoder[index].point) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0point; + } else if (index == 1) { + this_number = userspace_config.e1point; + } else { + this_number = 128; + } + switch(this_number) { case 0: // Left click tap_code16(KC_BTN1); break; @@ -238,7 +280,15 @@ void encoder_click_action(uint8_t index) { break; # endif // MOUSEKEY_ENABLE default: - switch(userspace_config.encoder[index].base) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0base; + } else if (index == 1) { + this_number = userspace_config.e1base; + } else { + this_number = 128; + } + switch(this_number) { case 0: // Toggle mute case 2: tap_code16(KC_MUTE); @@ -270,6 +320,7 @@ void encoder_click_action(uint8_t index) { bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // Check if and which encoder int encoder_index = -1; + switch (keycode) { case BB_ENC0: encoder_index = 0; @@ -285,44 +336,67 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { switch (get_highest_layer(layer_state)) { # ifdef RGB_MATRIX_ENABLE case _MEDI: - userspace_config.encoder[encoder_index].rgb = - (userspace_config.encoder[encoder_index].rgb + 1) % 5; + if (encoder_index == 0) { + userspace_config.e0rgb = (userspace_config.e0rgb + 1) % 5; + } else { + userspace_config.e1rgb = (userspace_config.e1rgb + 1) % 5; + } break; # endif // RGB_MATRIX_ENABLE # ifdef MOUSEKEY_ENABLE case _MOUS: - userspace_config.encoder[encoder_index].point = - (userspace_config.encoder[encoder_index].point + 1) % 4; + if (encoder_index == 0) { + userspace_config.e0point = (userspace_config.e0point + 1) % 4; + } else { + userspace_config.e1point = (userspace_config.e1point + 1) % 4; + } break; # endif // MOUSEKEY_ENABLE default: - userspace_config.encoder[encoder_index].base = - (userspace_config.encoder[encoder_index].base + 1) % 9; + if (encoder_index == 0) { + userspace_config.e0base = (userspace_config.e0base + 1) % 9; + } else { + userspace_config.e1base = (userspace_config.e1base + 1) % 9; + } break; } + // Write the change to EEPROM + eeconfig_update_user(userspace_config.raw); // If ctrl is active, move mode one point backwards } else if (get_mods() & MOD_MASK_CTRL) { switch (get_highest_layer(layer_state)) { # ifdef RGB_MATRIX_ENABLE case _MEDI: - userspace_config.encoder[encoder_index].rgb = - (userspace_config.encoder[encoder_index].rgb + 5 - 1) % 5; + if (encoder_index == 0) { + userspace_config.e0rgb = (userspace_config.e0rgb + 5 - 1) % 5; + } else { + userspace_config.e1rgb = (userspace_config.e1rgb + 5 - 1) % 5; + } break; # endif // RGB_MATRIX_ENABLE # ifdef MOUSEKEY_ENABLE case _MOUS: - userspace_config.encoder[encoder_index].point = - (userspace_config.encoder[encoder_index].point + 4 - 1) % 4; + if (encoder_index == 0) { + userspace_config.e0point = (userspace_config.e0point + 4 - 1) % 4; + } else { + userspace_config.e1point = (userspace_config.e1point + 4 - 1) % 4; + } break; # endif // MOUSEKEY_ENABLE default: - userspace_config.encoder[encoder_index].base = - (userspace_config.encoder[encoder_index].base + 9 - 1) % 9; + if (encoder_index == 0) { + userspace_config.e0base = (userspace_config.e0base + 9 - 1) % 9; + } else { + userspace_config.e1base = (userspace_config.e1base + 9 - 1) % 9; + } break; } + // Write the change to EEPROM + eeconfig_update_user(userspace_config.raw); // If meta is active, reset the encoder states } else if (get_mods() & MOD_MASK_GUI) { reset_encoder_state(); + eeconfig_update_user(userspace_config.raw); // If nothing else; just perform the click action } else { encoder_click_action(encoder_index); @@ -334,12 +408,21 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // For printing status to OLED #ifdef OLED_ENABLE void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { + uint8_t this_number; // Get the layer straight from the main function switch (layer) { // If RGB control mode is enabled # ifdef RGB_MATRIX_ENABLE case _MEDI: - switch (userspace_config.encoder[index].rgb) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0rgb; + } else if (index == 1) { + this_number = userspace_config.e1rgb; + } else { + this_number = 128; + } + switch (this_number) { case 0: strcpy(buffer, "ani mode"); break; @@ -364,7 +447,15 @@ void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { // If pointer control is enabled # ifdef MOUSEKEY_ENABLE case _MOUS: - switch (userspace_config.encoder[index].point) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0point; + } else if (index == 1) { + this_number = userspace_config.e1point; + } else { + this_number = 128; + } + switch (this_number) { case 0: strcpy(buffer, "Lateral "); break; @@ -384,7 +475,15 @@ void encoder_state_string(uint8_t index, uint8_t layer, char* buffer) { break; # endif // MOUSEKEY_ENABLE default: - switch (userspace_config.encoder[index].base) { + // Get correct index + if (index == 0) { + this_number = userspace_config.e0base; + } else if (index == 1) { + this_number = userspace_config.e1base; + } else { + this_number = 128; + } + switch (this_number) { case 0: strcpy(buffer, "Volume "); break; diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index a84a7bbc219..53a7438a196 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -84,6 +84,7 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { if (get_mods() & MOD_BIT(KC_RALT)) { userspace_config.layout = (userspace_config.layout + 1) % 3; + eeconfig_update_user(userspace_config.raw); } } return true; @@ -96,6 +97,7 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { } else { userspace_config.layout = (userspace_config.layout + 1) % 3; } + eeconfig_update_user(userspace_config.raw); } return false; break; diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index bc955193798..81fba74967b 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -14,7 +14,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - #pragma once #include QMK_KEYBOARD_H #include "quantum.h" @@ -54,12 +53,13 @@ #endif // OLED_ENABLE // Structure to keep runtime info on encoder state +/* typedef union { uint16_t raw; struct { - uint8_t base :4; // (9) The encoder state on most layers; regular function - uint8_t rgb :4; // (5) The encoder state on media layer; controls light - uint8_t point :4; // (4) The encoder state on mouse layer; moves pointer + uint8_t base :4; // (9:4) The encoder state on most layers; regular function + uint8_t rgb :4; // (5:3) The encoder state on media layer; controls light + uint8_t point :4; // (4:2) The encoder state on mouse layer; moves pointer uint8_t :4; // Padding }; } encoder_state_t; @@ -72,6 +72,20 @@ typedef union { uint8_t layout; }; } userspace_config_t; +*/ +typedef union { + uint32_t raw; + struct { + uint8_t e0base :4; // ( 4:0) The encoder state on most layers; regular function + uint8_t e1base :4; // ( 8:1) 9 states for this; 4 bits + uint8_t e0point :2; // (10:1) The encoder state on mouse layer; moves pointer + uint8_t e1point :2; // (12:1) 4 states for this; 2 bits + uint8_t e0rgb :4; // (16:2) The encoder state on media layer; controls light + uint8_t e1rgb :4; // (20:2) 5 states for this; 3 bits but 4 is better + uint8_t layout :2; // (22:2) Stores keymap layout; 3 states is good on 2 bits + uint16_t :10; // (32:3) Padding here + }; +} userspace_config_t; // Broadcast us to everyone else extern userspace_config_t userspace_config; From f1c8b1be056865985dbd1c0fcc9213a5068a02a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sun, 19 Sep 2021 17:54:59 -0400 Subject: [PATCH 87/94] Trying eeprom --- users/bbaserdem/bb-encoder.c | 11 +++++++++-- users/bbaserdem/bb-macro.c | 2 ++ users/bbaserdem/bbaserdem.c | 27 ++++++++++++--------------- users/bbaserdem/bbaserdem.h | 2 -- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index 92d7d60f0fb..e0fbbcd143b 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -320,7 +320,9 @@ void encoder_click_action(uint8_t index) { bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // Check if and which encoder int encoder_index = -1; + bool write_to_eeprom = true; + // Get the pressed encoder switch (keycode) { case BB_ENC0: encoder_index = 0; @@ -329,6 +331,7 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { encoder_index = 1; break; } + // Activate encoder function of button if ((encoder_index >= 0) & (!record->event.pressed)) { // If shifted, move mode one point forward @@ -391,8 +394,6 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { } break; } - // Write the change to EEPROM - eeconfig_update_user(userspace_config.raw); // If meta is active, reset the encoder states } else if (get_mods() & MOD_MASK_GUI) { reset_encoder_state(); @@ -400,6 +401,12 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // If nothing else; just perform the click action } else { encoder_click_action(encoder_index); + write_to_eeprom = false; + } + + // Write the change to EEPROM + if (write_to_eeprom) { + eeconfig_update_user(userspace_config.raw); } } return true; diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 53a7438a196..9724117447d 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -84,6 +84,7 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { if (get_mods() & MOD_BIT(KC_RALT)) { userspace_config.layout = (userspace_config.layout + 1) % 3; + // Update EEPROM after change eeconfig_update_user(userspace_config.raw); } } @@ -97,6 +98,7 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { } else { userspace_config.layout = (userspace_config.layout + 1) % 3; } + // Update EEPROM after change eeconfig_update_user(userspace_config.raw); } return false; diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index fdd58a8ed98..3117d1e49eb 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -50,8 +50,9 @@ void userspace_config_transport_update(void) { // If we are the main device; we want to send info. transport_userspace_config.raw = userspace_config.raw; } else { - // If we are the secondary device; we want to receive info. + // If we are the secondary device; we want to receive info, and save to eeprom. userspace_config.raw = transport_userspace_config.raw; + eeconfig_update_user(userspace_config.raw); } } @@ -60,7 +61,6 @@ void userspace_config_transport_sync(void) { if (is_keyboard_master()) { // Keep track of the last state static userspace_config_t last_userspace_config; - static uint32_t last_sync; bool needs_sync = false; // Check if the state values are different @@ -69,16 +69,9 @@ void userspace_config_transport_sync(void) { memcpy(&last_userspace_config, &transport_userspace_config, sizeof(transport_userspace_config)); } - // Send to secondary every 500ms regardless of state change - if (timer_elapsed32(last_sync) > 500) { - needs_sync = true; - } - // Perform the sync if requested if (needs_sync) { - if (transaction_rpc_send(RPC_ID_USERSPACE_SYNC, sizeof(transport_userspace_config), &transport_userspace_config)) { - last_sync = timer_read32(); - } + transaction_rpc_send(RPC_ID_USERSPACE_SYNC, sizeof(transport_userspace_config), &transport_userspace_config); needs_sync = false; } } @@ -121,7 +114,7 @@ __attribute__ ((weak)) void keyboard_post_init_user(void) { // set_single_persistent_default_layer(_BASE); // Initialize userspace config - userspace_config.layout = 0; + userspace_config.raw = eeconfig_read_user(); // Split keyboard halves communication # ifdef SPLIT_KEYBOARD @@ -171,12 +164,16 @@ void housekeeping_task_user(void) { /*-----------------------*\ |*-----EECONFIG INIT-----*| \*-----------------------*/ -/* Default values to send to the eeprom on boot. +/* Default values to send to the eeprom */ -__attribute__ ((weak)) void eeconfig_init_keymap(void) {} void eeconfig_init_user(void) { - // Hook to keymap code - eeconfig_init_keymap(); + // Set everything to default + userspace_config.raw = 0; + // Set encoder states to sane defaults if enabled +# ifdef ENCODER_ENABLE + reset_encoder_state(); +# endif // ENCODER_ENABLE + eeconfig_update_user(userspace_config.raw); } /*------------------------*\ diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 81fba74967b..99d171b5388 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -97,8 +97,6 @@ void keyboard_pre_init_keymap(void); void matrix_init_keymap(void); // For code that launches after initialization is finished. void keyboard_post_init_keymap(void); -// This code also launches on boot; but used after eeprom is available to write -void eeconfig_init_keymap(void); // These will be delegated to keymap specific stuff (weak definition) bool process_record_keymap(uint16_t keycode, keyrecord_t *record); // This code runs on every tick From 5a0c7c585e85d53f6bc0631c07f77f1001f85722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Sun, 19 Sep 2021 18:46:02 -0400 Subject: [PATCH 88/94] Fixed eeprom shenanigans a bit. --- users/bbaserdem/bb-encoder.c | 14 -------------- users/bbaserdem/bb-encoder.h | 2 -- users/bbaserdem/bb-macro.c | 4 ---- users/bbaserdem/bbaserdem.c | 20 +++++++++++++------- users/bbaserdem/bbaserdem.h | 2 +- users/bbaserdem/config.h | 3 +++ 6 files changed, 17 insertions(+), 28 deletions(-) diff --git a/users/bbaserdem/bb-encoder.c b/users/bbaserdem/bb-encoder.c index e0fbbcd143b..eea9751051a 100644 --- a/users/bbaserdem/bb-encoder.c +++ b/users/bbaserdem/bb-encoder.c @@ -44,11 +44,6 @@ void reset_encoder_state(void) { userspace_config.e1rgb = 1; } -// Initialize the encoder state beginning -void keyboard_post_init_encoder(void) { - reset_encoder_state(); -} - // Encoder scroll functionality bool encoder_update_user(uint8_t index, bool clockwise) { uint8_t this_number; @@ -320,7 +315,6 @@ void encoder_click_action(uint8_t index) { bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // Check if and which encoder int encoder_index = -1; - bool write_to_eeprom = true; // Get the pressed encoder switch (keycode) { @@ -363,8 +357,6 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { } break; } - // Write the change to EEPROM - eeconfig_update_user(userspace_config.raw); // If ctrl is active, move mode one point backwards } else if (get_mods() & MOD_MASK_CTRL) { switch (get_highest_layer(layer_state)) { @@ -401,12 +393,6 @@ bool process_record_encoder(uint16_t keycode, keyrecord_t *record) { // If nothing else; just perform the click action } else { encoder_click_action(encoder_index); - write_to_eeprom = false; - } - - // Write the change to EEPROM - if (write_to_eeprom) { - eeconfig_update_user(userspace_config.raw); } } return true; diff --git a/users/bbaserdem/bb-encoder.h b/users/bbaserdem/bb-encoder.h index 5c4db5ed7ee..dce08cd3d58 100644 --- a/users/bbaserdem/bb-encoder.h +++ b/users/bbaserdem/bb-encoder.h @@ -21,8 +21,6 @@ bool encoder_update_user(uint8_t index, bool clockwise); // Complicated code for what the encoder keys do when pressed bool process_record_encoder(uint16_t keycode, keyrecord_t *record); -// Initializing the encoder array -void keyboard_post_init_encoder(void); // Clear the encoder settings void reset_encoder_state(void); // This is so that encoder state is synched between two halves diff --git a/users/bbaserdem/bb-macro.c b/users/bbaserdem/bb-macro.c index 9724117447d..a84a7bbc219 100644 --- a/users/bbaserdem/bb-macro.c +++ b/users/bbaserdem/bb-macro.c @@ -84,8 +84,6 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { if (get_mods() & MOD_BIT(KC_RALT)) { userspace_config.layout = (userspace_config.layout + 1) % 3; - // Update EEPROM after change - eeconfig_update_user(userspace_config.raw); } } return true; @@ -98,8 +96,6 @@ bool process_record_macro(uint16_t keycode, keyrecord_t *record) { } else { userspace_config.layout = (userspace_config.layout + 1) % 3; } - // Update EEPROM after change - eeconfig_update_user(userspace_config.raw); } return false; break; diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 3117d1e49eb..4046fa9deab 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -52,7 +52,6 @@ void userspace_config_transport_update(void) { } else { // If we are the secondary device; we want to receive info, and save to eeprom. userspace_config.raw = transport_userspace_config.raw; - eeconfig_update_user(userspace_config.raw); } } @@ -131,11 +130,6 @@ __attribute__ ((weak)) void keyboard_post_init_user(void) { keyboard_post_init_underglow(); # endif // RGBLIGHT_ENABLE - // Encoders -# ifdef ENCODER_ENABLE - keyboard_post_init_encoder(); -# endif // ENCODER_ENABLE - // Unicode mode # ifdef UNICODEMAP_ENABLE set_unicode_input_mode(UC_LNX); @@ -152,11 +146,24 @@ __attribute__ ((weak)) void keyboard_post_init_user(void) { */ __attribute__ ((weak)) void housekeeping_task_keymap(void) {} void housekeeping_task_user(void) { + // Check eeprom every now and then + static userspace_config_t prev_userspace_config; + static fast_timer_t throttle_timer = 0; + # ifdef SPLIT_KEYBOARD userspace_config_transport_update(); userspace_config_transport_sync(); # endif // SPLIT_KEYBOARD + // Throttled task + if (timer_elapsed_fast(throttle_timer) >= EEPROM_CHECK_INTERVAL_MS) { + throttle_timer = timer_read_fast(); + if (prev_userspace_config.raw != userspace_config.raw) { + eeconfig_update_user(userspace_config.raw); + prev_userspace_config.raw = userspace_config.raw; + } + } + // Hook to keymap code housekeeping_task_keymap(); } @@ -173,7 +180,6 @@ void eeconfig_init_user(void) { # ifdef ENCODER_ENABLE reset_encoder_state(); # endif // ENCODER_ENABLE - eeconfig_update_user(userspace_config.raw); } /*------------------------*\ diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index 99d171b5388..b624cf10631 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -83,7 +83,7 @@ typedef union { uint8_t e0rgb :4; // (16:2) The encoder state on media layer; controls light uint8_t e1rgb :4; // (20:2) 5 states for this; 3 bits but 4 is better uint8_t layout :2; // (22:2) Stores keymap layout; 3 states is good on 2 bits - uint16_t :10; // (32:3) Padding here + uint16_t :10; // (32:3) Padding here, free space for 10 more bits }; } userspace_config_t; diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 8fbf761ce92..08e80cccf50 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -34,6 +34,9 @@ # define NO_PRINT #endif +// Some of my own settings +# define EEPROM_CHECK_INTERVAL_MS 250 + // Split transport settings #ifdef SPLIT_KEYBOARD # define SPLIT_TRANSPORT_MIRROR From 7393d2f89c9c34b4c06123f17b1e96a09d1a9fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 20 Sep 2021 20:49:28 -0400 Subject: [PATCH 89/94] Implemented a buggy feature (oled split sleep) on userspace. --- users/bbaserdem/bb-oled.c | 18 ++++++++++-- users/bbaserdem/bb-oled.h | 2 ++ users/bbaserdem/bbaserdem.c | 55 +++++++++++++++++++++++++++++++------ users/bbaserdem/bbaserdem.h | 22 ++++----------- users/bbaserdem/config.h | 9 +++--- users/bbaserdem/rules.mk | 6 ++-- 6 files changed, 76 insertions(+), 36 deletions(-) diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 4661cfc2a51..3a2ce343daf 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -31,8 +31,22 @@ __attribute__ ((weak)) bool oled_task_keymap(void) {return true;} // Do sane defaults for regular oled rendering void oled_task_user(void) { - if (oled_task_keymap()) { - render_status_lite(0, 0); + if (is_oled_on()) { + if (oled_task_keymap()) { + render_status_lite(0, 0); + } + } +} + +// Make sure oled sleeps timely +void housekeeping_task_oled(void) { + // If we are not master; sync the oled state + if (!is_keyboard_master()) { + if ((userspace_runtime.oled_on) && (!is_oled_on())) { + oled_on(); + } else if ((!userspace_runtime.oled_on) && (is_oled_on())) { + oled_off(); + } } } diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index a355c88ca91..ed4feecdce7 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -19,6 +19,8 @@ // Contain the main oled writer here void oled_task_user(void); +// Function to keep in housekeeping +void housekeeping_task_oled(void); // Some generic rendering functions void render_qmk_logo(uint8_t row, uint8_t col); void render_layer(uint8_t row, uint8_t col, uint8_t top_layer); diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 4046fa9deab..3bd5b8ef789 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -28,12 +28,14 @@ |*-----KEYBOARD CONFIG-----*| \*-------------------------*/ userspace_config_t userspace_config; +userspace_runtime_t userspace_runtime; /*---------------------------------*\ |*----SPLIT KEYBOARD TRANSPORT-----*| \*---------------------------------*/ #ifdef SPLIT_KEYBOARD userspace_config_t transport_userspace_config; +userspace_runtime_t transport_userspace_runtime; // Translate the RPC data to the local variable void userspace_config_sync(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { @@ -43,26 +45,38 @@ void userspace_config_sync(uint8_t in_buflen, const void* in_data, uint8_t out_b } // There is no data to send back; so no output handling } +void userspace_runtime_sync(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) { + // Copy incoming data to local variable + if (in_buflen == sizeof(transport_userspace_runtime)) { + memcpy(&transport_userspace_runtime, in_data, in_buflen); + } + // There is no data to send back; so no output handling +} // Either send or receive the correct data -void userspace_config_transport_update(void) { +void userspace_transport_update(void) { if (is_keyboard_master()) { // If we are the main device; we want to send info. transport_userspace_config.raw = userspace_config.raw; +# ifdef OLED_ENABLE + transport_userspace_runtime.oled_on = is_oled_on(); +# endif // OLED_ENABLE } else { // If we are the secondary device; we want to receive info, and save to eeprom. userspace_config.raw = transport_userspace_config.raw; + userspace_runtime.raw = transport_userspace_runtime.raw; } } // Initiate the protocol on sync -void userspace_config_transport_sync(void) { +void userspace_transport_sync(void) { if (is_keyboard_master()) { // Keep track of the last state static userspace_config_t last_userspace_config; + static userspace_runtime_t last_userspace_runtime; bool needs_sync = false; - // Check if the state values are different + // Check if the config values are different if (memcmp(&transport_userspace_config, &last_userspace_config, sizeof(transport_userspace_config))) { needs_sync = true; memcpy(&last_userspace_config, &transport_userspace_config, sizeof(transport_userspace_config)); @@ -70,7 +84,19 @@ void userspace_config_transport_sync(void) { // Perform the sync if requested if (needs_sync) { - transaction_rpc_send(RPC_ID_USERSPACE_SYNC, sizeof(transport_userspace_config), &transport_userspace_config); + transaction_rpc_send(RPC_ID_CONFIG_SYNC, sizeof(transport_userspace_config), &transport_userspace_config); + needs_sync = false; + } + + // Check if the runtime values are different + if (memcmp(&transport_userspace_runtime, &last_userspace_runtime, sizeof(transport_userspace_runtime))) { + needs_sync = true; + memcpy(&last_userspace_runtime, &transport_userspace_runtime, sizeof(transport_userspace_runtime)); + } + + // Perform the sync if requested + if (needs_sync) { + transaction_rpc_send(RPC_ID_RUNTIME_SYNC, sizeof(transport_userspace_runtime), &transport_userspace_runtime); needs_sync = false; } } @@ -117,7 +143,8 @@ __attribute__ ((weak)) void keyboard_post_init_user(void) { // Split keyboard halves communication # ifdef SPLIT_KEYBOARD - transaction_register_rpc(RPC_ID_USERSPACE_SYNC, userspace_config_sync); + transaction_register_rpc( RPC_ID_CONFIG_SYNC, userspace_config_sync ); + transaction_register_rpc(RPC_ID_RUNTIME_SYNC, userspace_runtime_sync); # endif // SPLIT_KEYBOARD // Backlight LED @@ -148,20 +175,30 @@ __attribute__ ((weak)) void housekeeping_task_keymap(void) {} void housekeeping_task_user(void) { // Check eeprom every now and then static userspace_config_t prev_userspace_config; + static userspace_runtime_t prev_userspace_runtime; static fast_timer_t throttle_timer = 0; + // Do transport stuff # ifdef SPLIT_KEYBOARD - userspace_config_transport_update(); - userspace_config_transport_sync(); + userspace_transport_update(); + userspace_transport_sync(); # endif // SPLIT_KEYBOARD - // Throttled task - if (timer_elapsed_fast(throttle_timer) >= EEPROM_CHECK_INTERVAL_MS) { + // Throttled tasks + if (timer_elapsed_fast(throttle_timer) >= HOUSEKEEPING_THROTTLE_INTERVAL_MS) { + // Refresh timer throttle_timer = timer_read_fast(); + // Check userspace config for eeprom updates if (prev_userspace_config.raw != userspace_config.raw) { eeconfig_update_user(userspace_config.raw); prev_userspace_config.raw = userspace_config.raw; } + // Check runtime config for updates + if (prev_userspace_runtime.raw != userspace_runtime.raw) { +# ifdef OLED_ENABLE + housekeeping_task_oled(); +# endif // OLED_ENABLE + } } // Hook to keymap code diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index b624cf10631..d61d3e2bcc5 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -53,26 +53,13 @@ #endif // OLED_ENABLE // Structure to keep runtime info on encoder state -/* typedef union { - uint16_t raw; + uint32_t raw; struct { - uint8_t base :4; // (9:4) The encoder state on most layers; regular function - uint8_t rgb :4; // (5:3) The encoder state on media layer; controls light - uint8_t point :4; // (4:2) The encoder state on mouse layer; moves pointer - uint8_t :4; // Padding + bool oled_on; }; -} encoder_state_t; +} userspace_runtime_t; -// Structure to contain userspace config in total -typedef union { - uint64_t raw; - struct { - encoder_state_t encoder[2]; - uint8_t layout; - }; -} userspace_config_t; -*/ typedef union { uint32_t raw; struct { @@ -88,7 +75,8 @@ typedef union { } userspace_config_t; // Broadcast us to everyone else -extern userspace_config_t userspace_config; +extern userspace_runtime_t userspace_runtime; +extern userspace_config_t userspace_config; // Function definitions that can be accessed through specific keymaps // Runs before all initialization diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 08e80cccf50..3697e8ee32a 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -35,15 +35,14 @@ #endif // Some of my own settings -# define EEPROM_CHECK_INTERVAL_MS 250 +# define HOUSEKEEPING_THROTTLE_INTERVAL_MS 250 // Split transport settings #ifdef SPLIT_KEYBOARD # define SPLIT_TRANSPORT_MIRROR # define SPLIT_LAYER_STATE_ENABLE -# define SPLIT_OLED_ENABLE # define SPLIT_MODS_ENABLE -# define SPLIT_TRANSACTION_IDS_USER RPC_ID_USERSPACE_SYNC, USER_SYNC_OLED, USER_SYNC_UNUSED +# define SPLIT_TRANSACTION_IDS_USER RPC_ID_CONFIG_SYNC, RPC_ID_RUNTIME_SYNC, RPC_ID_KEYMAP_SYNC # define SPLIT_LED_STATE_ENABLE # ifdef WPM_ENABLE # define SPLIT_WPM_ENABLE @@ -112,8 +111,8 @@ // OLED definitions #ifdef OLED_ENABLE - // Timeout in one minute -# define OLED_TIMEOUT 60000 + // Timeout does not work for split secondary board; i implemented it myself +# define OLED_TIMEOUT 30000 // Fade out the screen when timing out # define OLED_FADE_OUT # define OLED_FADE_OUT_INTERVAL 5 diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index e30c77051ed..8fe04807bcd 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -36,9 +36,9 @@ RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance # These features can be disabled at whim -NKRO_ENABLE ?= yes # Default is 6KRO -VELOCIKEY_ENABLE ?= yes # Speed effects change with typing speed -WPM_ENABLE = ?yes # Get WPM reports as you type +NKRO_ENABLE := yes # Default is 6KRO +VELOCIKEY_ENABLE = yes # Speed effects change with typing speed +WPM_ENABLE = yes # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 59470889a6025ad621fb20d62a16946cba4bc686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 20 Sep 2021 23:02:35 -0400 Subject: [PATCH 90/94] Fixed oled code to not have any dirty pixels --- users/bbaserdem/bb-oled.c | 33 ++++++++++++++------------------- users/bbaserdem/config.h | 2 +- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 3a2ce343daf..92be088de44 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -41,6 +41,7 @@ void oled_task_user(void) { // Make sure oled sleeps timely void housekeeping_task_oled(void) { // If we are not master; sync the oled state + /* if (!is_keyboard_master()) { if ((userspace_runtime.oled_on) && (!is_oled_on())) { oled_on(); @@ -48,6 +49,7 @@ void housekeeping_task_oled(void) { oled_off(); } } + */ } /*-------------------------*\ @@ -65,30 +67,30 @@ void render_qmk_logo(uint8_t row, uint8_t col) { } void render_layer(uint8_t row, uint8_t col, uint8_t top_layer) { - // Write the layer state + // Write the layer state; 17 chars oled_set_cursor(col, row); oled_write("Layer: ", false); switch (top_layer) { case _BASE: - oled_write("Default", false); + oled_write("Default ", false); break; case _CHAR: - oled_write("Sp. Chars", false); + oled_write("Sp. Chars ", false); break; case _GAME: - oled_write("Gaming", false); + oled_write("Gaming ", false); break; case _MEDI: - oled_write("Media Ctr", false); + oled_write("Media Ctr ", false); break; case _NAVI: oled_write("Navigation", false); break; case _SYMB: - oled_write("Symbols", false); + oled_write("Symbols ", false); break; case _NUMB: - oled_write("Numpad", false); + oled_write("Numpad ", false); break; case _FUNC: oled_write("Funct Keys", false); @@ -100,24 +102,22 @@ void render_layer(uint8_t row, uint8_t col, uint8_t top_layer) { oled_write("Music Mode", false); break; default: - oled_write("???", false); + oled_write("?? N/A ?? ", false); } - oled_advance_page(true); } void render_modifiers_lite(uint8_t row, uint8_t col, uint8_t mods) { - // Write the modifier state + // Write the modifier state, 16 characters oled_set_cursor(col, row); oled_write((mods & MOD_MASK_SHIFT ) ? "Shft " : " ", false); oled_write((mods & MOD_MASK_CTRL ) ? "Ctrl " : " ", false); oled_write((mods & MOD_MASK_ALT ) ? "Alt" : " ", false); oled_write((mods & MOD_BIT(KC_RALT)) ? "G " : " ", false); oled_write((mods & MOD_MASK_GUI ) ? "Meta " : " ", false); - oled_advance_page(true); } -// Renders the encoder state, 14 characters void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { + // Renders the encoder state, 14 characters oled_set_cursor(col, row); # ifdef ENCODER_ENABLE @@ -128,7 +128,6 @@ void render_encoder(uint8_t row, uint8_t col, uint8_t index, uint8_t layer) { # else // ENCODER_ENABLE oled_write("No enc. avail.", false); # endif // ENCODER_ENABLE - oled_advance_page(true); } void render_wpm(uint8_t row, uint8_t col) { @@ -143,12 +142,11 @@ void render_wpm(uint8_t row, uint8_t col) { # else // WPM_ENABLE oled_write("WPM: N/A", false); # endif // WPM_ENABLE - oled_advance_page(true); } // Writes the currently used OLED display layout void render_keymap(uint8_t row, uint8_t col, bool isLite) { - // Render the oled layout + // Render the oled layout; lite is 11, regular is 14 characters oled_set_cursor(col, row); if (isLite) { oled_write("KM: ", false); @@ -168,14 +166,13 @@ void render_keymap(uint8_t row, uint8_t col, bool isLite) { } if (isLite) { oled_write(" ", false); - } else { - oled_advance_page(true); } } // Writes the currently used OLED display layout #ifdef RGB_MATRIX_ENABLE void render_rgb_lite(uint8_t row, uint8_t col) { + // Writes the currently used OLED display layout, 19 characters static char rgb_temp4[4] = {0}; // Render the oled layout oled_set_cursor(col, row); @@ -191,7 +188,6 @@ void render_rgb_lite(uint8_t row, uint8_t col) { oled_write(" v", false); itoa(rgb_matrix_get_val(), rgb_temp4, 10); oled_write(rgb_temp4, false); - oled_advance_page(true); } #endif // RGB_MATRIX_ENABLE @@ -222,7 +218,6 @@ void render_status_lite(uint8_t row, uint8_t col) { render_wpm(row + 2, col + 11); // Line 4: Encoder states - oled_write("Encoder: ", false); # ifdef SPLIT_KEYBOARD if (is_keyboard_left()) { render_encoder(row + 3, col + 0, 0, this_layer); diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 3697e8ee32a..7af7b93cab6 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -115,7 +115,7 @@ # define OLED_TIMEOUT 30000 // Fade out the screen when timing out # define OLED_FADE_OUT -# define OLED_FADE_OUT_INTERVAL 5 +# define OLED_FADE_OUT_INTERVAL 15 #endif // OLED_ENABLE // For perkey leds From 3b6b50d517411a1507e5ecc4095815350560994c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 20 Sep 2021 23:05:25 -0400 Subject: [PATCH 91/94] Removed some bloat --- users/bbaserdem/bb-oled.c | 14 -------------- users/bbaserdem/bb-oled.h | 2 -- users/bbaserdem/bbaserdem.c | 10 +--------- users/bbaserdem/bbaserdem.h | 2 +- 4 files changed, 2 insertions(+), 26 deletions(-) diff --git a/users/bbaserdem/bb-oled.c b/users/bbaserdem/bb-oled.c index 92be088de44..cf00193c036 100644 --- a/users/bbaserdem/bb-oled.c +++ b/users/bbaserdem/bb-oled.c @@ -38,20 +38,6 @@ void oled_task_user(void) { } } -// Make sure oled sleeps timely -void housekeeping_task_oled(void) { - // If we are not master; sync the oled state - /* - if (!is_keyboard_master()) { - if ((userspace_runtime.oled_on) && (!is_oled_on())) { - oled_on(); - } else if ((!userspace_runtime.oled_on) && (is_oled_on())) { - oled_off(); - } - } - */ -} - /*-------------------------*\ |*---RENDERING FUNCTIONS---*| \*-------------------------*/ diff --git a/users/bbaserdem/bb-oled.h b/users/bbaserdem/bb-oled.h index ed4feecdce7..a355c88ca91 100644 --- a/users/bbaserdem/bb-oled.h +++ b/users/bbaserdem/bb-oled.h @@ -19,8 +19,6 @@ // Contain the main oled writer here void oled_task_user(void); -// Function to keep in housekeeping -void housekeeping_task_oled(void); // Some generic rendering functions void render_qmk_logo(uint8_t row, uint8_t col); void render_layer(uint8_t row, uint8_t col, uint8_t top_layer); diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 3bd5b8ef789..83d6be8c56b 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -58,9 +58,7 @@ void userspace_transport_update(void) { if (is_keyboard_master()) { // If we are the main device; we want to send info. transport_userspace_config.raw = userspace_config.raw; -# ifdef OLED_ENABLE - transport_userspace_runtime.oled_on = is_oled_on(); -# endif // OLED_ENABLE + transport_userspace_runtime.oled_on = userspace_runtime.raw; } else { // If we are the secondary device; we want to receive info, and save to eeprom. userspace_config.raw = transport_userspace_config.raw; @@ -193,12 +191,6 @@ void housekeeping_task_user(void) { eeconfig_update_user(userspace_config.raw); prev_userspace_config.raw = userspace_config.raw; } - // Check runtime config for updates - if (prev_userspace_runtime.raw != userspace_runtime.raw) { -# ifdef OLED_ENABLE - housekeeping_task_oled(); -# endif // OLED_ENABLE - } } // Hook to keymap code diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index d61d3e2bcc5..a7c04361166 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -56,7 +56,7 @@ typedef union { uint32_t raw; struct { - bool oled_on; + bool test; }; } userspace_runtime_t; From bcd6289cde5b8d607275cf05816cdbe88b0ca624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 20 Sep 2021 23:13:41 -0400 Subject: [PATCH 92/94] Some stuff to make firmware compile on all platforms --- keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk | 2 +- users/bbaserdem/bbaserdem.c | 3 +-- users/bbaserdem/config.h | 1 + users/bbaserdem/rules.mk | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk index a83d5d95193..21013120e66 100644 --- a/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk +++ b/keyboards/splitkb/kyria/keymaps/bbaserdem/rules.mk @@ -26,5 +26,5 @@ ifneq (,$(findstring splitkb/kyria/rev1,$(KEYBOARD))) # Space savers NKRO_ENABLE = no VELOCIKEY_ENABLE = no - # WPM_ENABLE = no + WPM_ENABLE = no endif diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 83d6be8c56b..233bd1793fe 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -58,7 +58,7 @@ void userspace_transport_update(void) { if (is_keyboard_master()) { // If we are the main device; we want to send info. transport_userspace_config.raw = userspace_config.raw; - transport_userspace_runtime.oled_on = userspace_runtime.raw; + transport_userspace_runtime.raw = userspace_runtime.raw; } else { // If we are the secondary device; we want to receive info, and save to eeprom. userspace_config.raw = transport_userspace_config.raw; @@ -173,7 +173,6 @@ __attribute__ ((weak)) void housekeeping_task_keymap(void) {} void housekeeping_task_user(void) { // Check eeprom every now and then static userspace_config_t prev_userspace_config; - static userspace_runtime_t prev_userspace_runtime; static fast_timer_t throttle_timer = 0; // Do transport stuff diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 7af7b93cab6..299e8e2dabb 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -120,6 +120,7 @@ // For perkey leds #ifdef RGB_MATRIX_ENABLE +# define RGB_DISABLE_TIMEOUT 1800000 # define RGB_DISABLE_WHEN_USB_SUSPENDED true // Start using this mode # define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON diff --git a/users/bbaserdem/rules.mk b/users/bbaserdem/rules.mk index 8fe04807bcd..58f72bb1106 100644 --- a/users/bbaserdem/rules.mk +++ b/users/bbaserdem/rules.mk @@ -36,9 +36,9 @@ RGBLIGHT_ENABLE = no # LED strip, but there is RGB_MATRIX instead TAP_DANCE_ENABLE = no # Tap dance keys; i don't use tap dance # These features can be disabled at whim -NKRO_ENABLE := yes # Default is 6KRO -VELOCIKEY_ENABLE = yes # Speed effects change with typing speed -WPM_ENABLE = yes # Get WPM reports as you type +NKRO_ENABLE ?= yes # Default is 6KRO +VELOCIKEY_ENABLE ?= yes # Speed effects change with typing speed +WPM_ENABLE ?= yes # Get WPM reports as you type # Manually configure these on each keyboard individually # AUDIO_ENABLE # Audio stuff From 4fc7d1a39dd9eeeba04c631e64ceaac08e54d967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 11 Oct 2021 12:44:00 -0400 Subject: [PATCH 93/94] Fixed some stuff --- .../community/split_3x6_3/bbaserdem/config.h | 8 +-- users/bbaserdem/bb-oled-extra.c | 9 +-- users/bbaserdem/bb-rgb.c | 8 +-- users/bbaserdem/bb-rgb.h | 2 + users/bbaserdem/bbaserdem.c | 59 ++++++++++++------- users/bbaserdem/bbaserdem.h | 2 +- users/bbaserdem/config.h | 3 +- 7 files changed, 54 insertions(+), 37 deletions(-) diff --git a/layouts/community/split_3x6_3/bbaserdem/config.h b/layouts/community/split_3x6_3/bbaserdem/config.h index 03473c5ae72..adf707d1bab 100644 --- a/layouts/community/split_3x6_3/bbaserdem/config.h +++ b/layouts/community/split_3x6_3/bbaserdem/config.h @@ -34,11 +34,6 @@ # undef USE_I2C # undef SSD1306OLED - // Add state info transmission -# define SPLIT_LAYER_STATE_ENABLE -# define SPLIT_MODS_ENABLE -# define SPLIT_WPM_ENABLE - // Audio output on pin A5 (actualy will be output on B1 using keymap init) # ifdef AUDIO_ENABLE # define AUDIO_PIN A5 @@ -68,8 +63,7 @@ # define WS2812_DMA_CHANNEL 3 // OLED related code -# ifdef OLED_DRIVER_ENABLE -# define OLED_TIMEOUT 50000 +# ifdef OLED_ENABLE # define OLED_UPDATE_INTERVAL 100 # endif diff --git a/users/bbaserdem/bb-oled-extra.c b/users/bbaserdem/bb-oled-extra.c index 69cfe520e7f..b52c4b335a8 100644 --- a/users/bbaserdem/bb-oled-extra.c +++ b/users/bbaserdem/bb-oled-extra.c @@ -570,6 +570,7 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { },{ 0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x08,0xf8,0x08,0xf0,0x00,0x70,0x88, 0x88,0x88,0x71,0x00,0x70,0x88,0x88,0x48,0xff,0x00,0x70,0xa8,0xa8,0xa8, 0xb0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xce,0xe7,0x00,0x00}}; + uint8_t this_layout = userspace_config.layout % 3; // Render the requested image on the given column and row // Don't grab highest layer; instead compare from top to bottom. @@ -582,7 +583,7 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { } else if (layer_state_cmp(layer_state, _FUNC)) { draw_image(row, col, func7_L); } else if (layer_state_cmp(layer_state, _NUMB)) { - switch (userspace_config.layout % 3) { + switch (this_layout) { case 0: // Dvorak if (mods & MOD_MASK_SHIFT) { draw_image(row, col, numb6_L_dvor_shift); @@ -618,7 +619,7 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { } else if (layer_state_cmp(layer_state, _CHAR)) { draw_image(row, col, char1_L); } else { - switch (userspace_config.layout % 3) { + switch (this_layout) { case 0: // Dvorak if (mods & MOD_MASK_SHIFT) { draw_image(row, col, base0_L_dvor_shift); @@ -654,7 +655,7 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { if (layer_state_cmp(layer_state, _MUSI)) { draw_image(row, col, musi9_R); } else if (layer_state_cmp(layer_state, _SYMB)) { - switch (userspace_config.layout % 3) { + switch (this_layout) { case 0: // Dvorak draw_image(row, col, symb5_R_dvor); break; @@ -682,7 +683,7 @@ void render_layout(uint8_t row, uint8_t col, uint8_t mods, bool isLeft) { } else if (layer_state_cmp(layer_state, _CHAR)) { draw_image(row, col, char1_R); } else { - switch (userspace_config.layout % 3) { + switch (this_layout) { case 0: // Dvorak if (mods & MOD_MASK_SHIFT) { draw_image(row, col, base0_R_dvor_shift); diff --git a/users/bbaserdem/bb-rgb.c b/users/bbaserdem/bb-rgb.c index ba8290eb791..bdb7f12bbd1 100644 --- a/users/bbaserdem/bb-rgb.c +++ b/users/bbaserdem/bb-rgb.c @@ -22,10 +22,6 @@ */ // Allow hooking into the RGB matrix indications using keymap code -// Allow to turn off global handling -__attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { - return false; -} // Modulates the brightness of indicator RGB helper_dimmer(uint8_t r, uint8_t g, uint8_t b) { @@ -62,6 +58,10 @@ void helper_painter(uint8_t led_min, uint8_t led_max, RGB col, uint8_t side) { } } +// Allow to turn off global handling +__attribute__ ((weak)) bool rgb_matrix_indicators_advanced_keymap(uint8_t led_min, uint8_t led_max) { + return false; +} // Set RGB state depending on layer void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { uint8_t thisInd = 3; diff --git a/users/bbaserdem/bb-rgb.h b/users/bbaserdem/bb-rgb.h index 62b6da9f2f2..55914a57300 100644 --- a/users/bbaserdem/bb-rgb.h +++ b/users/bbaserdem/bb-rgb.h @@ -22,6 +22,8 @@ // For custom indicators void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); +// RGB sleep implementation +void housekeeping_task_rgb(void); // Hook into shutdown code void shutdown_rgb(void); void suspend_wakeup_init_rgb(void); diff --git a/users/bbaserdem/bbaserdem.c b/users/bbaserdem/bbaserdem.c index 233bd1793fe..08346c3d64f 100644 --- a/users/bbaserdem/bbaserdem.c +++ b/users/bbaserdem/bbaserdem.c @@ -67,7 +67,7 @@ void userspace_transport_update(void) { } // Initiate the protocol on sync -void userspace_transport_sync(void) { +void userspace_transport_sync(bool force_sync) { if (is_keyboard_master()) { // Keep track of the last state static userspace_config_t last_userspace_config; @@ -79,9 +79,8 @@ void userspace_transport_sync(void) { needs_sync = true; memcpy(&last_userspace_config, &transport_userspace_config, sizeof(transport_userspace_config)); } - // Perform the sync if requested - if (needs_sync) { + if (needs_sync || force_sync) { transaction_rpc_send(RPC_ID_CONFIG_SYNC, sizeof(transport_userspace_config), &transport_userspace_config); needs_sync = false; } @@ -93,7 +92,7 @@ void userspace_transport_sync(void) { } // Perform the sync if requested - if (needs_sync) { + if (needs_sync || force_sync) { transaction_rpc_send(RPC_ID_RUNTIME_SYNC, sizeof(transport_userspace_runtime), &transport_userspace_runtime); needs_sync = false; } @@ -135,14 +134,32 @@ __attribute__ ((weak)) void keyboard_post_init_keymap(void) {} __attribute__ ((weak)) void keyboard_post_init_user(void) { // Fix beginning base layer, in case some other firmware was flashed // set_single_persistent_default_layer(_BASE); - - // Initialize userspace config - userspace_config.raw = eeconfig_read_user(); + + // Unicode mode +# ifdef UNICODEMAP_ENABLE + set_unicode_input_mode(UC_LNX); +# endif // UNICODEMAP_ENABLE // Split keyboard halves communication # ifdef SPLIT_KEYBOARD + // Register the transactions transaction_register_rpc( RPC_ID_CONFIG_SYNC, userspace_config_sync ); transaction_register_rpc(RPC_ID_RUNTIME_SYNC, userspace_runtime_sync); + // Load default config values + if (is_keyboard_master()) { + // If we are main; load from eeconfig + userspace_config.raw = eeconfig_read_user(); + // And update the transport variable + userspace_transport_update(); + // Do one forced transfer to sync halves + userspace_transport_sync(true); + } else { + // Just sync the data received + userspace_transport_update(); + } +# else // SPLIT_KEYBOARD + // If we are not split; just load from eeprom + userspace_config.raw = eeconfig_read_user(); # endif // SPLIT_KEYBOARD // Backlight LED @@ -155,11 +172,6 @@ __attribute__ ((weak)) void keyboard_post_init_user(void) { keyboard_post_init_underglow(); # endif // RGBLIGHT_ENABLE - // Unicode mode -# ifdef UNICODEMAP_ENABLE - set_unicode_input_mode(UC_LNX); -# endif // UNICODEMAP_ENABLE - // Keymap specific stuff keyboard_post_init_keymap(); } @@ -174,24 +186,31 @@ void housekeeping_task_user(void) { // Check eeprom every now and then static userspace_config_t prev_userspace_config; static fast_timer_t throttle_timer = 0; + static bool init_flag = true; - // Do transport stuff -# ifdef SPLIT_KEYBOARD - userspace_transport_update(); - userspace_transport_sync(); -# endif // SPLIT_KEYBOARD + // Read this if we never read it before + if (init_flag) { + init_flag = false; + prev_userspace_config.raw = eeconfig_read_user(); + } - // Throttled tasks + // Throttled tasks here if (timer_elapsed_fast(throttle_timer) >= HOUSEKEEPING_THROTTLE_INTERVAL_MS) { // Refresh timer throttle_timer = timer_read_fast(); // Check userspace config for eeprom updates - if (prev_userspace_config.raw != userspace_config.raw) { + if (memcmp(&prev_userspace_config, &userspace_config, sizeof(userspace_config))) { + memcpy(&prev_userspace_config, &userspace_config, sizeof(userspace_config)); eeconfig_update_user(userspace_config.raw); - prev_userspace_config.raw = userspace_config.raw; } } + // Do transport stuff +# ifdef SPLIT_KEYBOARD + userspace_transport_update(); + userspace_transport_sync(false); +# endif // SPLIT_KEYBOARD + // Hook to keymap code housekeeping_task_keymap(); } diff --git a/users/bbaserdem/bbaserdem.h b/users/bbaserdem/bbaserdem.h index a7c04361166..4792d5c2d77 100644 --- a/users/bbaserdem/bbaserdem.h +++ b/users/bbaserdem/bbaserdem.h @@ -56,7 +56,7 @@ typedef union { uint32_t raw; struct { - bool test; + bool rgb_sleep; }; } userspace_runtime_t; diff --git a/users/bbaserdem/config.h b/users/bbaserdem/config.h index 299e8e2dabb..477378102b3 100644 --- a/users/bbaserdem/config.h +++ b/users/bbaserdem/config.h @@ -120,7 +120,8 @@ // For perkey leds #ifdef RGB_MATRIX_ENABLE -# define RGB_DISABLE_TIMEOUT 1800000 +// This is not working +//# define RGB_DISABLE_TIMEOUT 1800000 # define RGB_DISABLE_WHEN_USB_SUSPENDED true // Start using this mode # define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_RAINBOW_BEACON From 2b5ba2125b684c902e4f61b08d91db6d7ac7d902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Tue, 19 Oct 2021 09:51:48 -0400 Subject: [PATCH 94/94] Mini change --- users/bbaserdem/bb-rgb.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/users/bbaserdem/bb-rgb.h b/users/bbaserdem/bb-rgb.h index 55914a57300..62b6da9f2f2 100644 --- a/users/bbaserdem/bb-rgb.h +++ b/users/bbaserdem/bb-rgb.h @@ -22,8 +22,6 @@ // For custom indicators void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max); -// RGB sleep implementation -void housekeeping_task_rgb(void); // Hook into shutdown code void shutdown_rgb(void); void suspend_wakeup_init_rgb(void);