1
0

190528 updates to get it compiling

Updates to get the package compiling and working for the most part
Bug with reactive lighting for QMK code and keeping caps/num lock lit when on
This commit is contained in:
patrickmt
2019-06-03 10:30:35 -04:00
parent 082c835c26
commit 413a8938f1
16 changed files with 569 additions and 448 deletions

View File

@@ -147,7 +147,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_OFF:
if (record->event.pressed) {
I2C3733_Control_Set(1);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:

View File

@@ -147,7 +147,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_OFF:
if (record->event.pressed) {
I2C3733_Control_Set(1);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:

View File

@@ -150,7 +150,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_OFF:
if (record->event.pressed) {
I2C3733_Control_Set(1);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:

View File

@@ -150,7 +150,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_OFF:
if (record->event.pressed) {
I2C3733_Control_Set(1);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:

View File

@@ -1,101 +0,0 @@
//TODO: JSON
{
"keyboard_name": "SHIFT",
"url": "https://www.massdrop.com/buy/massdrop-shift-mechanical-keyboard",
"maintainer": "Massdrop",
"width": 18.5,
"height": 6.5,
"layouts": {
"LAYOUT": {
"layout": [
{"label":"ESCAPE", "x":0, "y":0},
{"label":"F1", "x":2, "y":0},
{"label":"F2", "x":3, "y":0},
{"label":"F3", "x":4, "y":0},
{"label":"F4", "x":5, "y":0},
{"label":"F5", "x":6.5, "y":0},
{"label":"F6", "x":7.5, "y":0},
{"label":"F7", "x":8.5, "y":0},
{"label":"F8", "x":9.5, "y":0},
{"label":"F9", "x":11, "y":0},
{"label":"F10", "x":12, "y":0},
{"label":"F11", "x":13, "y":0},
{"label":"F12", "x":14, "y":0},
{"label":"PRINT SCREEN", "x":15.5, "y":0},
{"label":"SCROLL LOCK", "x":16.5, "y":0},
{"label":"PAUSE BREAK", "x":17.5, "y":0},
{"label":"BACKTICK", "x":0, "y":1.5},
{"label":"1", "x":1, "y":1.5},
{"label":"2", "x":2, "y":1.5},
{"label":"3", "x":3, "y":1.5},
{"label":"4", "x":4, "y":1.5},
{"label":"5", "x":5, "y":1.5},
{"label":"6", "x":6, "y":1.5},
{"label":"7", "x":7, "y":1.5},
{"label":"8", "x":8, "y":1.5},
{"label":"9", "x":9, "y":1.5},
{"label":"0", "x":10, "y":1.5},
{"label":"MINUS", "x":11, "y":1.5},
{"label":"EQUALS", "x":12, "y":1.5},
{"label":"BACKSPACE", "x":13, "y":1.5, "w":2},
{"label":"INSERT", "x":15.5, "y":1.5},
{"label":"HOME", "x":16.5, "y":1.5},
{"label":"PAGE UP", "x":17.5, "y":1.5},
{"label":"TAB", "x":0, "y":2.5, "w":1.5},
{"label":"Q", "x":1.5, "y":2.5},
{"label":"W", "x":2.5, "y":2.5},
{"label":"E", "x":3.5, "y":2.5},
{"label":"R", "x":4.5, "y":2.5},
{"label":"T", "x":5.5, "y":2.5},
{"label":"Y", "x":6.5, "y":2.5},
{"label":"U", "x":7.5, "y":2.5},
{"label":"I", "x":8.5, "y":2.5},
{"label":"O", "x":9.5, "y":2.5},
{"label":"P", "x":10.5, "y":2.5},
{"label":"LEFT BRACKET", "x":11.5, "y":2.5},
{"label":"RIGHT BRACKET", "x":12.5, "y":2.5},
{"label":"BACK SLASH", "x":13.5, "y":2.5, "w":1.5},
{"label":"DELETE", "x":15.5, "y":2.5},
{"label":"END", "x":16.5, "y":2.5},
{"label":"PAGE DOWN", "x":17.5, "y":2.5},
{"label":"CAPS LOCK", "x":0, "y":3.5, "w":1.75},
{"label":"A", "x":1.75, "y":3.5},
{"label":"S", "x":2.75, "y":3.5},
{"label":"D", "x":3.75, "y":3.5},
{"label":"F", "x":4.75, "y":3.5},
{"label":"G", "x":5.75, "y":3.5},
{"label":"H", "x":6.75, "y":3.5},
{"label":"J", "x":7.75, "y":3.5},
{"label":"K", "x":8.75, "y":3.5},
{"label":"L", "x":9.75, "y":3.5},
{"label":"SEMICOLON", "x":10.75, "y":3.5},
{"label":"SINGLE TICK", "x":11.75, "y":3.5},
{"label":"ENTER", "x":12.75, "y":3.5, "w":2.25},
{"label":"LEFT SHIFT", "x":0, "y":4.5, "w":2.25},
{"label":"Z", "x":2.25, "y":4.5},
{"label":"X", "x":3.25, "y":4.5},
{"label":"C", "x":4.25, "y":4.5},
{"label":"V", "x":5.25, "y":4.5},
{"label":"B", "x":6.25, "y":4.5},
{"label":"N", "x":7.25, "y":4.5},
{"label":"M", "x":8.25, "y":4.5},
{"label":"COMMA", "x":9.25, "y":4.5},
{"label":"PERIOD", "x":10.25, "y":4.5},
{"label":"FORWARD SLASH", "x":11.25, "y":4.5},
{"label":"RIGHT SHIFT", "x":12.25, "y":4.5, "w":2.75},
{"label":"UP ARROW", "x":16.5, "y":4.5},
{"label":"LEFT CTRL", "x":0.005, "y":5.5, "w":1.24},
{"label":"LEFT WIN", "x":1.255, "y":5.5, "w":1.24},
{"label":"LEFT ALT", "x":2.505, "y":5.5, "w":1.24},
{"label":"SPACEBAR", "x":3.75, "y":5.5, "w":6.25},
{"label":"RIGHT ALT", "x":10, "y":5.5, "w":1.25},
{"label":"FN", "x":11.25, "y":5.5, "w":1.25},
{"label":"MENU", "x":12.5, "y":5.5, "w":1.25},
{"label":"RIGHT CTRL", "x":13.75, "y":5.5, "w":1.25},
{"label":"LEFT ARROW", "x":15.5, "y":5.5},
{"label":"DOWN ARROW", "x":16.5, "y":5.5},
{"label":"RIGHT ARROW", "x":17.5, "y":5.5}
]
}
}
}

View File

@@ -1,6 +1,6 @@
#include QMK_KEYBOARD_H
enum ctrl_keycodes {
enum rocketeer_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
@@ -137,20 +137,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_ONF:
if (record->event.pressed) {
led_enabled = !led_enabled;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
led_enabled = 0;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:
@@ -207,8 +204,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case DBG_TOG:
@@ -248,3 +244,43 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void rgb_matrix_init_user(void) {
led_lighting_mode = LED_MODE_INDICATORS_ONLY; //Start Rocketeer with only indicator lights
}
led_instruction_t led_instructions[] = {
//LEDs are normally inactive, no processing is performed on them
//Flags are used in matching criteria for an LED to be active and indicate how to color it
//Flags can be found in tmk_core/protocol/arm_atsam/led_matrix.h (prefixed with LED_FLAG_)
//LED IDs can be found in config_led.h in the keyboard's directory
//Examples are below
//All LEDs use the user's selected pattern (this is the factory default)
{ .flags = LED_FLAG_USE_ROTATE_PATTERN },
//Specific LEDs use the user's selected pattern while all others are off
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 0xFFFFFFFF, .id1 = 0xAAAAAAAA, .id2 = 0x55555555, .id3 = 0x11111111 },
//Specific LEDs use specified RGB values while all others are off
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 },
//All LEDs use the user's selected pattern
//On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green
//When layer 1 is active, key LEDs use red (id0 32 - 17: 1111 1111 1111 1111 0000 0000 0000 0000 = 0xFFFF0000) (except top row 16 - 1)
//When layer 1 is active, key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//When layer 1 is active, key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF)
//When layer 1 is active, edge LEDs use green (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000)
//When layer 1 is active, edge LEDs use green (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF)
// { .flags = LED_FLAG_USE_ROTATE_PATTERN },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id0 = 0xFFFF0000, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255, .layer = 1 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id2 = 0xFF800000, .id3 = 0x00FFFFFF, .g = 127, .layer = 1 },
//All key LEDs use red while edge LEDs use the active pattern
//All key LEDs use red (id0 32 - 1: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//All key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//All key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF)
//Edge uses active pattern (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000)
//Edge uses active pattern (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF)
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFFFFFFFF, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN , .id2 = 0xFF800000, .id3 = 0x00FFFFFF },
//end must be set to 1 to indicate end of instruction set
{ .end = 1 }
};

View File

@@ -1,6 +1,6 @@
#include QMK_KEYBOARD_H
enum ctrl_keycodes {
enum rocketeer_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
@@ -137,20 +137,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_ONF:
if (record->event.pressed) {
led_enabled = !led_enabled;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
led_enabled = 0;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:
@@ -207,8 +204,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case DBG_TOG:
@@ -248,3 +244,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void rgb_matrix_init_user(void) {
led_lighting_mode = LED_MODE_INDICATORS_ONLY; //Start Rocketeer with only indicator lights
}
led_instruction_t led_instructions[] = {
//Please see ../default_md/keymap.c for examples
//All LEDs use the user's selected pattern (this is the factory default)
{ .flags = LED_FLAG_USE_ROTATE_PATTERN },
//end must be set to 1 to indicate end of instruction set
{ .end = 1 }
};

View File

@@ -1,20 +0,0 @@
# SHIFT
![SHIFT](https://massdrop-s3.imgix.net/product-images/massdrop-ntkl-mechanical-keyboard/FP/W6zvr0cTR4KVDY5z8rwp_AI7B6588%20copy%20page.jpg?auto=format&fm=jpg&fit=max&w=700&h=467&dpr=1&q=80)
The Massdrop SHIFT is a TKL mechanical keyboard featuring dual USB-C connectors, an integrated Hi-Speed USB 2.0 hub, and fully customizable RGB backlighting and underlighting.
Keyboard Maintainer: [Massdrop](https://github.com/massdrop)
Hardware Supported: Massdrop, Inc. SHIFT PCBs utilizing Microchip's ATSAMD51J18A MCU and USB2422 2-Port USB 2.0 Hi-Speed Hub Controller, and ISSI's IS31FL3733 LED Drivers.
Hardware Availability: [Massdrop SHIFT Mechanical Keyboard](https://www.massdrop.com/buy/massdrop-shift-mechanical-keyboard)
Make example for this keyboard (after setting up your build environment):
make massdrop/shift:default
For information on flashing this keyboard, visit the following links:
[Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1)
[Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader)
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).

View File

@@ -0,0 +1,178 @@
#ifdef RGB_MATRIX_ENABLE
#include "shift.h"
#include "led_matrix.h"
#include "rgb_matrix.h"
#include "config_led.h"
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
{ { 0|(0<<4) }, { 6, 5 }, 0 },
{ { 0|(1<<4) }, { 29, 5 }, 0 },
{ { 0|(2<<4) }, { 41, 5 }, 0 },
{ { 2|(2<<4) }, { 52, 5 }, 0 },
{ { 0|(3<<4) }, { 63, 5 }, 0 },
{ { 0|(4<<4) }, { 81, 5 }, 0 },
{ { 0|(5<<4) }, { 92, 5 }, 0 },
{ { 0|(6<<4) }, { 103, 5 }, 0 },
{ { 2|(6<<4) }, { 115, 5 }, 0 },
{ { 0|(7<<4) }, { 132, 5 }, 0 },
{ { 2|(7<<4) }, { 143, 5 }, 0 },
{ { 1|(0<<4) }, { 155, 5 }, 0 },
{ { 3|(0<<4) }, { 166, 5 }, 0 },
{ { 1|(1<<4) }, { 183, 5 }, 0 },
{ { 1|(2<<4) }, { 195, 5 }, 0 },
{ { 1|(3<<4) }, { 206, 5 }, 0 },
{ { 1|(4<<4) }, { 218, 5 }, 0 },
{ { 3|(1<<4) }, { 183, 13 }, 0 },
{ { 3|(2<<4) }, { 195, 13 }, 0 },
{ { 3|(3<<4) }, { 206, 13 }, 0 },
{ { 3|(4<<4) }, { 218, 13 }, 1 },
{ { 2|(0<<4) }, { 6, 22 }, 0 },
{ { 2|(1<<4) }, { 18, 22 }, 0 },
{ { 4|(1<<4) }, { 29, 22 }, 0 },
{ { 4|(2<<4) }, { 41, 22 }, 0 },
{ { 6|(2<<4) }, { 52, 22 }, 0 },
{ { 2|(3<<4) }, { 63, 22 }, 0 },
{ { 4|(3<<4) }, { 75, 22 }, 0 },
{ { 2|(4<<4) }, { 86, 22 }, 0 },
{ { 2|(5<<4) }, { 98, 22 }, 0 },
{ { 4|(5<<4) }, { 109, 22 }, 0 },
{ { 4|(6<<4) }, { 121, 22 }, 0 },
{ { 6|(6<<4) }, { 132, 22 }, 0 },
{ { 4|(7<<4) }, { 143, 22 }, 0 },
{ { 5|(0<<4) }, { 161, 22 }, 0 },
{ { 5|(1<<4) }, { 183, 22 }, 1 },
{ { 5|(2<<4) }, { 195, 22 }, 0 },
{ { 5|(3<<4) }, { 206, 22 }, 0 },
{ { 5|(4<<4) }, { 218, 22 }, 0 },
{ { 4|(0<<4) }, { 9, 31 }, 0 },
{ { 6|(1<<4) }, { 23, 31 }, 0 },
{ { 8|(1<<4) }, { 35, 31 }, 0 },
{ { 8|(2<<4) }, { 46, 31 }, 0 },
{ { 6|(3<<4) }, { 58, 31 }, 0 },
{ { 8|(3<<4) }, { 69, 31 }, 0 },
{ { 4|(4<<4) }, { 81, 31 }, 0 },
{ { 6|(4<<4) }, { 92, 31 }, 0 },
{ { 6|(5<<4) }, { 103, 31 }, 0 },
{ { 8|(5<<4) }, { 115, 31 }, 0 },
{ { 8|(6<<4) }, { 126, 31 }, 0 },
{ { 6|(7<<4) }, { 138, 31 }, 0 },
{ { 7|(0<<4) }, { 149, 31 }, 0 },
{ { 9|(0<<4) }, { 163, 31 }, 0 },
{ { 7|(1<<4) }, { 183, 31 }, 0 },
{ { 7|(2<<4) }, { 195, 31 }, 0 },
{ { 7|(3<<4) }, { 206, 31 }, 0 },
{ { 7|(4<<4) }, { 218, 31 }, 0 },
{ { 6|(0<<4) }, { 11, 40 }, 1 },
{ { 10|(1<<4) }, { 26, 40 }, 0 },
{ { 12|(1<<4) }, { 38, 40 }, 0 },
{ { 10|(2<<4) }, { 49, 40 }, 0 },
{ { 10|(3<<4) }, { 61, 40 }, 0 },
{ { 12|(3<<4) }, { 72, 40 }, 0 },
{ { 8|(4<<4) }, { 83, 40 }, 0 },
{ { 10|(4<<4) }, { 95, 40 }, 0 },
{ { 10|(5<<4) }, { 106, 40 }, 0 },
{ { 10|(6<<4) }, { 118, 40 }, 0 },
{ { 8|(7<<4) }, { 129, 40 }, 0 },
{ { 11|(0<<4) }, { 141, 40 }, 0 },
{ { 13|(0<<4) }, { 159, 40 }, 0 },
{ { 9|(1<<4) }, { 183, 40 }, 0 },
{ { 9|(2<<4) }, { 195, 40 }, 0 },
{ { 9|(3<<4) }, { 206, 40 }, 0 },
{ { 9|(4<<4) }, { 218, 40 }, 0 },
{ { 8|(0<<4) }, { 13, 48 }, 0 },
{ { 14|(1<<4) }, { 32, 48 }, 0 },
{ { 12|(2<<4) }, { 43, 48 }, 0 },
{ { 14|(2<<4) }, { 55, 48 }, 0 },
{ { 14|(3<<4) }, { 66, 48 }, 0 },
{ { 12|(4<<4) }, { 78, 48 }, 0 },
{ { 14|(5<<4) }, { 89, 48 }, 0 },
{ { 12|(5<<4) }, { 101, 48 }, 0 },
{ { 12|(6<<4) }, { 112, 48 }, 0 },
{ { 10|(7<<4) }, { 123, 48 }, 0 },
{ { 12|(7<<4) }, { 135, 48 }, 0 },
{ { 15|(0<<4) }, { 151, 48 }, 0 },
{ { 11|(1<<4) }, { 183, 48 }, 0 },
{ { 11|(2<<4) }, { 195, 48 }, 0 },
{ { 11|(3<<4) }, { 206, 48 }, 0 },
{ { 13|(1<<4) }, { 169, 51 }, 0 },
{ { 11|(4<<4) }, { 218, 53 }, 0 },
{ { 10|(0<<4) }, { 8, 57 }, 0 },
{ { 12|(0<<4) }, { 22, 57 }, 0 },
{ { 14|(0<<4) }, { 36, 57 }, 0 },
{ { 14|(4<<4) }, { 79, 57 }, 0 },
{ { 14|(6<<4) }, { 123, 57 }, 0 },
{ { 14|(7<<4) }, { 141, 57 }, 0 },
{ { 13|(3<<4) }, { 195, 57 }, 0 },
{ { 13|(4<<4) }, { 206, 57 }, 0 },
{ { 15|(1<<4) }, { 158, 59 }, 0 },
{ { 15|(2<<4) }, { 169, 59 }, 0 },
{ { 13|(2<<4) }, { 181, 59 }, 0 },
{ { 0xFF }, { 2, 1 }, 0 },
{ { 0xFF }, { 12, 0 }, 0 },
{ { 0xFF }, { 32, 0 }, 0 },
{ { 0xFF }, { 42, 0 }, 0 },
{ { 0xFF }, { 52, 0 }, 0 },
{ { 0xFF }, { 62, 0 }, 0 },
{ { 0xFF }, { 72, 0 }, 0 },
{ { 0xFF }, { 82, 0 }, 0 },
{ { 0xFF }, { 92, 0 }, 0 },
{ { 0xFF }, { 102, 0 }, 0 },
{ { 0xFF }, { 112, 0 }, 0 },
{ { 0xFF }, { 122, 0 }, 0 },
{ { 0xFF }, { 132, 0 }, 0 },
{ { 0xFF }, { 142, 0 }, 0 },
{ { 0xFF }, { 152, 0 }, 0 },
{ { 0xFF }, { 162, 0 }, 0 },
{ { 0xFF }, { 172, 0 }, 0 },
{ { 0xFF }, { 182, 0 }, 0 },
{ { 0xFF }, { 192, 0 }, 0 },
{ { 0xFF }, { 212, 0 }, 0 },
{ { 0xFF }, { 222, 1 }, 0 },
{ { 0xFF }, { 224, 9 }, 0 },
{ { 0xFF }, { 224, 17 }, 0 },
{ { 0xFF }, { 224, 24 }, 0 },
{ { 0xFF }, { 224, 32 }, 0 },
{ { 0xFF }, { 224, 40 }, 0 },
{ { 0xFF }, { 224, 47 }, 0 },
{ { 0xFF }, { 224, 55 }, 0 },
{ { 0xFF }, { 222, 63 }, 0 },
{ { 0xFF }, { 212, 64 }, 0 },
{ { 0xFF }, { 202, 64 }, 0 },
{ { 0xFF }, { 192, 64 }, 0 },
{ { 0xFF }, { 182, 64 }, 0 },
{ { 0xFF }, { 172, 64 }, 0 },
{ { 0xFF }, { 162, 64 }, 0 },
{ { 0xFF }, { 152, 64 }, 0 },
{ { 0xFF }, { 142, 64 }, 0 },
{ { 0xFF }, { 132, 64 }, 0 },
{ { 0xFF }, { 122, 64 }, 0 },
{ { 0xFF }, { 112, 64 }, 0 },
{ { 0xFF }, { 102, 64 }, 0 },
{ { 0xFF }, { 92, 64 }, 0 },
{ { 0xFF }, { 82, 64 }, 0 },
{ { 0xFF }, { 72, 64 }, 0 },
{ { 0xFF }, { 62, 64 }, 0 },
{ { 0xFF }, { 52, 64 }, 0 },
{ { 0xFF }, { 42, 64 }, 0 },
{ { 0xFF }, { 32, 64 }, 0 },
{ { 0xFF }, { 22, 64 }, 0 },
{ { 0xFF }, { 12, 64 }, 0 },
{ { 0xFF }, { 2, 63 }, 0 },
{ { 0xFF }, { 0, 55 }, 0 },
{ { 0xFF }, { 0, 47 }, 0 },
{ { 0xFF }, { 0, 40 }, 0 },
{ { 0xFF }, { 0, 32 }, 0 },
{ { 0xFF }, { 0, 24 }, 0 },
{ { 0xFF }, { 0, 17 }, 0 },
{ { 0xFF }, { 0, 9 }, 0 },
};
#ifdef USB_LED_INDICATOR_ENABLE
void rgb_matrix_indicators_kb(void)
{
led_matrix_indicators();
}
#endif // USB_LED_INDICATOR_ENABLE
#endif

View File

@@ -1,101 +0,0 @@
//TODO: JSON
{
"keyboard_name": "SHIFT",
"url": "https://www.massdrop.com/buy/massdrop-shift-mechanical-keyboard",
"maintainer": "Massdrop",
"width": 18.5,
"height": 6.5,
"layouts": {
"LAYOUT": {
"layout": [
{"label":"ESCAPE", "x":0, "y":0},
{"label":"F1", "x":2, "y":0},
{"label":"F2", "x":3, "y":0},
{"label":"F3", "x":4, "y":0},
{"label":"F4", "x":5, "y":0},
{"label":"F5", "x":6.5, "y":0},
{"label":"F6", "x":7.5, "y":0},
{"label":"F7", "x":8.5, "y":0},
{"label":"F8", "x":9.5, "y":0},
{"label":"F9", "x":11, "y":0},
{"label":"F10", "x":12, "y":0},
{"label":"F11", "x":13, "y":0},
{"label":"F12", "x":14, "y":0},
{"label":"PRINT SCREEN", "x":15.5, "y":0},
{"label":"SCROLL LOCK", "x":16.5, "y":0},
{"label":"PAUSE BREAK", "x":17.5, "y":0},
{"label":"BACKTICK", "x":0, "y":1.5},
{"label":"1", "x":1, "y":1.5},
{"label":"2", "x":2, "y":1.5},
{"label":"3", "x":3, "y":1.5},
{"label":"4", "x":4, "y":1.5},
{"label":"5", "x":5, "y":1.5},
{"label":"6", "x":6, "y":1.5},
{"label":"7", "x":7, "y":1.5},
{"label":"8", "x":8, "y":1.5},
{"label":"9", "x":9, "y":1.5},
{"label":"0", "x":10, "y":1.5},
{"label":"MINUS", "x":11, "y":1.5},
{"label":"EQUALS", "x":12, "y":1.5},
{"label":"BACKSPACE", "x":13, "y":1.5, "w":2},
{"label":"INSERT", "x":15.5, "y":1.5},
{"label":"HOME", "x":16.5, "y":1.5},
{"label":"PAGE UP", "x":17.5, "y":1.5},
{"label":"TAB", "x":0, "y":2.5, "w":1.5},
{"label":"Q", "x":1.5, "y":2.5},
{"label":"W", "x":2.5, "y":2.5},
{"label":"E", "x":3.5, "y":2.5},
{"label":"R", "x":4.5, "y":2.5},
{"label":"T", "x":5.5, "y":2.5},
{"label":"Y", "x":6.5, "y":2.5},
{"label":"U", "x":7.5, "y":2.5},
{"label":"I", "x":8.5, "y":2.5},
{"label":"O", "x":9.5, "y":2.5},
{"label":"P", "x":10.5, "y":2.5},
{"label":"LEFT BRACKET", "x":11.5, "y":2.5},
{"label":"RIGHT BRACKET", "x":12.5, "y":2.5},
{"label":"BACK SLASH", "x":13.5, "y":2.5, "w":1.5},
{"label":"DELETE", "x":15.5, "y":2.5},
{"label":"END", "x":16.5, "y":2.5},
{"label":"PAGE DOWN", "x":17.5, "y":2.5},
{"label":"CAPS LOCK", "x":0, "y":3.5, "w":1.75},
{"label":"A", "x":1.75, "y":3.5},
{"label":"S", "x":2.75, "y":3.5},
{"label":"D", "x":3.75, "y":3.5},
{"label":"F", "x":4.75, "y":3.5},
{"label":"G", "x":5.75, "y":3.5},
{"label":"H", "x":6.75, "y":3.5},
{"label":"J", "x":7.75, "y":3.5},
{"label":"K", "x":8.75, "y":3.5},
{"label":"L", "x":9.75, "y":3.5},
{"label":"SEMICOLON", "x":10.75, "y":3.5},
{"label":"SINGLE TICK", "x":11.75, "y":3.5},
{"label":"ENTER", "x":12.75, "y":3.5, "w":2.25},
{"label":"LEFT SHIFT", "x":0, "y":4.5, "w":2.25},
{"label":"Z", "x":2.25, "y":4.5},
{"label":"X", "x":3.25, "y":4.5},
{"label":"C", "x":4.25, "y":4.5},
{"label":"V", "x":5.25, "y":4.5},
{"label":"B", "x":6.25, "y":4.5},
{"label":"N", "x":7.25, "y":4.5},
{"label":"M", "x":8.25, "y":4.5},
{"label":"COMMA", "x":9.25, "y":4.5},
{"label":"PERIOD", "x":10.25, "y":4.5},
{"label":"FORWARD SLASH", "x":11.25, "y":4.5},
{"label":"RIGHT SHIFT", "x":12.25, "y":4.5, "w":2.75},
{"label":"UP ARROW", "x":16.5, "y":4.5},
{"label":"LEFT CTRL", "x":0.005, "y":5.5, "w":1.24},
{"label":"LEFT WIN", "x":1.255, "y":5.5, "w":1.24},
{"label":"LEFT ALT", "x":2.505, "y":5.5, "w":1.24},
{"label":"SPACEBAR", "x":3.75, "y":5.5, "w":6.25},
{"label":"RIGHT ALT", "x":10, "y":5.5, "w":1.25},
{"label":"FN", "x":11.25, "y":5.5, "w":1.25},
{"label":"MENU", "x":12.5, "y":5.5, "w":1.25},
{"label":"RIGHT CTRL", "x":13.75, "y":5.5, "w":1.25},
{"label":"LEFT ARROW", "x":15.5, "y":5.5},
{"label":"DOWN ARROW", "x":16.5, "y":5.5},
{"label":"RIGHT ARROW", "x":17.5, "y":5.5}
]
}
}
}

View File

@@ -1,28 +1,12 @@
#include QMK_KEYBOARD_H
enum ctrl_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
L_EDG_D, //LED Edge Brightness Decrease
L_EDG_M, //LED Edge lighting mode
L_PTN, //LED Pattern Select Next
L_PTP, //LED Pattern Select Previous
L_PSI, //LED Pattern Speed Increase
L_PSD, //LED Pattern Speed Decrease
L_T_MD, //LED Toggle Mode
L_T_ONF, //LED Toggle On / Off
L_ON, //LED On
L_OFF, //LED Off
L_T_BR, //LED Toggle Breath Effect
L_T_PTD, //LED Toggle Scrolling Pattern Direction and effect
U_T_AGCR, //USB Toggle Automatic GCR control
DBG_TOG, //DEBUG Toggle On / Off
DBG_MTRX, //DEBUG Toggle Matrix Prints
DBG_KBD, //DEBUG Toggle Keyboard Prints
DBG_MOU, //DEBUG Toggle Mouse Prints
DBG_FAC, //DEBUG Factory light testing (All on white)
MD_BOOT //Restart into bootloader after hold timeout
U_T_AGCR = SAFE_RANGE, //USB Toggle Automatic GCR control
DBG_TOG, //DEBUG Toggle On / Off
DBG_MTRX, //DEBUG Toggle Matrix Prints
DBG_KBD, //DEBUG Toggle Keyboard Prints
DBG_MOU, //DEBUG Toggle Mouse Prints
MD_BOOT, //Restart into bootloader after hold timeout
};
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
@@ -45,11 +29,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, KC_MUTE, \
KC_MPRV, KC_MNXT, KC_VOLD, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, _______, _______, _______, _______, \
L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, \
_______, _______, _______, DBG_FAC, KC_APP, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______ \
),
/*
@@ -75,154 +59,19 @@ void matrix_init_user(void) {
void matrix_scan_user(void) {
};
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
static uint8_t scroll_effect = 0;
switch (keycode) {
case L_BRI:
if (record->event.pressed) {
if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX;
else gcr_desired += LED_GCR_STEP;
if (led_animation_breathing) gcr_breathe = gcr_desired;
}
return false;
case L_BRD:
if (record->event.pressed) {
if (LED_GCR_STEP > gcr_desired) gcr_desired = 0;
else gcr_desired -= LED_GCR_STEP;
if (led_animation_breathing) gcr_breathe = gcr_desired;
}
return false;
case L_EDG_M:
if (record->event.pressed) {
led_edge_mode++;
if (led_edge_mode > LED_EDGE_MODE_MAX) {
led_edge_mode = LED_EDGE_MODE_ALL;
}
}
return false;
case L_EDG_I:
if (record->event.pressed) {
led_edge_brightness += 0.1;
if (led_edge_brightness > 1) { led_edge_brightness = 1; }
}
return false;
case L_EDG_D:
if (record->event.pressed) {
led_edge_brightness -= 0.1;
if (led_edge_brightness < 0) { led_edge_brightness = 0; }
}
return false;
case L_PTN:
if (record->event.pressed) {
if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
else led_animation_id++;
}
return false;
case L_PTP:
if (record->event.pressed) {
if (led_animation_id == 0) led_animation_id = led_setups_count - 1;
else led_animation_id--;
}
return false;
case L_PSI:
if (record->event.pressed) {
led_animation_speed += ANIMATION_SPEED_STEP;
}
return false;
case L_PSD:
if (record->event.pressed) {
led_animation_speed -= ANIMATION_SPEED_STEP;
if (led_animation_speed < 0) led_animation_speed = 0;
}
return false;
case L_T_MD:
if (record->event.pressed) {
led_lighting_mode++;
if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL;
}
return false;
case L_T_ONF:
if (record->event.pressed) {
led_enabled = !led_enabled;
I2C3733_Control_Set(led_enabled);
}
return false;
case L_ON:
if (record->event.pressed) {
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
}
return false;
case L_OFF:
if (record->event.pressed) {
led_enabled = 0;
I2C3733_Control_Set(led_enabled);
}
return false;
case L_T_BR:
if (record->event.pressed) {
led_animation_breathing = !led_animation_breathing;
if (led_animation_breathing) {
gcr_breathe = gcr_desired;
led_animation_breathe_cur = BREATHE_MIN_STEP;
breathe_dir = 1;
}
}
return false;
case L_T_PTD:
if (record->event.pressed) {
scroll_effect++;
if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 0;
} else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
led_animation_direction = 1;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
led_animation_direction = 0;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 4) { //Patterns with scroll explode from center
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 1;
} else if (scroll_effect == 5) { //Patterns with scroll implode on center
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 1;
} else { //Patterns with scroll move horizontal (Left to right)
scroll_effect = 0;
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 0;
}
}
return false;
case U_T_AGCR:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
}
return false;
case DBG_FAC:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
led_lighting_mode = LED_MODE_NORMAL;
led_edge_brightness = 1;
led_edge_mode = LED_EDGE_MODE_ALL;
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
}
return false;
case DBG_TOG:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");

View File

@@ -0,0 +1,294 @@
#include QMK_KEYBOARD_H
enum shift_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
L_EDG_D, //LED Edge Brightness Decrease
L_EDG_M, //LED Edge lighting mode
L_PTN, //LED Pattern Select Next
L_PTP, //LED Pattern Select Previous
L_PSI, //LED Pattern Speed Increase
L_PSD, //LED Pattern Speed Decrease
L_T_MD, //LED Toggle Mode
L_T_ONF, //LED Toggle On / Off
L_ON, //LED On
L_OFF, //LED Off
L_T_BR, //LED Toggle Breath Effect
L_T_PTD, //LED Toggle Scrolling Pattern Direction and effect
U_T_AGCR, //USB Toggle Automatic GCR control
DBG_TOG, //DEBUG Toggle On / Off
DBG_MTRX, //DEBUG Toggle Matrix Prints
DBG_KBD, //DEBUG Toggle Keyboard Prints
DBG_MOU, //DEBUG Toggle Mouse Prints
DBG_FAC, //DEBUG Factory light testing (All on white)
MD_BOOT //Restart into bootloader after hold timeout
};
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_HOME, KC_PGUP, KC_PAUS, \
KC_DEL, KC_END, KC_PGDN, KC_SLCK, \
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PSCR, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, \
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_P1, KC_P2, KC_P3, \
KC_UP, KC_PENT, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_P0, KC_PDOT, \
KC_LEFT, KC_DOWN, KC_RGHT \
),
[1] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, KC_MUTE, \
KC_MPRV, KC_MNXT, KC_VOLD, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, _______, _______, _______, _______, \
L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, \
_______, _______, _______, DBG_FAC, KC_APP, _______, _______, _______, \
_______, _______, _______ \
),
/*
[X] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______ \
),
*/
};
// Runs just one time when the keyboard initializes.
void matrix_init_user(void) {
};
// Runs constantly in the background, in a loop.
void matrix_scan_user(void) {
};
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
static uint8_t scroll_effect = 0;
switch (keycode) {
case L_BRI:
if (record->event.pressed) {
if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX;
else gcr_desired += LED_GCR_STEP;
if (led_animation_breathing) gcr_breathe = gcr_desired;
}
return false;
case L_BRD:
if (record->event.pressed) {
if (LED_GCR_STEP > gcr_desired) gcr_desired = 0;
else gcr_desired -= LED_GCR_STEP;
if (led_animation_breathing) gcr_breathe = gcr_desired;
}
return false;
case L_EDG_M:
if (record->event.pressed) {
led_edge_mode++;
if (led_edge_mode > LED_EDGE_MODE_MAX) {
led_edge_mode = LED_EDGE_MODE_ALL;
}
}
return false;
case L_EDG_I:
if (record->event.pressed) {
led_edge_brightness += 0.1;
if (led_edge_brightness > 1) { led_edge_brightness = 1; }
}
return false;
case L_EDG_D:
if (record->event.pressed) {
led_edge_brightness -= 0.1;
if (led_edge_brightness < 0) { led_edge_brightness = 0; }
}
return false;
case L_PTN:
if (record->event.pressed) {
if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
else led_animation_id++;
}
return false;
case L_PTP:
if (record->event.pressed) {
if (led_animation_id == 0) led_animation_id = led_setups_count - 1;
else led_animation_id--;
}
return false;
case L_PSI:
if (record->event.pressed) {
led_animation_speed += ANIMATION_SPEED_STEP;
}
return false;
case L_PSD:
if (record->event.pressed) {
led_animation_speed -= ANIMATION_SPEED_STEP;
if (led_animation_speed < 0) led_animation_speed = 0;
}
return false;
case L_T_MD:
if (record->event.pressed) {
led_lighting_mode++;
if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL;
}
return false;
case L_T_ONF:
if (record->event.pressed) {
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:
if (record->event.pressed) {
led_animation_breathing = !led_animation_breathing;
if (led_animation_breathing) {
gcr_breathe = gcr_desired;
led_animation_breathe_cur = BREATHE_MIN_STEP;
breathe_dir = 1;
}
}
return false;
case L_T_PTD:
if (record->event.pressed) {
scroll_effect++;
if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 0;
} else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
led_animation_direction = 1;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
led_animation_direction = 0;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 4) { //Patterns with scroll explode from center
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 1;
} else if (scroll_effect == 5) { //Patterns with scroll implode on center
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 1;
} else { //Patterns with scroll move horizontal (Left to right)
scroll_effect = 0;
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 0;
}
}
return false;
case U_T_AGCR:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
}
return false;
case DBG_FAC:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
led_lighting_mode = LED_MODE_NORMAL;
led_edge_brightness = 1;
led_edge_mode = LED_EDGE_MODE_ALL;
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
I2C3733_Control_Set(1);
}
return false;
case DBG_TOG:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
}
return false;
case DBG_MTRX:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix");
}
return false;
case DBG_KBD:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard");
}
return false;
case DBG_MOU:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse");
}
return false;
case MD_BOOT:
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
reset_keyboard();
}
}
return false;
default:
return true; //Process all other keycodes normally
}
}
led_instruction_t led_instructions[] = {
//LEDs are normally inactive, no processing is performed on them
//Flags are used in matching criteria for an LED to be active and indicate how to color it
//Flags can be found in tmk_core/protocol/arm_atsam/led_matrix.h (prefixed with LED_FLAG_)
//LED IDs can be found in config_led.h in the keyboard's directory
//Examples are below
//All LEDs use the user's selected pattern (this is the factory default)
{ .flags = LED_FLAG_USE_ROTATE_PATTERN },
//Specific LEDs use the user's selected pattern while all others are off
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 0xFFFFFFFF, .id1 = 0xAAAAAAAA, .id2 = 0x55555555, .id3 = 0x11111111 },
//Specific LEDs use specified RGB values while all others are off
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 },
//All LEDs use the user's selected pattern
//On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green
//When layer 1 is active, key LEDs use red (id0 32 - 17: 1111 1111 1111 1111 0000 0000 0000 0000 = 0xFFFF0000) (except top row 16 - 1)
//When layer 1 is active, key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//When layer 1 is active, key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF)
//When layer 1 is active, edge LEDs use green (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000)
//When layer 1 is active, edge LEDs use green (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF)
// { .flags = LED_FLAG_USE_ROTATE_PATTERN },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id0 = 0xFFFF0000, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255, .layer = 1 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id2 = 0xFF800000, .id3 = 0x00FFFFFF, .g = 127, .layer = 1 },
//All key LEDs use red while edge LEDs use the active pattern
//All key LEDs use red (id0 32 - 1: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//All key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//All key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF)
//Edge uses active pattern (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000)
//Edge uses active pattern (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF)
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFFFFFFFF, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN , .id2 = 0xFF800000, .id3 = 0x00FFFFFF },
//end must be set to 1 to indicate end of instruction set
{ .end = 1 }
};

View File

@@ -0,0 +1,2 @@
# This keymap requires Massdrop Configurator support
OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR

View File

@@ -1,6 +1,6 @@
#include QMK_KEYBOARD_H
enum ctrl_keycodes {
enum shift_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
@@ -149,20 +149,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_ONF:
if (record->event.pressed) {
led_enabled = !led_enabled;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
led_enabled = 0;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:
@@ -219,8 +216,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case DBG_TOG:
@@ -256,3 +252,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true; //Process all other keycodes normally
}
}
led_instruction_t led_instructions[] = {
//Please see ../default_md/keymap.c for examples
//All LEDs use the user's selected pattern (this is the factory default)
{ .flags = LED_FLAG_USE_ROTATE_PATTERN },
//end must be set to 1 to indicate end of instruction set
{ .end = 1 }
};

View File

@@ -1,20 +0,0 @@
# SHIFT
![SHIFT](https://massdrop-s3.imgix.net/product-images/massdrop-ntkl-mechanical-keyboard/FP/W6zvr0cTR4KVDY5z8rwp_AI7B6588%20copy%20page.jpg?auto=format&fm=jpg&fit=max&w=700&h=467&dpr=1&q=80)
The Massdrop SHIFT is a TKL mechanical keyboard featuring dual USB-C connectors, an integrated Hi-Speed USB 2.0 hub, and fully customizable RGB backlighting and underlighting.
Keyboard Maintainer: [Massdrop](https://github.com/massdrop)
Hardware Supported: Massdrop, Inc. SHIFT PCBs utilizing Microchip's ATSAMD51J18A MCU and USB2422 2-Port USB 2.0 Hi-Speed Hub Controller, and ISSI's IS31FL3733 LED Drivers.
Hardware Availability: [Massdrop SHIFT Mechanical Keyboard](https://www.massdrop.com/buy/massdrop-shift-mechanical-keyboard)
Make example for this keyboard (after setting up your build environment):
make massdrop/shift:default
For information on flashing this keyboard, visit the following links:
[Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1)
[Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader)
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).

View File

@@ -351,9 +351,9 @@ void led_matrix_indicators(void)
#endif //KANA
(0))
{
led_buffer[i].r = 255 - led_buffer[i].r;
led_buffer[i].g = 255 - led_buffer[i].g;
led_buffer[i].b = 255 - led_buffer[i].b;
led_buffer[i].r = 255 - led_buffer[i].r; //TODO: Issue here with keeping the LED lit, static value works
led_buffer[i].g = 255 - led_buffer[i].g; //TODO: Issue here with keeping the LED lit, static value works
led_buffer[i].b = 255 - led_buffer[i].b; //TODO: Issue here with keeping the LED lit, static value works
//TODO: Old code, see if this hard cutoff is better// if (*led_cur->rgb.r > 127) *led_cur->rgb.r = 0;
//TODO: Old code, see if this hard cutoff is better// else *led_cur->rgb.r = 255;
@@ -498,14 +498,6 @@ static void led_matrix_massdrop_config_override(int i)
uint8_t highest_active_layer = biton32(layer_state);
if (led_animation_circular) {
//disp.width
//disp.left
//disp.height
//disp.bottom
//disp.max_distance
//TODO: led_animation_circular needs fixing
//For reference, the old function was
//po = sqrtf((powf(fabsf((disp.width / 2) - ((float)g_rgb_leds[i].point.x - disp.left)), 2) + powf(fabsf((disp.height / 2) - ((float)g_rgb_leds[i].point.y - disp.bottom)), 2))) / disp.max_distance * 100;
po = sqrtf((powf(fabsf((224 / 2) - (float)g_rgb_leds[i].point.x), 2) + powf(fabsf((64 / 2) - (float)g_rgb_leds[i].point.y), 2))) / RGB_MAX_DISTANCE * 100;
} else {
if (led_animation_orientation) {