diff options
| author | Casey Webster <casey.webster@gmail.com> | 2020-10-18 15:55:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-18 13:55:38 -0700 |
| commit | 8bb2eeaabb6d79e774c6aae6c651857ce2e380dc (patch) | |
| tree | 2bed24bc62765fa3aceb3bd771d12ac65652da10 /users/cwebster2/cwebster2.c | |
| parent | c492dd791243b98a119fbf29c9b041d14238b102 (diff) | |
| download | qmk_firmware-8bb2eeaabb6d79e774c6aae6c651857ce2e380dc.tar.gz qmk_firmware-8bb2eeaabb6d79e774c6aae6c651857ce2e380dc.zip | |
[Keymap] add cwebster2 userspace and keymaps (#10541)
* Adding my keymap
* Add a starter keymap for kyria
* Updated keymap
* Add auto shift, tapping modifications and gravatar oled bitmap
* Add flashing helper scripts
* Updates to my keymap
* Enable raw hid and rgblight sleep
* Cleanup
* Updated keymap and board features
* Remove some RGB modes for space
* Start working on a miryoku-like keymap.
This adds homerow mods to my keymap on the base layer and adds
a game layer that doesnt have them
* more work on keymaps
* Fine tuning home row mods
* update keymap
* Keymap update
* add split transport
* keymap
* cherry pick from develop
* merge develop
* fix
* keymap iterations
* Refactoring
* continued refactoring
* messing with rgb
* update layer coloring
* continued refactoring
* more features
* modifier color
* Move stuff to userspace
* Moving stuff out to userspace
* refactoring into userspace
* More refactoring
* Fixing some errors in the keymap and changing the oled output
* Sync zen1 keymap to my userspace config
* Update copyright notices and revert transport.c to master
* Swap tab and esc
* Remove a file accidentally created
* Use LTO_ENABLE to turn on Link_Time_Optimization
* Drop modtap thumbs on game layout
* Update game keymap
* More iteration on the game keymap
* Add oled indications of kitty and i3 mod
* Promote colemak to default
* Update tapping term for modtap keys
* Add per key tapping term
* Use left modifiers on right side
Diffstat (limited to 'users/cwebster2/cwebster2.c')
| -rw-r--r-- | users/cwebster2/cwebster2.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/users/cwebster2/cwebster2.c b/users/cwebster2/cwebster2.c new file mode 100644 index 000000000..cfebc12c6 --- /dev/null +++ b/users/cwebster2/cwebster2.c | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | /* Copyright 2020 Casey Webster <casey@e1337.dev> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #include "cwebster2.h" | ||
| 17 | |||
| 18 | userspace_config_t userspace_config; | ||
| 19 | |||
| 20 | __attribute__((weak)) void matrix_scan_keymap(void) {} | ||
| 21 | |||
| 22 | void matrix_scan_user(void) { | ||
| 23 | static bool has_ran_yet; | ||
| 24 | if (!has_ran_yet) { | ||
| 25 | has_ran_yet = true; | ||
| 26 | startup_user(); | ||
| 27 | } | ||
| 28 | |||
| 29 | matrix_scan_keymap(); | ||
| 30 | } | ||
| 31 | |||
| 32 | void keyboard_post_init_rgb(void) { | ||
| 33 | #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION) | ||
| 34 | /*if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }*/ | ||
| 35 | /*if (rgblight_config.enable) {*/ | ||
| 36 | /*layer_state_set_user(layer_state);*/ | ||
| 37 | /*uint16_t old_hue = rgblight_config.hue;*/ | ||
| 38 | uint16_t old_hue = 170; | ||
| 39 | rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); | ||
| 40 | for (uint16_t i = 255; i > 0; i--) { | ||
| 41 | rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255); | ||
| 42 | matrix_scan(); | ||
| 43 | wait_ms(10); | ||
| 44 | } | ||
| 45 | /*}*/ | ||
| 46 | #endif | ||
| 47 | /*layer_state_set_user(layer_state);*/ | ||
| 48 | } | ||
| 49 | |||
| 50 | __attribute__((weak)) void eeconfig_init_keymap(void) {} | ||
| 51 | |||
| 52 | void eeconfig_init_user(void) { | ||
| 53 | userspace_config.raw = 0; | ||
| 54 | userspace_config.rgb_layer_change = true; | ||
| 55 | eeconfig_update_user(userspace_config.raw); | ||
| 56 | eeconfig_init_keymap(); | ||
| 57 | keyboard_init(); | ||
| 58 | } | ||
| 59 | |||
| 60 | bool hasAllBitsInMask(uint8_t value, uint8_t mask) { | ||
| 61 | value &= 0xF; | ||
| 62 | mask &= 0xF; | ||
| 63 | |||
| 64 | return (value & mask) == mask; | ||
| 65 | } | ||
