e0d688d4c8040302fcacb735350c95fe6be4dbde

Author
Joel Challis <git@zvecr.com>
Committer
GitHub <noreply@github.com>
Date

Message

Move converter specific tmk_core protocols (#14743)

Diff

  1diff --git a/tmk_core/protocol/adb.c b/keyboards/converter/adb_usb/adb.c
  2rename from tmk_core/protocol/adb.c
  3rename to keyboards/converter/adb_usb/adb.c
  4index 367f1b09fa11675a93eaab704f4406f39ff4e5c5..28f14c9fe8904ccbdb8ecd3ca47be70bbe8638ad 100644
  5--- a/tmk_core/protocol/adb.c
  6+++ b/keyboards/converter/adb_usb/adb.c
  7@@ -84,10 +84,6 @@ bool adb_host_psw(void) { return psw_in(); }
  8 uint16_t adb_host_kbd_recv(void) { return adb_host_talk(ADB_ADDR_KEYBOARD, ADB_REG_0); }
  9 
 10 #ifdef ADB_MOUSE_ENABLE
 11-__attribute__((weak)) void adb_mouse_init(void) { return; }
 12-
 13-__attribute__((weak)) void adb_mouse_task(void) { return; }
 14-
 15 uint16_t adb_host_mouse_recv(void) { return adb_host_talk(ADB_ADDR_MOUSE, ADB_REG_0); }
 16 #endif
 17 
 18diff --git a/tmk_core/protocol/adb.h b/keyboards/converter/adb_usb/adb.h
 19rename from tmk_core/protocol/adb.h
 20rename to keyboards/converter/adb_usb/adb.h
 21diff --git a/keyboards/converter/adb_usb/matrix.c b/keyboards/converter/adb_usb/matrix.c
 22index 9e5399de5d6b9f510a003e98d96617683e175060..e6a4921960e7cd61520f6baf48ef3702ee5bab98 100644
 23--- a/keyboards/converter/adb_usb/matrix.c
 24+++ b/keyboards/converter/adb_usb/matrix.c
 25@@ -31,6 +31,10 @@ Ported to QMK by Peter Roe <pete@13bit.me>
 26 #include "led.h"
 27 #include "timer.h"
 28 
 29+#ifndef ADB_MOUSE_MAXACC
 30+#    define ADB_MOUSE_MAXACC 8
 31+#endif
 32+
 33 static bool is_iso_layout = false;
 34 
 35 // matrix state buffer(1:on, 0:off)
 36@@ -84,6 +88,10 @@ void matrix_init(void)
 37 
 38 static report_mouse_t mouse_report = {};
 39 
 40+void housekeeping_task_kb(void) {
 41+    adb_mouse_task();
 42+}
 43+
 44 void adb_mouse_task(void)
 45 {
 46     uint16_t codes;
 47diff --git a/keyboards/converter/adb_usb/rules.mk b/keyboards/converter/adb_usb/rules.mk
 48index 7c861e2702adcae721d51809e8995b1521f5c7c5..8f4649f55660c61e8d9727332d422a01312e8e65 100644
 49--- a/keyboards/converter/adb_usb/rules.mk
 50+++ b/keyboards/converter/adb_usb/rules.mk
 51@@ -19,3 +19,6 @@ BACKLIGHT_ENABLE = no
 52 CUSTOM_MATRIX    = yes
 53 
 54 SRC = matrix.c adb.c led.c
 55+
 56+# ADB_MOUSE_ENABLE
 57+# OPT_DEFS += -DADB_MOUSE_ENABLE -DMOUSE_ENABLE
 58diff --git a/tmk_core/protocol/m0110.c b/keyboards/converter/m0110_usb/m0110.c
 59rename from tmk_core/protocol/m0110.c
 60rename to keyboards/converter/m0110_usb/m0110.c
 61diff --git a/tmk_core/protocol/m0110.h b/keyboards/converter/m0110_usb/m0110.h
 62rename from tmk_core/protocol/m0110.h
 63rename to keyboards/converter/m0110_usb/m0110.h
 64diff --git a/keyboards/converter/xt_usb/rules.mk b/keyboards/converter/xt_usb/rules.mk
 65index 519d76f4d4f1c7ec89106b8e45ec5759b82f9524..80336144472982003e89541134952b2a8cddf87f 100644
 66--- a/keyboards/converter/xt_usb/rules.mk
 67+++ b/keyboards/converter/xt_usb/rules.mk
 68@@ -19,7 +19,6 @@ NKRO_ENABLE = yes           # USB Nkey Rollover
 69 BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
 70 RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow
 71 AUDIO_ENABLE = no           # Audio output
 72-XT_ENABLE = yes
 73 CUSTOM_MATRIX = yes
 74 
 75-SRC += matrix.c
 76+SRC += matrix.c xt_interrupt.c
 77diff --git a/tmk_core/protocol/xt.h b/keyboards/converter/xt_usb/xt.h
 78rename from tmk_core/protocol/xt.h
 79rename to keyboards/converter/xt_usb/xt.h
 80diff --git a/tmk_core/protocol/xt_interrupt.c b/keyboards/converter/xt_usb/xt_interrupt.c
 81rename from tmk_core/protocol/xt_interrupt.c
 82rename to keyboards/converter/xt_usb/xt_interrupt.c
 83diff --git a/quantum/keyboard.c b/quantum/keyboard.c
 84index ee7fa2bd4b18c9f7a60d9ba15718997ca89b02b0..401abdd8fabdd06750e7b8f4e7d9ae66bbf2d836 100644
 85--- a/quantum/keyboard.c
 86+++ b/quantum/keyboard.c
 87@@ -43,9 +43,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 88 #ifdef SERIAL_MOUSE_ENABLE
 89 #    include "serial_mouse.h"
 90 #endif
 91-#ifdef ADB_MOUSE_ENABLE
 92-#    include "adb.h"
 93-#endif
 94 #ifdef RGBLIGHT_ENABLE
 95 #    include "rgblight.h"
 96 #endif
 97@@ -322,9 +319,6 @@ void keyboard_init(void) {
 98 #ifdef SERIAL_MOUSE_ENABLE
 99     serial_mouse_init();
100 #endif
101-#ifdef ADB_MOUSE_ENABLE
102-    adb_mouse_init();
103-#endif
104 #ifdef BACKLIGHT_ENABLE
105     backlight_init();
106 #endif
107@@ -504,10 +498,6 @@ MATRIX_LOOP_END:
108     serial_mouse_task();
109 #endif
110 
111-#ifdef ADB_MOUSE_ENABLE
112-    adb_mouse_task();
113-#endif
114-
115 #ifdef POINTING_DEVICE_ENABLE
116     pointing_device_task();
117 #endif
118diff --git a/show_options.mk b/show_options.mk
119index 0831069635fa2f6f8286149460f3aad10d4d89e1..e0d7c9b072b6dec1d73e8529a1ce0f9d73c497ce 100644
120--- a/show_options.mk
121+++ b/show_options.mk
122@@ -71,7 +71,6 @@ OTHER_OPTION_NAMES = \
123   SWAP_HANDS_ENABLE \
124   RING_BUFFERED_6KRO_REPORT_ENABLE \
125   WATCHDOG_ENABLE \
126-  XT_ENABLE \
127   ERGOINU \
128   NO_USB_STARTUP_CHECK \
129   DISABLE_PROMICRO_LEDs \
130diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk
131index b61f2f5463abe671a68faf7ddd277d92e76985b6..30c87a0f124ae46c66925d455c1a7c4306ae5f7e 100644
132--- a/tmk_core/protocol.mk
133+++ b/tmk_core/protocol.mk
134@@ -45,15 +45,6 @@ ifeq ($(strip $(SERIAL_MOUSE_USE_UART)), yes)
135     SRC += $(PROTOCOL_DIR)/serial_uart.c
136 endif
137 
138-ifeq ($(strip $(ADB_MOUSE_ENABLE)), yes)
139-    OPT_DEFS += -DADB_MOUSE_ENABLE -DMOUSE_ENABLE
140-endif
141-
142-ifeq ($(strip $(XT_ENABLE)), yes)
143-    SRC += $(PROTOCOL_DIR)/xt_interrupt.c
144-    OPT_DEFS += -DXT_ENABLE
145-endif
146-
147 ifeq ($(strip $(USB_HID_ENABLE)), yes)
148     include $(TMK_DIR)/protocol/usb_hid.mk
149 endif
150diff --git a/tmk_core/readme.md b/tmk_core/readme.md
151index a754cfee42d0a6917bfbfac2bcd1fbf8732935b7..a47dc881859161af961dab1a9b2234ca54d0855b 100644
152--- a/tmk_core/readme.md
153+++ b/tmk_core/readme.md
154@@ -25,7 +25,6 @@ These features can be used in your keyboard.
155 * Media Control Key   - Volume Down/Up, Mute, Next/Prev track, Play, Stop and etc
156 * USB NKRO            - 248 keys(+ 8 modifiers) simultaneously
157 * PS/2 mouse support  - PS/2 mouse(TrackPoint) as composite device
158-* Keyboard protocols  - PS/2, ADB, M0110, Sun and other old keyboard protocols
159 * User Function       - Customizable function of key with writing code
160 * Macro               - Very primitive at this time
161 * Keyboard Tricks     - Oneshot modifier and modifier with tapping feature
162@@ -84,9 +83,9 @@ Architecture
163       /          /| Keys/Mouse | Protocol  |d| | Action      | | | Protocol  |
164      /__________/ |<-----------|  LUFA     |r| |  Layer, Tap | | |  Matrix   |
165      |.--------.| |   LED      |  V-USB    |i| |-------------| | |  PS/2,IBM |             __________________
166-     ||        || |----------->|  UART     |v| | Keymap      | | |  ADB,M0110|  Keys      / /_/_/_/_/_/_/_/ /|
167-     ||  Host  || |  Console   |           |e| | Mousekey    | | |  SUN/NEWS |<----------/ /_/_/_/_/_/_/_/ / /
168-     ||________||/.<-----------|           |r| | Report      | | |  X68K/PC98| Control  / /_/_/_/_/_/_/_/ / /
169+     ||        || |----------->|  UART     |v| | Keymap      | | |           |  Keys      / /_/_/_/_/_/_/_/ /|
170+     ||  Host  || |  Console   |           |e| | Mousekey    | | |           |<----------/ /_/_/_/_/_/_/_/ / /
171+     ||________||/.<-----------|           |r| | Report      | | |           | Control  / /_/_/_/_/_/_/_/ / /
172      `_========_'/|            |---------------------------------------------|-------->/___ /_______/ ___/ /
173      |_o______o_|/             | Sendchar, Print, Debug, Command, ...        |         |_________________|/
174                                +---------------------------------------------+              Keyboard
175@@ -134,10 +133,6 @@ Files and Directories
176 * lufa/     - LUFA USB stack
177 * vusb/     - Objective Development V-USB
178 * ps2.c     - PS/2 protocol
179-* adb.c     - Apple Desktop Bus protocol
180-* m0110.c   - Macintosh 128K/512K/Plus keyboard protocol
181-* news.c    - Sony NEWS keyboard protocol
182-* x68k.c    - Sharp X68000 keyboard protocol
183 * serial_soft.c - Asynchronous Serial protocol implemented by software
184 
185