Browse Source

Working keeb

pull/14484/head^2
Batuhan Başerdem 2 years ago
parent
commit
60b132c783
17 changed files with 1408 additions and 949 deletions
  1. +3
    -10
      keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c
  2. +0
    -447
      layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c
  3. +44
    -43
      layouts/community/split_3x6_3/bbaserdem/config.h
  4. +82
    -11
      layouts/community/split_3x6_3/bbaserdem/keymap.c
  5. +0
    -1
      layouts/community/split_3x6_3/bbaserdem/rules.mk
  6. +118
    -26
      users/bbaserdem/bb-encoder.c
  7. +4
    -13
      users/bbaserdem/bb-encoder.h
  8. +21
    -1
      users/bbaserdem/bb-macro.c
  9. +700
    -0
      users/bbaserdem/bb-oled-extra.c
  10. +6
    -4
      users/bbaserdem/bb-oled-extra.h
  11. +153
    -253
      users/bbaserdem/bb-oled.c
  12. +11
    -6
      users/bbaserdem/bb-oled.h
  13. +61
    -39
      users/bbaserdem/bb-rgb.c
  14. +102
    -20
      users/bbaserdem/bbaserdem.c
  15. +43
    -10
      users/bbaserdem/bbaserdem.h
  16. +52
    -60
      users/bbaserdem/config.h
  17. +8
    -5
      users/bbaserdem/rules.mk

+ 3
- 10
keyboards/splitkb/kyria/keymaps/bbaserdem/keymap.c View File

@ -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

+ 0
- 447
layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.c View File

@ -1,447 +0,0 @@
/*
Copyright 2019 Batuhan Başerdem <baserdem.batuhan@gmail.com> @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 <http://www.gnu.org/licenses/>.
*/
#include "bb-oled.h"
#include "bb-crkbdarm-oled.h"
#ifdef ENCODER_ENABLE
#include "bb-encoder.h"
#endif
// PROGMEM images
// Naming scheme is <layer>_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: <OS> <Alt/Gr> <Ctrl> <Shift>
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: <OS> <Alt/Gr> <Ctrl> <Shift>
// Enc: <8 len str>
// Wpm: <wpm here>
// Layout: <dvorak/qwerty/tur. f>
// 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: <OS> <Alt/Gr> <Ctrl> <Shift>
// Enc: <8 len str>
// Wpm: <wpm here>
// Layout: <dvorak/qwerty/tur. f>
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);
}

+ 44
- 43
layouts/community/split_3x6_3/bbaserdem/config.h View File

@ -18,66 +18,67 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 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

+ 82
- 11
layouts/community/split_3x6_3/bbaserdem/keymap.c View File

@ -12,7 +12,9 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "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

+ 0
- 1
layouts/community/split_3x6_3/bbaserdem/rules.mk View File

@ -40,5 +40,4 @@ ifneq (,$(findstring crkbd/rev1,$(KEYBOARD)))
# BOOTMAGIC_ENABLE = lite
# LTO_ENABLE = yes
# PIMORONI_TRACKBALL = no
SRC += bb-crkbdarm-oled.c
endif

+ 118
- 26
users/bbaserdem/bb-encoder.c View File

@ -12,10 +12,15 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bb-encoder.h"
#include <string.h>
// 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 <string.h>
#endif
/* ROTARY ENCODER
* This contains my general rotary encoder code
@ -26,16 +31,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* 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

+ 4
- 13
users/bbaserdem/bb-encoder.h View File

@ -13,9 +13,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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);

+ 21
- 1
users/bbaserdem/bb-macro.c View File

@ -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


+ 700
- 0
users/bbaserdem/bb-oled-extra.c View File

@ -0,0 +1,700 @@
/*
Copyright 2019 Batuhan Başerdem <baserdem.batuhan@gmail.com> @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 <http://www.gnu.org/licenses/>.
*/
#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: <OS> <Alt/Gr> <Ctrl> <Shift>
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: <OS> <Alt/Gr> <Ctrl> <Shift>
// Enc: <8 len str>
// Wpm: <wpm here>
// Layout: <dvorak/qwerty/tur. f>
// 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: <OS> <Alt/Gr> <Ctrl> <Shift>
// Enc: <8 len str>
// Wpm: <wpm here>
// Layout: <dvorak/qwerty/tur. f>
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);
}

layouts/community/split_3x6_3/bbaserdem/bb-crkbdarm-oled.h → users/bbaserdem/bb-oled-extra.h View File

@ -13,7 +13,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#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);

+ 153
- 253
users/bbaserdem/bb-oled.c View File

@ -13,305 +13,205 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bb-oled.h"
#include <string.h>
// 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
}

+ 11
- 6
users/bbaserdem/bb-oled.h View File

@ -15,9 +15,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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);

+ 61
- 39
users/bbaserdem/bb-rgb.c View File

@ -12,78 +12,100 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "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


+ 102
- 20
users/bbaserdem/bbaserdem.c View File

@ -14,6 +14,72 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "bbaserdem.h"
// Language imports
#include <sendstring_dvorak.h>
// Need memcpy and memcmp from string.h along with transfer stuff
#ifdef SPLIT_KEYBOARD
#include "transactions.h"
#include <string.h>
#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);
}


+ 43
- 10
users/bbaserdem/bbaserdem.h View File

@ -45,6 +45,29 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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
*
* MediaPrev.MuTogMuStpNext Media control
*
* Sink Vol - Mut EjectVol + Volume control
*
* VelocMusic Feature control on keyboard
* OledLVelocMusic 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
*


+ 52
- 60
users/bbaserdem/config.h View File

@ -33,29 +33,32 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// 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 <http://www.gnu.org/licenses/>.
// 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

+ 8
- 5
users/bbaserdem/rules.mk View File

@ -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

Loading…
Cancel
Save