]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/process_keycode/process_steno.c
several improvements for mitosis:datagrok (#1960)
[qmk_firmware.git] / quantum / process_keycode / process_steno.c
index a9126866603015ed3dafeb89a4e6db9af6df792a..16bbf154fd0c1870d8dc23998920530566ed17c8 100644 (file)
@@ -1,5 +1,21 @@
- #include "process_steno.h"
+/* Copyright 2017 Joseph Wasson
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+#include "process_steno.h"
 #include "quantum_keycodes.h"
+#include "eeprom.h"
 #include "keymap_steno.h"
 #include "virtser.h"
 
@@ -39,8 +55,9 @@
 
 #define BOLT_STATE_SIZE 4
 #define GEMINI_STATE_SIZE 6
+#define MAX_STATE_SIZE GEMINI_STATE_SIZE
 
-uint8_t state[MAX(BOLT_STATE_SIZE, GEMINI_STATE_SIZE)] = {0};
+uint8_t state[MAX_STATE_SIZE] = {0};
 uint8_t pressed = 0;
 steno_mode_t mode;
 
@@ -53,11 +70,8 @@ uint8_t boltmap[64] = {
   TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_NUM, TXB_Z_R
 };
 
-#define BOLTMAP_MASK (sizeof(boltmap) - 1)
-
-
 void steno_clear_state(void) {
-  memset(state, 0, sizeof(state));
+  __builtin_memset(state, 0, sizeof(state));
 }
 
 void steno_init() {