Add first configuration, including specific FR and DK characters
This commit is contained in:
parent
2b588f3ff6
commit
51195e5394
91
README.md
91
README.md
@ -1,92 +1,11 @@
|
||||
# Isokheir
|
||||
*ambidextrous*
|
||||
|
||||
Keyboard configuration and layout for my custom CRKBD
|
||||
|
||||
## Getting started
|
||||
## Setup
|
||||
|
||||
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
|
||||
Clone the `qmk_firmware` repository, and clone this repository under `qmk_firmware/keyboard/crkbd/keymaps/isokheir`.
|
||||
|
||||
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
|
||||
|
||||
## Add your files
|
||||
|
||||
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
|
||||
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
|
||||
|
||||
```
|
||||
cd existing_repo
|
||||
git remote add origin https://git.halia.dev/therbron/isokheir.git
|
||||
git branch -M master
|
||||
git push -uf origin master
|
||||
```
|
||||
|
||||
## Integrate with your tools
|
||||
|
||||
- [ ] [Set up project integrations](https://git.halia.dev/therbron/isokheir/-/settings/integrations)
|
||||
|
||||
## Collaborate with your team
|
||||
|
||||
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
|
||||
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
|
||||
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
|
||||
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
|
||||
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
|
||||
|
||||
## Test and Deploy
|
||||
|
||||
Use the built-in continuous integration in GitLab.
|
||||
|
||||
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
|
||||
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
|
||||
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
|
||||
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
|
||||
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
|
||||
|
||||
***
|
||||
|
||||
# Editing this README
|
||||
|
||||
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
|
||||
|
||||
## Suggestions for a good README
|
||||
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
|
||||
|
||||
## Name
|
||||
Choose a self-explaining name for your project.
|
||||
|
||||
## Description
|
||||
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
|
||||
|
||||
## Badges
|
||||
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
|
||||
|
||||
## Visuals
|
||||
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
|
||||
|
||||
## Installation
|
||||
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
|
||||
|
||||
## Usage
|
||||
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
|
||||
|
||||
## Support
|
||||
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
|
||||
|
||||
## Roadmap
|
||||
If you have ideas for releases in the future, it is a good idea to list them in the README.
|
||||
|
||||
## Contributing
|
||||
State if you are open to contributions and what your requirements are for accepting them.
|
||||
|
||||
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
|
||||
|
||||
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
|
||||
|
||||
## Authors and acknowledgment
|
||||
Show your appreciation to those who have contributed to the project.
|
||||
|
||||
## License
|
||||
For open source projects, say how it is licensed.
|
||||
|
||||
## Project status
|
||||
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
|
||||
## Compile & flash
|
||||
`make crkbd:isokheir:flash -e AVR_CFLAGS="-Wno-array-bounds"`
|
||||
|
59
config.h
Normal file
59
config.h
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
This is the c configuration file for the keymap
|
||||
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
//#define USE_MATRIX_I2C
|
||||
|
||||
/* Select hand configuration */
|
||||
|
||||
#define MASTER_LEFT
|
||||
|
||||
#define SPLIT_WPM_ENABLE
|
||||
#define SPLIT_OLED_ENABLE
|
||||
// #define MASTER_RIGHT
|
||||
// #define EE_HANDS
|
||||
|
||||
//#define TAPPING_FORCE_HOLD
|
||||
//#define TAPPING_TERM 100
|
||||
|
||||
#define SPLIT_TRANSACTION_IDS_USER USER_SYNC_A
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
#define RGBLIGHT_LIMIT_VAL 120
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
#endif
|
||||
|
||||
#define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c"
|
||||
|
||||
#define UNICODE_KEY_LNX LCTL(LSFT(KC_U))
|
||||
#define UNICODE_SELECTED_MODES UC_LNX
|
94
keymap.c
Normal file
94
keymap.c
Normal file
@ -0,0 +1,94 @@
|
||||
/*
|
||||
Copyright 2019 @foostan
|
||||
Copyright 2020 Drashna Jaelre <@drashna>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#ifdef OLED_ENABLE
|
||||
# include "oled.c"
|
||||
#endif
|
||||
|
||||
enum unicode_names {
|
||||
A_GRAVE,
|
||||
E_ACUTE,
|
||||
E_GRAVE,
|
||||
U_GRAVE,
|
||||
A_AELIG,
|
||||
A_RING,
|
||||
O_SLASH
|
||||
};
|
||||
|
||||
const uint32_t PROGMEM unicode_map[] = {
|
||||
[A_GRAVE] = 0x00E0,
|
||||
[E_ACUTE] = 0x00E9,
|
||||
[E_GRAVE] = 0x00E8,
|
||||
[U_GRAVE] = 0x00F9,
|
||||
[A_AELIG] = 0x00E6,
|
||||
[A_RING] = 0x00E5,
|
||||
[O_SLASH] = 0x00F8
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_split_3x6_3(
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TAB ,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
KC_LGUI, MO(1), KC_SPC, KC_ENT, MO(2), KC_RALT
|
||||
//`--------------------------' `--------------------------'
|
||||
|
||||
),
|
||||
|
||||
[1] = LAYOUT_split_3x6_3(
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSFT,X(A_GRAVE),X(E_GRAVE), X(E_ACUTE), X(U_GRAVE), XXXXXXX, KC_LEFT, KC_DOWN, KC_UP,KC_RIGHT, XXXXXXX, XXXXXXX,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LCTL, X(A_AELIG), X(A_RING), X(O_SLASH), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
KC_LGUI, _______, KC_SPC, KC_ENT, MO(3), KC_RALT
|
||||
//`--------------------------' `--------------------------'
|
||||
),
|
||||
|
||||
[2] = LAYOUT_split_3x6_3(
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TILD,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
KC_LGUI, MO(3), KC_SPC, KC_ENT, _______, KC_RALT
|
||||
//`--------------------------' `--------------------------'
|
||||
),
|
||||
|
||||
[3] = LAYOUT_split_3x6_3(
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LCTL, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
KC_LGUI, _______, KC_SPC, KC_ENT, _______, KC_RALT
|
||||
//`--------------------------' `--------------------------'
|
||||
)
|
||||
};
|
||||
|
245
oled.c
Normal file
245
oled.c
Normal file
@ -0,0 +1,245 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <transactions.h>
|
||||
char wpm_str[10];
|
||||
|
||||
uint32_t anim_timer = 0;
|
||||
uint8_t current_idle_frame = 0;
|
||||
uint8_t current_tap_frame = 0;
|
||||
|
||||
char is_slave_connected = 0;
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return OLED_ROTATION_270;
|
||||
}
|
||||
|
||||
#define L_BASE 0
|
||||
#define L_LOWER 2
|
||||
#define L_RAISE 4
|
||||
#define L_ADJUST 8
|
||||
|
||||
#define IDLE_FRAMES 5
|
||||
#define IDLE_SPEED 20
|
||||
#define TAP_SPEED_SLOW 40
|
||||
#define TAP_SPEED_HALF 60
|
||||
#define TAP_SPEED_FAST 80
|
||||
#define TAP_FRAMES 2
|
||||
#define ANIM_SIZE 256
|
||||
#define ANIM_FRAME_DURATION 250
|
||||
#define ANIM_TAP_SLOW 400
|
||||
#define ANIM_TAP_HALF 300
|
||||
#define ANIM_TAP_FAST 200
|
||||
|
||||
typedef struct _master_to_slave_t {
|
||||
int m2s_data;
|
||||
} master_to_slave_t;
|
||||
|
||||
typedef struct _slave_to_master_t {
|
||||
int s2m_data;
|
||||
} slave_to_master_t;
|
||||
|
||||
void oled_render_layer_state(void) {
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
switch (layer_state) {
|
||||
case L_BASE:
|
||||
oled_write_ln_P(PSTR("Default"), false);
|
||||
break;
|
||||
case L_LOWER:
|
||||
oled_write_ln_P(PSTR("Lower"), false);
|
||||
break;
|
||||
case L_RAISE:
|
||||
oled_write_ln_P(PSTR("Raise"), false);
|
||||
break;
|
||||
case L_ADJUST:
|
||||
case L_ADJUST|L_LOWER:
|
||||
case L_ADJUST|L_RAISE:
|
||||
case L_ADJUST|L_LOWER|L_RAISE:
|
||||
oled_write_ln_P(PSTR("Adjust"), false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char keylog_str[24] = {};
|
||||
|
||||
const char code_to_name[60] = {
|
||||
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
|
||||
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
|
||||
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||
'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
|
||||
'#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
|
||||
|
||||
void set_keylog(uint16_t keycode, keyrecord_t *record) {
|
||||
char name = ' ';
|
||||
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) ||
|
||||
(keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; }
|
||||
if (keycode < 60) {
|
||||
name = code_to_name[keycode];
|
||||
}
|
||||
|
||||
// update keylog
|
||||
snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
|
||||
record->event.key.row, record->event.key.col,
|
||||
keycode, name);
|
||||
}
|
||||
|
||||
void oled_render_keylog(void) {
|
||||
oled_write(keylog_str, false);
|
||||
}
|
||||
|
||||
void oled_render_wpm(void) {
|
||||
sprintf(wpm_str, "%3d", get_current_wpm());
|
||||
oled_write(wpm_str, false);
|
||||
}
|
||||
|
||||
void oled_render_logo(void) {
|
||||
static const char PROGMEM crkbd_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(crkbd_logo, false);
|
||||
}
|
||||
|
||||
static void oled_render_bongo(void) {
|
||||
static const char PROGMEM bongo_idle[IDLE_FRAMES][ANIM_SIZE] = {
|
||||
{0, 0,128,128,192,192,192,192,224,240,248,248,248,248,252,252,252,252,254,254,254,252,240,224,192,128, 0, 0, 0, 0, 0, 0, 0,128,225,247,255,255,255,255,223,223,223,243,243,255,127,119,111,111, 55, 51, 60, 60, 63, 27, 59, 59,127,126,124,120, 56, 0},
|
||||
{0, 0,128,128,128,128,192,192,192,224,224,240,240,240,240,248,248,252,254,254,254,240,224,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0,129,231,255,255,255,255,255,191,191,167,231,255,127,111, 95, 95, 47, 39, 57, 57, 63, 23, 55, 55,126,124,120,120, 48, 0},
|
||||
{0, 0, 0, 0, 0, 0,128,128,128,192,192,192,224,224,240,240,240,248,252,252,254,240,224,192,128, 0, 0, 0, 0, 0, 0, 0, 0, 0,129,231,255,255,255,255,255,191,191,167,231,255,255,239,223,223,239,103,121,121, 63, 23, 55, 55,126,124,120,120, 48, 0},
|
||||
{0, 0, 0,128,128,128,192,192,192,192,224,224,224,240,240,240,248,252,252,254,254,240,240,224,192,128, 0, 0, 0, 0, 0, 0, 0, 0,129,231,255,255,255,255,255,191,191,179,243,255,239,223,223,239,239,119,124,124, 63, 23, 55, 55,127,126,120,120, 48, 0},
|
||||
{0, 0, 0,128,128,192,192,192,224,224,224,240,240,248,248,248,248,252,254,254,254,240,240,224,192,128, 0, 0, 0, 0, 0, 0, 0,128,193,231,255,255,255,255,255,223,223,211,243,255,255,247,239,111,119,115,124, 60, 63, 27, 59, 59,127,126,124,120, 48, 0}
|
||||
};
|
||||
static const char PROGMEM bongo_prep[ANIM_SIZE] = {
|
||||
0, 0,128,128,192,192,192,192,224,240,248,248,248,248,252,252,252,252,254,254,254,252,240,224,192, 0,128,192, 64,192,128, 0, 0,128,225,247,223,239,183,215,183,239,159,243,243,255,127,119,111,111, 55, 51, 60, 60, 31, 27, 27, 27, 15, 14, 15, 6, 7, 0
|
||||
};
|
||||
static const char PROGMEM bongo_tap[TAP_FRAMES][ANIM_SIZE] = {
|
||||
{0, 0,128,128,192,192,192,192,224,240,248,248,248,248,252,252,252,252,254,254,254,252,240,224,192,128, 0, 0, 0, 0, 0, 0, 0,128,225,247,223,239,183,215,183,239,159,243,243,255,127,119,111,111, 55, 51, 60, 60, 63, 27, 59, 59,127,254,252,248,112, 0},
|
||||
{0, 0,128,128,192,192,192,192,224,240,248,248,248,248,252,252,252,252,254,254,254,252,240,224,192, 0,128,192, 64,192,128, 0, 0,128,225,247,255,255,255,255,255,255,255,243,243,255,127,119,111,111, 55, 51, 60, 60, 31, 27, 27, 27, 15, 14, 15, 6, 7, 0}
|
||||
};
|
||||
|
||||
void animation_idle_phase(void) {
|
||||
if(get_current_wpm() <= IDLE_SPEED) {
|
||||
current_idle_frame = (current_idle_frame + 1) % IDLE_FRAMES;
|
||||
oled_write_raw_P(bongo_idle[abs((IDLE_FRAMES - 1) - current_idle_frame)], ANIM_SIZE);
|
||||
return;
|
||||
}
|
||||
|
||||
if(get_current_wpm() > IDLE_SPEED && get_current_wpm() < TAP_SPEED_SLOW) {
|
||||
oled_write_raw_P(bongo_prep, ANIM_SIZE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void animation_tap_phase(void) {
|
||||
if(get_current_wpm() > TAP_SPEED_FAST && timer_elapsed32(anim_timer) > ANIM_TAP_FAST) {
|
||||
anim_timer = timer_read32();
|
||||
current_tap_frame = (current_tap_frame + 1) % TAP_FRAMES;
|
||||
oled_write_raw_P(bongo_tap[abs((TAP_FRAMES - 1) - current_tap_frame)], ANIM_SIZE);
|
||||
return;
|
||||
}
|
||||
|
||||
if(get_current_wpm() > TAP_SPEED_HALF && timer_elapsed32(anim_timer) > ANIM_TAP_HALF) {
|
||||
anim_timer = timer_read32();
|
||||
current_tap_frame = (current_tap_frame + 1) % TAP_FRAMES;
|
||||
oled_write_raw_P(bongo_tap[abs((TAP_FRAMES - 1) - current_tap_frame)], ANIM_SIZE);
|
||||
return;
|
||||
}
|
||||
|
||||
if(get_current_wpm() > TAP_SPEED_SLOW && timer_elapsed32(anim_timer) > ANIM_TAP_SLOW) {
|
||||
anim_timer = timer_read32();
|
||||
current_tap_frame = (current_tap_frame + 1) % TAP_FRAMES;
|
||||
oled_write_raw_P(bongo_tap[abs((TAP_FRAMES - 1) - current_tap_frame)], ANIM_SIZE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(get_current_wpm() > TAP_SPEED_SLOW) {
|
||||
animation_tap_phase();
|
||||
} else {
|
||||
if(timer_elapsed32(anim_timer) > ANIM_FRAME_DURATION) {
|
||||
anim_timer = timer_read32();
|
||||
animation_idle_phase();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void oled_render_split_status(void) {
|
||||
static const char PROGMEM kb_status[2][64] = {
|
||||
{0,192, 64, 64,192, 64, 64,192, 96,112,200,136,132,132, 4, 4, 4,196, 68, 68,232, 48, 48,224, 32, 32,224, 32, 32,224, 0, 0, 0, 31, 18, 18, 31, 18, 18, 31, 18, 18, 63, 36, 36, 63, 0, 0, 0, 31, 18, 18, 31, 9, 9, 15, 9, 9, 15, 9, 9, 15, 0, 0},
|
||||
{0,192, 64, 64,192, 64, 64,192, 96,112,200,136,132,132, 0, 4, 4, 0, 4, 64,136, 0, 0, 0,128, 64, 0, 0, 0, 0, 0, 0, 0, 31, 18, 18, 31, 18, 18, 31, 18, 18, 63, 36, 36, 63, 0, 0, 0, 0, 0, 16, 8, 5, 2, 5, 8, 16, 0, 0, 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
if(is_slave_connected) {
|
||||
oled_write_raw_P(kb_status[0], sizeof(kb_status[0]));
|
||||
} else {
|
||||
oled_write_raw_P(kb_status[1], sizeof(kb_status[1]));
|
||||
}
|
||||
}
|
||||
|
||||
void oled_render_layer_status(void) {
|
||||
oled_write_ln_P(PSTR("A"), true);
|
||||
//switch (layer_state) {
|
||||
// case L_BASE:
|
||||
// oled_write_ln_P(PSTR("Default"), false);
|
||||
// break;
|
||||
// case L_LOWER:
|
||||
// oled_write_ln_P(PSTR("Lower"), false);
|
||||
// break;
|
||||
// case L_RAISE:
|
||||
// oled_write_ln_P(PSTR("Raise"), false);
|
||||
// break;
|
||||
// case L_ADJUST:
|
||||
// case L_ADJUST|L_LOWER:
|
||||
// case L_ADJUST|L_RAISE:
|
||||
// case L_ADJUST|L_LOWER|L_RAISE:
|
||||
// oled_write_ln_P(PSTR("Adjust"), false);
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
static void oled_render_dashboard(void) {
|
||||
oled_render_split_status();
|
||||
//oled_render_layer_status();
|
||||
}
|
||||
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
//oled_render_layer_state();
|
||||
//oled_render_keylog();
|
||||
oled_render_dashboard();
|
||||
} else {
|
||||
oled_render_bongo();
|
||||
oled_set_cursor(0, 4);
|
||||
oled_render_wpm();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void user_sync_a_slave_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) {
|
||||
const master_to_slave_t *m2s = (const master_to_slave_t*)in_data;
|
||||
slave_to_master_t *s2m = (slave_to_master_t*)out_data;
|
||||
s2m->s2m_data = m2s->m2s_data + 5; // whatever comes in, add 5 so it can be sent back
|
||||
}
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
transaction_register_rpc(USER_SYNC_A, user_sync_a_slave_handler);
|
||||
}
|
||||
|
||||
void housekeeping_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// Interact with slave every 500ms
|
||||
static uint32_t last_sync = 0;
|
||||
if (timer_elapsed32(last_sync) > 500) {
|
||||
master_to_slave_t m2s = {6};
|
||||
slave_to_master_t s2m = {0};
|
||||
if(transaction_rpc_exec(USER_SYNC_A, sizeof(m2s), &m2s, sizeof(s2m), &s2m)) {
|
||||
last_sync = timer_read32();
|
||||
is_slave_connected = 1;
|
||||
} else {
|
||||
is_slave_connected = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
12
rules.mk
Normal file
12
rules.mk
Normal file
@ -0,0 +1,12 @@
|
||||
MOUSEKEY_ENABLE = no # Mouse keys
|
||||
EXTRAKEY_ENABLE = no # Audio control and System control
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
OLED_ENABLE = yes
|
||||
OLED_DRIVER = SSD1306
|
||||
LTO_ENABLE = yes
|
||||
# Bongo animation specific
|
||||
OLED_DRIVER_ENABLE = no
|
||||
WPM_ENABLE = yes
|
||||
|
||||
# Special characters
|
||||
UNICODEMAP_ENABLE = yes
|
Loading…
Reference in New Issue
Block a user