[Keymap] RGB Changes for Drashna Keyboards (#5803)

* Disable a bunch of reactive modes

* Enable rgb matrix for Corne Keyboard

* Convert CRKBD to rgb matrix

* Add Gergo keyboard layout

* Make Diablo 3 tap dance better

* Add basic support for Planck EZ

* Fix RGB Matrix stuff

* Fix keycodes for Planck EZ

* Update CRKBD OLED stuff

* Fix typo for sleep on ergodox glow

* Improve my gergo layout

* Scrolling OLED key logger!

* Change gergo layout

* Hnadle unicode keycodes if unicode is disabled

* Disable COMMAND/CONSOLE for gergo

* Fix right side control

* Re-enable LTO for all platforms

Since I got updated arm gcc binaries that no longer error out on lto

* Update formatting to match newer community standards

Poor 2 space

* Re-alight startup animation to use new HUE range

* Streamline gitlab ci scripts

* Disabled Space Cadet

* Add support for breathing table

* Enable new LTO Option

And clean up defines that will now be repeatitive

* Remove vscode settings

* Additional formatting cleanup of config.h files
master
Drashna Jaelre 2019-05-06 22:34:09 -07:00 committed by MechMerlin
parent 7a751f1141
commit f3d5b1091d
38 changed files with 1414 additions and 1444 deletions

View File

@ -27,7 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// #define MASTER_RIGHT
#define EE_HANDS
// #define SSD1306OLED
#undef USE_I2C
#undef SSD1306OLED
#define USE_SERIAL_PD2
@ -44,6 +45,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define RGBLIGHT_LIMIT_VAL 100
#endif
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
# define DISABLE_RGB_MATRIX_CYCLE_ALL
# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN
# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define DISABLE_RGB_MATRIX_DUAL_BEACON
# define DISABLE_RGB_MATRIX_RAINBOW_BEACON
# define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS
// #define DISABLE_RGB_MATRIX_RAINDROPS
// #define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
# define DISABLE_RGB_MATRIX_DIGITAL_RAIN
# define DISABLE_RGB_MATRIX_SOLID_REACTIVE
# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
# 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_NEXUS
# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
# define DISABLE_RGB_MATRIX_SOLID_SPLASH
# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH
#ifdef AUDIO_ENABLE
# define B6_AUDIO
// #define NO_MUSIC_MODE

View File

@ -1,15 +1,5 @@
#include QMK_KEYBOARD_H
#include "drashna.h"
#ifdef PROTOCOL_LUFA
#include "lufa.h"
#include "split_util.h"
#endif
#ifdef SSD1306OLED
#include "ssd1306.h"
#endif
#ifdef OLED_DRIVER_ENABLE
#include "oled_driver.h"
#endif
extern keymap_config_t keymap_config;
extern uint8_t is_master;
@ -31,7 +21,7 @@ enum crkbd_keycodes {
LAYOUT_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \
)
#define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__)
@ -115,11 +105,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
void matrix_init_keymap(void) {
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED
iota_gfx_init(!has_usb()); // turns on the display
#endif
#ifndef CONVERT_TO_PROTON_C
setPinOutput(D5);
writePinHigh(D5);
@ -129,169 +114,6 @@ void matrix_init_keymap(void) {
#endif
}
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
#ifdef SSD1306OLED
// When add source files to SRC in rules.mk, you can use functions.
const char *read_logo(void);
char layer_state_str[24];
char modifier_state_str[24];
char host_led_state_str[24];
char keylog_str[24] = {};
char keylogs_str[21] = {};
int keylogs_str_idx = 0;
// const char *read_mode_icon(bool swap);
// void set_timelog(void);
// const char *read_timelog(void);
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);
// update keylogs
if (keylogs_str_idx == sizeof(keylogs_str) - 1) {
keylogs_str_idx = 0;
for (int i = 0; i < sizeof(keylogs_str) - 1; i++) {
keylogs_str[i] = ' ';
}
}
keylogs_str[keylogs_str_idx] = name;
keylogs_str_idx++;
}
const char *read_keylog(void) {
return keylog_str;
}
const char *read_keylogs(void) {
return keylogs_str;
}
const char* read_modifier_state(void) {
uint8_t modifiers = get_mods();
uint8_t one_shot = get_oneshot_mods();
snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s",
(modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL) ? "CTL" : " ",
(modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI) ? "GUI" : " ",
(modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT) ? "ALT" : " ",
(modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? "SFT" : " "
);
return modifier_state_str;
}
const char *read_host_led_state(void) {
uint8_t leds = host_keyboard_leds();
snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s",
(leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ",
(leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ",
(leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "
);
return host_led_state_str;
}
const char* read_layer_state(void) {
switch (biton32(layer_state)) {
case _RAISE:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise ");
break;
case _LOWER:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower ");
break;
case _ADJUST:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust ");
break;
default:
switch (biton32(default_layer_state)) {
case _QWERTY:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Qwerty ");
break;
case _COLEMAK:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak");
break;
case _DVORAK:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak ");
break;
case _WORKMAN:
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman");
break;
}
break;
}
return layer_state_str;
}
void matrix_scan_keymap(void) {
iota_gfx_task();
}
void matrix_render_user(struct CharacterMatrix *matrix) {
if (is_master) {
//If you want to change the display of OLED, you need to change here
matrix_write_ln(matrix, read_layer_state());
matrix_write_ln(matrix, read_modifier_state());
// matrix_write_ln(matrix, read_keylog());
matrix_write_ln(matrix, read_keylogs());
// matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
// matrix_write(matrix, read_host_led_state());
//matrix_write_ln(matrix, read_timelog());
} else {
matrix_write(matrix, read_logo());
}
}
void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) {
if (memcmp(dest->display, source->display, sizeof(dest->display))) {
memcpy(dest->display, source->display, sizeof(dest->display));
dest->dirty = true;
}
}
void iota_gfx_task_user(void) {
struct CharacterMatrix matrix;
matrix_clear(&matrix);
matrix_render_user(&matrix);
matrix_update(&display, &matrix);
}
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_A ... KC_SLASH:
case KC_F1 ... KC_F12:
case KC_INSERT ... KC_UP:
case KC_KP_SLASH ... KC_KP_DOT:
case KC_F13 ... KC_F24:
if (record->event.pressed) { set_keylog(keycode, record); }
break;
// set_timelog();
}
return true;
}
#endif
#ifdef OLED_DRIVER_ENABLE
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
@ -311,6 +133,43 @@ void render_crkbd_logo(void) {
oled_write_P(crkbd_logo, false);
}
#define KEYLOG_LEN (int)(32 / OLED_FONT_WIDTH)
char keylog_str[KEYLOG_LEN] = {};
uint8_t keylogs_str_idx = 0;
uint16_t log_timer = 0;
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 add_keylog(uint16_t keycode) {
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) ||
(keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; }
for (uint8_t i = KEYLOG_LEN - 1; i > 0; i--) {
keylog_str[i] = keylog_str[i - 1];
}
if (keycode < 60) {
keylog_str[0] = code_to_name[keycode];
}
log_timer = timer_read();
}
void update_log(void) {
if (timer_elapsed(log_timer) > 750) {
add_keylog(0);
}
}
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { add_keylog(keycode); }
return true;
}
void render_status(void) {
@ -364,25 +223,18 @@ void render_status(void) {
uint8_t one_shot = get_oneshot_mods();
oled_write_P(PSTR("Mods:"), false);
oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false);
oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false);
oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false);
oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false);
oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false);
oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false);
oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false);
oled_write_P(PSTR("BTMGK"), false);
static const char PROGMEM mode_logo[4][4] = {
{0x95,0x96,0x0a,0},
{0xb5,0xb6,0x0a,0},
{0x97,0x98,0x0a,0},
{0xb7,0xb8,0x0a,0} };
if (keymap_config.swap_lalt_lgui != false) {
oled_write_P(mode_logo[0], false);
oled_write_P(mode_logo[1], false);
if (keymap_config.swap_lalt_lgui) {
oled_write_P(PSTR(" Mac "), false);
} else {
oled_write_P(mode_logo[2], false);
oled_write_P(mode_logo[3], false);
oled_write_P(PSTR(" Win "), false);
}
uint8_t led_usb_state = host_keyboard_leds();
@ -390,6 +242,8 @@ void render_status(void) {
oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR(" "), false);
oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR(" "), false);
oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR(" SCRL") : PSTR(" "), false);
oled_write(keylog_str, false);
}
@ -401,6 +255,8 @@ void oled_task_user(void) {
oled_scroll_left(); // Turns on scrolling
}
}
void matrix_scan_keymap(void) { update_log(); }
#endif
uint16_t get_tapping_term(uint16_t keycode) {

View File

@ -14,9 +14,10 @@ MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
SWAP_HANDS_ENABLE = no # Enable one-hand typing
RGBLIGHT_STARTUP_ANIMATION = yes
RGB_MATRIX_ENABLE = WS2812
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
@ -24,3 +25,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
BOOTLOADER = qmk-dfu
OLED_DRIVER_ENABLE = yes
ifneq ($(strip $(OLED_DRIVER_ENABLE)), yes)
RGB_MATRIX_SPLIT_RIGHT=yes
endif

View File

@ -9,13 +9,7 @@
#include QMK_KEYBOARD_H
#include "drashna.h"
// Blank template at the bottom
enum customKeycodes {
URL = 1
};
#define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__)
#define LAYOUT_gergo_base( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
@ -23,9 +17,9 @@ enum customKeycodes {
) \
LAYOUT_gergo_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \
KC_TAB, ALT_T(K11), K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \
_______, _______, KC_SPC, LT(_LOWER, KC_BSPC), LT(_RAISE, KC_DEL), KC_ENT, _______, _______ \
KC_TAB, K11, K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, KC_QUOT, \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
KC_GRV, KC_SPC, BK_LWER, OS_LALT, OS_RGUI, DL_RAIS, KC_ENT, _______ \
)
#define LAYOUT_gergo_base_wrapper(...) LAYOUT_gergo_base(__VA_ARGS__)

View File

@ -0,0 +1,2 @@
CONSOLE_ENABLE = no
COMMAND_ENABLE = no

View File

@ -37,7 +37,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define RGBLIGHT_VAL_STEP 12
# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
# define RGBLIGHT_LIMIT_VAL 225
#endif // RGBLIGHT_ENABLE

View File

@ -12,7 +12,7 @@
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \
KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \
)
#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__)

View File

@ -9,6 +9,7 @@ AUDIO_ENABLE = no
NKRO_ENABLE = yes
BACKLIGHT_ENABLE = no
SWAP_HANDS_ENABLE = no
SPACE_CADET_ENABLE = no
INDICATOR_LIGHTS = no
MACROS_ENABLED = no

View File

@ -29,21 +29,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define RGBLIGHT_VAL_STEP 8
# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
#endif // RGBLIGHT_ENABLE
#undef LOCKING_SUPPORT_ENABLE
#undef LOCKING_RESYNC_ENABLE
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
#undef PRODUCT
#define PRODUCT Drashnas Viterbi Macro Pad

View File

@ -8,6 +8,7 @@ RGBLIGHT_ENABLE = yes
AUDIO_ENABLE = yes
NKRO_ENABLE = yes
SPLIT_KEYBOARD = no
SPACE_CADET_ENABLE = no
NO_SECRETS = yes
MACROS_ENABLED = yes

View File

@ -48,7 +48,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# define RGBLIGHT_VAL_STEP 12
# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
#endif // RGBLIGHT_ENABLE
#ifdef AUDIO_ENABLE

View File

@ -39,7 +39,7 @@ uint8_t last_osm;
LAYOUT_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, RAISE, K16, K17, K18, K19, K1A, KC_QUOT, \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF \
)
#define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__)

View File

@ -7,6 +7,7 @@ TAP_DANCE_ENABLE = no
RGBLIGHT_ENABLE = yes
AUDIO_ENABLE = no
NKRO_ENABLE = yes
SPACE_CADET_ENABLE = no
INDICATOR_LIGHTS = yes
MACROS_ENABLED = no

View File

@ -6,7 +6,6 @@
# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3
# define RGBLIGHT_EFFECT_SNAKE_LENGTH 3
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
#endif // RGBLIGHT_ENABLE

View File

@ -20,6 +20,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef UNICODEMAP_ENABLE
#include "drashna_unicode.h"
#endif // UNICODEMAP_ENABLE
#ifndef UNICODE_ENABLE
# define UC(x) KC_NO
#endif
#ifdef RGB_MATRIX_ENABLE
extern bool g_suspend_state;
@ -43,7 +46,7 @@ bool skip_leds = false;
KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \
KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \
KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, RCTL_T(K2A), KC_MRSF, \
KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \
OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \
KC_APP, KC_MENU, \
@ -331,6 +334,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
userspace_config.swapped_numbers ^= 1;
eeconfig_update_user(userspace_config.raw);
}
break;
}
//switch (keycode) {
// case KC_P00:
@ -375,7 +379,7 @@ void matrix_scan_keymap(void) { // runs frequently to update info
}
};
}
bool indicator_is_this_led_used_keyboard(uint8_t index) {
@ -393,11 +397,9 @@ bool indicator_is_this_led_used_keyboard(uint8_t index) {
void suspend_power_down_keymap(void) {
rgb_matrix_set_suspend_state(true);
rgb_matrix_config.enable = false;
}
void suspend_wakeup_init_keymap(void) {
rgb_matrix_config.enable = true;
rgb_matrix_set_suspend_state(false);
}
@ -412,8 +414,16 @@ void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) {
}
void rgb_matrix_indicators_user(void) {
if (g_suspend_state || !rgb_matrix_config.enable || !userspace_config.rgb_layer_change) { return; }
if ( userspace_config.rgb_layer_change &&
#ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
!g_suspend_state &&
#endif
#if defined(RGBLIGHT_ENABLE)
(!rgblight_config.enable && rgb_matrix_config.enable)
#else
rgb_matrix_config.enable
#endif
) {
switch (biton32(layer_state)) {
case _MODS:
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break;
@ -461,33 +471,7 @@ void rgb_matrix_indicators_user(void) {
rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break;
}
}
#if 0
if (this_mod & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MOD_MASK_SHIFT) {
rgb_matrix_set_color(24, 0x00, 0xFF, 0x00);
rgb_matrix_set_color(36, 0x00, 0xFF, 0x00);
}
if (this_mod & MOD_MASK_CTRL || this_osm & MOD_MASK_CTRL) {
rgb_matrix_set_color(25, 0xFF, 0x00, 0x00);
rgb_matrix_set_color(34, 0xFF, 0x00, 0x00);
rgb_matrix_set_color(37, 0xFF, 0x00, 0x00);
}
if (this_mod & MOD_MASK_GUI || this_osm & MOD_MASK_GUI) {
rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00);
}
if (this_mod & MOD_MASK_ALT || this_osm & MOD_MASK_ALT) {
rgb_matrix_set_color(38, 0x00, 0x00, 0xFF);
}
#endif
}
void matrix_init_keymap(void) {
#if 0
#ifdef RGB_MATRIX_KEYPRESSES
rgblight_mode(RGB_MATRIX_MULTISPLASH);
#else
rgblight_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON);
#endif
#endif
}
#endif //RGB_MATRIX_INIT

View File

@ -1,6 +1,7 @@
TAP_DANCE_ENABLE = yes
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
COMMAND_ENABLE = no # Commands for debug and configuration
SPACE_CADET_ENABLE = no
ifneq (,$(findstring ergodox_ez,$(KEYBOARD)))
RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = no

View File

@ -12,4 +12,15 @@
# define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended
// #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
// #define EECONFIG_RGB_MATRIX (uint32_t *)16
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
# define DISABLE_RGB_MATRIX_CYCLE_ALL
# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
# define DISABLE_RGB_MATRIX_DUAL_BEACON
# define DISABLE_RGB_MATRIX_RAINBOW_BEACON
# define DISABLE_RGB_MATRIX_DIGITAL_RAIN
# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#endif

View File

@ -11,7 +11,6 @@
# define RGBLIGHT_VAL_STEP 12
# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
#endif // RGBLIGHT_ENABLE
#if defined(KEYBOARD_primekb_prime_m)

View File

@ -10,22 +10,25 @@
# define RGBLIGHT_VAL_STEP 12
# define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2
# define RGBLIGHT_EFFECT_SNAKE_LENGTH 2
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
# ifdef RGB_MATRIX_ENABLE
# define RGBLIGHT_DISABLE_KEYCODES
# endif
#endif // RGBLIGHT_ENABLE
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot)
// #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened)
// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
#define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended
// #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
# define RGB_DISABLE_WHEN_USB_SUSPENDED true// turn off effects when suspended
# ifndef KEYBOARD_planck_ez
# define EECONFIG_RGB_MATRIX (uint32_t *)15
# endif
#endif
#if defined(KEYBOARD_lets_split_rev2)
# define USE_SERIAL
# undef USE_I2C
# define EE_HANDS
#endif
@ -58,7 +61,7 @@
- MIDI notes can be sent when in Music mode is on
*/
#define MIDI_BASIC
// #define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap

View File

@ -34,6 +34,18 @@ enum planck_keycodes {
#define BACKLIT OSM(MOD_LSFT)
#endif
#ifdef KEYBOARD_planck_ez
# define PLNK_1 BK_LWER
# define PLNK_2 SP_LWER
# define PLNK_3 KC_NO
# define PLNK_4 ET_RAIS
#else
# define PLNK_1 SP_LWER
# define PLNK_2 BK_LWER
# define PLNK_3 DL_RAIS
# define PLNK_4 ET_RAIS
#endif
#define LAYOUT_ortho_4x12_base( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \
@ -42,8 +54,8 @@ enum planck_keycodes {
LAYOUT_ortho_4x12_wrapper( \
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_ENT, \
BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), KC_ENT, \
BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, PLNK_1, PLNK_2, PLNK_3, PLNK_4, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
)
#define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__)
@ -131,7 +143,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
#ifdef BACKLIGHT_ENABLE
case BACKLIT:
if (record->event.pressed) {
@ -167,15 +178,13 @@ bool music_mask_user(uint16_t keycode) {
void suspend_power_down_keymap(void) {
rgb_matrix_set_suspend_state(true);
rgb_matrix_config.enable = false;
}
void suspend_wakeup_init_keymap(void) {
rgb_matrix_config.enable = true;
rgb_matrix_set_suspend_state(false);
}
void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) {
void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) {
rgb_led led;
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
led = g_rgb_leds[i];
@ -189,9 +198,16 @@ void rgb_matrix_indicators_user(void) {
uint8_t this_mod = get_mods();
uint8_t this_led = host_keyboard_leds();
uint8_t this_osm = get_oneshot_mods();
bool is_ez;
#ifdef KEYBOARD_planck_ez
is_ez = true;
#endif
if (!g_suspend_state && userspace_config.rgb_layer_change &&
#if defined(RGBLIGHT_ENABLE) && defined(RGB_MATRIX_ENABLE)
if ( userspace_config.rgb_layer_change &&
#ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
!g_suspend_state &&
#endif
#if defined(RGBLIGHT_ENABLE)
(!rgblight_config.enable && rgb_matrix_config.enable)
#else
rgb_matrix_config.enable
@ -199,42 +215,42 @@ void rgb_matrix_indicators_user(void) {
) {
switch (biton32(layer_state)) {
case _RAISE:
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break;
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break;
case _LOWER:
rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break;
rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break;
case _ADJUST:
rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break;
rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break;
default:
switch (biton32(default_layer_state)) {
case _QWERTY:
rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break;
rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break;
case _COLEMAK:
rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break;
rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break;
case _DVORAK:
rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break;
rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break;
case _WORKMAN:
rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break;
rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break;
case _NORMAN:
rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D, true); break;
rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break;
case _MALTRON:
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, true); break;
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break;
case _EUCALYN:
rgb_matrix_layer_helper(0xFF, 0x80, 0xBF, true); break;
rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break;
case _CARPLAX:
rgb_matrix_layer_helper(0x00, 0x00, 0xFF, true); break;
rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break;
}
}
}
switch (biton32(default_layer_state)) {
case _QWERTY:
rgb_matrix_set_color(42, 0x00, 0xFF, 0xFF); break;
rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); break;
case _COLEMAK:
rgb_matrix_set_color(42, 0xFF, 0x00, 0xFF); break;
rgb_matrix_set_color(is_ez ? 41 : 42, 0xFF, 0x00, 0xFF); break;
case _DVORAK:
rgb_matrix_set_color(42, 0x00, 0xFF, 0x00); break;
rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0x00); break;
case _WORKMAN:
rgb_matrix_set_color(42, 0xD9, 0xA5, 0x21); break;
rgb_matrix_set_color(is_ez ? 41 : 42, 0xD9, 0xA5, 0x21); break;
}
if ( (this_mod | this_osm) & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK)) {
rgb_matrix_set_color(24, 0x00, 0xFF, 0x00);
@ -282,6 +298,7 @@ void encoder_update(bool clockwise) {
#else
clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP);
#endif
break;
case _ADJUST:
#ifdef AUDIO_CLICKY
clockwise ? clicky_freq_up() : clicky_freq_down();
@ -314,3 +331,26 @@ void dip_update(uint8_t index, bool active) {
}
}
#endif // KEYBOARD_planck_rev6
#ifdef KEYBOARD_planck_ez
uint32_t layer_state_set_keymap(uint32_t state) {
palClearPad(GPIOB, 8);
palClearPad(GPIOB, 9);
switch (biton32(state)) {
case _LOWER:
palSetPad(GPIOB, 9);
break;
case _RAISE:
palSetPad(GPIOB, 8);
break;
case _ADJUST:
palSetPad(GPIOB, 9);
palSetPad(GPIOB, 8);
break;
default:
break;
}
return state;
}
#endif

View File

@ -5,6 +5,8 @@ CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
TAP_DANCE_ENABLE = no
AUDIO_ENABLE = yes
SPACE_CADET_ENABLE = no
ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6
RGBLIGHT_ENABLE = yes
INDICATOR_LIGHTS = yes
@ -16,6 +18,15 @@ ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Lig
RGBLIGHT_ENABLE = no
RGBLIGHT_STARTUP_ANIMATION = no
endif
ifneq (,$(findstring planck/ez,$(KEYBOARD))) # Make sure it IS the Planck Light
RGBLIGHT_ENABLE = no
# SERIAL_LINK_ENABLE = yes
ENCODER_ENABLE = no
RGB_MATRIX_ENABLE = IS31FL3737
INDICATOR_LIGHTS = yes
RGBLIGHT_TWINKLE = yes
RGBLIGHT_STARTUP_ANIMATION = yes
endif
ifeq ($(strip $(PROTOCOL)), VUSB)
NKRO_ENABLE = no

View File

@ -18,5 +18,4 @@
# define RGBLIGHT_EFFECT_KNIGHT_OFFSET 3
# define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 14
#endif

View File

@ -1,9 +1,7 @@
stages:
- test
- build
- deploy
Preliminary Test:
QMK Firmware:
stage: test
variables:
GIT_SUBMODULE_STRATEGY: recursive
@ -18,36 +16,7 @@ Preliminary Test:
script:
- make test:all
- make planck/rev6:default planck/rev5:default
QMK Firmware Defaults:
stage: deploy
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- linux
image: ubuntu:18.10
before_script:
- apt-get update -qy
- apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip
- avr-gcc --version
- uname -a
script:
- make test:all
- make all:default -j16
Drashna Firmware:
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
tags:
- linux
image: ubuntu:18.10
before_script:
- apt-get update -qy
- apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip
- avr-gcc --version
script:
- make keebio/iris/rev2:drashna keebio/iris/rev2:drashna_old ergodox_ez:drashna ergodox_ez:drashna_glow keebio/viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna planck/rev6:drashna fractal:drashna primekb/prime_m:drashna -j16 --output-sync
- make keebio/iris/rev2:drashna keebio/iris/rev2:drashna_old ergodox_ez:drashna ergodox_ez:drashna_glow keebio/viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna planck/rev6:drashna fractal:drashna primekb/prime_m:drashna -j2 --output-sync
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:

View File

@ -12,13 +12,6 @@
}
# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
// #ifdef RGBLIGHT_ENABLE
// #define NO_MUSIC_MODE
// #endif //RGBLIGHT_ENABLE/
// #ifndef __arm__
// #undef NOTE_REST
// #define NOTE_REST 1.00f
// #endif // !__arm__
# define UNICODE_SONG_OSX SONG(RICK_ROLL)
# define UNICODE_SONG_LNX SONG(RICK_ROLL)
@ -77,9 +70,12 @@
#endif
// Disable action_get_macro and fn_actions, since we don't use these
// and it saves on space in the firmware.
#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
#define TAP_CODE_DELAY 5
/* Disable unused and unneeded features to reduce on firmware size */
#ifdef LOCKING_SUPPORT_ENABLE
# undef LOCKING_SUPPORT_ENABLE
#endif
#ifdef LOCKING_RESYNC_ENABLE
# undef LOCKING_RESYNC_ENABLE
#endif

View File

@ -104,7 +104,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
uint8_t dtime;
for (dtime = 0; dtime < 4; dtime++) {
diablo_key_time[dtime] = diablo_times[0];
diablo_timer[dtime].key_time = diablo_times[0];
}
}
#endif // TAP_DANCE_ENABLE

View File

@ -150,7 +150,9 @@ void scan_rgblight_fadeout(void) { // Don't effing change this function .... rgb
light->timer = timer_read();
}
else {
if (light->enabled && biton32(layer_state) == 0) { rgblight_sethsv_default_helper(light_index); }
if (light->enabled && biton32(layer_state) == 0) {
rgblight_sethsv_default_helper(light_index);
}
litup = light->enabled = false;
}
}
@ -253,8 +255,8 @@ void keyboard_post_init_rgb(void) {
layer_state_set_user(layer_state);
uint16_t old_hue = rgblight_config.hue;
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
for (uint16_t i = 360; i > 0; i--) {
rgblight_sethsv_noeeprom( ( i + old_hue) % 360, 255, 255);
for (uint16_t i = 255; i > 0; i--) {
rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255);
matrix_scan();
wait_ms(10);
}
@ -329,47 +331,8 @@ uint32_t layer_state_set_rgb(uint32_t state) {
biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it
break;
}
// layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow
}
#endif // RGBLIGHT_ENABLE
return state;
}
#if 0
uint32_t default_layer_state_set_rgb(uint32_t state) {
#ifdef RGBLIGHT_ENABLE
if (userspace_config.rgb_layer_change) {
rgblight_config_t temp_rgblight_config = rgblight_config;
switch (biton32(state)) {
case _COLEMAK:
temp_rgblight_config.hue = 300;
temp_rgblight_config.val = 255;
temp_rgblight_config.sat = 255;
temp_rgblight_config.mode = 1;
break;
case _DVORAK:
temp_rgblight_config.hue = 150;
temp_rgblight_config.val = 255;
temp_rgblight_config.sat = 255;
temp_rgblight_config.mode = 1;
case _WORKMAN:
temp_rgblight_config.hue = 43;
temp_rgblight_config.val = 218;
temp_rgblight_config.sat = 218;
temp_rgblight_config.mode = 1;
default:
temp_rgblight_config.hue = 180;
temp_rgblight_config.val = 255;
temp_rgblight_config.sat = 255;
temp_rgblight_config.mode = 1;
}
if (temp_rgblight_config.raw != eeconfig_read_rgblight()) {
xprintf("rgblight set default layer hsv [EEPROM]: %u,%u,%u,%u\n", temp_rgblight_config.hue, temp_rgblight_config.sat, temp_rgblight_config.val, temp_rgblight_config.mode);
eeconfig_update_rgblight(temp_rgblight_config.raw);
}
}
#endif // RGBLIGHT_ENABLE
return state;
}
#endif

View File

@ -0,0 +1,116 @@
#ifndef RGBLIGHT_EFFECT_BREATHE_TABLE
#define RGBLIGHT_EFFECT_BREATHE_TABLE
const uint8_t rgblight_effect_breathe_table[] PROGMEM = {
/* #define RGBLIGHT_EFFECT_BREATHE_CENTER 0.00 */
/* #define RGBLIGHT_EFFECT_BREATHE_MAX 255 */
#if RGBLIGHT_BREATHE_TABLE_SIZE == 256
0x44, 0x45, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x4e,
0x4f, 0x51, 0x52, 0x54, 0x55, 0x57, 0x58, 0x5a,
0x5c, 0x5d, 0x5f, 0x60, 0x62, 0x64, 0x65, 0x67,
0x69, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x73, 0x75,
0x77, 0x79, 0x7b, 0x7c, 0x7e, 0x80, 0x82, 0x84,
0x86, 0x88, 0x8a, 0x8b, 0x8d, 0x8f, 0x91, 0x93,
0x95, 0x97, 0x99, 0x9b, 0x9d, 0x9f, 0xa1, 0xa3,
0xa5, 0xa7, 0xa9, 0xaa, 0xac, 0xae, 0xb0, 0xb2,
0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe, 0xbf, 0xc1,
0xc3, 0xc5, 0xc7, 0xc9, 0xca, 0xcc, 0xce, 0xd0,
0xd1, 0xd3, 0xd5, 0xd6, 0xd8, 0xda, 0xdb, 0xdd,
0xde, 0xe0, 0xe1, 0xe3, 0xe4, 0xe5, 0xe7, 0xe8,
0xe9, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xf0, 0xf1,
0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf8,
0xf9, 0xfa, 0xfa, 0xfb, 0xfc, 0xfc, 0xfc, 0xfd,
0xfd, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe,
0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfd,
0xfd, 0xfc, 0xfc, 0xfc, 0xfb, 0xfa, 0xfa, 0xf9,
0xf8, 0xf8, 0xf7, 0xf6, 0xf5, 0xf4, 0xf3, 0xf2,
0xf1, 0xf0, 0xef, 0xee, 0xed, 0xec, 0xeb, 0xe9,
0xe8, 0xe7, 0xe5, 0xe4, 0xe3, 0xe1, 0xe0, 0xde,
0xdd, 0xdb, 0xda, 0xd8, 0xd6, 0xd5, 0xd3, 0xd1,
0xd0, 0xce, 0xcc, 0xca, 0xc9, 0xc7, 0xc5, 0xc3,
0xc1, 0xbf, 0xbe, 0xbc, 0xba, 0xb8, 0xb6, 0xb4,
0xb2, 0xb0, 0xae, 0xac, 0xaa, 0xa9, 0xa7, 0xa5,
0xa3, 0xa1, 0x9f, 0x9d, 0x9b, 0x99, 0x97, 0x95,
0x93, 0x91, 0x8f, 0x8d, 0x8b, 0x8a, 0x88, 0x86,
0x84, 0x82, 0x80, 0x7e, 0x7c, 0x7b, 0x79, 0x77,
0x75, 0x73, 0x72, 0x70, 0x6e, 0x6c, 0x6a, 0x69,
0x67, 0x65, 0x64, 0x62, 0x60, 0x5f, 0x5d, 0x5c,
0x5a, 0x58, 0x57, 0x55, 0x54, 0x52, 0x51, 0x4f,
0x4e, 0x4c, 0x4b, 0x4a, 0x48, 0x47, 0x45, 0x44
#endif /* 256 bytes table */
#if RGBLIGHT_BREATHE_TABLE_SIZE == 128
0x44, 0x47, 0x4a, 0x4c,
0x4f, 0x52, 0x55, 0x58,
0x5c, 0x5f, 0x62, 0x65,
0x69, 0x6c, 0x70, 0x73,
0x77, 0x7b, 0x7e, 0x82,
0x86, 0x8a, 0x8d, 0x91,
0x95, 0x99, 0x9d, 0xa1,
0xa5, 0xa9, 0xac, 0xb0,
0xb4, 0xb8, 0xbc, 0xbf,
0xc3, 0xc7, 0xca, 0xce,
0xd1, 0xd5, 0xd8, 0xdb,
0xde, 0xe1, 0xe4, 0xe7,
0xe9, 0xec, 0xee, 0xf0,
0xf2, 0xf4, 0xf6, 0xf8,
0xf9, 0xfa, 0xfc, 0xfc,
0xfd, 0xfe, 0xfe, 0xfe,
0xfe, 0xfe, 0xfe, 0xfe,
0xfd, 0xfc, 0xfb, 0xfa,
0xf8, 0xf7, 0xf5, 0xf3,
0xf1, 0xef, 0xed, 0xeb,
0xe8, 0xe5, 0xe3, 0xe0,
0xdd, 0xda, 0xd6, 0xd3,
0xd0, 0xcc, 0xc9, 0xc5,
0xc1, 0xbe, 0xba, 0xb6,
0xb2, 0xae, 0xaa, 0xa7,
0xa3, 0x9f, 0x9b, 0x97,
0x93, 0x8f, 0x8b, 0x88,
0x84, 0x80, 0x7c, 0x79,
0x75, 0x72, 0x6e, 0x6a,
0x67, 0x64, 0x60, 0x5d,
0x5a, 0x57, 0x54, 0x51,
0x4e, 0x4b, 0x48, 0x45
#endif /* 128 bytes table */
#if RGBLIGHT_BREATHE_TABLE_SIZE == 64
0x44, 0x4a,
0x4f, 0x55,
0x5c, 0x62,
0x69, 0x70,
0x77, 0x7e,
0x86, 0x8d,
0x95, 0x9d,
0xa5, 0xac,
0xb4, 0xbc,
0xc3, 0xca,
0xd1, 0xd8,
0xde, 0xe4,
0xe9, 0xee,
0xf2, 0xf6,
0xf9, 0xfc,
0xfd, 0xfe,
0xfe, 0xfe,
0xfd, 0xfb,
0xf8, 0xf5,
0xf1, 0xed,
0xe8, 0xe3,
0xdd, 0xd6,
0xd0, 0xc9,
0xc1, 0xba,
0xb2, 0xaa,
0xa3, 0x9b,
0x93, 0x8b,
0x84, 0x7c,
0x75, 0x6e,
0x67, 0x60,
0x5a, 0x54,
0x4e, 0x48
#endif /* 64 bytes table */
};
static const int table_scale = 256/sizeof(rgblight_effect_breathe_table);
#endif /* RGBLIGHT_EFFECT_BREATHE_TABLE */

View File

@ -1,6 +1,8 @@
SRC += drashna.c \
process_records.c
LINK_TIME_OPTIMIZATION_ENABLE = yes
ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
SRC += secrets.c
endif
@ -9,9 +11,7 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
SRC += tap_dances.c
endif
ifeq ($(PLATFORM),AVR)
EXTRAFLAGS += -flto
endif
ifeq ($(strip $(NO_SECRETS)), yes)
OPT_DEFS += -DNO_SECRETS
@ -33,7 +33,7 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
endif
endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
SRC += rgb_stuff.c
endif

View File

@ -2,37 +2,38 @@
//define diablo macro timer variables
uint16_t diablo_timer[4];
uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 };
uint8_t diablo_key_time[4];
diablo_timer_t diablo_timer[4];
uint8_t diablo_times[] = { 0, 0, 1, 3, 5, 10, 30 };
// has the correct number of seconds elapsed (as defined by diablo_times)
bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; };
bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer].key_time) < (diablo_timer[dtimer].timer * 1000)) ? false : true; };
// Cycle through the times for the macro, starting at 0, for disabled.
// Max of six values, so don't exceed
void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) {
void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data) {
int index = (int)user_data;
if (state->count >= 7) {
diablo_key_time[diablo_key] = diablo_times[0];
diablo_timer[index].key_time = diablo_times[0];
reset_tap_dance(state);
} else {
diablo_key_time[diablo_key] = diablo_times[state->count - 1];
diablo_timer[index].key_time = diablo_times[state->count];
}
}
// Would rather have one function for all of this, but no idea how to do that...
void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); }
void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); }
void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); }
void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); }
// One funtion to rule them all!!
#define ACTION_TAP_DANCE_DIABLO(arg) { \
.fn = { NULL, (void *)diablo_tapdance_master, NULL }, \
.user_data = (void *)arg, \
}
//Tap Dance Definitions
qk_tap_dance_action_t tap_dance_actions[] = {
// tap once to disable, and more to enable timed micros
[TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1),
[TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2),
[TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3),
[TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4),
[TD_D3_1] = ACTION_TAP_DANCE_DIABLO(0),
[TD_D3_2] = ACTION_TAP_DANCE_DIABLO(1),
[TD_D3_3] = ACTION_TAP_DANCE_DIABLO(2),
[TD_D3_4] = ACTION_TAP_DANCE_DIABLO(3),
};
// Sends the key press to system, but only if on the Diablo layer
@ -56,8 +57,8 @@ void send_diablo_keystroke(uint8_t diablo_key) {
void run_diablo_macro_check(void) {
uint8_t dtime;
for (dtime = 0; dtime < 4; dtime++) {
if (check_dtimer(dtime) && diablo_key_time[dtime]) {
diablo_timer[dtime] = timer_read();
if (check_dtimer(dtime) && diablo_timer[dtime].key_time) {
diablo_timer[dtime].timer = timer_read();
send_diablo_keystroke(dtime);
}
}

View File

@ -2,10 +2,13 @@
#include "drashna.h"
//define diablo macro timer variables
extern uint16_t diablo_timer[4];
extern uint8_t diablo_times[];
extern uint8_t diablo_key_time[4];
typedef struct {
uint16_t timer;
uint8_t key_time;
} diablo_timer_t;
extern diablo_timer_t diablo_timer[4];
void run_diablo_macro_check(void);

View File

@ -15,6 +15,7 @@ expanded before being used as arguments to the LAYOUT_xxx macro.
#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__)
#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__)
#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__)
#define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__)
/*
Blocks for each of the four major keyboard layouts