summaryrefslogtreecommitdiffstats
path: root/users/stanrc85
diff options
context:
space:
mode:
Diffstat (limited to 'users/stanrc85')
-rw-r--r--users/stanrc85/rules.mk2
-rw-r--r--users/stanrc85/stanrc85.c41
-rw-r--r--users/stanrc85/stanrc85.h9
3 files changed, 52 insertions, 0 deletions
diff --git a/users/stanrc85/rules.mk b/users/stanrc85/rules.mk
index c94dca0b7c..4b66f9692d 100644
--- a/users/stanrc85/rules.mk
+++ b/users/stanrc85/rules.mk
@@ -8,6 +8,8 @@ AUDIO_ENABLE = no
CONSOLE_ENABLE = no
NKRO_ENABLE = no
+SRC += stanrc85.c
+
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
# Include my fancy rgb functions source here
SRC += layer_rgb.c
diff --git a/users/stanrc85/stanrc85.c b/users/stanrc85/stanrc85.c
new file mode 100644
index 0000000000..ecf3641172
--- /dev/null
+++ b/users/stanrc85/stanrc85.c
@@ -0,0 +1,41 @@
+#include "stanrc85.h"
+
+__attribute__ ((weak))
+bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case KC_MAKE:
+ if (!record->event.pressed) {
+ uint8_t temp_mod = get_mods();
+ uint8_t temp_osm = get_oneshot_mods();
+ clear_mods();
+ clear_oneshot_mods();
+ send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10);
+ if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK ) {
+ //RESET board for flashing if SHIFT held or tapped with KC_MAKE
+ #if defined(__arm__)
+ send_string_with_delay_P(PSTR(":dfu-util"), 10);
+ wait_ms(100);
+ reset_keyboard();
+ #elif defined(BOOTLOADER_DFU)
+ send_string_with_delay_P(PSTR(":dfu"), 10);
+ #elif defined(BOOTLOADER_HALFKAY)
+ send_string_with_delay_P(PSTR(":teensy"), 10);
+ #elif defined(BOOTLOADER_CATERINA)
+ send_string_with_delay_P(PSTR(":avrdude"), 10);
+ #else
+ reset_keyboard();
+ #endif // bootloader options
+ }
+ if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); }
+ send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10);
+ set_mods(temp_mod);
+ }
+ return false;
+ break;
+ }
+ return process_record_keymap(keycode, record);
+}
diff --git a/users/stanrc85/stanrc85.h b/users/stanrc85/stanrc85.h
index 7e581f993e..091c810707 100644
--- a/users/stanrc85/stanrc85.h
+++ b/users/stanrc85/stanrc85.h
@@ -1,12 +1,21 @@
#pragma once
#include "quantum.h"
+#include "version.h"
#define DEFAULT 0 //Custom ANSI
#define LAYER1 1 //Default ANSI (enable with Fn2+CAPS)
#define LAYER2 2 //Function keys, arrows, custom shortcuts, volume control
#define LAYER3 3 //RGB Underglow controls and RESET
+enum custom_keycodes {
+ KC_MAKE = SAFE_RANGE,
+ NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes
+};
+
+#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
+#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
+
//Aliases for longer keycodes
#define KC_CAD LALT(LCTL(KC_DEL))
#define KC_LOCK LGUI(KC_L)