shopping_cart

CTRL Can I get source code from configurator?

more_vert
I am trying to code up some custom lighting for my CTRL where I change individual LED colors based on the current layer and I am having a hard time finding good documentation to help me with this. Is it possible to get an option to download uncompiled source code from the configurator so I can reverse engineer how you are able to change single LEDs? Or better yet, is there any documentation about how to do this and how to change colors based on the current layer? Thank you!
Vote
11
remove_red_eye
592

search
close
Minor
53
Jan 25, 2019
Not sure if you got the answer. I have done this myself to my ALT keyboard. I think CTRL should be the same thing. Just for reference, my way is just to get things working. There are gonna to be better way. 1) I added a method begin_update_current_led into TMK led pipeline in /tmk_core/protocol/arm_atsam/led_matrix.c (the if statement on line 312), to make it easy to override the default behavior of the LED. If the method return false, it will cancel all the default pattern change of the LED. And I provided the default implementation to always return true. https://dev.azure.com/MinorDLand/QMK/_git/QMK?path=%2Ftmk_core%2Fprotocol%2Farm_atsam%2Fled_matrix.c&version=GBmaster And then, I implemented my own version of it in https://dev.azure.com/MinorDLand/QMK/_git/QMK?path=%2Fkeyboards%2Fmassdrop%2Falt%2Fkeymaps%2Fdennisz%2Frgb_matrix_user.c&version=GBmaster Like this. Basically, this method will be called for each LED. And you can just override the RGB of the LED and return false. To me, I use my FN key to indicate different layer. The layers is come from layer_state|default_layer_state as shown below. Please note when the keyboard hooked in firstly, the default_layer is set to 0 instead of 1. But I think 0 and 1 behave the same. And the bit means which layer is the default. (0100b means layer 3 ) bool begin_update_current_led(void) { return setup_perled(led_cur); } void post_update_current_led(void) { } static bool setup_perled(issi3733_led_t* led_c) { if (led_c->scan == 71 ) { uint32_t layers = layer_state | default_layer_state; *led_c->rgb.r = 0; *led_c->rgb.g = 0; *led_c->rgb.b = 0; if ((layers & _DD_DEFAULT_LAYERS_MASK) == 0) { // Default state, no default layers has been set, assume the layer 0 is default layer.
layers |= _DD_DEFAULT_LAYER_MASK;
}

if (layers & 1) { *led_c->rgb.r = 255; } if (layers & 2) { *led_c->rgb.g = 255; } if (layers & 4) { *led_c->rgb.b = 255; } return false; } return true; } LED id and scan code is defined in /keyboards/massdrop/alt/config_led.h for control. Hope this helps.
Minor
53
Jan 25, 2019
Sorry, I am new to GIT, seems like the file I shared is having permission issue. Still trying to figure out how to open a GIT repo to public. Anyway, please let me know if you have any questions.
Kiefofpolice
154
Jan 11, 2019
Go to the CNTRL KEYBOARD DROP and they have all the software and website to customize each key and program your own
fullCircle801
2
Jan 20, 2019
Thanks, I'll update when I get it figured out. In the meantime, check out https://github.com/valen214/Massdrop-Ctrl-Keyboard-Ripple-LED. He has some pretty cool effects he has programmed. Also, you can go into led_programs.c and make new/modify patterns. I just looked at the existing ones to figure out how they were doing it and then modified from there.
LastContinue
154
Jan 20, 2019
If you're interested in Valen's stuff, I'd just checkout QMK proper as he got a keymap based version of that code merged in recently. https://github.com/qmk/qmk_firmware/pull/4856