Skip to content

Commit 5c3be31

Browse files
author
Christoph
committed
Merged upstream changes from tmk repo
1 parent 67a108a commit 5c3be31

File tree

265 files changed

+18150
-44625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+18150
-44625
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tmk_core/protocol/usb_hid/USB_Host_Shield_2.0-tmk"]
2+
path = tmk_core/protocol/usb_hid/USB_Host_Shield_2.0-tmk
3+
url = https://github.com/tmk/USB_Host_Shield_2.0.git

converter/adb_usb/MEMO.txt

-27
This file was deleted.

converter/adb_usb/Makefile

+16-16
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ TARGET_DIR ?= .
99

1010
# project specific files
1111
SRC ?= matrix.c \
12-
led.c \
1312
adb.c
1413

1514
CONFIG_H = config.h
@@ -64,26 +63,27 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
6463
# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
6564
# LUFA bootloader 4096
6665
# USBaspLoader 2048
67-
OPT_DEFS += -DBOOTLOADER_SIZE=4096
66+
BOOTLOADER_SIZE ?= 4096
67+
OPT_DEFS += -DBOOTLOADER_SIZE=$(BOOTLOADER_SIZE)
6868

6969

7070
# Build Options
7171
# comment out to disable the options.
7272
#
73-
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
74-
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
75-
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
76-
CONSOLE_ENABLE = yes # Console for debug(+400)
77-
COMMAND_ENABLE = yes # Commands for debug and configuration
78-
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
79-
#NKRO_ENABLE = yes # USB Nkey Rollover
80-
ADB_MOUSE_ENABLE = yes
81-
#UNIMAP_ENABLE = yes
82-
#ACTIONMAP_ENABLE = yes # Use 16bit actionmap instead of 8bit keymap
83-
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
73+
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
74+
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
75+
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
76+
CONSOLE_ENABLE ?= yes # Console for debug(+400)
77+
COMMAND_ENABLE ?= yes # Commands for debug and configuration
78+
NKRO_ENABLE ?= no # USB Nkey Rollover
79+
ADB_MOUSE_ENABLE ?= yes # ADB Mouse support
80+
UNIMAP_ENABLE ?= yes # Use unimap
81+
ACTIONMAP_ENABLE ?= no # Use 16bit actionmap instead of 8bit keymap
82+
KEYMAP_SECTION_ENABLE ?= yes # fixed address keymap for keymap editor
8483

8584
# ADB Mice need acceleration for todays much bigger screens.
86-
OPT_DEFS += -DADB_MOUSE_MAXACC=8
85+
ADB_MOUSE_MAXACC ?= 8
86+
OPT_DEFS += -DADB_MOUSE_MAXACC=$(ADB_MOUSE_MAXACC)
8787

8888

8989
# Optimize size but this may cause error "relocation truncated to fit"
@@ -93,10 +93,10 @@ OPT_DEFS += -DADB_MOUSE_MAXACC=8
9393
#
9494
# Keymap file
9595
#
96-
ifdef UNIMAP_ENABLE
96+
ifeq (yes,$(strip $(UNIMAP_ENABLE)))
9797
KEYMAP_FILE = unimap
9898
else
99-
ifdef ACTIONMAP_ENABLE
99+
ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
100100
KEYMAP_FILE = actionmap
101101
else
102102
KEYMAP_FILE = keymap

converter/adb_usb/Makefile.unimap.rev1

-5
This file was deleted.

converter/adb_usb/Makefile.unimap.rev2

-5
This file was deleted.

converter/adb_usb/README.md

+36-33
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
ADB to USB keyboard converter
22
=============================
3-
This firmware converts Apple ADB keyboard protocol to USB, you can use it to plug old ADB keyboard into modern computer. It works on TMK ADB-USB Converter, PJRC Teensy2.0 and other USB AVR MCU(ATMega32U4, AT90USB64/128 or etc) and needs more than 10KB flash at least.
3+
This firmware converts Apple ADB keyboard/mouse protocol to USB, you can use it to plug old ADB keyboard/mouse into modern computer. It works on prebuilt TMK ADB-USB Converter or generic dev board with USB AVR MCU(ATMega32U4/2) like Teensy2.0.
44

5-
Discuss here: http://geekhack.org/showwiki.php?title=Island:14290
5+
Discuss about this here: http://geekhack.org/showwiki.php?title=Island:14290
66

7-
You can buy a TMK converter here: https://geekhack.org/index.php?topic=72052.0
7+
Prebuilt TMK ADB-USB converter is available here: https://geekhack.org/index.php?topic=72052.0
88

99

1010

@@ -16,18 +16,20 @@ https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb
1616
Also check these when you are in trouble.
1717

1818
https://github.com/tmk/tmk_keyboard/wiki
19-
https://github.com/tmk/tmk_keyboard/labels/NOTE
19+
https://github.com/tmk/tmk_keyboard/issues
2020

2121

2222
Wiring
2323
------
24-
Connect ADB pins to controller just by 3 lines(Vcc, GND, Data). By default Data line uses port PD0.
24+
If you build this yourself you have to solder some wires.
25+
Connect ADB pins to controller just by 3 lines(Vcc, GND, Data) at least. By default Data line uses port PD0.
26+
This is not needed but you can connect PSW to PD1 optionally.
2527

2628
ADB female socket from the front:
2729

2830
,--_--.
2931
/ o4 3o \ 1: DATA
30-
| o2 1o | 2: Power SW
32+
| o2 1o | 2: PSW(Power SW)
3133
- === - 3: VCC
3234
`-___-' 4: GND
3335

@@ -36,13 +38,13 @@ https://github.com/tmk/tmk_keyboard/wiki/FAQ#pull-up-resistor
3638

3739
Pull-up resister:
3840

39-
Keyboard Conveter
41+
Keyboard AVR MCU
4042
,------.
4143
5V------+------|VCC |
4244
| | |
4345
[R] | |
4446
| | |
45-
Signal--+------|PD0 |
47+
DATA----+------|PD0 |
4648
| |
4749
GND------------|GND |
4850
`------'
@@ -58,59 +60,60 @@ Build firmware and Program microcontroller
5860
------------------------------------------
5961
See [doc/build.md](../../tmk_core/doc/build.md).
6062

61-
To build firmware and program TMK Converter run these commands:
63+
To build firmware and program TMK ADB-USB Converter run these commands:
6264

6365
$ make -f Makefile clean
64-
$ make -f Makefile [KEYMAP=(plain|ansi|iso|hasu)]
65-
$ make -f Makefile [KEYMAP=(plain|ansi|iso|hasu)] dfu
66+
$ make -f Makefile [KEYMAP=yourname]
67+
$ make -f Makefile [KEYMAP=yourname] dfu
6668

67-
You can select keymap with optional `KEYMAP=` (plain is default). Push button on the converter before running `dfu` target.
69+
You can select keymap name with optional `KEYMAP=` ('plain' is default name). Push button on the converter before running `dfu` target.
6870

69-
Use **Makefile.rev1** for old TMK Converter rev.1 and **Makefile.teensy** for Teensy2.0 instead of **Makefile**. For TMK Converter rev.2 just use **Makefile**.
70-
71-
To program Teensy you can use `teensy` target:
72-
73-
$ make -f Makefile.teensy [KEYMAP=(plain|ansi|iso|hasu)] teensy
71+
Use **Makefile.rev1** for old TMK Converter rev.1 and Teensy2.0 instead of **Makefile**.
7472

7573

7674

7775
Keymap
7876
------
79-
You can change a keymap by editing code of keymap_[plain|ansi|iso|hasu|yours].c.
77+
You can change keymap by editing code of unimap_plain.c directly, or copy it to your own keymap file like unimap_yourname.c and edit the file.
8078
How to define the keymap is probably obvious. You can find key symbols in common/keycode.h. And see [doc/keymap.md](../../tmk_core/doc/keymap.md) for more detail.
8179

8280

8381
Magic command
8482
-------------
85-
To get help press `h` holding Magic key. Magic key is `Power key`.
83+
To get help message in hid_listen press `h` holding Magic key. Magic key is `Power key`.
84+
85+
https://github.com/tmk/tmk_keyboard/wiki#debug
8686

8787

8888
Locking CapsLock
8989
----------------
90-
Many of old ADB keyboards have mechanical push-lock switch for Capslock key and this converter supports the locking Capslock key by default. See README in top directory for more detail about this feature.
90+
Many of old ADB keyboards have mechanical push-lock switch for Capslock key and this converter supports the locking Capslock key by default. Use keycode `LCAP` instead of `CAPS` in your keymap in short. See README in top directory for more detail.
9191
https://github.com/tmk/tmk_keyboard/blob/master/README.md#mechanical-locking-support
9292

93-
Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch.
93+
If you want to remap Capslock key you will have to remove locking pin or just replace with normal momentary switch. Some keyboards like Apple Adujstable keyboard use firmware-base locking with momentary switch for Capslock and remapping it won't be useful in most cases.
9494

9595

96-
Mouse support
97-
-------------
98-
ADB mouse support was added by @mek-apelsin on Apr,2015. It supports only one button as of now.
99-
https://github.com/tmk/tmk_keyboard/pull/207
100-
101-
102-
Notes
103-
-----
96+
Notes for keyboard
97+
------------------
10498
Not-extended ADB keyboards have no discrimination between right modifier and left one,
10599
you will always see left control even if you press right control key.
106100
Apple Extended Keyboard and Apple Extended Keyboard II can discriminate both side
107101
modifiers except for GUI key(Windows/Command).
108102

109-
And most ADB keyboard has no diodes in its matrix so they are not NKRO,
110-
though ADB protocol itself supports it. See protocol/adb.c for more info.
103+
And most of ADB keyboards have no diodes in its matrix so they are not NKRO unfortunately,
104+
though ADB protocol itself supports it. See tmk_core/protocol/adb.c for more info.
105+
106+
107+
Notes for mouse
108+
---------------
109+
ADB mouse support was added by @mek-apelsin on Apr,2015.
110+
https://github.com/tmk/tmk_keyboard/pull/207
111+
112+
All one-button mouses should be supported.
111113

112-
If keyboard has ISO layout you may have swapped keys problem, see this for the detail.
114+
As of 2019 June, the converter can handle multi-button mice and trackball up to eight buttons if the pointing device supports Apple Extended Mouse protocol. But some devices use their own specific protocol unfortunately and they will work as one-button mouse unless device specific code is added.
113115

114-
https://github.com/tmk/tmk_keyboard/issues/35
116+
Kensington Turbo Mouse 5(#64210) is supported now.
117+
https://github.com/tmk/tmk_keyboard/issues/274#issuecomment-504726633
115118

116119
EOF

0 commit comments

Comments
 (0)