aboutsummaryrefslogtreecommitdiffstats
path: root/users
diff options
context:
space:
mode:
authorGravatar Drashna Jaelre <drashna@live.com>2019-05-19 10:01:16 -0700
committerGravatar GitHub <noreply@github.com>2019-05-19 10:01:16 -0700
commit6b8be985551efc5a5f95dfea6dc1554352bc46e0 (patch)
treecb0db9437ef27eef7c07a26f985a615d17a4d794 /users
parent2a8fd5823244eb1c7e8906b4118f01d2078c4e28 (diff)
parent89e9785d7a87e8dbb941dd272c032f34658169fd (diff)
downloadqmk_firmware-6b8be985551efc5a5f95dfea6dc1554352bc46e0.tar.gz
[Keymap] Drashna Corne Keyboard updates (#5903)
* Re-enable Audio And there was much rejoicingmake keebio/iris/rev2:drashna AUDIO_ENABLE=yes! * Re-add debounce to ergodox EZ * Fix rgb matrix helper function * Make sure that RGM Matrix is checked properly * Fix merge commit? * Disable more RGB matrix modes * Increase Debounce for Ergodox EZ The performance improvements have made it necessary, actually * Consolidate RGB Matrix layer indication function And changes to iris * Fix lighting issue for gamepad * Update Corne Keyboard configuration * Update Corne Keyboard layout * Update KC_MAKE macro to better handle crkbd split * Tweaks to Corne Keyboard Layout * Enable RGB Matrix Sleep * Update my code to use layer_state_t typedef
Diffstat (limited to 'users')
-rw-r--r--users/drashna/drashna.c8
-rw-r--r--users/drashna/drashna.h4
-rw-r--r--users/drashna/process_records.c30
-rw-r--r--users/drashna/rgb_stuff.c13
-rw-r--r--users/drashna/rgb_stuff.h6
-rw-r--r--users/drashna/rules.mk1
-rw-r--r--users/drashna/template.c4
7 files changed, 42 insertions, 24 deletions
diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c
index 7c60a2e4a..acc6b9f9e 100644
--- a/users/drashna/drashna.c
+++ b/users/drashna/drashna.c
@@ -187,13 +187,13 @@ void matrix_scan_user(void) {
__attribute__ ((weak))
-uint32_t layer_state_set_keymap (uint32_t state) {
+layer_state_t layer_state_set_keymap (layer_state_t state) {
return state;
}
// on layer change, no matter where the change was initiated
// Then runs keymap's layer change check
-uint32_t layer_state_set_user(uint32_t state) {
+layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
#ifdef RGBLIGHT_ENABLE
state = layer_state_set_rgb(state);
@@ -203,12 +203,12 @@ uint32_t layer_state_set_user(uint32_t state) {
__attribute__ ((weak))
-uint32_t default_layer_state_set_keymap (uint32_t state) {
+layer_state_t default_layer_state_set_keymap (layer_state_t state) {
return state;
}
// Runs state check and changes underglow color and animation
-uint32_t default_layer_state_set_user(uint32_t state) {
+layer_state_t default_layer_state_set_user(layer_state_t state) {
state = default_layer_state_set_keymap(state);
#if 0
#ifdef RGBLIGHT_ENABLE
diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h
index 5df67792a..507504f04 100644
--- a/users/drashna/drashna.h
+++ b/users/drashna/drashna.h
@@ -67,8 +67,8 @@ void shutdown_keymap(void);
void suspend_power_down_keymap(void);
void suspend_wakeup_init_keymap(void);
void matrix_scan_keymap(void);
-uint32_t layer_state_set_keymap (uint32_t state);
-uint32_t default_layer_state_set_keymap (uint32_t state);
+layer_state_t layer_state_set_keymap (layer_state_t state);
+layer_state_t default_layer_state_set_keymap (layer_state_t state);
void led_set_keymap(uint8_t usb_led);
void eeconfig_init_keymap(void);
diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c
index a5487b585..770219917 100644
--- a/users/drashna/process_records.c
+++ b/users/drashna/process_records.c
@@ -39,22 +39,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
clear_mods(); clear_oneshot_mods();
send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), TAP_CODE_DELAY);
#ifndef MAKE_BOOTLOADER
- if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT )
+ if ( ( temp_mod | temp_osm ) & MOD_MASK_SHIFT )
+#endif
+ {
+ #if defined(__arm__)
+ send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY);
+ #elif defined(BOOTLOADER_DFU)
+ send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY);
+ #elif defined(BOOTLOADER_HALFKAY)
+ send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY);
+ #elif defined(BOOTLOADER_CATERINA)
+ send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY);
+ #endif // bootloader options
+ }
+ if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); }
+#ifdef RGB_MATRIX_SPLIT_RIGHT
+ send_string_with_delay_P(PSTR(" RGB_MATRIX_SPLIT_RIGHT=yes OLED_DRIVER_ENABLE=no"), TAP_CODE_DELAY);
#endif
- {
- #if defined(__arm__)
- send_string_with_delay_P(PSTR(":dfu-util"), TAP_CODE_DELAY);
- #elif defined(BOOTLOADER_DFU)
- send_string_with_delay_P(PSTR(":dfu"), TAP_CODE_DELAY);
- #elif defined(BOOTLOADER_HALFKAY)
- send_string_with_delay_P(PSTR(":teensy"), TAP_CODE_DELAY);
- #elif defined(BOOTLOADER_CATERINA)
- send_string_with_delay_P(PSTR(":avrdude"), TAP_CODE_DELAY);
- #endif // bootloader options
- }
- if ( ( temp_mod | temp_osm ) & MOD_MASK_CTRL) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), TAP_CODE_DELAY); }
send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY);
}
+
break;
case VRSN: // Prints firmware version
diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c
index 9e19747fa..7d364fa68 100644
--- a/users/drashna/rgb_stuff.c
+++ b/users/drashna/rgb_stuff.c
@@ -275,7 +275,7 @@ void matrix_scan_rgb(void) {
}
-uint32_t layer_state_set_rgb(uint32_t state) {
+layer_state_t layer_state_set_rgb(layer_state_t state) {
#ifdef RGBLIGHT_ENABLE
if (userspace_config.rgb_layer_change) {
switch (biton32(state)) {
@@ -334,3 +334,14 @@ uint32_t layer_state_set_rgb(uint32_t state) {
return state;
}
+
+#ifdef RGB_MATRIX_ENABLE
+extern led_config_t g_led_config;
+void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type) {
+ for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ if (HAS_FLAGS(g_led_config.flags[i], led_type)) {
+ rgb_matrix_set_color( i, red, green, blue );
+ }
+ }
+}
+#endif
diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h
index 886f20ffc..f5bbd0f3b 100644
--- a/users/drashna/rgb_stuff.h
+++ b/users/drashna/rgb_stuff.h
@@ -15,7 +15,9 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record);
void scan_rgblight_fadeout(void);
void keyboard_post_init_rgb(void);
void matrix_scan_rgb(void);
-uint32_t layer_state_set_rgb(uint32_t state);
-uint32_t default_layer_state_set_rgb(uint32_t state);
+layer_state_t layer_state_set_rgb(layer_state_t state);
+layer_state_t default_layer_state_set_rgb(layer_state_t state);
void rgblight_sethsv_default_helper(uint8_t index);
void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
+
+void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, uint8_t led_type);
diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk
index 085840f1c..cdb9e5436 100644
--- a/users/drashna/rules.mk
+++ b/users/drashna/rules.mk
@@ -33,6 +33,7 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
endif
endif
+RGB_MATRIX_ENABLE ?= no
ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
SRC += rgb_stuff.c
endif
diff --git a/users/drashna/template.c b/users/drashna/template.c
index 0e188f3a5..d90e6bdec 100644
--- a/users/drashna/template.c
+++ b/users/drashna/template.c
@@ -62,11 +62,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
__attribute__ ((weak))
-uint32_t layer_state_set_keymap (uint32_t state) {
+layer_state_t layer_state_set_keymap (layer_state_t state) {
return state;
}
-uint32_t layer_state_set_user (uint32_t state) {
+layer_state_t layer_state_set_user (layer_state_t state) {
return layer_state_set_keymap (state);
}