Merge remote-tracking branch 'upstream/master' into develop

master
James Young 2021-09-23 00:59:31 -07:00
commit c679911f3d
No known key found for this signature in database
GPG Key ID: 87CBD151019773A8
10 changed files with 341 additions and 282 deletions

View File

@ -1 +1,17 @@
/* Copyright 2017 Cole Markham, WoodKeys.click
*
* 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 "meira.h"

View File

@ -1,5 +1,19 @@
/* Copyright 2017 Cole Markham, WoodKeys.click
*
* 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
#include "../meira.h"
#include "quantum.h"
#include "meira.h"

View File

@ -2,6 +2,10 @@
"keyboard_name": "Meira",
"url": "",
"maintainer": "colemarkham",
"layout_aliases": {
"KEYMAP": "LAYOUT_ortho_4x12",
"LAYOUT": "LAYOUT_ortho_4x12"
},
"layouts": {
"LAYOUT_ortho_4x12": {
"layout": [

View File

@ -17,24 +17,26 @@
#include "lighting.h"
#ifdef RGBLIGHT_ENABLE
//Following line allows macro to read current RGB settings
// Following line allows macro to read current RGB settings
extern rgblight_config_t rgblight_config;
#endif
#define _QWERTY 0
#define _COLEMAK 1
#define _DVORAK 2
#define _LOWER 3
#define _RAISE 4
#define _ADJUST 16
enum layer_names {
_QWERTY,
_COLEMAK,
_DVORAK,
_LOWER,
_RAISE,
_ADJUST
};
enum custom_keycodes {
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
LOWER,
RAISE,
ADJUST,
QWERTY = SAFE_RANGE,
COLEMAK,
DVORAK,
LOWER,
RAISE,
ADJUST
};
#ifdef AUDIO_ENABLE
@ -42,257 +44,256 @@ enum custom_keycodes {
float tone_my_startup[][2] = SONG(ODE_TO_JOY);
float tone_my_goodbye[][2] = SONG(ROCK_A_BYE_BABY);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
#endif /* AUDIO_ENABLE */
// define variables for reactive RGB
bool TOG_STATUS = false;
int RGB_current_mode;
int RGB_current_mode;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Ctrl | Alt |Lower | Cmd |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = KEYMAP( \
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_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \
ADJUST, KC_LCTL, KC_LALT, KC_LALT, LOWER, KC_LGUI, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; | ' |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Alt | Alt |Lower | Cmd |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT( \
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_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \
ADJUST, KC_LCTL, KC_LALT, KC_LALT, LOWER, KC_LGUI, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = KEYMAP( \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT( \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = KEYMAP( \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Dvorak
* ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT( \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT, \
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP( \
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, KC_QUOT, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \
),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT( \
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \
KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, KC_QUOT, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \
),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Home | PgUp | PgDn | End |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP( \
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \
),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | Home | PgUp | PgDn | End |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT( \
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \
),
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = KEYMAP( \
BL_TOGG, RESET, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_PSCR, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, \
BL_STEP, RGB_MOD, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
)
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT( \
BL_TOGG, RESET, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_PSCR, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, \
BL_STEP, RGB_MOD, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
)
};
// Setting ADJUST layer RGB back to default
void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
#ifdef RGBLIGHT_ENABLE
rgblight_mode(RGB_current_mode);
rgblight_mode(RGB_current_mode);
#endif
layer_on(layer3);
} else {
layer_off(layer3);
}
layer_on(layer3);
} else {
layer_off(layer3);
}
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
// persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
// persistent_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
// persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
//not sure how to have keyboard check mode and set it to a variable, so my work around
//uses another variable that would be set to true after the first time a reactive key is pressed.
if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
} else {
TOG_STATUS = !TOG_STATUS;
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_qwerty);
#endif
// persistent_default_layer_set(1UL<<_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_colemak);
#endif
// persistent_default_layer_set(1UL<<_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(tone_dvorak);
#endif
// persistent_default_layer_set(1UL<<_DVORAK);
}
return false;
break;
case LOWER:
if (record->event.pressed) {
// not sure how to have keyboard check mode and set it to a variable, so my work around
// uses another variable that would be set to true after the first time a reactive key is pressed.
if (TOG_STATUS) { // TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
} else {
TOG_STATUS = !TOG_STATUS;
#ifdef RGBLIGHT_ENABLE
rgblight_mode(16);
rgblight_mode(16);
#endif
}
layer_on(_LOWER);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
} else {
#ifdef RGBLIGHT_ENABLE
rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change
#endif
TOG_STATUS = false;
layer_off(_LOWER);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
// not sure how to have keyboard check mode and set it to a variable, so my work around
// uses another variable that would be set to true after the first time a reactive key is pressed.
if (TOG_STATUS) { // TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
} else {
TOG_STATUS = !TOG_STATUS;
#ifdef RGBLIGHT_ENABLE
rgblight_mode(15);
#endif
}
layer_on(_RAISE);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
} else {
#ifdef RGBLIGHT_ENABLE
rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change
#endif
layer_off(_RAISE);
TOG_STATUS = false;
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case ADJUST:
// FIXME add RGB feedback
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
break;
case BL_TOGG:
#ifdef BACKLIGHT_ENABLE
if (record->event.pressed) {
print("Enabling backlight\n");
backlight_init_ports();
}
#endif
return false;
break;
case BL_STEP:
if (record->event.pressed) {
print("Stepping backlight\n");
#ifdef BACKLIGHT_ENABLE
print("Really stepping backlight\n");
backlight_step();
#endif
}
layer_on(_LOWER);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
} else {
return false;
break;
// led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released
#ifdef RGBLIGHT_ENABLE
rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change
#endif
TOG_STATUS = false;
layer_off(_LOWER);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
//not sure how to have keyboard check mode and set it to a variable, so my work around
//uses another variable that would be set to true after the first time a reactive key is pressed.
if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false
} else {
TOG_STATUS = !TOG_STATUS;
#ifdef RGBLIGHT_ENABLE
rgblight_mode(15);
#endif
case RGB_MOD:
if (record->event.pressed) {
rgblight_mode(RGB_current_mode);
rgblight_step();
RGB_current_mode = rgblight_config.mode;
}
layer_on(_RAISE);
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
} else {
#ifdef RGBLIGHT_ENABLE
rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change
return false;
break;
#endif
layer_off(_RAISE);
TOG_STATUS = false;
update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case ADJUST:
// FIXME add RGB feedback
if (record->event.pressed) {
layer_on(_ADJUST);
} else {
layer_off(_ADJUST);
}
return false;
break;
case BL_TOGG:
#ifdef BACKLIGHT_ENABLE
if (record->event.pressed) {
print("Enabling backlight\n");
backlight_init_ports();
}
#endif
return false;
break;
case BL_STEP:
if (record->event.pressed) {
print("Stepping backlight\n");
#ifdef BACKLIGHT_ENABLE
print("Really stepping backlight\n");
backlight_step();
#endif
}
return false;
break;
//led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released
#ifdef RGBLIGHT_ENABLE
case RGB_MOD:
if (record->event.pressed) {
rgblight_mode(RGB_current_mode);
rgblight_step();
RGB_current_mode = rgblight_config.mode;
}
return false;
break;
#endif
// case BL_INC:
// meira_inc_backlight_level();
// return false;
// break;
}
return true;
// case BL_INC:
// meira_inc_backlight_level();
// return false;
// break;
}
return true;
}

View File

@ -30,7 +30,9 @@ void matrix_init_kb(void)
#ifdef ISSI_ENABLE
issi_init();
#endif
#ifdef BACKLIGHT_ENABLE
backlight_set(5);
#endif
#ifdef WATCHDOG_ENABLE
// This is done after turning the layer LED red, if we're caught in a loop
// we should get a flashing red light

View File

@ -13,7 +13,6 @@
* 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
#include "quantum.h"
@ -22,19 +21,17 @@
void reset_keyboard_kb(void);
// This a shortcut to help you visually see your layout.
// The following is an example using the Planck MIT layout
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
#define LAYOUT_ortho_4x12( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B } \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
) \
{ \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \
}
#define LAYOUT LAYOUT_ortho_4x12

View File

@ -1,2 +1,17 @@
#include "meira.h"
/* Copyright 2017 Cole Markham, WoodKeys.click
*
* 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 "meira.h"

View File

@ -1,5 +1,19 @@
/* Copyright 2017 Cole Markham, WoodKeys.click
*
* 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
#include "../meira.h"
#include "quantum.h"
#include "meira.h"

View File

@ -1,26 +1,23 @@
# Meira
![Miera](https://imgur.com/kF4MFlW)
![Meira](https://i.imgur.com/kF4MFlWh.jpeg)
A 4x12 ortholinear low-profile keyboard.
Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham)
Hardware Supported: Meira/ProMicro, Meira/FeatherBLE
Hardware Availability: [WoodKeys.click](https://woodkeys.click/meira)
* Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham)
* Hardware Supported: Meira/ProMicro, Meira/FeatherBLE
* Hardware Availability: [WoodKeys.click](https://woodkeys.click/meira)
Two controllers are support: the Pro Micro, and the Adafruit Feather BLE 32u4. Support for each is defined as a hardware revision subfolder in QMK. Main differences include processor frequencies and matrix pinouts.
Two controllers are supported: the Pro Micro, and the Adafruit Feather BLE 32u4. Support for each is defined as a hardware revision subfolder in QMK. Main differences include processor frequencies and matrix pinouts.
Make example for this keyboard (after setting up your build environment):
Make examples for this keyboard (after setting up your build environment):
make meira/promicro:default
make meira/featherble:default # for Feather BLE 32u4 controllers
make meira/promicro:default # for Pro Micro controllers
or
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
make meira/featherble:default
See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information on generic QMK configuration and setup.
Both the Pro Micro and the Feather BLE use the Catalina bootloader, which is typically programmed using avrdude.
Both the Pro Micro and the Feather BLE use the Caterina bootloader, which is typically programmed using avrdude.
## Matrix
@ -28,4 +25,4 @@ In order to have enough pins for the matrix and other functions, a custom matrix
## LED Controller
The in-switch LEDs are driven by an ISSI LED controller (IS31FL3731). The micro controller communicates with this chip using I2C. Individual LED control is possible, but currently only general backlighting support is implemented. This functionality is located in lighting.c, issi.c, and TWILib.c.
The in-switch LEDs are driven by an ISSI LED controller (IS31FL3731). The micro controller communicates with this chip using I2C. Individual LED control is possible, but currently only general backlighting support is implemented. This functionality is located in lighting.c, issi.c, and TWILib.c.

View File

@ -8,27 +8,26 @@ BOOTLOADER = caterina
# change yes to no to disable
#
BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite
MOUSEKEY_ENABLE = no # Mouse keys
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover
UNICODE_ENABLE = no # Unicode
AUDIO_ENABLE = no # Audio output
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality, also set ISSI_ENABLE below for Meira
BACKLIGHT_DRIVER = custom
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality, also set ISSI_ENABLE below for Miera
ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled
ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
CUSTOM_MATRIX = yes
#ifeq ($(strip $(ISSI_ENABLE)), yes)
# TMK_COMMON_DEFS += -DISSI_ENABLE
#endif
#
#ifeq ($(strip $(WATCHDOG_ENABLE)), yes)
# TMK_COMMON_DEFS += -DWATCHDOG_ENABLE
#endif