aboutsummaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorFred Silberberg <fred@silberberg.xyz>2018-08-05 08:42:16 -0700
committerDrashna Jaelre <drashna@live.com>2018-08-05 08:42:16 -0700
commit9a4db7a860ecb35ed6d1402955cc169512a8ba74 (patch)
tree636775298097afdd1f052759d8d389d86a9795bb /users
parenta6e1cb08c657e5fe1d355a662b6cbd2e613d5f9b (diff)
downloadqmk_firmware-9a4db7a860ecb35ed6d1402955cc169512a8ba74.tar.gz
qmk_firmware-9a4db7a860ecb35ed6d1402955cc169512a8ba74.zip
Keymap: Adds zen layout for 333fred (#3563)
* Initial commit of zen keymap * Added RGB control for my zen * Fixed ergodox layout. * Reduce brightness. * PR feedback.
Diffstat (limited to 'users')
-rw-r--r--users/333fred/333fred.c24
-rw-r--r--users/333fred/333fred.h5
-rw-r--r--users/333fred/333fred_config.h5
-rw-r--r--users/333fred/rgb.c28
-rw-r--r--users/333fred/rules.mk5
5 files changed, 58 insertions, 9 deletions
diff --git a/users/333fred/333fred.c b/users/333fred/333fred.c
index ef2d741e5..12ee9e7d7 100644
--- a/users/333fred/333fred.c
+++ b/users/333fred/333fred.c
@@ -34,6 +34,7 @@ void tap_dance_layer_finished(qk_tap_dance_state_t *state, void *user_data) {
34 break; 34 break;
35 case DOUBLE: 35 case DOUBLE:
36 layer_on(VIM); 36 layer_on(VIM);
37 break;
37 } 38 }
38} 39}
39 40
@@ -61,3 +62,26 @@ void tap_dance_process_record(uint16_t keycode) {
61 tap_dance_active = false; 62 tap_dance_active = false;
62 } 63 }
63} 64}
65
66__attribute__ ((weak))
67void matrix_init_rgb(void) {}
68
69__attribute__ ((weak))
70void layer_state_set_rgb(uint32_t state) {}
71
72__attribute__ ((weak))
73void matrix_scan_user_keyboard(void) {}
74
75void matrix_scan_user() {
76 static bool first_run = true;
77 if (first_run) {
78 first_run = false;
79 matrix_init_rgb();
80 }
81 matrix_scan_user_keyboard();
82}
83
84uint32_t layer_state_set_user(uint32_t state) {
85 layer_state_set_rgb(state);
86 return state;
87}
diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h
index 4a0462b7a..8599198a5 100644
--- a/users/333fred/333fred.h
+++ b/users/333fred/333fred.h
@@ -1,5 +1,4 @@
1#ifndef FRED_333 1#pragma once
2#define FRED_333
3 2
4#include "quantum.h" 3#include "quantum.h"
5 4
@@ -18,5 +17,3 @@ enum tap_dance_declarations {
18void tap_dance_layer_finished(qk_tap_dance_state_t*, void*); 17void tap_dance_layer_finished(qk_tap_dance_state_t*, void*);
19void tap_dance_layer_reset(qk_tap_dance_state_t*, void*); 18void tap_dance_layer_reset(qk_tap_dance_state_t*, void*);
20void tap_dance_process_record(uint16_t); 19void tap_dance_process_record(uint16_t);
21
22#endif
diff --git a/users/333fred/333fred_config.h b/users/333fred/333fred_config.h
index f796abc09..7c637d8d3 100644
--- a/users/333fred/333fred_config.h
+++ b/users/333fred/333fred_config.h
@@ -1,7 +1,4 @@
1#ifndef FRED333_CONFIG 1#pragma once
2#define FRED333_CONFIG
3 2
4#define PREVENT_STUCK_MODIFIERS 3#define PREVENT_STUCK_MODIFIERS
5#define PERMISSIVE_HOLD 4#define PERMISSIVE_HOLD
6
7#endif
diff --git a/users/333fred/rgb.c b/users/333fred/rgb.c
new file mode 100644
index 000000000..a3dfd905c
--- /dev/null
+++ b/users/333fred/rgb.c
@@ -0,0 +1,28 @@
1#include "quantum.h"
2#include "333fred.h"
3
4void matrix_init_rgb(void) {
5 rgblight_enable_noeeprom();
6 rgblight_sethsv_noeeprom(270, 255, 20);
7}
8
9void layer_state_set_rgb(uint32_t state) {
10 switch (biton32(state)) {
11 case BASE:
12 // purple
13 rgblight_sethsv_noeeprom(270, 255, 20);
14 break;
15 case SYMB:
16 // blue
17 rgblight_sethsv_noeeprom(240, 255, 20);
18 break;
19 case VIM:
20 // green
21 rgblight_sethsv_noeeprom(120, 255, 20);
22 break;
23 case GAME:
24 // red
25 rgblight_sethsv_noeeprom(0, 255, 20);
26 break;
27 }
28}
diff --git a/users/333fred/rules.mk b/users/333fred/rules.mk
index 3160ac2e6..0e2cc2588 100644
--- a/users/333fred/rules.mk
+++ b/users/333fred/rules.mk
@@ -1,2 +1,5 @@
1
2SRC += 333fred.c 1SRC += 333fred.c
2
3ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
4 SRC += rgb.c
5endif