]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
[Keyboard] XT converter: add config_common.h include and fix E0 collision (#7341)
authorfauxpark <fauxpark@gmail.com>
Wed, 13 Nov 2019 08:38:37 +0000 (19:38 +1100)
committerJames Young <18669334+noroadsleft@users.noreply.github.com>
Wed, 13 Nov 2019 08:38:37 +0000 (00:38 -0800)
keyboards/converter/xt_usb/config.h
keyboards/converter/xt_usb/matrix.c

index ecebc123fa190004295173f3a461d24525abd7b9..fe799538737b845bfe415af3ca33de06989a67b3 100644 (file)
@@ -17,6 +17,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #pragma once
 
+#include "config_common.h"
+
 #define VENDOR_ID       0xFEED
 #define PRODUCT_ID      0x6512
 #define DEVICE_VER      0x0001
index e2d7117b13a99fa73f8cbefc3d33606dd6c2dffe..d48f1a887f59d52951d2eb335bcaf19b9d337c6a 100644 (file)
@@ -99,25 +99,25 @@ static uint8_t move_e0code(uint8_t code) {
 uint8_t matrix_scan(void)
 {
     static enum {
-        INIT,
-        E0,
+        XT_STATE_INIT,
+        XT_STATE_E0,
         // Pause: E1 1D 45, E1 9D C5
-        E1,
-        E1_1D,
-        E1_9D,
-    } state = INIT;
+        XT_STATE_E1,
+        XT_STATE_E1_1D,
+        XT_STATE_E1_9D,
+    } state = XT_STATE_INIT;
 
     uint8_t code = xt_host_recv();
     if (!code) return 0;
     xprintf("%02X ", code);
     switch (state) {
-        case INIT:
+        case XT_STATE_INIT:
             switch (code) {
                 case 0xE0:
-                    state = E0;
+                    state = XT_STATE_E0;
                     break;
                 case 0xE1:
-                    state = E1;
+                    state = XT_STATE_E1;
                     break;
                 default:
                     if (code < 0x80)
@@ -127,59 +127,59 @@ uint8_t matrix_scan(void)
                     break;
             }
             break;
-        case E0:
+        case XT_STATE_E0:
             switch (code) {
                 case 0x2A:
                 case 0xAA:
                 case 0x36:
                 case 0xB6:
                     //ignore fake shift
-                    state = INIT;
+                    state = XT_STATE_INIT;
                     break;
                 default:
                     if (code < 0x80)
                         matrix_make(move_e0code(code));
                     else
                         matrix_break(move_e0code(code & 0x7F));
-                    state = INIT;
+                    state = XT_STATE_INIT;
                     break;
             }
             break;
-        case E1:
+        case XT_STATE_E1:
             switch (code) {
                 case 0x1D:
-                    state = E1_1D;
+                    state = XT_STATE_E1_1D;
                     break;
                 case 0x9D:
-                    state = E1_9D;
+                    state = XT_STATE_E1_9D;
                     break;
                 default:
-                    state = INIT;
+                    state = XT_STATE_INIT;
                     break;
             }
             break;
-        case E1_1D:
+        case XT_STATE_E1_1D:
             switch (code) {
                 case 0x45:
                     matrix_make(0x55);
                     break;
                 default:
-                    state = INIT;
+                    state = XT_STATE_INIT;
                     break;
             }
             break;
-        case E1_9D:
+        case XT_STATE_E1_9D:
             switch (code) {
                 case 0x45:
                     matrix_break(0x55);
                     break;
                 default:
-                    state = INIT;
+                    state = XT_STATE_INIT;
                     break;
             }
             break;
         default:
-            state = INIT;
+            state = XT_STATE_INIT;
     }
     matrix_scan_quantum();
     return 1;