]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Add EEPROM_RESET keycode to core code (#4234)
authorDrashna Jaelre <drashna@live.com>
Tue, 6 Nov 2018 05:38:18 +0000 (21:38 -0800)
committerJack Humbert <jack.humb@gmail.com>
Tue, 6 Nov 2018 05:38:18 +0000 (00:38 -0500)
* Add EEPROM Reset keycode

* Add keycode to docs

* Move EEPROM Reset code to the end of the enum

* Cleanup and naming change

docs/quantum_keycodes.md
quantum/quantum.c
quantum/quantum_keycodes.h

index 1d7fc0e12706fc399bfe6f9e3a56205d57884b21..90192e632410f33e34b2afd117030e013abaf1d9 100644 (file)
@@ -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                                              |
index 5f1a691c88413d69d4c62193ad67fe8607e07208..69692233ebe4254c95223c7790f6bdd7eda8ffe4 100644 (file)
@@ -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) {
index 53fece21cce2eb7d9917af5e6200c6510eceb64a..14f8c2b812a9d99d4e9b15cdb815dd75f72e3e5b 100644 (file)
@@ -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