Skip to content

Commit

Permalink
Merge branch 'master' into split_common-use-RGBLIGHT_SPLIT
Browse files Browse the repository at this point in the history
  • Loading branch information
mtei committed Apr 4, 2019
2 parents c68ee60 + 852d125 commit a3f7089
Show file tree
Hide file tree
Showing 327 changed files with 18,630 additions and 2,745 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ VOLUME /qmk_firmware
WORKDIR /qmk_firmware
COPY . .

CMD make $KEYBOARD:$KEYMAP
CMD make clean ; make git-submodule ; make $KEYBOARD:$KEYMAP
21 changes: 8 additions & 13 deletions docs/custom_quantum_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ This example, running after everything else has initialized, sets up the rgb und
void keyboard_post_init_user(void) {
// Call the post init code.
rgblight_enable_noeeprom(); // enables Rgb, without saving settings
rgblight_sethsv_noeeprom(180, 255, 255): // sets the color to teal/cyan without saving
rgblight_sethsv_noeeprom(180, 255, 255); // sets the color to teal/cyan without saving
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); // sets mode to Fast breathing without saving
}
```
Expand Down Expand Up @@ -342,7 +342,7 @@ This is an example of how to add settings, and read and write it. We're using th
In your keymap.c file, add this to the top:
```
```c
typedef union {
uint32_t raw;
struct {
Expand All @@ -358,7 +358,7 @@ This sets up a 32 bit structure that we can store settings with in memory, and w
We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `keyboard_post_init_user` and `process_record_user` to configure everything.

Now, using the `keyboard_post_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like:
```
```c
void keyboard_post_init_user(void) {
// Call the keymap level matrix init.

Expand All @@ -375,7 +375,7 @@ void keyboard_post_init_user(void) {
```
The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above.
```
```c
uint32_t layer_state_set_user(uint32_t state) {
switch (biton32(state)) {
case _RAISE:
Expand All @@ -397,8 +397,8 @@ uint32_t layer_state_set_user(uint32_t state) {
return state;
}
```
This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR` and `EPRM`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this:
```
This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this:
```c

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
Expand All @@ -415,11 +415,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
PLAY_NOTE_ARRAY(tone_qwerty);
}
return true; // Let QMK send the enter press/release events
case EPRM:
if (record->event.pressed) {
eeconfig_init(); // resets the EEPROM to default
}
return false;
case RGB_LYR: // This allows me to use underglow as layer indication, or as normal
if (record->event.pressed) {
user_config.rgb_layer_change ^= 1; // Toggles the status
Expand All @@ -442,9 +437,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
}
```
And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. For example, if you want to set rgb layer indication by default, and save the default valued.
And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. To force an EEPROM reset, use the `EEP_RST` keycode or [Bootmagic](feature_bootmagic.md) functionallity. For example, if you want to set rgb layer indication by default, and save the default valued.
```
```c
void eeconfig_init_user(void) { // EEPROM is getting reset!
user_config.raw = 0;
user_config.rgb_layer_change = true; // We want this enabled by default
Expand Down
5 changes: 4 additions & 1 deletion docs/feature_debounce_type.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ The debounce code is compatible with split keyboards.
# Changing between included debouncing methods
You can either use your own code, by including your own debounce.c, or switch to another included one.
Included debounce methods are:
* eager_pk - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE_DELAY``` millseconds of no further input for that key
* eager_pr - debouncing per row. On any state change, response is immediate, followed by locking the row ```DEBOUNCE_DELAY``` milliseconds of no further input for that row.
For use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computationally expensive / low scan rate, and fingers usually only hit one row at a time. This could be
appropriate for the ErgoDox models; the matrix is rotated 90°, and hence its "rows" are really columns, and each finger only hits a single "row" at a time in normal use.
* eager_pk - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE_DELAY``` milliseconds of no further input for that key
* sym_g - debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE_DELAY``` milliseconds of no changes has occured, all input changes are pushed.


Loading

0 comments on commit a3f7089

Please sign in to comment.