summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-11-05 21:38:18 -0800
committerJack Humbert <jack.humb@gmail.com>2018-11-06 00:38:18 -0500
commit6e44f94f21ef45865eb8820923d4c9c696f08133 (patch)
treed1a0514c9d6205834eb66fa2c91ae4dd361b42f9
parentf2101cfb6a2270345fe6235d4c36e2e0d49db528 (diff)
Add EEPROM_RESET keycode to core code (#4234)
* Add EEPROM Reset keycode * Add keycode to docs * Move EEPROM Reset code to the end of the enum * Cleanup and naming change
-rw-r--r--docs/quantum_keycodes.md25
-rw-r--r--quantum/quantum.c5
-rw-r--r--quantum/quantum_keycodes.h4
3 files changed, 22 insertions, 12 deletions
diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md
index 1d7fc0e127..90192e6324 100644
--- a/docs/quantum_keycodes.md
+++ b/docs/quantum_keycodes.md
@@ -8,15 +8,16 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are
## QMK Keycodes
-|Key |Aliases |Description |
-|-------------|-----------|---------------------------------------------------------------------|
-|`RESET` | |Put the keyboard into DFU mode for flashing |
-|`DEBUG` | |Toggle debug mode |
-|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, <code>&#96;</code> when pressed with Shift or GUI|
-|`KC_LSPO` | |Left Shift when held, `(` when tapped |
-|`KC_RSPC` | |Right Shift when held, `)` when tapped |
-|`KC_LEAD` | |The [Leader key](feature_leader_key.md) |
-|`KC_LOCK` | |The [Lock key](feature_key_lock.md) |
-|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) |
-|`M(n)` | |Call macro `n` |
-|`MACROTAP(n)`| |Macro-tap `n` idk FIXME |
+|Key |Aliases |Description |
+|---------------|-----------|---------------------------------------------------------------------|
+|`RESET` | |Put the keyboard into DFU mode for flashing |
+|`DEBUG` | |Toggle debug mode |
+|`EEPROM_RESET` |`EEP_RST` |Resets EEPROM state by reinitializing it |
+|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, <code>&#96;</code> when pressed with Shift or GUI|
+|`KC_LSPO` | |Left Shift when held, `(` when tapped |
+|`KC_RSPC` | |Right Shift when held, `)` when tapped |
+|`KC_LEAD` | |The [Leader key](feature_leader_key.md) |
+|`KC_LOCK` | |The [Lock key](feature_key_lock.md) |
+|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) |
+|`M(n)` | |Call macro `n` |
+|`MACROTAP(n)` | |Macro-tap `n` idk FIXME |
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 5f1a691c88..69692233eb 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -298,6 +298,11 @@ bool process_record_quantum(keyrecord_t *record) {
print("DEBUG: enabled.\n");
}
return false;
+ case EEPROM_RESET:
+ if (record->event.pressed) {
+ eeconfig_init();
+ }
+ return false;
#ifdef FAUXCLICKY_ENABLE
case FC_TOG:
if (record->event.pressed) {
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 53fece21cc..14f8c2b812 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -454,6 +454,8 @@ enum quantum_keycodes {
TERM_OFF,
#endif
+ EEPROM_RESET,
+
// always leave at the end
SAFE_RANGE
};
@@ -569,6 +571,8 @@ enum quantum_keycodes {
#define KC_GESC GRAVE_ESC
+#define EEP_RST EEPROM_RESET
+
#define CK_TOGG CLICKY_TOGGLE
#define CK_RST CLICKY_RESET
#define CK_UP CLICKY_UP