]> git.friedersdorff.com Git - max/tmk_keyboard.git/commitdiff
Merge pull request #230 from jerryen/master
authortmk <tmk@users.noreply.github.com>
Sat, 16 Jan 2016 02:17:13 +0000 (11:17 +0900)
committertmk <tmk@users.noreply.github.com>
Sat, 16 Jan 2016 02:17:13 +0000 (11:17 +0900)
Add KEYBOARD_LOCK_ENABLE to makefile

88 files changed:
README.md
converter/adb_usb/Makefile
converter/adb_usb/Makefile.pjrc [deleted file]
converter/adb_usb/Makefile.rev1 [new file with mode: 0644]
converter/adb_usb/Makefile.teensy [new file with mode: 0644]
converter/adb_usb/README.md
converter/adb_usb/keymap_ansi.c
converter/adb_usb/keymap_iso.c
converter/adb_usb/matrix.c
converter/ibm4704_usb/README.md
converter/ibm4704_usb/keymap_alps102key.c [new file with mode: 0644]
converter/ibm4704_usb/keymap_common.h
converter/ibm4704_usb/matrix.c
converter/m0110_usb/Makefile.tmk_rev1 [moved from converter/m0110_usb/Makefile.pjrc with 58% similarity]
converter/m0110_usb/Makefile.tmk_rev2 [new file with mode: 0644]
converter/m0110_usb/README.md
converter/m0110_usb/keymap_common.h
converter/m0110_usb/keymap_default.c
converter/m0110_usb/keymap_for_editor.c [deleted file]
converter/m0110_usb/keymap_intl.c
converter/m0110_usb/keymap_plain.c [deleted file]
converter/m0110_usb/matrix.c
converter/next_usb/Makefile
converter/next_usb/config.h
converter/next_usb/keymap.c
converter/next_usb/led.c
converter/next_usb/matrix.c
converter/ps2_usb/Makefile.mbed
converter/ps2_usb/Makefile.vusb
converter/usb_usb/Makefile
converter/usb_usb/Makefile.keymap_editor [new file with mode: 0644]
converter/usb_usb/config.h
converter/usb_usb/keymap.c
converter/usb_usb/keymap_common.h
converter/usb_usb/keymap_editor.c [new file with mode: 0644]
converter/usb_usb/keymap_iso.c [new file with mode: 0644]
converter/usb_usb/keymap_jis.c [new file with mode: 0644]
converter/usb_usb/keymap_spacefn.c
converter/usb_usb/led.c [deleted file]
converter/usb_usb/main.cpp
converter/usb_usb/matrix.c
doc/COPYING.GPLv2 [deleted file]
doc/COPYING.GPLv3 [deleted file]
doc/FUSE.txt [deleted file]
doc/POWER.txt [deleted file]
doc/USB_NKRO.txt [deleted file]
doc/build.md [deleted file]
doc/keycode.txt [deleted file]
doc/keymap.md [deleted file]
doc/other_projects.md [deleted file]
keyboard/alps64/Makefile.keymap_editor [new file with mode: 0644]
keyboard/alps64/keymap_plain.c
keyboard/alps64/matrix.c
keyboard/hhkb/Makefile.keymap_editor [new file with mode: 0644]
keyboard/hhkb/Makefile.rn42
keyboard/hhkb/Makefile.rn42.keymap_editor [new file with mode: 0644]
keyboard/hhkb/config_rn42.h
keyboard/hhkb/doc/HHKB_keycodes.txt [new file with mode: 0644]
keyboard/hhkb/keymap_hhkb.c
keyboard/hhkb/rn42/MEMO.txt
keyboard/hhkb/rn42/rn42.c
keyboard/onekey/Makefile.vusb [new file with mode: 0644]
keyboard/onekey/usbconfig.h [new file with mode: 0644]
tmk_core/common.mk
tmk_core/common/action.c
tmk_core/common/action_code.h
tmk_core/common/action_macro.c
tmk_core/common/action_macro.h
tmk_core/common/action_util.c
tmk_core/common/bootmagic.c
tmk_core/common/command.c
tmk_core/common/keycode.h
tmk_core/common/keymap.c
tmk_core/common/led.h
tmk_core/doc/build.md
tmk_core/doc/keymap.md
tmk_core/doc/other_projects.md [deleted file]
tmk_core/ldscript_keymap_avr35.x [new file with mode: 0644]
tmk_core/ldscript_keymap_avr5.x
tmk_core/protocol/lufa/lufa.c
tmk_core/protocol/next_kbd.c
tmk_core/protocol/serial_soft.c
tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/Arduino_Makefile_master [deleted submodule]
tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/RTClib [deleted submodule]
tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/generic_storage [deleted submodule]
tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/xmem2 [deleted submodule]
tmk_core/protocol/usb_hid/parser.cpp
tmk_core/rules.mk

index 4f850619e3948ca0d9e06def2de42271548fab0c..4a6d80fbfc260b22c9536b00d8c66b498ce561b4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -114,13 +114,13 @@ Third party libraries like LUFA, PJRC and V-USB have their own license respectiv
 
 Build Firmware and Program Controller
 -------------------------------------
-See [doc/build.md](doc/build.md).
+See [tmk_core/doc/build.md](tmk_core/doc/build.md).
 
 
 
 Change your keymap
 ------------------
-See [doc/keymap.md](doc/keymap.md).
+See [tmk_core/doc/keymap.md](tmk_core/doc/keymap.md).
 
 
 
@@ -226,10 +226,10 @@ You can use xprintf() to display debug info on `hid_listen`, see `tmk_core/commo
 Files and Directories
 -------------------
 ### Top
-* tmk_core/     - core library
 * keyboard/     - keyboard projects
 * converter/    - protocol converter projects
-* doc/          - documents
+* tmk_core/     - core library
+* tmk_core/doc/ - documents
 
 
 
@@ -241,4 +241,4 @@ Coding Style
 
 Other Keyboard Firmware Projects
 ------------------
-You can learn a lot about keyboard firmware from these. See [doc/other_projects.md](doc/other_projects.md).
+You can learn a lot about keyboard firmware from these. See [Other Projects](https://github.com/tmk/tmk_keyboard/wiki/Other-Protjects) other than TMK.
index 2369ee70ac7279562478fc3861f94365f272dfd5..7b385749d55302999c8683eb1a16f32572bd9d4b 100644 (file)
@@ -63,8 +63,10 @@ CONFIG_H = config.h
 
 
 # MCU name
-#MCU = at90usb1287
-MCU = atmega32u4
+# atmega32u4   Teensy2.0
+# atemga32u4   TMK Converter rev.1
+# atemga32u2   TMK Converter rev.2
+MCU = atmega32u2
 
 # Processor frequency.
 #     This will define a symbol, F_CPU, in all source code files equal to the
@@ -106,7 +108,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
 # Boot Section Size in *bytes*
 #   Teensy halfKay   512
 #   Teensy++ halfKay 1024
-#   Atmel DFU loader 4096
+#   Atmel DFU loader 4096      for TMK Converter rev.1/rev.2
 #   LUFA bootloader  4096
 #   USBaspLoader     2048
 OPT_DEFS += -DBOOTLOADER_SIZE=4096
diff --git a/converter/adb_usb/Makefile.pjrc b/converter/adb_usb/Makefile.pjrc
deleted file mode 100644 (file)
index c320c09..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-# Target file name (without extension).
-TARGET = adb_usb_pjrc
-
-# Directory common source filess exist
-TMK_DIR = ../../tmk_core
-
-# Directory keyboard dependent files exist
-TARGET_DIR = .
-
-# keyboard dependent files
-SRC =  keymap_common.c \
-       matrix.c \
-       led.c \
-       adb.c
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_ansi.c $(SRC)
-endif
-
-CONFIG_H = config.h
-
-
-# MCU name, you MUST set this to match the board you are using
-# type "make clean" after changing this, so all files will be rebuilt
-#MCU = at90usb162       # Teensy 1.0
-MCU = atmega32u4       # Teensy 2.0
-#MCU = at90usb646       # Teensy++ 1.0
-#MCU = at90usb1286      # Teensy++ 2.0
-
-
-# Processor frequency.
-#   Normally the first thing your program should do is set the clock prescaler,
-#   so your program will run at the correct speed.  You should also set this
-#   variable to same clock speed.  The _delay_ms() macro uses this, and many
-#   examples use this variable to calculate timings.  Do not add a "UL" here.
-F_CPU = 16000000
-
-
-# Boot Section Size in *bytes*
-#   Teensy halfKay   512
-#   Teensy++ halfKay 1024
-#   Atmel DFU loader 4096
-#   LUFA bootloader  4096
-#   USBaspLoader     2048
-OPT_DEFS += -DBOOTLOADER_SIZE=4096
-
-
-# Build Options
-#   comment out to disable the options.
-#
-BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
-MOUSEKEY_ENABLE = yes  # Mouse keys(+5000)
-EXTRAKEY_ENABLE = yes  # Audio control and System control(+600)
-CONSOLE_ENABLE = yes    # Console for debug
-COMMAND_ENABLE = yes    # Commands for debug and configuration
-#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
-#NKRO_ENABLE = yes     # USB Nkey Rollover(+500)
-ADB_MOUSE_ENABLE = yes
-
-# ADB Mice need acceleration for todays much bigger screens. 
-OPT_DEFS += -DADB_MOUSE_MAXACC=8
-
-
-# Search Path
-VPATH += $(TARGET_DIR)
-VPATH += $(TMK_DIR)
-
-include $(TMK_DIR)/protocol/pjrc.mk
-include $(TMK_DIR)/protocol.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk
diff --git a/converter/adb_usb/Makefile.rev1 b/converter/adb_usb/Makefile.rev1
new file mode 100644 (file)
index 0000000..1cd539b
--- /dev/null
@@ -0,0 +1,143 @@
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device.
+#                Please customize your programmer settings(PROGRAM_CMD)
+#
+# make teensy = Download the hex file to the device, using teensy_loader_cli.
+#               (must have teensy_loader_cli installed).
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+#            have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+#             have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+#               (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+#                (must have Atmel FLIP installed).
+#
+# make debug = Start either simulavr or avarice as specified for debugging, 
+#              with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+#                   bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+# Target file name (without extension).
+TARGET = adb_usb_lufa
+
+# Directory common source filess exist
+TMK_DIR = ../../tmk_core
+
+# Directory keyboard dependent files exist
+TARGET_DIR = .
+
+# project specific files
+SRC =  keymap_common.c \
+       matrix.c \
+       led.c \
+       adb.c
+
+ifdef KEYMAP
+    SRC := keymap_$(KEYMAP).c $(SRC)
+else
+    SRC := keymap_ansi.c $(SRC)
+endif
+
+CONFIG_H = config.h
+
+
+# MCU name
+# atmega32u4   Teensy2.0
+# atemga32u4   TMK Converter rev.1
+# atemga32u2   TMK Converter rev.2
+MCU = atmega32u4
+
+# Processor frequency.
+#     This will define a symbol, F_CPU, in all source code files equal to the
+#     processor frequency in Hz. You can then use this symbol in your source code to
+#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+#     automatically to create a 32-bit value in your source code.
+#
+#     This will be an integer division of F_USB below, as it is sourced by
+#     F_USB after it has run through any CPU prescalers. Note that this value
+#     does not *change* the processor frequency - it should merely be updated to
+#     reflect the processor speed set externally so that the code can use accurate
+#     software delays.
+F_CPU = 16000000
+
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+#     This will define a symbol, F_USB, in all source code files equal to the
+#     input clock frequency (before any prescaling is performed) in Hz. This value may
+#     differ from F_CPU if prescaling is used on the latter, and is required as the
+#     raw input clock is fed directly to the PLL sections of the AVR for high speed
+#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+#     at the end, this will be done automatically to create a 32-bit value in your
+#     source code.
+#
+#     If no clock division is performed on the input clock inside the AVR (via the
+#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+#   Teensy halfKay   512
+#   Teensy++ halfKay 1024
+#   Atmel DFU loader 4096      for TMK Converter rev.1/rev.2
+#   LUFA bootloader  4096
+#   USBaspLoader     2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+
+# Build Options
+#   comment out to disable the options.
+#
+#BOOTMAGIC_ENABLE = yes        # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes  # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes  # Audio control and System control(+450)
+CONSOLE_ENABLE = yes   # Console for debug(+400)
+COMMAND_ENABLE = yes    # Commands for debug and configuration
+#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
+#NKRO_ENABLE = yes     # USB Nkey Rollover
+ADB_MOUSE_ENABLE = yes
+
+# ADB Mice need acceleration for todays much bigger screens. 
+OPT_DEFS += -DADB_MOUSE_MAXACC=8
+
+
+# Optimize size but this may cause error "relocation truncated to fit"
+#EXTRALDFLAGS = -Wl,--relax
+
+# Search Path
+VPATH += $(TARGET_DIR)
+VPATH += $(TMK_DIR)
+
+include $(TMK_DIR)/protocol/lufa.mk
+include $(TMK_DIR)/protocol.mk
+include $(TMK_DIR)/common.mk
+include $(TMK_DIR)/rules.mk
diff --git a/converter/adb_usb/Makefile.teensy b/converter/adb_usb/Makefile.teensy
new file mode 100644 (file)
index 0000000..d97f0eb
--- /dev/null
@@ -0,0 +1,143 @@
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make all = Make software.
+#
+# make clean = Clean out built project files.
+#
+# make coff = Convert ELF to AVR COFF.
+#
+# make extcoff = Convert ELF to AVR Extended COFF.
+#
+# make program = Download the hex file to the device.
+#                Please customize your programmer settings(PROGRAM_CMD)
+#
+# make teensy = Download the hex file to the device, using teensy_loader_cli.
+#               (must have teensy_loader_cli installed).
+#
+# make dfu = Download the hex file to the device, using dfu-programmer (must
+#            have dfu-programmer installed).
+#
+# make flip = Download the hex file to the device, using Atmel FLIP (must
+#             have Atmel FLIP installed).
+#
+# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
+#               (must have dfu-programmer installed).
+#
+# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
+#                (must have Atmel FLIP installed).
+#
+# make debug = Start either simulavr or avarice as specified for debugging, 
+#              with avr-gdb or avr-insight as the front end for debugging.
+#
+# make filename.s = Just compile filename.c into the assembler code only.
+#
+# make filename.i = Create a preprocessed source file for use in submitting
+#                   bug reports to the GCC project.
+#
+# To rebuild project do "make clean" then "make all".
+#----------------------------------------------------------------------------
+
+# Target file name (without extension).
+TARGET = adb_usb_lufa
+
+# Directory common source filess exist
+TMK_DIR = ../../tmk_core
+
+# Directory keyboard dependent files exist
+TARGET_DIR = .
+
+# project specific files
+SRC =  keymap_common.c \
+       matrix.c \
+       led.c \
+       adb.c
+
+ifdef KEYMAP
+    SRC := keymap_$(KEYMAP).c $(SRC)
+else
+    SRC := keymap_ansi.c $(SRC)
+endif
+
+CONFIG_H = config.h
+
+
+# MCU name
+# atmega32u4   Teensy2.0
+# atemga32u4   TMK Converter rev.1
+# atemga32u2   TMK Converter rev.2
+MCU = atmega32u4
+
+# Processor frequency.
+#     This will define a symbol, F_CPU, in all source code files equal to the
+#     processor frequency in Hz. You can then use this symbol in your source code to
+#     calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+#     automatically to create a 32-bit value in your source code.
+#
+#     This will be an integer division of F_USB below, as it is sourced by
+#     F_USB after it has run through any CPU prescalers. Note that this value
+#     does not *change* the processor frequency - it should merely be updated to
+#     reflect the processor speed set externally so that the code can use accurate
+#     software delays.
+F_CPU = 16000000
+
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+#     This will define a symbol, F_USB, in all source code files equal to the
+#     input clock frequency (before any prescaling is performed) in Hz. This value may
+#     differ from F_CPU if prescaling is used on the latter, and is required as the
+#     raw input clock is fed directly to the PLL sections of the AVR for high speed
+#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+#     at the end, this will be done automatically to create a 32-bit value in your
+#     source code.
+#
+#     If no clock division is performed on the input clock inside the AVR (via the
+#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+#   Teensy halfKay   512
+#   Teensy++ halfKay 1024
+#   Atmel DFU loader 4096      for TMK Converter rev.1/rev.2
+#   LUFA bootloader  4096
+#   USBaspLoader     2048
+OPT_DEFS += -DBOOTLOADER_SIZE=512
+
+
+# Build Options
+#   comment out to disable the options.
+#
+#BOOTMAGIC_ENABLE = yes        # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes  # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes  # Audio control and System control(+450)
+CONSOLE_ENABLE = yes   # Console for debug(+400)
+COMMAND_ENABLE = yes    # Commands for debug and configuration
+#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
+#NKRO_ENABLE = yes     # USB Nkey Rollover
+ADB_MOUSE_ENABLE = yes
+
+# ADB Mice need acceleration for todays much bigger screens. 
+OPT_DEFS += -DADB_MOUSE_MAXACC=8
+
+
+# Optimize size but this may cause error "relocation truncated to fit"
+#EXTRALDFLAGS = -Wl,--relax
+
+# Search Path
+VPATH += $(TARGET_DIR)
+VPATH += $(TMK_DIR)
+
+include $(TMK_DIR)/protocol/lufa.mk
+include $(TMK_DIR)/protocol.mk
+include $(TMK_DIR)/common.mk
+include $(TMK_DIR)/rules.mk
index 46082ff67f971eb3966a297d2c4636e9c0d77ed9..aa06c8db8744e5dbbce5b45aec546aa15e32c57f 100644 (file)
@@ -1,8 +1,7 @@
 ADB to USB keyboard converter
 =============================
 This firmware converts ADB keyboard protocol to USB.
-You can use PJRC Teensy for this converter, though, other USB AVR(ATMega32U4, AT90USB64/128 or etc) should work.
-But binary size is about 10KB or more it doesn't fit into 8K flash like ATMega8U2.
+You can use TMK Converter, PJRC Teensy2.0 and other USB AVR MCU(ATMega32U4, AT90USB64/128 or etc) for this. But binary size is probably more than 10KB and it won't fit into 8K flash.
 
 Discuss: http://geekhack.org/showwiki.php?title=Island:14290
 
@@ -54,22 +53,34 @@ Define following macros for ADB connection in config.h if you use other than por
     ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT
 
 
-Build
------
-See doc/build.md. In short,
+Build firmware and Program microcontroller
+------------------------------------------
+See [doc/build.md](../../tmk_core/doc/build.md).
+
+To build firmware:
 
-    $ make clean
-    $ make
+    $ make -f Makefile clean
+    $ make -f Makefile
 
 You can select keymap(ansi is default) like this:
 
-    $ make KEYMAP=[ansi|iso|hasu]
+    $ make -f Makefile KEYMAP=[ansi|iso|hasu]
+
+To program TMK Converter:
+
+    $ make -f Makefile dfu
+
+To program Teensy2.0:
+
+    $ make -f Makefile.teensy teensy
+
+Use **Makefile.rev1** for TMK Converter rev.1 and **Makefile.teensy** for Teensy2.0 instead of **Makefile**. For TMK Converter rev.2 just use **Makefile**.
 
 
 Keymap
 ------
 You can change a keymap by editing code of keymap_[ansi|iso|hasu|yours].c.
-How to define the keymap is probably obvious. You can find key symbols in common/keycode.h. And see doc/keymap.md for more detail.
+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.
 
 
 Magic command
@@ -85,6 +96,12 @@ https://github.com/tmk/tmk_keyboard/blob/master/README.md#mechanical-locking-sup
 Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch.
 
 
+Mouse support
+-------------
+ADB mouse support was added by @mek-apelsin on Apr,2015. It supports only one button as of now.
+https://github.com/tmk/tmk_keyboard/pull/207
+
+
 Notes
 -----
 Not-extended ADB keyboards have no discrimination between right modifier and left one,
index 4ea601be0a02b681af65088b1b13cd5ed0bebfd9..aa9931928f8318f2334f6c12f83289ea8da3b2b4 100644 (file)
@@ -4,7 +4,7 @@
 const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     KEYMAP_EXT_ANSI(
     ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,                   NO,
-    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PEQL,PSLS,PAST,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,EQL, PSLS,PAST,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
     LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
     LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
index a1b1a5ebd3cfb157e326934b8fd98f5696823e23..1ccb17e264a4ce9bd0cec1acd00844fe948bca65 100644 (file)
@@ -4,7 +4,7 @@
 const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     KEYMAP_EXT_ISO(
     ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,                   NO,
-    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PEQL,PSLS,PAST,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,EQL, PSLS,PAST,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,ENT,      DEL, END, PGDN,    P7,  P8,  P9,  PMNS,
     LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,                             P4,  P5,  P6,  PPLS,
     LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RSFT,          UP,           P1,  P2,  P3,
index 6220ee6e1c001418f19b381c309ea6b5b4d88185..dad71758bce9946b6f29486fae46c607eba04051 100644 (file)
@@ -86,6 +86,12 @@ void matrix_init(void)
     //debug_keyboard = true;
     //debug_mouse = true;
     print("debug enabled.\n");
+
+    // LED flash
+    DDRD |= (1<<6); PORTD |= (1<<6);
+    _delay_ms(500);
+    DDRD |= (1<<6); PORTD &= ~(1<<6);
+
     return;
 }
 
index 15c826ab8b7f7a26afc7c75f636731c34c0f40d5..68db4bd05004a6f7370a26f10da54a98e85e2de9 100644 (file)
@@ -7,6 +7,7 @@ Keyboard initialization process takes a few seconds at start up. During that you
 
 Update
 ------
+2015/09/07  Added keymap for Alps 102-key. Thanks, tai @ geekhack!
 2015/05/05  Added keymaps for 107-key, 77-key and 50-key. Thanks, orihalcon @ geekhack!
 2015/05/19  Fixed a protocol handling bug.
 
@@ -67,3 +68,5 @@ To select keymap:
 Keymap
 ------
 Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document(you can find in top README.md) and existent keymap files.
+
+Use `KEYMAP_ALPS102()` to define your keymap for Alps models.
diff --git a/converter/ibm4704_usb/keymap_alps102key.c b/converter/ibm4704_usb/keymap_alps102key.c
new file mode 100644 (file)
index 0000000..f3dda71
--- /dev/null
@@ -0,0 +1,50 @@
+#include "keymap_common.h"
+
+
+const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    /* Layer 0:
+     * ,---------------------------------------------------------------.  ,-----------. ,---------------.
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|BS |BS |F21|  |PSC|SLK|PAU| |F1 |F2 |F3 |F4 |
+     * |---------------------------------------------------------------|  |-----------| |---------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|F22|  |Ins|Hom|PgU| |F5 |F6 |F7 |F8 |
+     * |---------------------------------------------------------------|  |-----------| |---------------|
+     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Ret|Ret |F23|  |Del|End|PgD| |F9 |F10|F11|F12|
+     * |---------------------------------------------------------------|  |-----------| |---------------|
+     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shf|Shift |F24|  |   |Up |   | |F13|F14|F15|F16|
+     * |---------------------------------------------------------------|  |-----------| |---------------|
+     * |Fn0  |Gui|Alt  |         Space             |Alt* |Gui|Fn0      |  |Lef|Dow|Rig| |F17|F18|F19|F20|
+     * `---------------------------------------------------------------'  `-----------' `---------------'
+     */
+    KEYMAP_ALPS102(
+    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,BSPC,F21,      PSCR,SLCK,PAUS,     F1,  F2,  F3,  F4,  \
+    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     F22,      INS, HOME,PGUP,     F5,  F6,  F7,  F8,  \
+    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,GRV, ENT,      F23,      DEL, END, PGDN,     F9,  F10, F11, F12, \
+    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,RSFT,          F24,      NO,  UP,  NO,       F13, F14, F15, F16, \
+    FN0, LGUI,LALT,          SPC,                     RALT,RGUI,               FN0,      LEFT,DOWN,RGHT,     F17, F18, F19, F20  \
+    ),
+
+    /* Layer 1:
+     * ,---------------------------------------------------------------.  ,-----------. ,---------------.
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|BS |BS |F21|  |VoD|VoU|Mut| |F1 |F2 |F3 |F4 |
+     * |---------------------------------------------------------------|  |-----------| |---------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|F22|  |Ins|Hom|PgU| |F5 |F6 |F7 |F8 |
+     * |---------------------------------------------------------------|  |-----------| |---------------|
+     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Ret|Ret |F23|  |Del|End|PgD| |F9 |F10|F11|F12|
+     * |---------------------------------------------------------------|  |-----------| |---------------|
+     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shf|Shift |F24|  |   |PgU|   | |F13|F14|F15|F16|
+     * |---------------------------------------------------------------|  |-----------| |---------------|
+     * |Fn0  |Gui|Alt  |         Space             |Alt* |Gui|Fn0      |  |Hom|PgD|End| |F17|F18|F19|F20|
+     * `---------------------------------------------------------------'  `-----------' `---------------'
+     */
+    KEYMAP_ALPS102(
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     VOLD,VOLU,MUTE,     TRNS,TRNS,TRNS,TRNS, \
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,     TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,TRNS, \
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,     TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,TRNS, \
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,     TRNS,PGUP,TRNS,     TRNS,TRNS,TRNS,TRNS, \
+    TRNS,TRNS,TRNS,          TRNS,                    TRNS,TRNS,               TRNS,     HOME,PGDN,END,      TRNS,TRNS,TRNS,TRNS  \
+    ),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+    [0] = ACTION_LAYER_MOMENTARY(1),
+};
index 30eba6ab92d7ee59202200407f478b660ae07b72..9cb23b0b838c9f34986326542fa06bcfc1805526 100644 (file)
@@ -116,4 +116,31 @@ extern const uint16_t fn_actions[];
     { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }  \
 }
 
+/* Alps 102-key */
+#define KEYMAP_ALPS102( \
+    K00, K0F, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E,   K44, K45, K46,   K43, K41, K42, K4A, \
+    K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D,      K1E,   K54, K55, K56,   K50, K51, K52, K5A, \
+    K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D,      K2E,   K64, K65, K66,   K60, K61, K62, K6B, \
+    K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D,           K3E,   K74, K75, K76,   K70, K71, K72, K7B, \
+    K31, K47, K3F,                 K40,               K4F, K48,                K2F,   K77, K67, K57,   K73, K63, K53, K4E  \
+) { \
+    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
+    { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \
+    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
+    { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO,   }, \
+    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
+    { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \
+    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, \
+    { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, \
+    { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \
+    { KC_##K48, KC_NO,    KC_##K4A, KC_NO,    KC_NO,    KC_NO,    KC_##K4E, KC_##K4F }, \
+    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
+    { KC_NO,    KC_NO,    KC_##K5A, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
+    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \
+    { KC_NO,    KC_NO,    KC_NO,    KC_##K6B, KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
+    { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
+    { KC_NO,    KC_NO,    KC_NO,    KC_##K7B, KC_NO,    KC_NO,    KC_NO,    KC_NO,   }  \
+}
+
+
 #endif
index 155df9c38f26f5fa2d9a610e4773436c75dd1fdc..5b91d49f81debc56baae4162f6eccb1c091234f6 100644 (file)
@@ -68,8 +68,9 @@ uint8_t matrix_cols(void)
 static void enable_break(void)
 {
     print("Enable break: ");
+    while (ibm4704_send(0xFC)) { _delay_ms(10); }
     // valid scancode: 00-79h
-    for (uint8_t code = 0; code < 0x7A; code++) {
+    for (uint8_t code = 0; code < 0x7F; code++) {
         while (ibm4704_send(0x80|code)) _delay_ms(10);
         _delay_ms(5);   // wait for response
         // No response(FF) when ok, FD when out of bound
similarity index 58%
rename from converter/m0110_usb/Makefile.pjrc
rename to converter/m0110_usb/Makefile.tmk_rev1
index e82564218ecd16a8311e745bd5950271de669d3e..f36fcc4b5dee9b2d502d79ab741d4e43a164650f 100644 (file)
@@ -1,5 +1,5 @@
 # Target file name (without extension).
-TARGET = m0110_pjrc
+TARGET = m0110_lufa
 
 # Directory common source filess exist
 TMK_DIR = ../../tmk_core
@@ -10,13 +10,14 @@ TARGET_DIR = .
 # keyboard dependent files
 SRC =  matrix.c \
        led.c \
+       keymap_common.c \
        m0110.c
 
 # To use own keymap file run make like: make keymap=hasu
-ifdef keymap
-    SRC += keymap_$(keymap).c
+ifdef KEYMAP
+    SRC += keymap_$(KEYMAP).c
 else
-    SRC += keymap.c
+    SRC += keymap_default.c
 endif
 
 CONFIG_H = config.h
@@ -24,10 +25,8 @@ CONFIG_H = config.h
 
 # MCU name, you MUST set this to match the board you are using
 # type "make clean" after changing this, so all files will be rebuilt
-#MCU = at90usb162       # Teensy 1.0
-MCU = atmega32u4       # Teensy 2.0
-#MCU = at90usb646       # Teensy++ 1.0
-#MCU = at90usb1286      # Teensy++ 2.0
+#MCU = atmega32u2       # TMK converter rev2
+MCU = atmega32u4       # TMK converter rev1
 
 
 # Processor frequency.
@@ -38,6 +37,29 @@ MCU = atmega32u4       # Teensy 2.0
 F_CPU = 16000000
 
 
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+#     This will define a symbol, F_USB, in all source code files equal to the
+#     input clock frequency (before any prescaling is performed) in Hz. This value may
+#     differ from F_CPU if prescaling is used on the latter, and is required as the
+#     raw input clock is fed directly to the PLL sections of the AVR for high speed
+#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+#     at the end, this will be done automatically to create a 32-bit value in your
+#     source code.
+#
+#     If no clock division is performed on the input clock inside the AVR (via the
+#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
 # Boot Section Size in bytes
 #   Teensy halfKay   512
 #   Atmel DFU loader 4096
@@ -55,6 +77,7 @@ CONSOLE_ENABLE = yes  # Console for debug(+400)
 COMMAND_ENABLE = yes    # Commands for debug and configuration
 #SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
 #NKRO_ENABLE = yes     # USB Nkey Rollover - not yet supported in LUFA
+#KEYMAP_SECTION_ENABLE = yes   # fixed address keymap for keymap editor
 
 
 
@@ -67,7 +90,7 @@ VPATH += $(TARGET_DIR)
 VPATH += $(TMK_DIR)
 
 
-include $(TMK_DIR)/protocol/pjrc.mk
+include $(TMK_DIR)/protocol/lufa.mk
 include $(TMK_DIR)/protocol.mk
 include $(TMK_DIR)/common.mk
 include $(TMK_DIR)/rules.mk
diff --git a/converter/m0110_usb/Makefile.tmk_rev2 b/converter/m0110_usb/Makefile.tmk_rev2
new file mode 100644 (file)
index 0000000..e836456
--- /dev/null
@@ -0,0 +1,96 @@
+# Target file name (without extension).
+TARGET = m0110_lufa
+
+# Directory common source filess exist
+TMK_DIR = ../../tmk_core
+
+# Directory keyboard dependent files exist
+TARGET_DIR = .
+
+# keyboard dependent files
+SRC =  matrix.c \
+       led.c \
+       keymap_common.c \
+       m0110.c
+
+# To use own keymap file run make like: make keymap=hasu
+ifdef KEYMAP
+    SRC += keymap_$(KEYMAP).c
+else
+    SRC += keymap_default.c
+endif
+
+CONFIG_H = config.h
+
+
+# MCU name, you MUST set this to match the board you are using
+# type "make clean" after changing this, so all files will be rebuilt
+MCU = atmega32u2       # TMK converter rev2
+#MCU = atmega32u4       # TMK converter rev1
+
+
+# Processor frequency.
+#   Normally the first thing your program should do is set the clock prescaler,
+#   so your program will run at the correct speed.  You should also set this
+#   variable to same clock speed.  The _delay_ms() macro uses this, and many
+#   examples use this variable to calculate timings.  Do not add a "UL" here.
+F_CPU = 16000000
+
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+#     This will define a symbol, F_USB, in all source code files equal to the
+#     input clock frequency (before any prescaling is performed) in Hz. This value may
+#     differ from F_CPU if prescaling is used on the latter, and is required as the
+#     raw input clock is fed directly to the PLL sections of the AVR for high speed
+#     clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+#     at the end, this will be done automatically to create a 32-bit value in your
+#     source code.
+#
+#     If no clock division is performed on the input clock inside the AVR (via the
+#     CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in bytes
+#   Teensy halfKay   512
+#   Atmel DFU loader 4096
+#   LUFA bootloader  4096
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+
+# Build Options
+#   *Comment out* to disable the options.
+#
+#BOOTMAGIC_ENABLE = yes        # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes  # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes  # Audio control and System control(+450)
+CONSOLE_ENABLE = yes   # Console for debug(+400)
+COMMAND_ENABLE = yes    # Commands for debug and configuration
+#SLEEP_LED_ENABLE = yes  # Breathing sleep LED during USB suspend
+#NKRO_ENABLE = yes     # USB Nkey Rollover - not yet supported in LUFA
+#KEYMAP_SECTION_ENABLE = yes   # fixed address keymap for keymap editor
+
+
+
+#---------------- Programming Options --------------------------
+PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
+
+
+# Search Path
+VPATH += $(TARGET_DIR)
+VPATH += $(TMK_DIR)
+
+
+include $(TMK_DIR)/protocol/lufa.mk
+include $(TMK_DIR)/protocol.mk
+include $(TMK_DIR)/common.mk
+include $(TMK_DIR)/rules.mk
index c1ecb53b0b9e0c333c398dc421cafea12ad4cbe0..bfd3261df539859d8aab1c8162b373e775687fff 100644 (file)
@@ -59,19 +59,16 @@ To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to
 
     $ git clone git://github.com/tmk/tmk_keyboard.git (or download source)
     $ cd m0110_usb
-    $ make -f Makefile clean
-    $ make -f Makefile [KEYMAP={default|plain|intl|spacefn|hasu}]
+    $ make -f Makefile.rev2 clean
+    $ make -f Makefile.rev2 [KEYMAP={default|intl|spacefn|hasu}]
 
-Use `Makefile.teensy` instead for Teensy.
+Use `Maefile.tmk_rev1` for TMK converter Rev.1, `Makefile.teensy` for Teensy instead.
 
 
 
 Keymap
 ------
-To create your own keymap copy existent keymap file to `keymap_name.c` and edit it. You can build it like this.
-
-    $ make -f Makefile clean
-    $ make -f Makefile KEYMAP=name
+To create your own keymap copy existent keymap file to `keymap_name.c` and edit it.
 
 
 
index 8bde7473ddb839af5c1bd4df7d2f87d0e049ee8a..925556d9776274ab5e02996b1c2c0ad41b2af4d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
-Copyright 2011,2012,2014 Jun Wako <wakojun@gmail.com>
+Copyright 2011,2012,2014,2015 Jun Wako <wakojun@gmail.com>
 
 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
@@ -24,64 +24,49 @@ extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
 extern const uint16_t fn_actions[];
 
 
-/* 
- * The keymap works with both M0110 and M0110A keyboards. As you can see, the M0110A is a superset
- * of the M0110 keyboard, with only one exception: 'Enter' in M0110 does not exist
- * on the M0110A, but since it generates a unique scan code which is not used for some other key in
- * the M0110A, they are totally interchangeable.  In fact, the M0110A is functionally (almost)
- * identical to the combination of the M0110 along with the M0120 keypad. The only difference
- * (which is causing some problems as you will read below) is that the M0110+M0120 don't have
- * dedicated arrow keys, while the M0110A does. However, the M0120 did have arrow keys, which
- * doubled as the [comma], [/], [*] and [+] keys, when used with the [Shift] key. The M0110A has
- * substituted the [comma] key with the [=] key, however its scancode is the same.
+/* Common layout for M0110 and M0110A
+ * This keymap works with both keyboards. As you can see, the M0110A is 
+ * a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110
+ * does not exist on the M0110A.
  *
- * Physical layout:
- * M0110A
  * ,---------------------------------------------------------. ,---------------.
- * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Bcksp| |Clr|  =|  /|  *|
+ * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs| |Clr|  =|  /|  *|
  * |---------------------------------------------------------| |---------------|
  * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|   | |  7|  8|  9|  -|
  * |-----------------------------------------------------'   | |---------------|
  * |Caps  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return| |  4|  5|  6|  +|
  * |---------------------------------------------------------| |---------------|
  * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shft|Up | |  1|  2|  3|   |
- * |---------------------------------------------------------' |-----------|Ent|
- * |Opt  |Mac    |           Space           |  \|Lft|Rgt|Dn | |      0|  .|   |
+ * |---------------------------------------------------------| |-----------|Ent|
+ * |Opt  |Mac    |         Space         |Ent|  \|Lft|Rgt|Dn | |      0|  .|   |
  * `---------------------------------------------------------' `---------------'
  *
- * M0110                                                       M0120
+ * M0110A scan codes
  * ,---------------------------------------------------------. ,---------------.
- * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs| |Clr|  -|  +|  *|
+ * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18|   33| | 47| 68| 6D| 62|
  * |---------------------------------------------------------| |---------------|
- * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \| |  7|  8|  9|  /|
- * |---------------------------------------------------------| |---------------|
- * |Caps  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return| |  4|  5|  6|  ,|
+ * |   30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E|   | | 59| 5B| 5C| 4E|
+ * |-----------------------------------------------------'   | |---------------|
+ * |    39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27|    24| | 56| 57| 58| 66|
  * |---------------------------------------------------------| |---------------|
- * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift   | |  1|  2|  3|   |
- * `---------------------------------------------------------' |-----------|Ent|
- *      |Opt|Mac |         Space               |Ent |Opt|      |      0|  .|   |
- *      `-----------------------------------------------'      `---------------'
- * With Shift keys on M0120 work as curosor.(-:Left *:Right /:Up ,:Down)
+ * |      38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C|  38| 4D| | 53| 54| 55|   |
+ * `---------------------------------------------------------' |-----------| 4C|
+ * |   3A|     37|             31            | 2A| 46| 42| 48| |     52| 41|   |
+ * `---------------------------------------------------------' `---------------'
  *
- * NOTE: \ is located differently.
- * NOTE: Enter on M0110 is different from Enter on keypad(M0120 and M0110A).
- * NOTE: Left Shift and right Shift are logically same key.
- * NOTE: Left Option and right Option are logically same key.
- */
-
-/* Keymap definition Macro
+ * M0110 + M0120 scan codes
  * ,---------------------------------------------------------. ,---------------.
- * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs| |Clr|  =|  /|  *|
+ * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18|   33| | 47| 68| 6D| 62|
  * |---------------------------------------------------------| |---------------|
- * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|   | |  7|  8|  9|  -|
- * |-----------------------------------------------------'   | |---------------|
- * |Caps  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return| |  4|  5|  6|  +|
+ * |   30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
  * |---------------------------------------------------------| |---------------|
- * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shft|Up | |  1|  2|  3|   |
- * |---------------------------------------------------------| |-----------|Ent|
- * |Opt  |Mac    |         Space         |Ent|  \|Lft|Rgt|Dn | |      0|  .|   |
- * `---------------------------------------------------------' `---------------'
- * NOTE: Ent between Space and \ means Enter on M0110.
+ * |    39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27|    24| | 56| 57| 58| 66|
+ * |---------------------------------------------------------| |---------------|
+ * |      38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C|      38| | 53| 54| 55|   |
+ * `---------------------------------------------------------' |-----------| 4C|
+ *      | 3A|  37|             31              |   34| 3A|     |     52| 41|   |
+ *      `------------------------------------------------'     `---------------'
+ * Two right and left keys of 38 and 3A are identical, you cannot discriminate those two.
  */
 #define KEYMAP( \
     K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33,  K47,K68,K6D,K62, \
@@ -106,25 +91,30 @@ extern const uint16_t fn_actions[];
     { KC_##K68, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K6D, KC_NO,    KC_NO    }, \
 }
 
-/* International keyboard
- *  ,---------------------------------------------------------.
- *  | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18|   33|
- *  |---------------------------------------------------------|
- *  |   30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A|
- *  |------------------------------------------------------,  |
- *  |    39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24|  |
- *  |---------------------------------------------------------|
- *  |  38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A|      38|
- *  `---------------------------------------------------------'
- *       | 3A|  37|             34              |   31| 3A|
- *       `------------------------------------------------'
+/* International keyboard layout for M0110 + M0120
+ * https://en.wikipedia.org/wiki/File:Apple_Macintosh_Plus_Keyboard.jpg
+ * Probably International keyboard layout of M0110A doesn't exist.
+ *
+ * M0110 + M0120 scan codes
+ * ,---------------------------------------------------------. ,---------------.
+ * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18|   33| | 47| 68| 6D| 62|
+ * |---------------------------------------------------------| |---------------|
+ * |   30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
+ * |------------------------------------------------------,  | |---------------|
+ * |    39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24|  | | 56| 57| 58| 66|
+ * |---------------------------------------------------------| |---------------|
+ * |  38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A|      38| | 53| 54| 55|   |
+ * `---------------------------------------------------------' |-----------| 4C|
+ *      | 3A|  37|             34              |   31| 3A|     |     52| 41|   |
+ *      `------------------------------------------------'     `---------------'
+ * Two right and left keys of 38 and 3A are identical, you cannot discriminate those two.
  */
 #define KEYMAP_INTL( \
     K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33,  K47,K68,K6D,K62, \
     K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A,  K59,K5B,K5C,K4E, \
     K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,K24,      K56,K57,K58,K66, \
-    K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,K0A,    K4D,  K53,K54,K55,K4C, \
-    K3A,K37,            K34,            K31,    K46,K42,K48,  K52,    K41      \
+    K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,K0A,          K53,K54,K55,K4C, \
+        K3A,K37,            K34,                K31,          K52,    K41      \
 ) { \
     { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
     { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \
@@ -134,8 +124,8 @@ extern const uint16_t fn_actions[];
     { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, \
     { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_NO,    KC_NO,    KC_##K37 }, \
     { KC_##K38, KC_##K39, KC_##K3A, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_##K41, KC_##K42, KC_NO,    KC_NO,    KC_NO,    KC_##K46, KC_##K47 }, \
-    { KC_##K48, KC_NO,    KC_NO,    KC_NO,    KC_##K4C, KC_##K4D, KC_##K4E, KC_NO    }, \
+    { KC_NO,    KC_##K41, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K47 }, \
+    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K4C, KC_NO,    KC_##K4E, KC_NO    }, \
     { KC_NO,    KC_NO,    KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
     { KC_##K58, KC_##K59, KC_NO,    KC_##K5B, KC_##K5C, KC_NO,    KC_NO,    KC_NO    }, \
     { KC_NO,    KC_NO,    KC_##K62, KC_NO,    KC_NO,    KC_NO,    KC_##K66, KC_NO    }, \
index b0b8ee220a6f46d677fa1df4552d3d9f4cb1e92b..0f9b8d2754a07285e248a460d531e0c1dca32bb7 100644 (file)
@@ -20,15 +20,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 
+#ifdef KEYMAP_SECTION_ENABLE
+const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
+#else
 const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
+#endif
     /* Default:
      * M0110                                                       M0120
      * ,---------------------------------------------------------. ,---------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs| |Nlk|  -|  +|  *|
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs| |Nlk|  =|  /|  *|
      * |---------------------------------------------------------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \| |  7|  8|  9|  /|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \| |  7|  8|  9|  -|
      * |---------------------------------------------------------| |---------------|
-     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return| |  4|  5|  6|  ,|
+     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return| |  4|  5|  6|  +|
      * |---------------------------------------------------------| |---------------|
      * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift   | |  1|  2|  3|   |
      * `---------------------------------------------------------' |-----------|Ent|
@@ -52,27 +56,40 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
     TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,         P7,  P8,  P9,  PMNS,
     LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,     P4,  P5,  P6,  PPLS,
     LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          UP,      P1,  P2,  P3,  PENT,
-    LALT,LGUI,               SPC,                FN0, BSLS,LEFT,RGHT,DOWN,    P0,       PDOT
+    LALT,LGUI,               SPC,                FN0, FN13,LEFT,RGHT,DOWN,    P0,       PDOT
     ),
-    /* Cursor Layer
+    /* Cursor Layer:
+     * M0110                                                       M0120
      * ,---------------------------------------------------------. ,---------------.
-     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk|  -|  +|  *|
+     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk|  =|  /|  *|
      * |---------------------------------------------------------| |---------------|
-     * |Caps |Hom| Up|PgU|   |   |   |   |Psc|Slk|Pau|Up |   |INS| |  7|  8|  9|  /|
+     * |Caps |Hom| Up|PgU|   |   |   |   |Psc|Slk|Pau|Up |INS|   | |  7|  8|  9|  -|
      * |---------------------------------------------------------| |---------------|
-     * |Ctrl  |Lef|Dow|Rig|   |   |   |   |Hom|PgU|Lef|Rig|Return| |  4|  5|  6|  ,|
+     * |Ctrl  |Lef|Dow|Rig|   |   |   |   |Hom|PgU|Lef|Rig|Return| |  4|  5|  6|  +|
      * |---------------------------------------------------------| |---------------|
      * |Shift   |End|   |PgD|   |   |   |   |End|PgD|Dow|Shift   | |  1|  2|  3|   |
      * `---------------------------------------------------------' |-----------|Ent|
      *      |Opt|Mac |         Space               |Fn  |Opt|      |      0|  .|   |
      *      `-----------------------------------------------'      `---------------'
+     * M0110A
+     * ,---------------------------------------------------------. ,---------------.
+     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk|  =|  /|  *|
+     * |---------------------------------------------------------| |---------------|
+     * |Caps |Hom| Up|PgU|   |   |   |   |Psc|Slk|Pau|Up |INS|   | |  7|  8|  9|  -|
+     * |-----------------------------------------------------'   | |---------------|
+     * |Ctrl  |Lef|Dow|Rig|   |   |   |   |Hom|PgU|Lef|Rig|Return| |  4|  5|  6|  +|
+     * |---------------------------------------------------------| |---------------|
+     * |Shift   |End|   |PgD|   |   |   |   |End|PgD|Dow|Shft|PgU| |  1|  2|  3|   |
+     * |---------------------------------------------------------| |-----------|Ent|
+     * |Opt  |Mac    |         Space             |  \|Hom|End|PgD| |      0|  .|   |
+     * `---------------------------------------------------------' `---------------'
      */
     [1] = KEYMAP(
     ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
-    CAPS,HOME,UP,  PGUP,NO,  NO,  NO,  NO,  PSCR,SLCK,PAUS,UP,  NO,           P7,  P8,  P9,  PMNS,
+    CAPS,HOME,UP,  PGUP,NO,  NO,  NO,  NO,  PSCR,SLCK,PAUS,UP,  INS,          P7,  P8,  P9,  PMNS,
     LCTL,LEFT,DOWN,RGHT,NO,  NO,  NO,  NO,  HOME,PGUP,LEFT,RGHT,     ENT,     P4,  P5,  P6,  PPLS,
     LSFT,END, NO,  PGDN,NO,  NO,  NO,  NO,  END, PGDN,DOWN,          PGUP,    P1,  P2,  P3,  PENT,
-    LALT,LGUI,               SPC,                FN0, INS, HOME,END, PGDN,    P0,       PDOT
+    LALT,LGUI,               SPC,                FN0, FN13,HOME,END, PGDN,    P0,       PDOT
     ),
 };
 
@@ -80,6 +97,41 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
 /*
  * Fn action definition
  */
+#ifdef KEYMAP_SECTION_ENABLE
+const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
+#else
 const uint16_t fn_actions[] PROGMEM = {
+#endif
     [0]  = ACTION_LAYER_MOMENTARY(1),
+    [1]  = ACTION_LAYER_MOMENTARY(2),
+    [2]  = ACTION_LAYER_MOMENTARY(3),
+    [3]  = ACTION_LAYER_MOMENTARY(4),
+    [4]  = ACTION_LAYER_MOMENTARY(5),
+    [5]  = ACTION_LAYER_MOMENTARY(6),
+    [6]  = ACTION_LAYER_MOMENTARY(7),
+    [7]  = ACTION_LAYER_TOGGLE(1),
+    [8]  = ACTION_LAYER_TOGGLE(2),
+    [9]  = ACTION_LAYER_TOGGLE(3),
+    [10] = ACTION_LAYER_TAP_TOGGLE(1),
+    [11] = ACTION_LAYER_TAP_TOGGLE(2),
+    [12] = ACTION_LAYER_TAP_TOGGLE(3),
+    [13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH),
+    [14] = ACTION_LAYER_TAP_KEY(2, KC_TAB),
+    [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER),
+    [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE),
+    [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON),
+    [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE),
+    [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH),
+    [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE),
+    [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE),
+    [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE),
+    [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER),
+    [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
+    [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE),
+    [26] = ACTION_MODS_ONESHOT(MOD_LCTL),
+    [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),
+    [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE),
+    [29] = ACTION_MODS_ONESHOT(MOD_LSFT),
+    [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE),
+    [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH),
 };
diff --git a/converter/m0110_usb/keymap_for_editor.c b/converter/m0110_usb/keymap_for_editor.c
deleted file mode 100644 (file)
index d20f298..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-Copyright 2014 Jun Wako <wakojun@gmail.com>
-
-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 <stdint.h>
-#include "keycode.h"
-#include "keymap_common.h"
-
-
-#ifdef KEYMAP_SECTION_ENABLE
-const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
-#else
-const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
-#endif
-    /* Default:
-     * ,---------------------------------------------------------. ,---------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs| |Clr|  =|  /|  *|
-     * |---------------------------------------------------------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|   | |  7|  8|  9|  -|
-     * |-----------------------------------------------------'   | |---------------|
-     * |Caps  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter | |  4|  5|  6|  +|
-     * |---------------------------------------------------------| |---------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shft|Up | |  1|  2|  3|   |
-     * |---------------------------------------------------------| |-----------|Ent|
-     * |Ctl  |Gui    |         Space         |Alt|  \|Lft|Rgt|Dn | |      0|  .|   |
-     * `---------------------------------------------------------' `---------------'
-     */
-    [0] = KEYMAP(
-    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,    CLR, EQL, PSLS,PAST,
-    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,         P7,  P8,  P9,  PMNS,
-    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     FN15,    P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          UP,      P1,  P2,  P3,  PENT,
-    LCTL,LGUI,               FN16,               LALT,FN31,LEFT,RGHT,DOWN,    P0,       PDOT
-    ),
-    /* Cursor Layer(WASD, IJKL)
-     * ,---------------------------------------------------------. ,---------------.
-     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk|  =|  /|  *|
-     * |---------------------------------------------------------| |---------------|
-     * |Caps |Hom| Up|PgU|   |   |   |   |Psc|Slk|Pau|Up |Ins|   | |  7|  8|  9|  -|
-     * |-----------------------------------------------------'   | |---------------|
-     * |Caps  |Lef|Dow|Rig|   |   |   |   |Hom|PgU|Lef|Rig|Enter | |  4|  5|  6|  +|
-     * |---------------------------------------------------------| |---------------|
-     * |Shift   |End|   |PgD|   |   |   |   |End|PgD|Dow|Shif|PgU| |  1|  2|  3|   |
-     * |---------------------------------------------------------| |-----------|Ent|
-     * |Ctl  |Gui    |         Space        |Alt |  \|Hom|End|PgD| |      0|  .|   |
-     * `---------------------------------------------------------' `---------------'
-     */
-    [3] = KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
-    CAPS,HOME,UP,  PGUP,NO,  NO,  NO,  NO,  PSCR,SLCK,PAUS,UP,  INS,          P7,  P8,  P9,  PMNS,
-    LCAP,LEFT,DOWN,RGHT,NO,  NO,  NO,  NO,  HOME,PGUP,LEFT,RGHT,     FN15,    P4,  P5,  P6,  PPLS,
-    LSFT,END, NO,  PGDN,NO,  NO,  NO,  NO,  END, PGDN,DOWN,          PGUP,    P1,  P2,  P3,  PENT,
-    LCTL,LGUI,               FN16,               LALT,FN31,HOME,END, PGDN,    P0,       PDOT
-    ),
-    [4] = KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
-    CAPS,HOME,UP,  PGUP,NO,  NO,  NO,  NO,  PSCR,SLCK,PAUS,UP,  INS,          P7,  P8,  P9,  PMNS,
-    LCAP,LEFT,DOWN,RGHT,NO,  NO,  NO,  NO,  HOME,PGUP,LEFT,RGHT,     FN15,    P4,  P5,  P6,  PPLS,
-    LSFT,END, NO,  PGDN,NO,  NO,  NO,  NO,  END, PGDN,DOWN,          PGUP,    P1,  P2,  P3,  PENT,
-    LCTL,LGUI,               FN16,               LALT,FN31,HOME,END, PGDN,    P0,       PDOT
-    ),
-    [7] = {},
-};
-
-
-/*
- * Fn action definition
- */
-#ifdef KEYMAP_SECTION_ENABLE
-const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
-#else
-const uint16_t fn_actions[] PROGMEM = {
-#endif
-    [0]  = ACTION_LAYER_MOMENTARY(1),
-    [1]  = ACTION_LAYER_MOMENTARY(2),
-    [2]  = ACTION_LAYER_MOMENTARY(3),
-    [3]  = ACTION_LAYER_MOMENTARY(4),
-    [4]  = ACTION_LAYER_MOMENTARY(5),
-    [5]  = ACTION_LAYER_MOMENTARY(6),
-    [6]  = ACTION_LAYER_MOMENTARY(7),
-    [7]  = ACTION_LAYER_TOGGLE(1),
-    [8]  = ACTION_LAYER_TOGGLE(2),
-    [9]  = ACTION_LAYER_TOGGLE(3),
-    [10] = ACTION_LAYER_TAP_TOGGLE(1),
-    [11] = ACTION_LAYER_TAP_TOGGLE(2),
-    [12] = ACTION_LAYER_TAP_TOGGLE(3),
-    [13] = ACTION_LAYER_TAP_KEY(1, KC_F),
-    [14] = ACTION_LAYER_TAP_KEY(2, KC_J),
-    [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER),
-    [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE),
-    [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON),
-    [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE),
-    [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH),
-    [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE),
-    [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE),
-    [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE),
-    [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER),
-    [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
-    [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE),
-    [26] = ACTION_MODS_ONESHOT(MOD_LCTL),
-    [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),
-    [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE),
-    [29] = ACTION_MODS_ONESHOT(MOD_LSFT),
-    [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE),
-    [31] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_BSLASH),
-};
index 80b029305f11e76c6363273b6895bd670496f9c1..6cc251a28940bbdf69f30c195fb9940aaf6ddf22 100644 (file)
@@ -30,29 +30,17 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
      * |------------------------------------------------------,  | |---------------|
      * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  \|  | |  4|  5|  6|  ,|
      * |---------------------------------------------------------| |---------------|
-     * |Shif|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift   | |  1|  2|  3|   |
+     * |Shif|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|        | |  1|  2|  3|   |
      * `---------------------------------------------------------' |-----------|Ent|
-     *      |Opt|Mac |         Space               |Fn  |Opt|      |      0|  .|   |
+     *      |Opt|Mac |         Space               |Fn  |   |      |      0|  .|   |
      *      `-----------------------------------------------'      `---------------'
-     * M0110A(not existent?)
-     * ,---------------------------------------------------------. ,---------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs| |Nlk|  =|  /|  *|
-     * |---------------------------------------------------------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|Ret| |  7|  8|  9|  -|
-     * |------------------------------------------------------,  | |---------------|
-     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  \|  | |  4|  5|  6|  +|
-     * |---------------------------------------------------------| |---------------|
-     * |Shif|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shft|Up | |  1|  2|  3|   |
-     * |---------------------------------------------------------| |-----------|Ent|
-     * |Opt  |Mac    |         Space             |  \|Lft|Rgt|Dn | |      0|  .|   |
-     * `---------------------------------------------------------' `---------------'
      */
     [0] = KEYMAP_INTL(
     GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,    NLCK,EQL, PSLS,PAST,
     TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,ENT,     P7,  P8,  P9,  PMNS,
     LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,BSLS,         P4,  P5,  P6,  PPLS,
-    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     UP,      P1,  P2,  P3,  PENT,
-    LALT,LGUI,               SPC,                FN0,      LEFT,RGHT,DOWN,    P0,       PDOT
+    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,              P1,  P2,  P3,  PENT,
+         LALT,LGUI,               SPC,                     FN0,               P0,       PDOT
     ),
     /* Cursor Layer
      * ,---------------------------------------------------------. ,---------------.
@@ -62,17 +50,17 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
      * |------------------------------------------------------,  | |---------------|
      * |Ctrl  |Lef|Dow|Rig|   |   |   |   |Hom|PgU|Lef|Rig|Ins|  | |  4|  5|  6|  ,|
      * |---------------------------------------------------------| |---------------|
-     * |Shif|  <|End|   |PgD|   |   |   |   |End|PgD|Dow|Shift   | |  1|  2|  3|   |
+     * |Shif|  <|End|   |PgD|   |   |   |   |End|PgD|Dow|        | |  1|  2|  3|   |
      * `---------------------------------------------------------' |-----------|Ent|
-     *      |Opt|Mac |         Space               |Fn  |Opt|      |      0|  .|   |
+     *      |Opt|Mac |         Space               |Fn  |   |      |      0|  .|   |
      *      `-----------------------------------------------'      `---------------'
      */
     [1] = KEYMAP_INTL(
     ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
     CAPS,HOME,UP,  PGUP,NO,  NO,  NO,  NO,  PSCR,SLCK,PAUS,UP,  NO,  ENT,     P7,  P8,  P9,  PMNS,
     LCTL,LEFT,DOWN,RGHT,NO,  NO,  NO,  NO,  HOME,PGUP,LEFT,RGHT,INS,          P4,  P5,  P6,  PPLS,
-    LSFT,NO,  END, NO,  PGDN,NO,  NO,  NO,  NO,  END, PGDN,DOWN,     PGUP,    P1,  P2,  P3,  PENT,
-    LALT,LGUI,               SPC,                FN0,      HOME,END, PGDN,    P0,       PDOT
+    LSFT,NO,  END, NO,  PGDN,NO,  NO,  NO,  NO,  END, PGDN,DOWN,              P1,  P2,  P3,  PENT,
+         LALT,LGUI,               SPC,                     FN0,               P0,       PDOT
     ),
 };
 
diff --git a/converter/m0110_usb/keymap_plain.c b/converter/m0110_usb/keymap_plain.c
deleted file mode 100644 (file)
index d1507fc..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-Copyright 2014 Jun Wako <wakojun@gmail.com>
-
-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 <stdint.h>
-#include "keycode.h"
-#include "keymap_common.h"
-
-
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* Default:
-     * M0110                                                       M0120
-     * ,---------------------------------------------------------. ,---------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs| |Nlk|  -|  +|  *|
-     * |---------------------------------------------------------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \| |  7|  8|  9|  /|
-     * |---------------------------------------------------------| |---------------|
-     * |Caps  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return| |  4|  5|  6|  ,|
-     * |---------------------------------------------------------| |---------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift   | |  1|  2|  3|   |
-     * `---------------------------------------------------------' |-----------|Ent|
-     *      |Opt|Mac |         Space               |Mac |Opt|      |      0|  .|   |
-     *      `-----------------------------------------------'      `---------------'
-     *  M0110A
-     * ,---------------------------------------------------------. ,---------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Bcksp| |Nlk|  =|  /|  *|
-     * |---------------------------------------------------------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|   | |  7|  8|  9|  -|
-     * |-----------------------------------------------------'   | |---------------|
-     * |Caps  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return| |  4|  5|  6|  +|
-     * |---------------------------------------------------------| |---------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shft|Up | |  1|  2|  3|   |
-     * |---------------------------------------------------------' |-----------|Ent|
-     * |Opt  |Mac    |           Space           |  \|Lft|Rgt|Dn | |      0|  .|   |
-     * `---------------------------------------------------------' `---------------'
-     */
-    [0] = KEYMAP(
-    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,    NLCK,PEQL,PSLS,PAST,
-    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,         P7,  P8,  P9,  PMNS,
-    LCAP,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,     P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          UP,      P1,  P2,  P3,  PENT,
-    LALT,LGUI,               SPC,                RGUI,BSLS,LEFT,RGHT,DOWN,    P0,       PDOT
-    ),
-};
-
-/*
- * Fn action definition
- */
-const uint16_t fn_actions[] PROGMEM = {
-};
-
-
index 2189c0b56fe492ab0b58a557aa084589132077a9..9dcdc0d6d5061d6b5a6a5e0b4c0df68babe5323a 100644 (file)
@@ -64,6 +64,12 @@ void matrix_init(void)
     // initialize matrix state: all keys off
     for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00;
     matrix = _matrix0;
+
+    // LED flash
+    DDRD |= (1<<6); PORTD |= (1<<6);
+    _delay_ms(500);
+    DDRD |= (1<<6); PORTD &= ~(1<<6);
+
     return;
 }
 
index fe19e98ccb4440acd5097392a5af9e6427e6b3e7..7190f1eaf4c634177fb425dfd49586827f072817 100644 (file)
@@ -17,10 +17,10 @@ CONFIG_H = config.h
 # MCU name, you MUST set this to match the board you are using
 # type "make clean" after changing this, so all files will be rebuilt
 #MCU = at90usb162       # Teensy 1.0
-MCU = atmega32u4       # Teensy 2.0
+#MCU = atmega32u4       # Teensy 2.0
 #MCU = at90usb646       # Teensy++ 1.0
 #MCU = at90usb1286      # Teensy++ 2.0
-#MCU = atmega32u2       # TMK converter
+MCU = atmega32u2       # TMK converter
 
 
 # Processor frequency.
index cd80b5af1b3e6ebfe03732a2258ed7a9febccf62..a06affc5e845bb3f1a0df234ec0fae40cb204595 100644 (file)
@@ -45,7 +45,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 */
 
-#define VENDOR_ID       0xBCBC
+#define VENDOR_ID       0xFEED
 #define PRODUCT_ID      0xBCBC
 #define DEVICE_VER      0x0500
 #define MANUFACTURER    t.m.k.
@@ -56,14 +56,15 @@ POSSIBILITY OF SUCH DAMAGE.
 #define MATRIX_ROWS 12  // keycode bit: 3-0
 #define MATRIX_COLS  8  // keycode bit: 6-4
 
-//#define DEBUG_ON_INIT 1
+#define DEBUG_ON_INIT 1
 
 //#define TEENSY_CONFIG 1
-#define PRO_MICRO_CONFIG 1
-//#define TMK_CONFIG 1
+//#define PRO_MICRO_CONFIG 1
+#define TMK_CONFIG 1
 
-// comment out if you don't want the keyboard's LEDs to flash upon initialization
-#define NEXT_KBD_INIT_FLASH_LEDS
+// comment out if you don't want the keyboard's LEDs to flash upon initialization or pressing shift
+//#define NEXT_KBD_INIT_FLASH_LEDS
+//#define NEXT_KBD_SHIFT_FLASH_LEDS
 
 //============= Start of Arduino Pro Micro Configuration ==============
 #ifdef PRO_MICRO_CONFIG
@@ -183,6 +184,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 /* key combination for command */
 #define IS_COMMAND() ( \
-    (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))|| \
-    (keyboard_report->mods == (MOD_BIT(KC_RALT) | MOD_BIT(KC_RCTL)))  \
+    (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) || \
+    (keyboard_report->mods == (MOD_BIT(KC_RALT) | MOD_BIT(KC_RALT))) || \
+    (keyboard_report->mods == (MOD_BIT(KC_RGUI) | MOD_BIT(KC_RGUI)))  \
 )
index 3a510754838a6da3d10da213d02945964713a396..0041df543fdab8be07c6b9fe380cefae7b2b3c63 100644 (file)
@@ -159,7 +159,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     TRNS,PAUS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,FN3, BSLS,TRNS,  VOLD,     PGDN,  BTN1,MS_U,BTN2,WH_U,
     TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,                   MS_L,MS_D,MS_R,WH_D,
     TRNS,     FN4, FN5, FN6, FN7, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,       TRNS,       TRNS,TRNS,TRNS,  
-    TRNS,RALT,                    TRNS,                         RGUI,TRNS,  TRNS,TRNS,TRNS,  TRNS,     TRNS,TRNS
+    TRNS,TRNS,                    TRNS,                         TRNS,TRNS,  TRNS,TRNS,TRNS,  TRNS,     TRNS,TRNS
     
     )
 };
index 24db15e16acaa7386628eb9dc075dca5ed075397..2bd0ef6dd4f1b152eb931a907c868e4e36b522ff 100644 (file)
@@ -47,9 +47,14 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #include "stdint.h"
 #include "led.h"
+#include "next_kbd.h"
 
 
 void led_set(uint8_t usb_led)
 {
-
+    if (usb_led &  (1<<USB_LED_CAPS_LOCK)) {
+        next_kbd_set_leds(true, true);
+    } else {
+        next_kbd_set_leds(false, false);
+    }
 }
index fd6eb9d64fe5f19838ad26784f0869b8ca7c34c8..d91cd25774d172a0106d1535f074f13ab5d0a2a7 100644 (file)
@@ -160,7 +160,7 @@ void matrix_init(void)
 /* scan all key states on matrix */
 uint8_t matrix_scan(void)
 {
-    _delay_ms(20);
+    _delay_ms(5);
     
     //next_kbd_set_leds(false, false);
     NEXT_KBD_LED1_OFF;
@@ -194,10 +194,12 @@ uint8_t matrix_scan(void)
     
     NEXT_KBD_LED1_ON;
     
+#ifdef NEXT_KBD_SHIFT_FLASH_LEDS
     next_kbd_set_leds(
         NEXT_KBD_PRESSED_SHIFT_LEFT(resp) ? true : false, 
         NEXT_KBD_PRESSED_SHIFT_RGHT(resp) ? true : false
     );
+#endif
     
     dprintf("[ r=%04lX keycode=%02X pressed=%X CTRL=%X SHIFT_LEFT=%X SHIFT_RGHT=%X CMD_LEFT=%X CMD_RGHT=%X ALT_LEFT=%X ALT_RGHT=%X ]\n", \
         resp, \
index eeb5ad9d5e5f8fe4e8ce328be95aed72915da7bd..a7ea5bcf241fede1d77a7b85dc3464228ceaf36a 100644 (file)
@@ -1,7 +1,7 @@
 PROJECT = ps2_usb
 
 TMK_DIR = ../../tmk_core
-MBED_DIR = $(TMK_DIR)/mbed-sdk
+MBED_DIR = $(TMK_DIR)/tool/mbed/mbed-sdk
 
 #VPATH += $(MBED_DIR):$(TMK_DIR)
 vpath %.s .:$(MBED_DIR):$(TMK_DIR)
index 8af5c5b0836d6b0d4608b000424d1ed39c3631da..d9fa12bcda6791e581c04af3818399d54cd37331 100644 (file)
@@ -18,13 +18,13 @@ else
     SRC := keymap_plain.c $(SRC)
 endif
 
-# Use USART for PS/2. With V-USB INT and BUSYWAIT code is not useful.
-SRC += protocol/ps2_usart.c
-OPT_DEFS += -DPS2_USE_USART
-
 CONFIG_H = config.h
 
 
+# Use USART for PS/2. With V-USB INT and BUSYWAIT code is not useful.
+PS2_USE_USART = yes
+
+
 # V-USB debug level: To use ps2_usart.c level must be 0
 # ps2_usart.c requires USART to receive PS/2 signal.
 OPT_DEFS += -DDEBUG_LEVEL=0
index f1a1c24d3683d5964b216ed8081fb680ad0e1301..0f25232b2599ca93350cdae2f2cc1a02000b40c1 100644 (file)
@@ -111,7 +111,6 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
 SRC =  \
        keymap_common.c \
        matrix.c \
-       led.c \
        main.cpp
 
 ifdef KEYMAP
diff --git a/converter/usb_usb/Makefile.keymap_editor b/converter/usb_usb/Makefile.keymap_editor
new file mode 100644 (file)
index 0000000..08293d5
--- /dev/null
@@ -0,0 +1,5 @@
+# build firmware for keymap editor
+#
+KEYMAP_SECTION_ENABLE = yes    # fixed address keymap for keymap editor
+KEYMAP = editor
+include Makefile
index c9924567630793587566bbc1a093bf4403d480af..87da4a45eb01b870ecdc58cc125c11e00bfe3c4b 100644 (file)
@@ -30,8 +30,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 /* matrix size */
-#define MATRIX_ROWS 32
-#define MATRIX_COLS 8
+#define MATRIX_ROWS 16
+#define MATRIX_COLS 16
 
 /* key combination for command */
 #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) 
index 5397de519fade5524e7d910193ed7d1c99fa5f74..f1211147e000acad30896bcf5b1cf210cd72d404 100644 (file)
@@ -18,33 +18,37 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "keymap_common.h"
 
 
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
     /* 0: plain Qwerty without layer switching
-     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.     ,-----------.
-     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|     |Pwr|Slp|Wak|
-     * `---'   `---------------' `---------------' `---------------' `-----------'     `-----------'
-     * ,-----------------------------------------------------------. ,-----------. ,---------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa| |Ins|Hom|PgU| |NmL|  /|  *|  -|
-     * |-----------------------------------------------------------| |-----------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \| |Del|End|PgD| |  7|  8|  9|   |
-     * |-----------------------------------------------------------| `-----------' |-----------|  +|
-     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return  |               |  4|  5|  6|   |
-     * |-----------------------------------------------------------|     ,---.     |---------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
-     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
-     * |Ctrl |Gui |Alt |         Space         |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| |      0|  .|   |
-     * `-----------------------------------------------------------' `-----------' `---------------'
+     *         ,---------------. ,---------------. ,---------------.
+     *         |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
+     * ,---.   |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.
+     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help  |
+     * `---'   `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
+     * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -| |Stp|Agn|
+     * |-----------------------------------------------------------| |-----------| |---------------| |-------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  | |Del|End|PgD| |  7|  8|  9|  +| |Mnu|Und|
+     * |-----------------------------------------------------------| `-----------' |---------------| |-------|
+     * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|Retn|               |  4|  5|  6|KP,| |Sel|Cpy|
+     * |-----------------------------------------------------------|     ,---.     |---------------| |-------|
+     * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|KP=| |Exe|Pst|
+     * |-----------------------------------------------------------| ,-----------. |---------------| |-------|
+     * |Ctl|Gui|Alt|MHEN|HNJ| Space  |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |  0    |  .|Ent| |Fnd|Cut|
+     * `-----------------------------------------------------------' `-----------' `---------------' `-------'
      */
-    KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,
-    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
-    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     DEL, END, PGDN,    P7,  P8,  P9,
-    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
-    LCTL,LGUI,LALT,          SPC,                     RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
+    KEYMAP_ALL(
+              F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
+    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,    VOLD,VOLU,MUTE,PWR,     HELP,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,    STOP,AGIN,
+    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,    MENU,UNDO,
+    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,    SLCT,COPY,
+    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  RSFT,          UP,           P1,  P2,  P3,  PEQL,    EXEC,PSTE,
+    LCTL,LGUI,LALT,MHEN,HANJ,     SPC,      HAEN,HENK,KANA,RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT,    FIND,CUT
     ),
 
-    /* 1: Colemak http://colemak.com
+#if 0
+    /* Colemak http://colemak.com
      * ,-----------------------------------------------------------.
      * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa|
      * |-----------------------------------------------------------|
@@ -57,16 +61,17 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * |Ctrl |Gui |Alt |         Space         |Alt |Gui |Menu|Ctrl|
      * `----------------------------------------------------------'
      */
-    KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,
-    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
-    TAB, Q,   W,   F,   P,   G,   J,   L,   U,   Y,   SCLN,LBRC,RBRC,BSLS,     DEL, END, PGDN,    P7,  P8,  P9,
-    BSPC,A,   R,   S,   T,   D,   H,   N,   E,   I,   O,   QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   K,   M,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
-    LCTL,LGUI,LALT,          SPC,                     RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
+    KEYMAP_ALL(
+              F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
+    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,    VOLD,VOLU,MUTE,PWR,     HELP,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,    STOP,AGIN,
+    TAB, Q,   W,   F,   P,   G,   J,   L,   U,   Y,   SCLN,LBRC,RBRC,     BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,    MENU,UNDO,
+    BSPC,A,   R,   S,   T,   D,   H,   N,   E,   I,   O,   QUOT,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,    SLCT,COPY,
+    LSFT,NUBS,Z,   X,   C,   V,   B,   K,   M,   COMM,DOT, SLSH,     RO,  RSFT,          UP,           P1,  P2,  P3,  PEQL,    EXEC,PSTE,
+    LCTL,LGUI,LALT,MHEN,HANJ,     SPC,      HAEN,HENK,KANA,RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT,    FIND,CUT
     ),
 
-    /* 2: Dvorak http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard
+    /* Dvorak http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard
      * ,-----------------------------------------------------------.
      * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  [|  ]|Backspa|
      * |-----------------------------------------------------------|
@@ -79,16 +84,17 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * |Ctrl |Gui |Alt |         Space         |Alt |Gui |Menu|Ctrl|
      * `-----------------------------------------------------------'
      */
-    KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,
-    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   LBRC,RBRC,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
-    TAB, QUOT,COMM,DOT, P,   Y,   F,   G,   C,   R,   L,   SLSH,EQL, BSLS,     DEL, END, PGDN,    P7,  P8,  P9,
-    CAPS,A,   O,   E,   U,   I,   D,   H,   T,   N,   S,   MINS,     ENT,                         P4,  P5,  P6,  PPLS,
-    LSFT,SCLN,Q,   J,   K,   X,   B,   M,   W,   V,   Z,             RSFT,          UP,           P1,  P2,  P3,
-    LCTL,LGUI,LALT,          SPC,                     RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
+    KEYMAP_ALL(
+              F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
+    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,    VOLD,VOLU,MUTE,PWR,     HELP,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   LBRC,RBRC,JYEN,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,    STOP,AGIN,
+    TAB, QUOT,COMM,DOT, P,   Y,   F,   G,   C,   R,   L,   SLSH,EQL,      BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,    MENU,UNDO,
+    CAPS,A,   O,   E,   U,   I,   D,   H,   T,   N,   S,   MINS,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,    SLCT,COPY,
+    LSFT,NUBS,SCLN,Q,   J,   K,   X,   B,   M,   W,   V,   Z,        RO,  RSFT,          UP,           P1,  P2,  P3,  PEQL,    EXEC,PSTE,
+    LCTL,LGUI,LALT,MHEN,HANJ,     SPC,      HAEN,HENK,KANA,RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT,    FIND,CUT
     ),
 
-    /* 3: Workman http://viralintrospection.wordpress.com/2010/09/06/a-different-philosophy-in-designing-keyboard-layouts/
+    /* Workman http://viralintrospection.wordpress.com/2010/09/06/a-different-philosophy-in-designing-keyboard-layouts/
      * ,-----------------------------------------------------------.
      * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa|
      * |-----------------------------------------------------------|
@@ -101,15 +107,16 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * |Ctrl |Gui |Alt |         Space         |Alt |Gui |Menu|Ctrl|
      * `-----------------------------------------------------------'
      */
-    KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,
-    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
-    TAB, Q,   D,   R,   W,   B,   J,   F,   U,   P,   SCLN,LBRC,RBRC,BSLS,     DEL, END, PGDN,    P7,  P8,  P9,
-    BSPC,A,   S,   H,   T,   G,   Y,   N,   E,   O,   I,   QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   M,   C,   V,   K,   L,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
-    LCTL,LGUI,LALT,          SPC,                     RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
+    KEYMAP_ALL(
+              F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
+    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,    VOLD,VOLU,MUTE,PWR,     HELP,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,    STOP,AGIN,
+    TAB, Q,   D,   R,   W,   B,   J,   F,   U,   P,   SCLN,LBRC,RBRC,     BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,    MENU,UNDO,
+    CAPS,A,   S,   H,   T,   G,   Y,   N,   E,   O,   I,   QUOT,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,    SLCT,COPY,
+    LSFT,NUBS,Z,   X,   M,   C,   V,   K,   L,   COMM,DOT, SLSH,     RO,  RSFT,          UP,           P1,  P2,  P3,  PEQL,    EXEC,PSTE,
+    LCTL,LGUI,LALT,MHEN,HANJ,     SPC,      HAEN,HENK,KANA,RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT,    FIND,CUT
     ),
+#endif
 };
 
-const uint16_t PROGMEM fn_actions[] = {
-};
+const uint16_t fn_actions[] PROGMEM = {};
index 435d83fdc7ad40cfd89412b744c2d0ec5c0c5957..ee1c7c4de997cf8aa01ddb45413d131f0bc8a5af 100644 (file)
@@ -32,46 +32,182 @@ extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
 extern const uint16_t fn_actions[];
 
 
-#define KEYMAP( \
-    K29,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,     K46,K47,K48,                   \
-    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A, K49,K4A,K4B,  K53,K54,K55,K56, \
-    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K31, K4C,K4D,K4E,  K5F,K60,K61,     \
-    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K28,               K5C,K5D,K5E,K57, \
-    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,        KE5,     K52,      K59,K5A,K5B,     \
-    KE0,KE3,KE2,        K2C,                KE6,KE7,K65,KE4, K50,K51,K4F,  K62,    K63,K58  \
+/*         ,---------------. ,---------------. ,---------------.
+ *         |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
+ * ,---.   |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.
+ * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help  |
+ * `---'   `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
+ * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
+ * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -| |Stp|Agn|
+ * |-----------------------------------------------------------| |-----------| |---------------| |-------|
+ * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  | |Del|End|PgD| |  7|  8|  9|  +| |Mnu|Und|
+ * |-----------------------------------------------------------| `-----------' |---------------| |-------|
+ * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|Retn|               |  4|  5|  6|KP,| |Sel|Cpy|
+ * |-----------------------------------------------------------|     ,---.     |---------------| |-------|
+ * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|KP=| |Exe|Pst|
+ * |-----------------------------------------------------------| ,-----------. |---------------| |-------|
+ * |Ctl|Gui|Alt|MHEN|HNJ| Space  |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |  0    |  .|Ent| |Fnd|Cut|
+ * `-----------------------------------------------------------' `-----------' `---------------' `-------'
+ *
+ *
+ * App:         Windows Menu key
+ * Gui:         Windows key, Mac ⌘ key or Meta key
+ *
+ * Pwr:         Power for Unix and Mac
+ * VDn,Vup,Mut: Volume control for Unix and Mac
+ * Stp,Agn..:   for Unix
+ *
+ * KP,:         Brazilian Keypad Comma
+ * KP=:         Keypad = for Mac
+ * <,#:         ISO keys(UK legend)
+ * JPY:         Japanese Yen(¥)
+ * RO:          Japanese ろ or Brazilian /
+ * MHEN:        Japanese 無変換 Non Conversion
+ * HENK:        Japanese 変換 Conversion
+ * KANA:        Japanese かな Hiragana/Katakana
+ *              https://en.wikipedia.org/wiki/Keyboard_layout#Japanese
+ * H/E:         Korean 한/영 Hangul/English
+ * HNJ:         Korean 한자 Hanja
+ *              https://en.wikipedia.org/wiki/Keyboard_layout#Hangul_.28for_Korean.29
+ *
+ * TODO: use same keycode to pass through instead of KC_NO?
+ */
+#define KEYMAP_ALL( \
+            K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73,                                              \
+    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  K81,K80,K7F,K66, K75,     \
+    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, K78,K79, \
+    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57, K76,K7A, \
+    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K32,K28,                K5C,K5D,K5E,K85, K77,K7C, \
+    KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    K87,KE5,      K52,      K59,K5A,K5B,K67, K74,K7D, \
+    KE0,KE3,KE2,K8B,K91,    K2C,    K90,K8A,K88,KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, K7E,K7B  \
 ) { \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, /* 00-07 */ \
-    { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, /* 08-0F */ \
-    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, /* 10-17 */ \
-    { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, /* 18-1F */ \
-    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, /* 20-27 */ \
-    { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, /* 28-2F */ \
-    { KC_##K30, KC_##K31, KC_NO,    KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37 }, /* 30-37 */ \
-    { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, /* 38-3F */ \
-    { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, /* 40-47 */ \
-    { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, /* 48-4F */ \
-    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, /* 50-57 */ \
-    { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F }, /* 58-5F */ \
-    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_NO,    KC_##K65, KC_NO,    KC_NO    }, /* 60-67 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 68-6F */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 70-77 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 78-7F */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 80-87 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 88-8F */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 90-97 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 98-9F */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* A0-A7 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* A8-AF */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* B0-B7 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* B8-BF */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* C0-C7 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* C8-CF */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* D0-D7 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* D8-DF */ \
-    { KC_##KE0, KC_##KE1, KC_##KE2, KC_##KE3, KC_##KE4, KC_##KE5, KC_##KE6, KC_##KE7 }, /* E0-E7 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* E8-EF */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* F0-F7 */ \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* F8-FF */ \
+    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K04, KC_##K05, KC_##K06, KC_##K07,   /* 00-07 */ \
+      KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, /* 08-0F */ \
+    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17,   /* 10-17 */ \
+      KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, /* 18-1F */ \
+    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27,   /* 20-27 */ \
+      KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F }, /* 28-2F */ \
+    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37,   /* 30-37 */ \
+      KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F }, /* 38-3F */ \
+    { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47,   /* 40-47 */ \
+      KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, /* 48-4F */ \
+    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57,   /* 50-57 */ \
+      KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F }, /* 58-5F */ \
+    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67,   /* 60-67 */ \
+      KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, /* 68-6F */ \
+    { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77,   /* 70-77 */ \
+      KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_##K7F }, /* 78-7F */ \
+    { KC_##K80, KC_##K81, KC_NO,    KC_NO,    KC_NO,    KC_##K85, KC_NO,    KC_##K87,   /* 80-87 */ \
+      KC_##K88, KC_##K89, KC_##K8A, KC_##K8B, KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 88-8F */ \
+    { KC_##K90, KC_##K91, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* 90-97 */ \
+      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* 98-9F */ \
+    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* A0-A7 */ \
+      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* A8-AF */ \
+    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* B0-B7 */ \
+      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* B8-BF */ \
+    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* C0-C7 */ \
+      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* C8-CF */ \
+    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* D0-D7 */ \
+      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* D8-DF */ \
+    { KC_##KE0, KC_##KE1, KC_##KE2, KC_##KE3, KC_##KE4, KC_##KE5, KC_##KE6, KC_##KE7,   /* E0-E7 */ \
+      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* E8-EF */ \
+    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,      /* F0-F7 */ \
+      KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, /* F8-FF */ \
 }
 
+/* ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
+ * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
+ * `---'   `---------------' `---------------' `---------------' `-----------'
+ * ,-----------------------------------------------------------. ,-----------. ,---------------.
+ * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|    Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
+ * |-----------------------------------------------------------| |-----------| |---------------|
+ * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  | |Del|End|PgD| |  7|  8|  9|  +|
+ * |-----------------------------------------------------------| `-----------' |-----------|   |
+ * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  Return|               |  4|  5|  6|  +|
+ * |-----------------------------------------------------------|     ,---.     |---------------|
+ * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
+ * |-----------------------------------------------------------| ,-----------. |-----------|   |
+ * |Ctl|Gui|Alt|           Space               |Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|Ent|
+ * `-----------------------------------------------------------' `-----------' `---------------'
+ */
+#define KEYMAP( \
+    K29,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                   \
+    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, \
+    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K31,  K4C,K4D,K4E,  K5F,K60,K61,     \
+    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K28,                K5C,K5D,K5E,K57, \
+    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,        KE5,      K52,      K59,K5A,K5B,     \
+    KE0,KE3,KE2,        K2C,                KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58  \
+) KEYMAP_ALL( \
+            NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,                                               \
+    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
+    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,NO, K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
+    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K31,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
+    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    NO, K28,                K5C,K5D,K5E,NO,  NO, NO,  \
+    KE1,NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    NO, KE5,      K52,      K59,K5A,K5B,NO,  NO, NO,  \
+    KE0,KE3,KE2,NO, NO,     K2C,    NO, NO, NO, KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
+)
+
+/* ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
+ * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
+ * `---'   `---------------' `---------------' `---------------' `-----------'
+ * ,-----------------------------------------------------------. ,-----------. ,---------------.
+ * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|    Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
+ * |-----------------------------------------------------------| |-----------| |---------------|
+ * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Retn| |Del|End|PgD| |  7|  8|  9|  +|
+ * |------------------------------------------------------`    | `-----------' |-----------|   |
+ * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|    |               |  4|  5|  6|   |
+ * |-----------------------------------------------------------|     ,---.     |---------------|
+ * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|Ent|
+ * |-----------------------------------------------------------| ,-----------. |-----------|   |
+ * |Ctl|Gui|Alt|           Space               |Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
+ * `-----------------------------------------------------------' `-----------' `---------------'
+ */
+#define KEYMAP_ISO( \
+    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,  K46,K47,K48,                   \
+    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, \
+    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K28,  K4C,K4D,K4E,  K5F,K60,K61,K57, \
+    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32,                    K5C,K5D,K5E,     \
+    KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    KE5,      K52,      K59,K5A,K5B,K58, \
+    KE0,KE3,KE2,        K2C,                KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63      \
+) KEYMAP_ALL( \
+            NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,                                               \
+    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
+    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,NO, K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
+    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K32,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
+    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K32,K28,                K5C,K5D,K5E,NO,  NO, NO,  \
+    KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    NO, KE5,      K52,      K59,K5A,K5B,NO,  NO, NO,  \
+    KE0,KE3,KE2,NO, NO,     K2C,    NO, NO, NO, KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
+)
+
+/* ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
+ * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
+ * `---'   `---------------' `---------------' `---------------' `-----------'
+ * ,-----------------------------------------------------------. ,-----------. ,---------------.
+ * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
+ * |-----------------------------------------------------------| |-----------| |---------------|
+ * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  @|  [| Retn| |Del|End|PgD| |  7|  8|  9|  +|
+ * |------------------------------------------------------`    | `-----------' |-----------|   |
+ * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  ]|    |               |  4|  5|  6|   |
+ * |-----------------------------------------------------------|     ,---.     |---------------|
+ * |Shft    |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|Ent|
+ * |-----------------------------------------------------------| ,-----------. |-----------|   |
+ * |Ctl|Gui|Alt|MHEN|      Space      |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
+ * `-----------------------------------------------------------' `-----------' `---------------'
+ */
+#define KEYMAP_JIS( \
+    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,                   \
+    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, \
+    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K28,  K4C,K4D,K4E,  K5F,K60,K61,K57, \
+    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32,                        K5C,K5D,K5E,     \
+    KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,        K87,KE5,      K52,      K59,K5A,K5B,K58, \
+    KE0,KE3,KE2,K8B,    K2C,        K8A,K88,KE6,KE7,K65,KE4,      K50,K51,K4F,  K62,    K63      \
+) KEYMAP_ALL( \
+            NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,                                               \
+    K29,    K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45,      K46,K47,K48,  NO, NO, NO, NO,  NO,      \
+    K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A,  K49,K4A,K4B,  K53,K54,K55,K56, NO, NO,  \
+    K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,    K32,  K4C,K4D,K4E,  K5F,K60,K61,K57, NO, NO,  \
+    K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,    K32,K28,                K5C,K5D,K5E,NO,  NO, NO,  \
+    KE1,NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38,    K87,KE5,      K52,      K59,K5A,K5B,NO,  NO, NO,  \
+    KE0,KE3,KE2,K8B,NO,     K2C,    NO, K8A,K88,KE6,KE7,K65,KE4,  K50,K51,K4F,  K62,    K63,K58, NO, NO   \
+)
 #endif
diff --git a/converter/usb_usb/keymap_editor.c b/converter/usb_usb/keymap_editor.c
new file mode 100644 (file)
index 0000000..bd63ea2
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+Copyright 2016 Jun Wako <wakojun@gmail.com>
+
+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 "keymap_common.h"
+
+
+#ifndef KEYMAP_SECTION_ENABLE
+    #error "KEYMAP_SECTION_ENABLE is not defined."
+#endif
+
+const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
+    /* 0: plain Qwerty without layer switching
+     *         ,---------------. ,---------------. ,---------------.
+     *         |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
+     * ,---.   |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.
+     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help  |
+     * `---'   `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
+     * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -| |Stp|Agn|
+     * |-----------------------------------------------------------| |-----------| |---------------| |-------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  | |Del|End|PgD| |  7|  8|  9|  +| |Mnu|Und|
+     * |-----------------------------------------------------------| `-----------' |---------------| |-------|
+     * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|Retn|               |  4|  5|  6|KP,| |Sel|Cpy|
+     * |-----------------------------------------------------------|     ,---.     |---------------| |-------|
+     * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|KP=| |Exe|Pst|
+     * |-----------------------------------------------------------| ,-----------. |---------------| |-------|
+     * |Ctl|Gui|Alt|MHEN|HNJ| Space  |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |  0    |  .|Ent| |Fnd|Cut|
+     * `-----------------------------------------------------------' `-----------' `---------------' `-------'
+     */
+    KEYMAP_ALL(
+              F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
+    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,    VOLD,VOLU,MUTE,PWR,     HELP,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,    STOP,AGIN,
+    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,    MENU,UNDO,
+    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,    SLCT,COPY,
+    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  RSFT,          UP,           P1,  P2,  P3,  PEQL,    EXEC,PSTE,
+    LCTL,LGUI,LALT,MHEN,HANJ,     SPC,      HAEN,HENK,KANA,RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT,    FIND,CUT
+    ),
+};
+
+const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
+    [0]  = ACTION_LAYER_MOMENTARY(1),
+    [1]  = ACTION_LAYER_MOMENTARY(2),
+    [2]  = ACTION_LAYER_MOMENTARY(3),
+    [3]  = ACTION_LAYER_MOMENTARY(4),
+    [4]  = ACTION_LAYER_MOMENTARY(5),
+    [5]  = ACTION_LAYER_MOMENTARY(6),
+    [6]  = ACTION_LAYER_MOMENTARY(7),
+    [7]  = ACTION_LAYER_TOGGLE(1),
+    [8]  = ACTION_LAYER_TOGGLE(2),
+    [9]  = ACTION_LAYER_TOGGLE(3),
+    [10] = ACTION_LAYER_TAP_TOGGLE(1),
+    [11] = ACTION_LAYER_TAP_TOGGLE(2),
+    [12] = ACTION_LAYER_TAP_TOGGLE(3),
+    [13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH),
+    [14] = ACTION_LAYER_TAP_KEY(2, KC_TAB),
+    [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER),
+    [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE),
+    [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON),
+    [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE),
+    [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH),
+    [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE),
+    [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE),
+    [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE),
+    [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER),
+    [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
+    [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE),
+    [26] = ACTION_MODS_ONESHOT(MOD_LCTL),
+    [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),
+    [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE),
+    [29] = ACTION_MODS_ONESHOT(MOD_LSFT),
+    [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE),
+    [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH),
+};
diff --git a/converter/usb_usb/keymap_iso.c b/converter/usb_usb/keymap_iso.c
new file mode 100644 (file)
index 0000000..f22a840
--- /dev/null
@@ -0,0 +1,36 @@
+#include "keymap_common.h"
+
+const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
+    /* Layer 0: Default Layer
+     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
+     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
+     * `---'   `---------------' `---------------' `---------------' `-----------'
+     * ,-----------------------------------------------------------. ,-----------. ,---------------.
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|    Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
+     * |-----------------------------------------------------------| |-----------| |---------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Retn| |Del|End|PgD| |  7|  8|  9|  +|
+     * |------------------------------------------------------`    | `-----------' |-----------|   |
+     * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  #|    |               |  4|  5|  6|   |
+     * |-----------------------------------------------------------|     ,---.     |---------------|
+     * |Shft|\  |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|Ent|
+     * |-----------------------------------------------------------| ,-----------. |-----------|   |
+     * |Ctl|Gui|Alt|           Space       |HNK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
+     * `-----------------------------------------------------------' `-----------' `---------------'
+     */
+    [0] = \
+    KEYMAP_ISO(
+    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
+    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,ENT,      DEL, END, PGDN,    P7,  P8,  P9,  PPLS,
+    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,                             P4,  P5,  P6,
+    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RSFT,          UP,           P1,  P2,  P3,  PENT,
+    LCTL,LGUI,LALT,          SPC,                     RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT 
+    ),
+};
+
+
+/*
+ * Fn action definition
+ */
+const uint16_t fn_actions[] PROGMEM = {
+};
diff --git a/converter/usb_usb/keymap_jis.c b/converter/usb_usb/keymap_jis.c
new file mode 100644 (file)
index 0000000..d164dce
--- /dev/null
@@ -0,0 +1,36 @@
+#include "keymap_common.h"
+
+const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
+    /* Layer 0: Default Layer
+     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.
+     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
+     * `---'   `---------------' `---------------' `---------------' `-----------'
+     * ,-----------------------------------------------------------. ,-----------. ,---------------.
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  ^|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
+     * |-----------------------------------------------------------| |-----------| |---------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  @|  [| Retn| |Del|End|PgD| |  7|  8|  9|  +|
+     * |------------------------------------------------------`    | `-----------' |-----------|   |
+     * |CapsL |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  ]|    |               |  4|  5|  6|   |
+     * |-----------------------------------------------------------|     ,---.     |---------------|
+     * |Shft    |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|Ent|
+     * |-----------------------------------------------------------| ,-----------. |-----------|   |
+     * |Ctl|Gui|Alt|MHEN|      Space      |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |      0|  .|   |
+     * `-----------------------------------------------------------' `-----------' `---------------'
+     */
+    [0] = \
+    KEYMAP_JIS(
+    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,
+    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JPY, BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
+    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     ENT,      DEL, END, PGDN,    P7,  P8,  P9,  PPLS,
+    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,NUHS,                                  P4,  P5,  P6,
+    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RO,  RSFT,          UP,           P1,  P2,  P3,  PENT,
+    LCTL,LGUI,LALT,MHEN,     SPC,                HENK,KANA,RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT 
+    ),
+};
+
+
+/*
+ * Fn action definition
+ */
+const uint16_t fn_actions[] PROGMEM = {
+};
index bffd2bc606f0403b56968400bdeda21ff1eaaab1..69f8693eb9204e83d8017bbaef8d3056b01a9264 100644 (file)
@@ -6,36 +6,39 @@
 
 
 const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* 0: default
-     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.     ,-----------.
-     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|     |Pwr|Slp|Wak|
-     * `---'   `---------------' `---------------' `---------------' `-----------'     `-----------'
-     * ,-----------------------------------------------------------. ,-----------. ,---------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backspa| |Ins|Hom|PgU| |NmL|  /|  *|  -|
-     * |-----------------------------------------------------------| |-----------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \| |Del|End|PgD| |  7|  8|  9|   |
-     * |-----------------------------------------------------------| `-----------' |-----------|  +|
-     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Return  |               |  4|  5|  6|   |
-     * |-----------------------------------------------------------|     ,---.     |---------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
-     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
-     * |Ctrl |Gui |Alt |         Space         |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| |      0|  .|   |
-     * `-----------------------------------------------------------' `-----------' `---------------'
+    /* 0: plain Qwerty
+     *         ,---------------. ,---------------. ,---------------.
+     *         |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24|
+     * ,---.   |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------.
+     * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help  |
+     * `---'   `---------------' `---------------' `---------------' `-----------' `---------------' `-------'
+     * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------.
+     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|JPY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -| |Stp|Agn|
+     * |-----------------------------------------------------------| |-----------| |---------------| |-------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  | |Del|End|PgD| |  7|  8|  9|  +| |Mnu|Und|
+     * |-----------------------------------------------------------| `-----------' |---------------| |-------|
+     * |LCtrl |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  #|Retn|               |  4|  5|  6|KP,| |Sel|Cpy|
+     * |-----------------------------------------------------------|     ,---.     |---------------| |-------|
+     * |Shft|  <|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|KP=| |Exe|Pst|
+     * |-----------------------------------------------------------| ,-----------. |---------------| |-------|
+     * |Ctl|Gui|Alt|MHEN|HNJ| Space  |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| |  0    |  .|Ent| |Fnd|Cut|
+     * `-----------------------------------------------------------' `-----------' `---------------' `-------'
      */
-    KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,
-    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
-    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,     DEL, END, PGDN,    P7,  P8,  P9,
-    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     ENT,                         P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,          RSFT,          UP,           P1,  P2,  P3,
-    LCTL,LGUI,LALT,          FN0,                     RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
+    KEYMAP_ALL(
+              F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
+    ESC,      F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,PAUS,    VOLD,VOLU,MUTE,PWR,     HELP,
+    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, JYEN,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,    STOP,AGIN,
+    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,     BSLS,     DEL, END, PGDN,    P7,  P8,  P9,  PPLS,    MENU,UNDO,
+    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,     NUHS,ENT,                         P4,  P5,  P6,  PCMM,    SLCT,COPY,
+    LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,     RO,  RSFT,          UP,           P1,  P2,  P3,  PEQL,    EXEC,PSTE,
+    LCTL,LGUI,LALT,MHEN,HANJ,     FN0,      HAEN,HENK,KANA,RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT,    FIND,CUT
     ),
 
     /* 1: SpaceFN
      * ,-----------------------------------------------------------.
      * |`  | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete |
      * |-----------------------------------------------------------|
-     * |     |   |   |Esc|   |   |   |Hom|Up |End|Psc|Slk|Pau|Ins  |
+     * |Caps |   |   |Esc|   |   |   |Hom|Up |End|Psc|Slk|Pau|Ins  |
      * |-----------------------------------------------------------|
      * |      |   |   |   |   |   |PgU|Lef|Dow|Rig|   |   |        |
      * |-----------------------------------------------------------|
@@ -44,13 +47,14 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      * |    |    |    |                        |    |    |    |    |
      * `-----------------------------------------------------------'
      */
-    KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,
-    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,      INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
-    TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP,  END, PSCR,SLCK,PAUS,INS,      DEL, END, PGDN,    P7,  P8,  P9,
-    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS,     TRNS,                        P4,  P5,  P6,  PPLS,
-    TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP,           TRNS,          UP,           P1,  P2,  P3,
-    TRNS,TRNS,TRNS,          TRNS,                    TRNS,TRNS,TRNS,TRNS,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
+    KEYMAP_ALL(
+              TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+    TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,          TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,    TRNS,
+    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS,DEL,      TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,    TRNS,TRNS,
+    CAPS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP,  END, PSCR,SLCK,PAUS,     INS,      TRNS,TRNS,TRNS,    TRNS,TRNS,TRNS,TRNS,    TRNS,TRNS,
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS,     TRNS,TRNS,                        TRNS,TRNS,TRNS,TRNS,    TRNS,TRNS,
+    TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP,      TRNS,TRNS,          TRNS,         TRNS,TRNS,TRNS,TRNS,    TRNS,TRNS,
+    TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,     TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,     TRNS,TRNS,TRNS,    TRNS,     TRNS,TRNS,    TRNS,TRNS
     ),
 };
 
diff --git a/converter/usb_usb/led.c b/converter/usb_usb/led.c
deleted file mode 100644 (file)
index fc0eeb0..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-Copyright 2012 Jun Wako <wakojun@gmail.com>
-
-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 "stdint.h"
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-}
index 57a5de3d3563b1f44980ab803496f9b3179c82f3..652c80573466b3498d29b41b2dfbef72a35d0c33 100644 (file)
@@ -5,10 +5,10 @@
 
 // USB HID host
 #include "Usb.h"
+#include "usbhub.h"
 #include "hid.h"
 #include "hidboot.h"
 #include "parser.h"
-#include "usbhub.h"
 
 // LUFA
 #include "lufa.h"
@@ -17,6 +17,7 @@
 #include "sendchar.h"
 #include "debug.h"
 #include "keyboard.h"
+#include "led.h"
 
 
 /* LED ping configuration */
 #endif
 
 
-static USB     usb_host;
-static HIDBoot<HID_PROTOCOL_KEYBOARD>    kbd(&usb_host);
-static KBDReportParser kbd_parser;
-static USBHub hub1(&usb_host);  // one hub is enough for HHKB pro2
-/* may be needed  for other device with more hub
-static USBHub hub2(&usb_host);
-static USBHub hub3(&usb_host);
-static USBHub hub4(&usb_host);
-static USBHub hub5(&usb_host);
-static USBHub hub6(&usb_host);
-static USBHub hub7(&usb_host);
-*/
-
 static void LUFA_setup(void)
 {
     /* Disable watchdog if enabled by bootloader/fuses */
@@ -74,17 +62,24 @@ static void LUFA_setup(void)
     print_set_sendchar(sendchar);
 }
 
-static void HID_setup()
-{
-    if (usb_host.Init() == -1) {
-        LED_TX_OFF;
-    }
 
-    _delay_ms(200);
 
-    kbd.SetReportParser(0, (HIDReportParser*)&kbd_parser);
+/*
+ * USB Host Shield HID keyboard
+ */
+USB usb_host;
+USBHub hub1(&usb_host);
+HIDBoot<HID_PROTOCOL_KEYBOARD>    kbd(&usb_host);
+KBDReportParser kbd_parser;
+
+
+void led_set(uint8_t usb_led)
+{
+    kbd.SetReport(0, 0, 2, 0, 1, &usb_led);
 }
 
+
+
 int main(void)
 {
     // LED for debug
@@ -92,12 +87,17 @@ int main(void)
     LED_TX_ON;
 
     debug_enable = true;
+    debug_keyboard = true;
 
     host_set_driver(&lufa_driver);
     keyboard_init();
 
     LUFA_setup();
-    HID_setup();
+
+    // USB Host Shield setup
+    usb_host.Init();
+    kbd.SetReportParser(0, (HIDReportParser*)&kbd_parser);
+
     /* NOTE: Don't insert time consuming job here.
      * It'll cause unclear initialization failure when DFU reset(worm start).
      */
index 83d5ab6c8319d1fea3f04d48b488a74a994da18e..184933acf3e17f32ea3f6ef0f10a6095ee6a329f 100644 (file)
@@ -31,20 +31,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  *  7 6 5 4 3 2 1 0
  * +---------------+
- * |   ROW   | COL |
+ * |  ROW  |  COL  |
  * +---------------+
  *
- * Matrix space(32 * 8):
- *      01234567
- *   0 +--------+
- *   : |        |
- *   : |        |
- *  31 +--------+
+ * Matrix space(16 * 16):
+ *   r\c0123456789ABCDEF
+ *   0 +----------------+
+ *   : |                |
+ *   : |                |
+ *  16 +----------------+
  */
-#define ROW_MASK 0xF8
-#define COL_MASK 0x07
-#define CODE(row, col)  (((row) << 3) | (col))
-#define ROW(code)       (((code) & ROW_MASK) >> 3)
+#define ROW_MASK 0xF0
+#define COL_MASK 0x0F
+#define CODE(row, col)  (((row) << 4) | (col))
+#define ROW(code)       (((code) & ROW_MASK) >> 4)
 #define COL(code)       ((code) & COL_MASK)
 #define ROW_BITS(code)  (1 << COL(code))
 
@@ -89,8 +89,8 @@ bool matrix_is_on(uint8_t row, uint8_t col) {
     return false;
 }
 
-uint8_t matrix_get_row(uint8_t row) {
-    uint8_t row_bits = 0;
+matrix_row_t matrix_get_row(uint8_t row) {
+    uint16_t row_bits = 0;
 
     if (IS_MOD(CODE(row, 0)) && usb_hid_keyboard_report.mods) {
         row_bits |= usb_hid_keyboard_report.mods;
diff --git a/doc/COPYING.GPLv2 b/doc/COPYING.GPLv2
deleted file mode 100644 (file)
index d159169..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                            NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
diff --git a/doc/COPYING.GPLv3 b/doc/COPYING.GPLv3
deleted file mode 100644 (file)
index 94a9ed0..0000000
+++ /dev/null
@@ -1,674 +0,0 @@
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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 3 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/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/doc/FUSE.txt b/doc/FUSE.txt
deleted file mode 100644 (file)
index 40055e5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-ATMega168P Fuse/Lock Bits
-=========================
-This configuration is from usbasploader's Makefile.
-
-    HFUSE   0xD6
-    LFUSE   0xDF
-    EFUSE   0x00
-    LOCK    0x3F(intact)
-
-#---------------------------------------------------------------------
-# ATMega168P
-#---------------------------------------------------------------------
-# Fuse extended byte:
-# 0x00 = 0 0 0 0   0 0 0 0 <-- BOOTRST (boot reset vector at 0x1800)
-#                    \+/
-#                     +------- BOOTSZ (00 = 2k bytes)
-# Fuse high byte:
-# 0xd6 = 1 1 0 1   0 1 1 0
-#        ^ ^ ^ ^   ^ \-+-/
-#        | | | |   |   +------ BODLEVEL 0..2 (110 = 1.8 V)
-#        | | | |   + --------- EESAVE (preserve EEPROM over chip erase)
-#        | | | +-------------- WDTON (if 0: watchdog always on)
-#        | | +---------------- SPIEN (allow serial programming)
-#        | +------------------ DWEN (debug wire enable)
-#        +-------------------- RSTDISBL (reset pin is enabled)
-# Fuse low byte:
-# 0xdf = 1 1 0 1   1 1 1 1
-#        ^ ^ \ /   \--+--/
-#        | |  |       +------- CKSEL 3..0 (external >8M crystal)
-#        | |  +--------------- SUT 1..0 (crystal osc, BOD enabled)
-#        | +------------------ CKOUT (if 0: Clock output enabled)
-#        +-------------------- CKDIV8 (if 0: divide by 8)
-
-
-# Lock Bits
-# 0x3f = - - 1 1   1 1 1 1
-#            \ /   \-/ \-/
-#             |     |   +----- LB 2..1 (No memory lock features enabled)
-#             |     +--------- BLB0 2..1 (No restrictions for SPM or LPM accessing the Application section)
-#             +--------------- BLB1 2..1 (No restrictions for SPM or LPM accessing the Boot Loader section)
diff --git a/doc/POWER.txt b/doc/POWER.txt
deleted file mode 100644 (file)
index 0abbbe4..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-Time to Sleep
-=============
-USB suspend     no activity on USB line for  3ms
-No Interaction  no user interaction
-    matrix has no change
-    matrix has no switch on
-
-
-AVR Power Management
-====================
-
-V-USB suspend
-    USB suspend
-    http://vusb.wikidot.com/examples
-
-MCUSR   MCU Status Register
-    WDRF    Watchdog Reset Flag
-    BORF
-    EXTRF
-    PORF    Power-on Reset Flag
-
-SMCR    Sleep Mode Control Register
-    SE      Sleep Enable
-    SM2:0   
-        #define set_sleep_mode(mode) \
-        #define SLEEP_MODE_IDLE         (0)
-        #define SLEEP_MODE_ADC          _BV(SM0)
-        #define SLEEP_MODE_PWR_DOWN     _BV(SM1)
-        #define SLEEP_MODE_PWR_SAVE     (_BV(SM0) | _BV(SM1))
-        #define SLEEP_MODE_STANDBY      (_BV(SM1) | _BV(SM2))
-        #define SLEEP_MODE_EXT_STANDBY  (_BV(SM0) | _BV(SM1) | _BV(SM2))
-
-
-ACSR    Analog Comparator Control and Status Register
-    To disable Analog Comparator
-    ACSR = 0x80;
-    or
-    ACSR &= ~_BV(ACIE);
-    ACSR |= _BV(ACD);
-
-    ACD: Analog Comparator Disable
-        When this bit is written logic one, the power to the Analog Comparator is
-        switched off. This bit can be set at any time to turn off the Analog
-        Comparator. This will reduce power consumption in Active and Idle mode.
-        When changing the ACD bit, the Analog Comparator Interrupt must be disabled
-        by clearing the ACIE bit in ACSR. Otherwise an interrupt can occur when
-        the bit is changed.
-
-DIDR1   Digital Input Disable Register 1
-    AIN1D
-    AIN0D
-        When this bit is written logic one, the digital input buffer on the AIN1/0 pin is disabled. The corresponding PIN Register bit will always read as zero when this bit is set. When an analog signal is applied to the AIN1/0 pin and the digital input from this pin is not needed, this bit should be written logic one to reduce power consumption in the digital input buffer.
-
-
-PRR     Power Reduction Register
-    PRTWI
-    PRTIM2
-    PRTIM0
-    PRTIM1
-    PRSPI
-    PRUSART0
-    PRADC
diff --git a/doc/USB_NKRO.txt b/doc/USB_NKRO.txt
deleted file mode 100644 (file)
index d9f1d12..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-USB NKRO MEMO
-=============
-2010/12/09
-
-
-References
-----------
-USB - boot mode, NKRO, compatibility, etc...
-    http://geekhack.org/showthread.php?t=13162
-NKey Rollover - Overview, Testing Methodology, and Results
-    http://geekhack.org/showwiki.php?title=NKey+Rollover+-+Overview+Testing+Methodology+and+Results
-dfj's NKRO(2010/06)
-    http://geekhack.org/showpost.php?p=191195&postcount=251
-    http://geekhack.org/showthread.php?p=204389#post204389
-
-
-Terminology
----------
-NKRO
-ghost
-matrix
-mechanical with diodes
-membrane
-
-
-OS Support Status
------------------
-USB NKRO is possible *without* a custom driver.
-At least following OS's supports.
-    Windows7 64bit
-    WindowsXP
-    Windows2000 SP4
-    Ubuntu10.4(Linux 2.6)
-    MacOSX(To be tested)
-
-
-Custom Driver for USB NKRO
---------------------------
-NOT NEEDED
-at least when using following report formats on Windows, Linux or MacOSX.
-
-
-USB NKRO methods
-----------------
-1. Virtual keyboards
-    Keyboard can increase its KRO by using virtual keyboards with Standard or Extended report.
-    If the keyboard has 2 virtual keyboard with Standard report(6KRO), it gets 12KRO.
-    Using this method means the keyboard is a composite device.
-
-2. Extended report
-    It needs large report size for this method to achieve NKRO.
-    If a keyboard has 101keys, it needs 103byte report. It seems to be inefficient.
-
-3. Bitmap report
-    If the keyboard has less than 128keys, 16byte report will be enough for NKRO.
-    The 16byte report seems to be reasonable cost to get NKRO.
-
-
-Report Format
--------------
-Other report formats than followings are possible, though these format are typical one.
-
-1. Standard             8bytes
-    modifiers(bitmap)       1byte
-    reserved                1byte(not used)
-    keys(array)             1byte*6
-Standard report can send 6keys plus 8modifiers simultaneously.
-Standard report is used by most keyboards in the marketplace.
-Standard report is identical to boot protocol report.
-Standard report is hard to suffer from compatibility problems.
-
-2. Extended standard    16,32,64bytes
-    modifiers(bitmap)       1byte
-    reserved                1byte(not used)
-    keys(array)             1byte*(14,32,62)
-Extended report can send N-keys by using N+2bytes.
-Extended report is expected to be compatible with boot protocol.
-
-3. Bitmap               16,32,64bytes
-    keys(bitmap)            (16,32)bytes
-Bitmap report can send at most 128keys by 16bytes and 256keys by 32bytes.
-Bitmap report can achieve USB NKRO efficiently in terms of report size.
-Bitmap report needs a deliberation for boot protocol implementation.
-Bitmap report descriptor sample:
-        0x05, 0x01,                     // Usage Page (Generic Desktop),
-        0x09, 0x06,                     // Usage (Keyboard),
-        0xA1, 0x01,                     // Collection (Application),
-        // bitmap of modifiers
-        0x75, 0x01,                     //   Report Size (1),
-        0x95, 0x08,                     //   Report Count (8),
-        0x05, 0x07,                     //   Usage Page (Key Codes),
-        0x19, 0xE0,                     //   Usage Minimum (224),
-        0x29, 0xE7,                     //   Usage Maximum (231),
-        0x15, 0x00,                     //   Logical Minimum (0),
-        0x25, 0x01,                     //   Logical Maximum (1),
-        0x81, 0x02,                     //   Input (Data, Variable, Absolute), ;Modifier byte
-        // LED output report
-        0x95, 0x05,                     //   Report Count (5),
-        0x75, 0x01,                     //   Report Size (1),
-        0x05, 0x08,                     //   Usage Page (LEDs),
-        0x19, 0x01,                     //   Usage Minimum (1),
-        0x29, 0x05,                     //   Usage Maximum (5),
-        0x91, 0x02,                     //   Output (Data, Variable, Absolute),
-        0x95, 0x01,                     //   Report Count (1),
-        0x75, 0x03,                     //   Report Size (3),
-        0x91, 0x03,                     //   Output (Constant),
-        // bitmap of keys
-        0x95, (REPORT_BYTES-1)*8,      //   Report Count (),
-        0x75, 0x01,                     //   Report Size (1),
-        0x15, 0x00,                     //   Logical Minimum (0),
-        0x25, 0x01,                     //   Logical Maximum(1),
-        0x05, 0x07,                     //   Usage Page (Key Codes),
-        0x19, 0x00,                     //   Usage Minimum (0),
-        0x29, (REPORT_BYTES-1)*8-1,    //   Usage Maximum (),
-        0x81, 0x02,                     //   Input (Data, Variable, Absolute),
-        0xc0                            // End Collection
-where REPORT_BYTES is a report size in bytes.
-
-
-Considerations
---------------
-Compatibility
-    boot protocol
-    minor/old system
-        Some BIOS doesn't send SET_PROTOCOL request, a keyboard can't switch to boot protocol mode.
-        This may cause a problem on a keyboard which uses other report than Standard.
-Reactivity
-    USB polling time
-    OS/Driver processing time
-
-
-Windows Problem
----------------
-1. Windows accepts only 6keys  in case of Standard report.
-        It should be able to send 6keys plus 8modifiers.
-2. Windows accepts only 10keys in case of 16bytes Extended report.
-        It should be able to send 14keys plus 8modifiers.
-3. Windows accepts only 18keys in case of 32bytes Extended report.
-        It should be able to send 30keys plus 8modifiers.
-If keys are pressed in excess of the number, wrong keys are registered on Windows.
-
-This problem will be reportedly fixed soon.(2010/12/05)
-    http://forums.anandtech.com/showpost.php?p=30873364&postcount=17
-
-
-Tools for testing NKRO
-----------------------
-Browser App:
-http://www.microsoft.com/appliedsciences/content/projects/KeyboardGhostingDemo.aspx
-http://random.xem.us/rollover.html
-
-Windows:
-AquaKeyTest.exe http://geekhack.org/showthread.php?t=6643
-
-Linux:
-xkeycaps
-xev
-showkeys
-
-EOF
diff --git a/doc/build.md b/doc/build.md
deleted file mode 100644 (file)
index 20702e9..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-Build Firmware and Program Controller
-=====================================
-
-
-Download and Install
---------------------
-### 1. Install Tools
-
-1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC with your favorite package manager.
-
-2. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog].
-
-3. **Driver** On Windows you start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. In case of `dfu-programmer` use its driver.
-
-If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader].
-
-
-### 2. Download source
-You can find firmware source at github:
-
-- <https://github.com/tmk/tmk_keyboard>
-
-If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from:
-
-- <https://github.com/tmk/tmk_keyboard/archive/master.zip>
-
-
-Build firmware
---------------
-### 1. Open terminal
-Open terminal window to get access to commands. Use Cygwin(or MingGW) `shell terminal` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up.
-
-### 2. Change directory
-Move to project directory in the firmware source.
-
-    cd tmk_keyboard/{'keyboard' or 'converter'}/<project>
-
-### 3. Make
-Build firmware using GNU `make` command. You'll see `<project>_<variant>.hex` file in that directory unless something unexpected occurs in build process.
-
-
-    make -f Makefile.<variant> clean
-    make -f Makefile.<variant>
-
-
-
-
-Program Controller
-------------------
-Now you have **hex** file to program on current directory. This **hex** is only needed to program your controller, other files are used for development and you may leave and forget them.
-
-### 1. Start bootloader
-How to program controller depends on controller chip and its board design. To program AVR USB chips you'll need to start it up in bootloader mode. Most of boards with the chip have a push button to let bootloader come up. Consult with your controller board manual.
-
-### 2. Program with DFU bootloader
-Stock AVR USB chip including ATmega32U4 has DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. Open source command line tool `dfu-programmer` also supports AVR chips, it runs on Linux, Mac OSX and even Windows.
-
-To program AVR chip with DFU bootloader use `FLIP` or `dfu-programmer`.
-If you have a proper program command in `Makefile` just type this.
-
-`FLIP` has two version of tool, GUI app and command line program. If you want GUI see tutorial below.
-To use command line tool run this command. Note that you need to set PATH variable properly.
-
-    $ make -f Makefile.<variant> flip
-
-Or to program with `dfu-programmer` run:
-
-    $ make -f Makefile.<variant> dfu
-
-#### FLIP GUI tutorial
-1. On menu bar click Device -> Select, then. `ATmega32u4`.
-2. On menu bar click Settings -> Communication -> USB, then click 'Open' button on 'USB Port Connection' dialog.
-At this point you'll see grey-outed widgets on the app get colored and ready.
-
-3. On menu bar click File -> Load HEX File, then select your firmware hex file on File Selector dialog.
-4. On 'Operations Flow' panel click 'Run' button to load the firmware binary to the chip. Note that you should keep 'Erase', 'Blank Check', 'Program' and 'Verify' check boxes selected.
-5. Re-plug USB cord or click 'Start Application' button to restart your controller.
-Done.
-
-See also these instructions if you need.
-
-- <http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP>
-- <http://www.atmel.com/Images/doc7769.pdf>
-
-
-### 3. Program with Teensy Loader
-If you have PJRC Teensy see instruction of `Teensy Loader`.
-
-- <http://www.pjrc.com/teensy/loader.html>
-
-Or use this command if you have command line version of Teensy Loader installed.
-
-    $ make -f Makefile.<variant> teensy
-
-
-### 4. Program with Other programmer
-You may want to use other programmer like `avrdude` with AVRISPmkII, Arduino or USBasp. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in Makefile.
-
-    $ make -f Makefile.<variant> program
-
-
-[cygwin]:       https://www.cygwin.com/
-[mingw]:        http://www.mingw.org/
-[mhv]:          https://infernoembedded.com/products/avr-tools
-[winavr]:       http://winavr.sourceforge.net/
-[crosspack]:    http://www.obdev.at/products/crosspack/index.html
-[flip]:         http://www.atmel.com/tools/FLIP.aspx
-[dfu-prog]:     http://dfu-programmer.sourceforge.net/
-[teensy-loader]:http://www.pjrc.com/teensy/loader.html
-
-
-
-Makefile Options
-----------------
-### 1. MCU and Frequency.
-
-    MCU = atmega32u4       # Teensy 2.0
-    #MCU = at90usb1286      # Teensy++ 2.0
-    F_CPU = 16000000
-
-Set your MCU and its clock in Hz.
-
-    # Boot Section Size in *bytes*
-    #   Teensy halfKay   512
-    #   Atmel DFU loader 4096
-    #   LUFA bootloader  4096
-    OPT_DEFS += -DBOOTLOADER_SIZE=4096
-
-If you are using PJRC Teensy use `512` for `BOOTLOADER_SIZE`, otherwise use `4096` unless you are sure.
-
-### 2. Features
-Optional. Note that ***comment out*** with `#` to disable them.
-
-    BOOTMAGIC_ENABLE = yes      # Virtual DIP switch configuration(+1000)
-    MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
-    EXTRAKEY_ENABLE = yes       # Audio control and System control(+450)
-    CONSOLE_ENABLE = yes        # Console for debug(+400)
-    COMMAND_ENABLE = yes        # Commands for debug and configuration
-    SLEEP_LED_ENABLE = yes      # Breathing sleep LED during USB suspend
-    #NKRO_ENABLE = yes          # USB Nkey Rollover - not yet supported in LUFA
-    #BACKLIGHT_ENABLE = yes     # Enable keyboard backlight functionality
-
-### 3. Programmer
-Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`. Not needed if you use `FLIP`, `dfu-programmer` or `Teensy Loader`.
-
-    # avrdude with AVRISPmkII
-    PROGRAM_CMD = avrdude -p $(MCU) -c avrispmkII -P USB -U flash:w:$(TARGET).hex
-
-    # avrdude with USBaspLoader
-    PROGRAM_CMD = avrdude -p $(MCU) -c usbasp -U flash:w:$(TARGET).hex
-
-    # avrdude with arduino
-    PROGRAM_CMD = avrdude -p $(MCU) -c arduino -P COM1 -b 57600 -U flash:w:$(TARGET).hex
-
-
-
-Config.h Options
-----------------
-### 1. Magic command key combination
-
-    #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)))
-
-### 2. Mechanical Locking Support for CapsLock
-
-    /* Mechanical locking CapsLock support. Use KC_LCAP instead of KC_CAPS in keymap */
-    #define CAPSLOCK_LOCKING_ENABLE
-    /* Locking CapsLock re-synchronize hack */
-    #define CAPSLOCK_LOCKING_RESYNC_ENABLE
-
-### 3. Disable Debug and Print
-
-    /* disable debug print */
-    #define NO_DEBUG
-
-    /* disable print */
-    #define NO_PRINT
-
-### 4. Disable Action Features
-
-    #define NO_ACTION_LAYER
-    #define NO_ACTION_TAPPING
-    #define NO_ACTION_ONESHOT
-    #define NO_ACTION_MACRO
-    #define NO_ACTION_FUNCTION
-
-***TBD***
diff --git a/doc/keycode.txt b/doc/keycode.txt
deleted file mode 100644 (file)
index 44d7e27..0000000
+++ /dev/null
@@ -1,261 +0,0 @@
-Keycode Symbol Table
-====================
-Keycodes are defined in `common/keycode.h`.
-Range of 00-A4 and E0-E7 are identical with HID Usage:
-<http://www.usb.org/developers/devclass_docs/Hut1_11.pdf>
-Virtual keycodes are defined out of above range to support special actions.
-
-
-Keycode Symbol      Short name      Description
---------------------------------------------------------------------------------
-KC_NO                               00 Reserved (no event indicated)
-KC_ROLL_OVER                        01 Keyboard ErrorRollOver
-KC_POST_FAIL                        02 Keyboard POSTFail
-KC_UNDEFINED                        03 Keyboard ErrorUndefined
-KC_A                                04 Keyboard a and A
-KC_B                                05 Keyboard b and B
-KC_C                                06 Keyboard c and C
-KC_D                                07 Keyboard d and D
-KC_E                                08 Keyboard e and E
-KC_F                                09 Keyboard f and F
-KC_G                                0A Keyboard g and G
-KC_H                                0B Keyboard h and H
-KC_I                                0C Keyboard i and I
-KC_J                                0D Keyboard j and J
-KC_K                                0E Keyboard k and K
-KC_L                                0F Keyboard l and L
-KC_M                                10 Keyboard m and M
-KC_N                                11 Keyboard n and N
-KC_O                                12 Keyboard o and O
-KC_P                                13 Keyboard p and P
-KC_Q                                14 Keyboard q and Q
-KC_R                                15 Keyboard r and R
-KC_S                                16 Keyboard s and S
-KC_T                                17 Keyboard t and T
-KC_U                                18 Keyboard u and U
-KC_V                                19 Keyboard v and V
-KC_W                                1A Keyboard w and W
-KC_X                                1B Keyboard x and X
-KC_Y                                1C Keyboard y and Y
-KC_Z                                1D Keyboard z and Z
-KC_1                                1E Keyboard 1 and !
-KC_2                                1F Keyboard 2 and @
-KC_3                                20 Keyboard 3 and #
-KC_4                                21 Keyboard 4 and $
-KC_5                                22 Keyboard 5 and %
-KC_6                                23 Keyboard 6 and ^
-KC_7                                24 Keyboard 7 and &
-KC_8                                25 Keyboard 8 and *
-KC_9                                26 Keyboard 9 and (
-KC_0                                27 Keyboard 0 and )
-KC_ENTER            KC_ENT          28 Keyboard Return (ENTER)
-KC_ESCAPE           KC_ESC          29 Keyboard ESCAPE
-KC_BSPACE           KC_BSPC         2A Keyboard DELETE (Backspace)
-KC_TAB                              2B Keyboard Tab
-KC_SPACE            KC_SPC          2C Keyboard Spacebar
-KC_MINUS            KC_MINS         2D Keyboard - and (underscore)
-KC_EQUAL            KC_EQL          2E Keyboard = and +
-KC_LBRACKET         KC_LBRC         2F Keyboard [ and {
-KC_RBRACKET         KC_RBRC         30 Keyboard ] and }
-KC_BSLASH           KC_BSLS         31 Keyboard \ and |
-KC_NONUS_HASH       KC_NUHS         32 Keyboard Non-US # and ~
-KC_SCOLON           KC_SCLN         33 Keyboard ; and :
-KC_QUOTE            KC_QUOT         34 Keyboard ‘ and “
-KC_GRAVE            KC_GRV          35 Keyboard Grave Accent and Tilde
-KC_COMMA            KC_COMM         36 Keyboard, and <
-KC_DOT                              37 Keyboard . and >
-KC_SLASH            KC_SLSH         38 Keyboard / and ?
-KC_CAPSLOCK         KC_CAPS         39 Keyboard Caps Lock
-KC_F1                               3A Keyboard F1
-KC_F2                               3B Keyboard F2
-KC_F3                               3C Keyboard F3
-KC_F4                               3D Keyboard F4
-KC_F5                               3E Keyboard F5
-KC_F6                               3F Keyboard F6
-KC_F7                               40 Keyboard F7
-KC_F8                               41 Keyboard F8
-KC_F9                               42 Keyboard F9
-KC_F10                              43 Keyboard F10
-KC_F11                              44 Keyboard F11
-KC_F12                              45 Keyboard F12
-KC_PSCREEN          KC_PSCR         46 Keyboard PrintScreen1
-KC_SCKLOCK          KC_SLCK         47 Keyboard Scroll Lock11
-KC_PAUSE            KC_PAUS         48 Keyboard Pause1
-KC_INSERT           KC_INS          49 Keyboard Insert1
-KC_HOME                             4A Keyboard Home1
-KC_PGUP                             4B Keyboard PageUp1
-KC_DELETE           KC_DELETE       4C Keyboard Delete Forward
-KC_END                              4D Keyboard End1
-KC_PGDOWN           KC_PGDN         4E Keyboard PageDown1
-KC_RIGHT            KC_RGHT         4F Keyboard RightArrow1
-KC_LEFT                             50 Keyboard LeftArrow1
-KC_DOWN                             51 Keyboard DownArrow1
-KC_UP                               52 Keyboard UpArrow1
-KC_NUMLOCK          KC_NLCK         53 Keypad Num Lock and Clear11
-KC_KP_SLASH         KC_PSLS         54 Keypad /1
-KC_KP_ASTERISK      KC_PAST         55 Keypad *
-KC_KP_MINUS         KC_PMNS         56 Keypad -
-KC_KP_PLUS          KC_PPLS         57 Keypad +
-KC_KP_ENTER         KC_PENT         58 Keypad ENTER5
-KC_KP_1             KC_P1           59 Keypad 1 and End
-KC_KP_2             KC_P2           5A Keypad 2 and Down Arrow
-KC_KP_3             KC_P3           5B Keypad 3 and PageDn
-KC_KP_4             KC_P4           5C Keypad 4 and Left Arrow
-KC_KP_5             KC_P5           5D Keypad 5
-KC_KP_6             KC_P6           5E Keypad 6 and Right Arrow
-KC_KP_7             KC_P7           5F Keypad 7 and Home
-KC_KP_8             KC_P8           60 Keypad 8 and Up Arrow
-KC_KP_9             KC_P9           61 Keypad 9 and PageUp
-KC_KP_0             KC_P0           62 Keypad 0 and Insert
-KC_KP_DOT           KC_PDOT         63 Keypad . and Delete
-KC_NONUS_BSLASH     KC_NUBS         64 Keyboard Non-US \ and |
-KC_APPLICATION      KC_APP          65 Keyboard Application10
-KC_POWER                            66 Keyboard Power9
-KC_KP_EQUAL         KC_PEQL         67 Keypad =
-KC_F13                              68 Keyboard F13
-KC_F14                              69 Keyboard F14
-KC_F15                              6A Keyboard F15
-KC_F16                              6B Keyboard F16
-KC_F17                              6C Keyboard F17
-KC_F18                              6D Keyboard F18
-KC_F19                              6E Keyboard F19
-KC_F20                              6F Keyboard F20
-KC_F21                              70 Keyboard F21
-KC_F22                              71 Keyboard F22
-KC_F23                              72 Keyboard F23
-KC_F24                              73 Keyboard F24
-KC_EXECUTE                          74 Keyboard Execute
-KC_HELP                             75 Keyboard Help
-KC_MENU                             76 Keyboard Menu
-KC_SELECT                           77 Keyboard Select
-KC_STOP                             78 Keyboard Stop
-KC_AGAIN                            79 Keyboard Again
-KC_UNDO                             7A Keyboard Undo
-KC_CUT                              7B Keyboard Cut
-KC_COPY                             7C Keyboard Copy
-KC_PASTE                            7D Keyboard Paste
-KC_FIND                             7E Keyboard Find
-KC__MUTE                            7F Keyboard Mute
-KC__VOLUP                           80 Keyboard Volume Up
-KC__VOLDOWN                         81 Keyboard Volume Down
-KC_LOCKING_CAPS                     82 Keyboard Locking Caps Lock12
-KC_LOCKING_NUM                      83 Keyboard Locking Num Lock12
-KC_LOCKING_SCROLL                   84 Keyboard Locking Scroll Lock12
-KC_KP_COMMA         KC_PCMM         85 Keypad Comma27
-KC_KP_EQUAL_AS400                   86 Keypad Equal Sign29
-KC_INT1             KC_RO           87 Keyboard International115,28
-KC_INT2             KC_KANA         88 Keyboard International216
-KC_INT3             KC_JYEN         89 Keyboard International317
-KC_INT4             KC_HENK         8A Keyboard International418
-KC_INT5             KC_MHEN         8B Keyboard International519
-KC_INT6                             8C Keyboard International620
-KC_INT7                             8D Keyboard International721
-KC_INT8                             8E Keyboard International822
-KC_INT9                             8F Keyboard International922
-KC_LANG1                            90 Keyboard LANG125
-KC_LANG2                            91 Keyboard LANG226
-KC_LANG3                            92 Keyboard LANG330
-KC_LANG4                            93 Keyboard LANG431
-KC_LANG5                            94 Keyboard LANG532
-KC_LANG6                            95 Keyboard LANG68
-KC_LANG7                            96 Keyboard LANG78
-KC_LANG8                            97 Keyboard LANG88
-KC_LANG9                            98 Keyboard LANG98
-KC_ALT_ERASE                        99 Keyboard Alternate Erase7
-KC_SYSREQ                           9A Keyboard SysReq/Attention1
-KC_CANCEL                           9B Keyboard Cancel
-KC_CLEAR                            9C Keyboard Clear
-KC_PRIOR                            9D Keyboard Prior
-KC_RETURN                           9E Keyboard Return
-KC_SEPARATOR                        9F Keyboard Separator
-KC_OUT                              A0 Keyboard Out
-KC_OPER                             A1 Keyboard Oper
-KC_CLEAR_AGAIN                      A2 Keyboard Clear/Again
-KC_CRSEL                            A3 Keyboard CrSel/Props
-KC_EXSEL                            A4 Keyboard ExSel
-/* Modifiers */
-KC_LCTRL            KC_LCTL         E0 Keyboard LeftControl
-KC_LSHIFT           KC_LSFT         E1 Keyboard LeftShift
-KC_LALT                             E2 Keyboard LeftAlt
-KC_LGUI                             E3 Keyboard Left GUI(Windows/Apple/Meta key)
-KC_RCTRL            KC_RCTL         E4 Keyboard RightControl
-KC_RSHIFT           KC_RSFT         E5 Keyboard RightShift
-KC_RALT                             E6 Keyboard RightAlt
-KC_RGUI                             E7 Keyboard Right GUI(Windows/Apple/Meta key)
-
-/* 
- * Virtual keycodes
- */
-/* System Control */
-KC_SYSTEM_POWER     KC_PWR          System Power Down
-KC_SYSTEM_SLEEP     KC_SLEP         System Sleep
-KC_SYSTEM_WAKE      KC_WAKE         System Wake
-/* Consumer Page */
-KC_AUDIO_MUTE       KC_MUTE
-KC_AUDIO_VOL_UP     KC_VOLU
-KC_AUDIO_VOL_DOWN   KC_VOLD
-KC_MEDIA_NEXT_TRACK KC_MNXT
-KC_MEDIA_PREV_TRACK KC_MPRV
-KC_MEDIA_STOP       KC_MSTP
-KC_MEDIA_PLAY_PAUSE KC_MPLY
-KC_MEDIA_SELECT     KC_MSEL
-KC_MAIL             KC_MAIL
-KC_CALCULATOR       KC_CALC
-KC_MY_COMPUTER      KC_MYCM
-KC_WWW_SEARCH       KC_WSCH
-KC_WWW_HOME         KC_WHOM
-KC_WWW_BACK         KC_WBAK
-KC_WWW_FORWARD      KC_WFWD
-KC_WWW_STOP         KC_WSTP
-KC_WWW_REFRESH      KC_WREF
-KC_WWW_FAVORITES    KC_WFAV
-/* Mousekey */
-KC_MS_UP            KC_MS_U         Mouse Cursor Up
-KC_MS_DOWN          KC_MS_D         Mouse Cursor Down
-KC_MS_LEFT          KC_MS_L         Mouse Cursor Left
-KC_MS_RIGHT         KC_MS_R         Mouse Cursor Right
-KC_MS_BTN1          KC_BTN1         Mouse Button 1
-KC_MS_BTN2          KC_BTN2         Mouse Button 2
-KC_MS_BTN3          KC_BTN3         Mouse Button 3
-KC_MS_BTN4          KC_BTN4         Mouse Button 4
-KC_MS_BTN5          KC_BTN5         Mouse Button 5
-KC_MS_WH_UP         KC_WH_U         Mouse Wheel Up
-KC_MS_WH_DOWN       KC_WH_D         Mouse Wheel Down
-KC_MS_WH_LEFT       KC_WH_L         Mouse Wheel Left
-KC_MS_WH_RIGHT      KC_WH_R         Mouse Wheel Right
-KC_MS_ACCEL0        KC_ACL0         Mouse Acceleration 0
-KC_MS_ACCEL1        KC_ACL1         Mouse Acceleration 1
-KC_MS_ACCEL2        KC_ACL2         Mouse Acceleration 2
-/* Fn key */
-KC_FN0
-KC_FN1
-KC_FN2
-KC_FN3
-KC_FN4
-KC_FN5
-KC_FN6
-KC_FN7
-KC_FN8
-KC_FN9
-KC_FN10
-KC_FN11
-KC_FN12
-KC_FN13
-KC_FN14
-KC_FN15
-KC_FN16
-KC_FN17
-KC_FN18
-KC_FN19
-KC_FN20
-KC_FN21
-KC_FN22
-KC_FN23
-KC_FN24
-KC_FN25
-KC_FN26
-KC_FN27
-KC_FN28
-KC_FN29
-KC_FN30
-KC_FN31
diff --git a/doc/keymap.md b/doc/keymap.md
deleted file mode 100644 (file)
index d4a129b..0000000
+++ /dev/null
@@ -1,593 +0,0 @@
-Keymap framework - how to define your keymap
-============================================
-***NOTE: This is not final version, may be inconsistent with source code and changed occasionally for a while.***
-
-## 0. Keymap and layers
-**Keymap** is comprised of multiple layers of key layout, you can define **32 layers** at most.
-**Layer** is an array of **keycodes** to define **actions** for each physical keys.
-respective layers can be validated simultaneously. Layers are indexed with 0 to 31 and higher layer has precedence.
-
-    Keymap: 32 Layers                   Layer: Keycode matrix
-    -----------------                   ---------------------
-    stack of layers                     array_of_keycode[row][column]
-           ____________ precedence               _______________________
-          /           / | high                  / ESC / F1  / F2  / F3   ....
-      31 /___________// |                      /-----/-----/-----/-----
-      30 /___________// |                     / TAB /  Q  /  W  /  E   ....
-      29 /___________/  |                    /-----/-----/-----/-----
-       :   _:_:_:_:_:__ |               :   /LCtrl/  A  /  S  /  D   ....
-       :  / : : : : : / |               :  /  :     :     :     :
-       2 /___________// |               2 `--------------------------
-       1 /___________// |               1 `--------------------------
-       0 /___________/  V low           0 `--------------------------
-
-
-
-### 0.1 Keymap status
-Keymap has its state in two parameters:
-**`default_layer`** indicates a base keymap layer(0-31) which is always valid and to be referred, **`keymap_stat`** is 16bit variable which has current on/off status of layers on its each bit.
-
-Keymap layer '0' is usually `default_layer` and which is the only valid layer and other layers is initially off after boot up firmware, though, you can configured them in `config.h`.
-To change `default_layer` will be useful when you switch key layout completely, say you want Colmak instead of Qwerty.
-
-    Initial state of Keymap          Change base layout              
-    -----------------------          ------------------              
-
-      31                               31
-      30                               30
-      29                               29
-       :                                :
-       :                                :   ____________
-       2   ____________                 2  /           /
-       1  /           /              ,->1 /___________/
-    ,->0 /___________/               |  0
-    |                                |
-    `--- default_layer = 0           `--- default_layer = 1
-         layer_state   = 0x00000001       layer_state   = 0x00000002
-
-On the other hand, you shall change `layer_state` to overlay base layer with some layers for feature such as navigation keys, function key(F1-F12), media keys or special actions.
-
-    Overlay feature layer
-    ---------------------      bit|status
-           ____________        ---+------
-      31  /           /        31 |   0
-      30 /___________// -----> 30 |   1
-      29 /___________/  -----> 29 |   1
-       :                        : |   :
-       :   ____________         : |   :
-       2  /           /         2 |   0
-    ,->1 /___________/  ----->  1 |   1
-    |  0                        0 |   0
-    |                                 +
-    `--- default_layer = 1            |
-         layer_state   = 0x60000002 <-'
-
-
-
-### 0.2 Layer Precedence and Transparency
-Note that ***higher layer has higher priority on stack of layers***, namely firmware falls down from top layer to bottom to look up keycode. Once it spots keycode other than **`KC_TRNS`**(transparent) on a layer it stops searching and lower layers aren't referred.
-
-You can place `KC_TRNS` on overlay layer changes just part of layout to fall back on lower or base layer.
-Key with `KC_TRANS` doesn't has its own keycode and refers to lower valid layers for keycode, instead.
-See example below.
-
-
-### 0.3 Keymap Example
-Keymap is **`keymaps[]`** C array in fact and you can define layers in it with **`KEYMAP()`** C macro and keycodes. To use complex actions you need to define `Fn` keycode in **`fn_actions[]`** array.
-
-This is a keymap example for [HHKB](http://en.wikipedia.org/wiki/Happy_Hacking_Keyboard) keyboard.
-This example has three layers, 'Qwerty' as base layer, 'Cursor' and  'Mousekey'.
-In this example,
-
- `Fn0` is a **momentary layer switching** key, you can use keys on Cursor layer while holding the key.
-
- `Fn1` is a momentary layer switching key with tapping feature, you can get semicolon **';'** with taping the key and switch layers while holding the key. The word **'tap'** or **'tapping'** mean to press and release a key quickly.
-
- `Fn2` is a **toggle layer switch** key, you can stay switched layer after releasing the key unlike momentary switching.
-
-You can find other keymap definitions in file `keymap.c` located on project directories.
-
-    static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-        /* 0: Qwerty
-         * ,-----------------------------------------------------------.
-         * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  `|
-         * |-----------------------------------------------------------|
-         * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|Backs|
-         * |-----------------------------------------------------------|
-         * |Contro|  A|  S|  D|  F|  G|  H|  J|  K|  L|Fn1|  '|Enter   |
-         * |-----------------------------------------------------------|
-         * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Fn0|
-         * `-----------------------------------------------------------'
-         *       |Gui|Alt  |Space                  |Alt  |Fn2|
-         *       `-------------------------------------------'
-         */
-        KEYMAP(ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS,GRV, \
-               TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSPC, \
-               LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   FN1, QUOT,ENT, \
-               LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,FN0, \
-                    LGUI,LALT,          SPC,                RALT,FN2),
-        /* 1: Cursor(HHKB mode)
-         * ,-----------------------------------------------------------.
-         * |Pwr| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
-         * |-----------------------------------------------------------|
-         * |Caps |   |   |   |   |   |   |   |Psc|Slk|Pus|Up |   |Backs|
-         * |-----------------------------------------------------------|
-         * |Contro|VoD|VoU|Mut|   |   |  *|  /|Hom|PgU|Lef|Rig|Enter   |
-         * |-----------------------------------------------------------|
-         * |Shift   |   |   |   |   |   |  +|  -|End|PgD|Dow|Shift |   |
-         * `-----------------------------------------------------------'
-         *      |Gui |Alt  |Space                  |Alt  |Gui|
-         *      `--------------------------------------------'
-         */ 
-        KEYMAP(PWR, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL, \
-               CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP,  TRNS,BSPC, \
-               LCTL,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, \
-               LSFT,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN,RSFT,TRNS, \
-                    LGUI,LALT,          SPC,                RALT,RGUI),
-        /* 2: Mousekey
-         * ,-----------------------------------------------------------.
-         * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
-         * |-----------------------------------------------------------|
-         * |Tab  |   |   |   |   |   |MwL|MwD|MwU|MwR|   |   |   |Backs|
-         * |-----------------------------------------------------------|
-         * |Contro|   |   |   |   |   |McL|McD|McU|McR|   |   |Return  |
-         * |-----------------------------------------------------------|
-         * |Shift   |   |   |   |   |Mb3|Mb2|Mb1|Mb4|Mb5|   |Shift |   |
-         * `-----------------------------------------------------------'
-         *      |Gui |Alt  |Mb1                    |Alt  |   |
-         *      `--------------------------------------------'
-         * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel 
-         */
-        KEYMAP(ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL, \
-               TAB, TRNS,TRNS,TRNS,TRNS,TRNS,WH_L,WH_D,WH_U,WH_R,TRNS,TRNS,TRNS,BSPC, \
-               LCTL,TRNS,ACL0,ACL1,ACL2,TRNS,MS_L,MS_D,MS_U,MS_R,TRNS,QUOT,ENT, \
-               LSFT,TRNS,TRNS,TRNS,TRNS,BTN3,BTN2,BTN1,BTN4,BTN5,SLSH,RSFT,TRNS, \
-                    LGUI,LALT,          BTN1,               RALT,TRNS),
-    };
-
-    static const uint16_t PROGMEM fn_actions[] = {
-        ACTION_LAYER_MOMENTARY(1),                  // FN0
-        ACTION_LAYER_TAP_KEY(2, KC_SCLN),           // FN1
-        ACTION_LAYER_TOGGLE(2),                     // FN2
-    };
-
-
-
-
-## 1. Keycode
-See [`common/keycode.h`](../common/keycode.h) or keycode table below for the detail. Keycode is internal **8bit code** to indicate action performed on key in keymap. Keycode has `KC_` prefixed symbol respectively. Most of keycodes like `KC_A` have simple action registers key to host on press and unregister on release, while some of other keycodes has some special actions like `Fn` keys, Media control keys, System control keys and Mousekeys.
-
- ***In `KEYMAP()` macro you should omit prefix part `KC_` of keycode to keep keymap compact.*** For example, just use `A` instead you place `KC_A` in `KEYMAP()`. Some keycodes has 4-letter **short name** in addition to descriptive name, you'll prefer short one in `KEYMAP()`.
-
-### 1.0 Other key
-- `KC_NO` for no action
-- `KC_TRNS` for layer transparency (See above)
-
-### 1.1 Normal key
-- `KC_A` to `KC_Z`, `KC_1` to `KC_0` for alpha numeric key
-- `KC_MINS`, `KC_EQL`, `KC_GRV`, `KC_RBRC`, `KC_LBRC`, `KC_COMM`, `KC_DOT`, `KC_BSLS`, `KC_SLSH`, `KC_SCLN`, `KC_QUOT`
-- `KC_ESC`, `KC_TAB`, `KC_SPC`, `KC_BSPC`, `KC_ENT`, `KC_DEL`, `KC_INS`
-- `KC_UP`, `KC_DOWN`, `KC_RGHT`, `KC_LEFT`, `KC_PGUP`, `KC_PGDN`, `KC_HOME`, `KC_END`
-- `KC_CAPS`, `KC_NLCK`, `KC_SLCK`, `KC_PSCR`, `KC_PAUS`, `KC_APP`, `KC_F1` to `KC_F24`
-- `KC_P1` to `KC_P0`, `KC_PDOT`, `KC_PCMM`, `KC_PSLS`, `KC_PAST`, `KC_PMNS`, `KC_PPLS`, `KC_PEQL`, `KC_PENT` for keypad.
-
-### 1.2 Modifier
-There are 8 modifiers which has discrimination between left and right. 
-
-- `KC_LCTL` and `KC_RCTL` for Control
-- `KC_LSFT` and `KC_RSFT` for Shift
-- `KC_LALT` and `KC_RALT` for Alt
-- `KC_LGUI` and `KC_RGUI` for Windows key or Command key in Mac
-
-### 1.3 Mousekey
-- `KC_MS_U`, `KC_MS_D`, `KC_MS_L`, `KC_MS_R` for mouse cursor
-- `KC_WH_U`, `KC_WH_D`, `KC_WH_L`, `KC_WH_R` for mouse wheel
-- `KC_BTN1`, `KC_BTN2`, `KC_BTN3`, `KC_BTN4`, `KC_BTN5` for mouse buttons
-
-### 1.4 System & Media key
-- `KC_PWR`, `KC_SLEP`, `KC_WAKE` for Power, Sleep, Wake
-- `KC_MUTE`, `KC_VOLU`, `KC_VOLD` for audio volume control
-- `KC_MNXT`, `KC_MPRV`, `KC_MSTP`, `KC_MPLY`, `KC_MSEL` for media control
-- `KC_MAIL`, `KC_CALC`, `KC_MYCM` for application launch
-- `KC_WSCH`, `KC_WHOM`, `KC_WBAK`, `KC_WFWD`, `KC_WSTP`, `KC_WREF`, `KC_WFAV` for web browser operation
-
-### 1.5 Fn key
-`KC_FNnn` are keycodes for `Fn` key which not given any actions at the beginning unlike most of keycodes has its own inborn action. To use these keycodes in `KEYMAP()` you need to assign action you want at first. Action of `Fn` key is defined in `fn_actions[]` and its index of the array is identical with number part of `KC_FNnn`. Thus `KC_FN0` keycode indicates the action defined in first element of the array. ***32 `Fn` keys can be defined at most.***
-
-### 1.6 Keycode Table
- See keycode table in [`doc/keycode.txt`](./keycode.txt) for description of keycodes.
-
- In regard to implementation side most of keycodes are identical with [HID usage][HID_usage](pdf) sent to host for real and some virtual keycodes are defined to support special actions.
-[HID_usage]: http://www.usb.org/developers/hidpage/Hut1_12v2.pdf
-
-
-
-## 2. Action
-See [`common/action_code.h`](../common/action_code.h). Action is a **16bit code** and defines function to perform on events of a key like press, release, holding and tapping.
-
-Most of keys just register 8bit scancode to host, but to support other complex features needs 16bit extended action codes internally. However, using 16bit action codes in keymap results in double size in memory compared to using just keycodes. To avoid this waste 8bit keycodes are used in `KEYMAP()` instead of action codes.
-
-***You can just use keycodes of `Normal key`, `Modifier`, `Mousekey` and `System & Media key` in keymap*** to indicate corresponding actions instead of using action codes. While ***to use other special actions you should use keycode of `Fn` key defined in `fn_actions[]`.***
-
-
-### 2.1 Key Action
-This is a simple action that registers scancodes(HID usage in fact) to host on press event of key and unregister on release.
-
-#### Parameters
-+ **mods**: { ` MOD_LCTL`, ` MOD_LSFT`, ` MOD_LALT`, ` MOD_LGUI`,
-              ` MOD_RCTL`, ` MOD_RSFT`, ` MOD_RALT`, ` MOD_RGUI` }
-+ **key**: keycode
-
-
-#### 2.1.1 Normal key and Modifier
-***This action usually won't be used expressly in keymap*** because you can just use keycodes in `KEYMAP()` instead.
-
-You can define these actions on *'A'* key and *'left shift'* modifier with:
-
-    ACTION_KEY(KC_A)
-    ACTION_KEY(KC_LSFT)
-
-#### 2.1.2 Modified key
-This action is comprised of strokes of modifiers and a key. `Macro` action is needed if you want more complex key strokes.
-
-Say you want to assign a key to `Shift + 1` to get character *'!'* or `Alt + Tab` to switch application windows.
-
-    ACTION_MODS_KEY(MOD_LSFT, KC_1)
-    ACTION_MODS_KEY(MOD_LALT, KC_TAB)
-
-Or `Alt,Shift + Tab` can be defined. `ACTION_MODS_KEY(mods, key)` requires **4-bit modifier state** and a **keycode** as arguments. See `keycode.h` for `MOD_BIT()` macro.
-
-    ACTION_MODS_KEY(MOD_LALT | MOD_LSFT, KC_TAB)
-
-#### 2.1.3 Multiple Modifiers
-Registers multiple modifiers with pressing a key. To specify multiple modifiers use `|`.
-
-    ACTION_MODS(MOD_ALT | MOD_LSFT)
-
-#### 2.1.3 Modifier with Tap key([Dual role][dual_role])
-Works as a modifier key while holding, but registers a key on tap(press and release quickly).
-
-
-    ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENT)
-
-
-
-### 2.2 Layer Action
-These actions operate layers of keymap.
-
-#### Parameters
-You can specify a **target layer** of action and **when the action is executed**. Some actions take a **bit value** for bitwise operation.
-
-
-+ **layer**: `0`-`31`
-+ **on**: { `ON_PRESS` | `ON_RELEASE` | `ON_BOTH` }
-+ **bits**: 4-bit value and 1-bit mask bit
-
-
-#### 2.2.1 Default Layer
-Default Layer is a layer which always is valid and referred to when actions is not defined on other overlay layers.
-
-This sets Default Layer to given parameter `layer` and activate it.
-
-    ACTION_DEFAULT_LAYER_SET(layer)
-
-
-#### 2.2.2 Momentary 
-Turns on `layer` momentarily while holding, in other words it activates when key is pressed and deactivate when released.
-
-    ACTION_LAYER_MOMENTARY(layer)
-
-
-#### 2.2.3 Toggle Switch
-Turns on `layer` with first type(press and release) and turns off with next.
-
-    ACTION_LAYER_TOGGLE(layer)
-
-
-#### 2.2.4 Momentary Switch with tap key
-Turns on `layer` momentary while holding, but registers key on tap(press and release quickly).
-
-    ACTION_LAYER_TAP_KEY(layer, key)
-
-
-#### 2.2.5 Momentary Switch with tap toggle
-Turns on `layer` momentary while holding and toggles it with serial taps.
-
-    ACTION_LAYER_TAP_TOGGLE(layer)
-
-
-#### 2.2.6 Invert state of layer
-Inverts current state of `layer`. If the layer is on it becomes off with this action.
-
-    ACTION_LAYER_INVERT(layer, on)
-
-
-#### 2.2.7 Turn On layer
-Turns on layer state.
-
-    ACTION_LAYER_ON(layer, on)
-
-Turns on layer state on press and turns off on release.
-
-    ACTION_LAYER_ON_OFF(layer)
-
-
-#### 2.2.8 Turn Off layer
-Turns off layer state.
-
-    ACTION_LAYER_OFF(layer, on)
-
-Turns off layer state on press and activates on release.
-
-    ACTION_LAYER_OFF_ON(layer)
-
-
-#### 2.2.9 Set layer
-Turn on layer only.
-`layer_state = (1<<layer) [layer: 0-31]`
-
-    ACTION_LAYER_SET(layer, on)
-
-Turns on layer only and clear all layer on release..
-
-    ACTION_LAYER_SET_CLEAR(layer)
-
-
-#### 2.2.10 Bitwise operation
-
-**part** indicates which part of 32bit layer state(0-7). **bits** is 5-bit value. **on** indicates when the action is executed.
-
-    ACTION_LAYER_BIT_AND(part, bits, on)
-    ACTION_LAYER_BIT_OR(part, bits, on)
-    ACTION_LAYER_BIT_XOR(part, bits, on)
-    ACTION_LAYER_BIT_SET(part, bits, on)
-
-These actions works with parameters as following code.
-
-    uint8_t shift = part*4;
-    uint32_t mask = (bits&0x10) ? ~(0xf<<shift) : 0;
-    uint32_t layer_state = layer_state <bitop> ((bits<<shift)|mask);
-
-
-Default Layer also has bitwise operations, they are executed when key is released.
-
-    ACTION_DEFAULT_LAYER_BIT_AND(part, bits)
-    ACTION_DEFAULT_LAYER_BIT_OR(part, bits)
-    ACTION_DEFAULT_LAYER_BIT_XOR(part, bits)
-    ACTION_DEFAULT_LAYER_BIT_SET(part, bits)
-
-
-
-### 2.3 Macro action
-***TBD***
-
-`Macro` action indicates complex key strokes.
-    MACRO( D(LSHIFT), D(D), END )
-    MACRO( U(D), U(LSHIFT), END )
-    MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END )
-
-#### 2.3.1 Macro Commands
-- **I()**   change interval of stroke.
-- **D()**   press key
-- **U()**   release key
-- **T()**   type key(press and release)
-- **W()**   wait
-- **END**   end mark
-
-#### 2.3.2 Examples
-
-***TODO: sample implementation***
-See `keyboard/hhkb/keymap.c` for sample.
-
-
-
-### 2.4 Function action
-***TBD***
-
-There are two type of action, normal `Function` and tappable `Function`.
-These actions call user defined function with `id`, `opt`, and key event information as arguments.
-
-#### 2.4.1 Function
-To define normal `Function` action in keymap use this.
-
-    ACTION_FUNCTION(id, opt)
-
-#### 2.4.2 Function with tap
-To define tappable `Function` action in keymap use this.
-
-    ACTION_FUNCTION_TAP(id, opt)
-
-#### 2.4.3 Implement user function
-`Function` actions can be defined freely with C by user in callback function:
-
-    void keymap_call_function(keyrecord_t *event, uint8_t id, uint8_t opt)
-
-This C function is called every time key is operated, argument `id` selects action to be performed and `opt` can be used for option. Function `id` can be 0-255 and `opt` can be 0-15.
-
- `keyrecord_t` is comprised of key event and tap count. `keyevent_t` indicates which and when key is pressed or released. From `tap_count` you can know tap state, 0 means no tap. These information will be used in user function to decide how action of key is performed.
-
-    typedef struct {
-        keyevent_t  event;
-        uint8_t     tap_count;
-    } keyrecord_t;
-
-    typedef struct {
-        key_t    key;
-        bool     pressed;
-        uint16_t time;
-    } keyevent_t;
-
-    typedef struct {
-        uint8_t col;
-        uint8_t row;
-    } key_t;
-
-***TODO: sample implementation***
-See `keyboard/hhkb/keymap.c` for sample.
-
-
-
-### 2.5 Backlight Action
-These actions control the backlight.
-
-#### 2.5.1 Change backlight level
-Increase backlight level.
-
-    ACTION_BACKLIGHT_INCREASE()
-
-Decrease backlight level.
-
-    ACTION_BACKLIGHT_DECREASE()
-
-Step through backlight levels.
-
-    ACTION_BACKLIGHT_STEP()
-
-Turn a specific backlight level on or off.
-
-    ACTION_BACKLIGHT_LEVEL(1)
-
-#### 2.5.2 Turn on / off backlight
-Turn the backlight on and off without changing level.
-
-    ACTION_BACKLIGHT_TOGGLE()
-
-
-
-## 3. Layer switching Example
-There are some ways to switch layer with 'Layer' actions.
-
-### 3.1 Momentary switching
-Momentary switching changes layer only while holding Fn key.
-
-This action makes 'Layer 1' active(valid) on key press event and inactive on release event. Namely you can overlay a layer on lower layers or default layer temporarily with this action.
-
-    ACTION_LAYER_MOMENTARY(1)
-
-
-Note that after switching on press the actions on destination layer(Layer 1) are performed.
-***Thus you shall need to place an action to go back on destination layer***, or you will be stuck in destination layer without way to get back. Usually you need to place same action or 'KC_TRNS` on destination layer to get back.
-
-
-### 3.2 Toggle switching
-Toggle switching performed after releasing a key. With this action you can keep staying on the destination layer until you type the key again to return.
-
-This performs toggle switching action of 'Layer 2'.
-
-    ACTION_LAYER_TOGGLE(2)
-
-
-
-### 3.3 Momentary switching with Tap key
-These actions switch a layer only while holding a key but register the key on tap. **Tap** means to press and release a key quickly.
-
-    ACTION_LAYER_TAP_KEY(2, KC_SCLN)
-
-With this you can place a layer switching action on normal key like ';' without losing its original key register function. This action allows you to have layer switching action without necessity of a dedicated key. It means you can have it even on home row of keyboard.
-
-
-
-### 3.4 Momentary switching with Tap Toggle
-This switches layer only while holding a key but toggle layer with several taps. **Tap** means to press and release key quickly.
-
-    ACTION_LAYER_TAP_TOGGLE(1)
-
-Number of taps can be configured with `TAPPING_TOGGLE` in `config.h`, `5` by default.
-
-
-
-### 3.5 Momentary switching with Modifiers
-This registers modifier key(s) simultaneously with layer switching.
-
-    ACTION_LAYER_MODS(2, MOD_LSFT | MOD_LALT)
-
-
-
-## 4. Tapping
-Tapping is to press and release a key quickly. Tapping speed is determined with setting of `TAPPING_TERM`, which can be defined in `config.h`, 200ms by default.
-
-### 4.1 Tap Key
-This is a feature to assign normal key action and modifier including layer switching to just same one physical key. This is a kind of [Dual role key][dual_role]. It works as modifier when holding the key but registers normal key when tapping.
-
-Modifier with tap key:
-
-    ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRV)
-
-Layer switching with tap key:
-
-    ACTION_LAYER_TAP_KEY(2, KC_SCLN)
-
-[dual_role]: http://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
-
-
-### 4.2 Tap Toggle
-This is a feature to assign both toggle layer and momentary switch layer action to just same one physical key. It works as momentary layer switch when holding a key but toggle switch with several taps.
-
-    ACTION_LAYER_TAP_TOGGLE(1)
-
-
-### 4.3 Oneshot Modifier
-This runs onetime effects which modify only on just one following key. It works as normal modifier key when holding down while oneshot modifier when tapping.
-
-    ACTION_MODS_ONESHOT(MOD_LSFT)
-
-Say you want to type 'The', you have to push and hold Shift key before type 't' then release it before type 'h' and 'e', otherwise you'll get 'THe' or 'the' unintentionally. With Oneshot Modifier you can tap Shift then type 't', 'h' and 'e' normally, you don't need to holding Shift key properly here. This mean you can release Shift before 't' is pressed down.
-
-Oneshot effect is cancel unless following key is pressed down within `ONESHOT_TIMEOUT` of `config.h`. No timeout when it is `0` or not defined.
-
-
-### 4.4 Tap Toggle Mods
-Similar to layer tap toggle, this works as a momentary modifier when holding, but toggles on with several taps. A single tap will 'unstick' the modifier again.
-
-    ACTION_MODS_TAP_TOGGLE(MOD_LSFT)
-
-
-
-
-## 5. Legacy Keymap
-This was used in prior version and still works due to legacy support code in `common/keymap.c`. Legacy keymap doesn't support many of features that new keymap offers. ***It is not recommended to use Legacy Keymap for new project.***
-
-To enable Legacy Keymap support define this macro in `config.h`.
-
-    #define USE_LEGACY_KEYMAP
-
-Legacy Keymap uses two arrays `fn_layer[]` and `fn_keycode[]` to define Fn key. The index of arrays corresponds with postfix number of `Fn` key. Array `fn_layer[]` indicates destination layer to switch and `fn_keycode[]` has keycodes to send when tapping `Fn` key.
-
-In following setting example, `Fn0`, `Fn1` and `Fn2` switch layer to 1, 2 and 2 respectively. `Fn2` registers `Space` key when tapping while `Fn0` and `Fn1` doesn't send any key.
-
-    static const uint8_t PROGMEM fn_layer[] = {
-        1,              // Fn0
-        2,              // Fn1
-        2,              // Fn2
-    };
-
-    static const uint8_t PROGMEM fn_keycode[] = {
-        KC_NO,          // Fn0
-        KC_NO,          // Fn1
-        KC_SPC,         // Fn2
-    };
-
-
-## 6. Terminology
-***TBD***
-### keymap
-is comprised of multiple layers.
-### layer
-is matrix of keycodes.
-### key
-is physical button on keyboard or logical switch on software.
-### keycode
-is codes used on firmware.
-### action
-is a function assigned on a key.
-### layer transparency
-Using transparent keycode one layer can refer key definition on other lower layer.
-### layer precedence
-Top layer has higher precedence than lower layers.
-### tapping
-is to press and release a key quickly.
-### Fn key
-is key which executes a special action like layer switching, mouse key, macro or etc.
-### dual role key
-<http://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys>
diff --git a/doc/other_projects.md b/doc/other_projects.md
deleted file mode 100644 (file)
index bf980b0..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-Other Keyboard Firmware Projects
-================================
-## PJRC USB Keyboard/Mouse Example[USB][PJRC][Teensy][AVR]
-- <http://www.pjrc.com/teensy/usb_keyboard.html>
-- <http://www.pjrc.com/teensy/usb_mouse.html>
-
-## kbupgrade[USB][V-USB][AVR]
-- <http://github.com/rhomann/kbupgrade>
-- <http://geekhack.org/showwiki.php?title=Island:8406>
-
-## c64key[USB][V-USB][AVR]
-- <http://symlink.dk/projects/c64key/>
-
-## rump[USB][V-USB][AVR]
-- <http://mg8.org/rump/>
-- <http://github.com/clee/rump>
-
-## dulcimer[USB][V-USB][AVR]
-- <http://www.schatenseite.de/dulcimer.html>
-
-## humblehacker-keyboard[USB][LUFA][AVR][Ergo]
-- <http://github.com/humblehacker>
-- <http://www.humblehacker.com/keyboard/>
-- <http://geekhack.org/showwiki.php?title=Island:6292>
-
-## ps2avr[PS/2][AVR]
-- <http://sourceforge.net/projects/ps2avr/>
-
-## ErgoDox[Ergo][Split][USB][AVR]
-- <http://geekhack.org/index.php?topic=22780.0>
-- <https://github.com/benblazak/ergodox-firmware>
-- <https://github.com/cub-uanic/tmk_keyboard>
-
-## Suka's keyboard collection[Ergo][Split][3DPrinting][USB][AVR]
-- <http://deskthority.net/workshop-f7/my-diy-keyboard-collection-or-how-i-became-a-kb-geek-t2534.html>
-- <https://github.com/frobiac/adnw>
-
-## bpiphany's AVR-Keyboard[PJRC][AVR][USB]
-- <https://github.com/BathroomEpiphanies/AVR-Keyboard>
-- <http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions>
-- <http://deskthority.net/wiki/Phantom>
-
-## USB-USB keyboard remapper[converter][USB-USB][AVR][Arduino]
-- <http://forum.colemak.com/viewtopic.php?pid=10837>
-- <https://github.com/darkytoothpaste/keymapper>
-
-## USB-USB converter threads[converter][USB-USB]
-- <http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html>
-- <http://geekhack.org/index.php?topic=19458.0>
-
-## kbdbabel.org[converter][vintage][protocol][8051]
-Great resource of vintage keyboard protocol information and code
-
-- <http://www.kbdbabel.org/>
-
-## Haata's kiibohd Controller[converter][vintage][protocol][AVR][PJRC][Cortex]
-A lots of vintage keyboard protocol supports
-
-- <http://gitorious.org/kiibohd-controller>
-
-## Kinesis ergonomic keyboard firmware replacement[V-USB][LUFA][Ergo]
-- <https://github.com/chrisandreae/kinesis-firmware>
diff --git a/keyboard/alps64/Makefile.keymap_editor b/keyboard/alps64/Makefile.keymap_editor
new file mode 100644 (file)
index 0000000..d7ad0cc
--- /dev/null
@@ -0,0 +1,4 @@
+# build firmware for keymap editor
+#
+KEYMAP_SECTION_ENABLE = yes    # fixed address keymap for keymap editor
+include Makefile
index a54899196aafbe5d83cd7937d6b491d1267bbf46..d6ff119fafd28bacc94c3c8e107eded69718d697 100644 (file)
@@ -1,7 +1,23 @@
 #include "keymap_common.h"
 
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* 0: qwerty */
+#ifdef KEYMAP_SECTION_ENABLE
+const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
+#else
+const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
+#endif
+    /* 0: qwerty
+     * ,-----------------------------------------------------------.
+     * |`  |  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  #|Bsp|
+     * |-----------------------------------------------------------|
+     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \  |
+     * |-----------------------------------------------------------|
+     * |Caps  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Enter   |
+     * |-----------------------------------------------------------|
+     * |Shft|  \|  Z|  X|  C|  V|  B|  N|  M|  ,|  .|  /|Shift |Esc|
+     * |-----------------------------------------------------------'
+     * |Ctrl|Gui |Alt |         Space         |App |Alt |Gui |Ctrl |
+     * `-----------------------------------------------------------'
+     */
     KEYMAP( \
         GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NUHS, BSPC, \
         TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS, \
@@ -9,4 +25,41 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
         LSFT,NUBS,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RSFT,ESC, \
         LCTL,LGUI,LALT,          SPC,                     APP, RALT,RGUI,RCTL),
 };
-const uint16_t PROGMEM fn_actions[] = {};
+#ifdef KEYMAP_SECTION_ENABLE
+const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
+    [0]  = ACTION_LAYER_MOMENTARY(1),
+    [1]  = ACTION_LAYER_MOMENTARY(2),
+    [2]  = ACTION_LAYER_MOMENTARY(3),
+    [3]  = ACTION_LAYER_MOMENTARY(4),
+    [4]  = ACTION_LAYER_MOMENTARY(5),
+    [5]  = ACTION_LAYER_MOMENTARY(6),
+    [6]  = ACTION_LAYER_MOMENTARY(7),
+    [7]  = ACTION_LAYER_TOGGLE(1),
+    [8]  = ACTION_LAYER_TOGGLE(2),
+    [9]  = ACTION_LAYER_TOGGLE(3),
+    [10] = ACTION_LAYER_TAP_TOGGLE(1),
+    [11] = ACTION_LAYER_TAP_TOGGLE(2),
+    [12] = ACTION_LAYER_TAP_TOGGLE(3),
+    [13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH),
+    [14] = ACTION_LAYER_TAP_KEY(2, KC_TAB),
+    [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER),
+    [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE),
+    [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON),
+    [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE),
+    [19] = ACTION_LAYER_TAP_KEY(7, KC_SLASH),
+    [20] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_SPACE),
+    [21] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_SPACE),
+    [22] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_QUOTE),
+    [23] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_ENTER),
+    [24] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ESC),
+    [25] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_BSPACE),
+    [26] = ACTION_MODS_ONESHOT(MOD_LCTL),
+    [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),
+    [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE),
+    [29] = ACTION_MODS_ONESHOT(MOD_LSFT),
+    [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE),
+    [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH),
+};
+#else
+const uint16_t fn_actions[] PROGMEM = {};
+#endif
index aa991e0aec0b10b10b54090ac726767fc468a1b3..5638d7f69d9ef63f72490cd7a5485041ce23e5ce 100644 (file)
@@ -157,7 +157,7 @@ static void unselect_rows(void)
     DDRD  &= ~0b01111111;
     PORTD &= ~0b01111111;
     DDRC  &= ~0b00000100;
-    PORTD &= ~0b00000100;
+    PORTC &= ~0b00000100;
 }
 
 static void select_row(uint8_t row)
diff --git a/keyboard/hhkb/Makefile.keymap_editor b/keyboard/hhkb/Makefile.keymap_editor
new file mode 100644 (file)
index 0000000..77a13e6
--- /dev/null
@@ -0,0 +1,5 @@
+# build firmware for keymap editor
+#
+KEYMAP_SECTION_ENABLE = yes    # fixed address keymap for keymap editor
+include Makefile
+
index cbb2b744c9652db6bb22f571b69c9ef7fa010fbe..8cb44352619ce26a7839483b19c964782ae785ee 100644 (file)
@@ -108,12 +108,12 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
 # Build Options
 #   comment out to disable the options.
 #
-#BOOTMAGIC_ENABLE = yes                # Virtual DIP switch configuration
+BOOTMAGIC_ENABLE = yes         # Virtual DIP switch configuration
 MOUSEKEY_ENABLE = yes          # Mouse keys
 EXTRAKEY_ENABLE = yes          # Audio control and System control
 CONSOLE_ENABLE = yes           # Console for debug
 COMMAND_ENABLE = yes           # Commands for debug and configuration
-#NKRO_ENABLE = yes             # USB Nkey Rollover
+NKRO_ENABLE = yes              # USB Nkey Rollover
 #KEYMAP_SECTION_ENABLE = yes   # fixed address keymap for keymap editor
 #HHKB_JP = yes                 # HHKB JP support
 
diff --git a/keyboard/hhkb/Makefile.rn42.keymap_editor b/keyboard/hhkb/Makefile.rn42.keymap_editor
new file mode 100644 (file)
index 0000000..6e55f69
--- /dev/null
@@ -0,0 +1,5 @@
+# build firmware for keymap editor
+#
+KEYMAP_SECTION_ENABLE = yes    # fixed address keymap for keymap editor
+include Makefile.rn42
+
index 21e73f1c5319fe76fc299564cb6d36925a824265..df75fba5a2f317e15e1ca6d51e72d904814b6175 100644 (file)
@@ -48,7 +48,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define ONESHOT_TIMEOUT 300
 
 /* Boot Magic salt key: Space */
-#define BOOTMAGIC_KEY_SALT      KC_FN6
+#define BOOTMAGIC_KEY_SALT      KC_SPACE
 
 /* power control of key switch board */
 #define HHKB_POWER_SAVING
diff --git a/keyboard/hhkb/doc/HHKB_keycodes.txt b/keyboard/hhkb/doc/HHKB_keycodes.txt
new file mode 100644 (file)
index 0000000..9ec8590
--- /dev/null
@@ -0,0 +1,69 @@
+HHKB keycodes
+=============
+2015/10/03
+Looked into unclear keycodes(usages) of Fn-chording-key on HHKB.
+Followings are usages of Keyboard/Keypad Page(0x07) that HHKB spits out when Fn key is down.
+
+## HHK mode(Off-Off)
+    Key         Usage
+    ------------------------
+    ⌘ / ◇       0x78    Stop
+
+## Lite Ext. mode(On-Off)
+
+
+## Mac mode(Off-On)
+    Key         Usage
+    ------------------------
+    Esc         0x66    Power
+    A           0x81    Volume Down
+    S           0x80    Volume Up
+    D           0x7F    Mute
+    F           0x6F    F20
+    Delete      0x53    Num Lock and Clear
+
+
+## Secret mode(On-On)
+    Key         Usage
+    ------------------------
+    Esc         0x66    Power
+    Q           0x78    Stop
+    W           0x7E    Find
+    E           0x74    Execute
+    R           0x77    Select
+    T           0x76    Menu
+    Y           0x75    Help
+    Z           0x7A    Undo
+    X           0x7B    Cut
+    C           0x7C    Copy
+    V           0x7D    Paste
+    B           0x79    Again
+
+
+## Matrix Key-Mode
+
+
+                Mode
+                -------------------------------
+    Key         HHK     Lite    Mac     Secret  Desc
+    ---------------------------------------------------------------------------------------
+    ⌘ / ◇       0x78    -       -       -       Stop
+    Esc         -       -       0x66    0x66    Power
+    A           -       -       0x81    -       Volume Down
+    S           -       -       0x80    -       Volume Up
+    D           -       -       0x7F    -       Mute
+    F           -       -       0x6F    -       F20
+    Delete      0x2A    0x2A    0x53    0x2A    Num Lock and Clear(0x53)/Backspace(0x2A)
+    Q           -       -       -       0x78    Stop
+    W           -       -       -       0x7E    Find
+    E           -       -       -       0x74    Execute
+    R           -       -       -       0x77    Select
+    T           -       -       -       0x76    Menu
+    Y           -       -       -       0x75    Help
+    Z           -       -       -       0x7A    Undo
+    X           -       -       -       0x7B    Cut
+    C           -       -       -       0x7C    Copy
+    V           -       -       -       0x7D    Paste
+    B           -       -       -       0x79    Again
+
+EOF
index 86ad0f5eee0370f586e96d8d4c6a27dc75166783..7807f43669797a6c327011d29de96b50426e5b34 100644 (file)
@@ -68,9 +68,9 @@ const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
     [10] = ACTION_LAYER_TAP_TOGGLE(1),
     [11] = ACTION_LAYER_TAP_TOGGLE(2),
     [12] = ACTION_LAYER_TAP_TOGGLE(3),
-    [13] = ACTION_LAYER_TAP_KEY(1, KC_A),
-    [14] = ACTION_LAYER_TAP_KEY(2, KC_F),
-    [15] = ACTION_LAYER_TAP_KEY(3, KC_J),
+    [13] = ACTION_LAYER_TAP_KEY(1, KC_BSLASH),
+    [14] = ACTION_LAYER_TAP_KEY(2, KC_TAB),
+    [15] = ACTION_LAYER_TAP_KEY(3, KC_ENTER),
     [16] = ACTION_LAYER_TAP_KEY(4, KC_SPACE),
     [17] = ACTION_LAYER_TAP_KEY(5, KC_SCOLON),
     [18] = ACTION_LAYER_TAP_KEY(6, KC_QUOTE),
@@ -85,8 +85,8 @@ const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
     [27] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_ESC),
     [28] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_BSPACE),
     [29] = ACTION_MODS_ONESHOT(MOD_LSFT),
-    [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ESC),
-    [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSPACE),
+    [30] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_GRAVE),
+    [31] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_BSLASH),
 };
 #else
 const uint16_t fn_actions[] PROGMEM = {
index 0363c2f43322f1a3e921baad1c0a52582a991ce1..a86c49c424c2dd4741a7afca5e03f0810ad817ed 100644 (file)
@@ -2,6 +2,13 @@ Memo of deveopment
 ==================
 just memo, NOT WORTH READING
 
+2015/11/24
+JP Bluetooth:
+    RN-42 cannot send Japanese keys like; henkan, mu-henkan and kana, JPY and RO.
+    It seems HID usage more than 0x65 cannot be send with the module.
+        http://shiki.esrille.com/2014/07/bluetoothnisse.html
+
+
 Bug:
 - Factory Reset PIO4 doesn't work
     - the reason is unclear - 12/08 NOT LOOK INTO ANY MORE
index 756285d7bb265a9342d9f2695070e3dd34ea6356..6fabf99ff3266ba03093967b549a52fe56f90ae8 100644 (file)
@@ -184,20 +184,20 @@ static void send_system(uint16_t data)
 static uint16_t usage2bits(uint16_t usage)
 {
     switch (usage) {
-        case AC_HOME:               return 0x01;
-        case AL_EMAIL:              return 0x02;
-        case AC_SEARCH:             return 0x04;
+        case AC_HOME:                 return 0x01;
+        case AL_EMAIL:                return 0x02;
+        case AC_SEARCH:               return 0x04;
         //case AL_KBD_LAYOUT:         return 0x08;  // Apple virtual keybaord toggle
-        case AUDIO_VOL_UP:          return 0x10;
-        case AUDIO_VOL_DOWN:        return 0x20;
-        case AUDIO_MUTE:            return 0x40;
-        case TRANSPORT_PLAY_PAUSE:  return 0x80;
-        case TRANSPORT_NEXT_TRACK:  return 0x100;
-        case TRANSPORT_PREV_TRACK:  return 0x200;
-        case TRANSPORT_STOP:        return 0x400;
-        case TRANSPORT_STOP_EJECT:  return 0x800;
-        //case return 0x1000;   // Fast forward
-        //case return 0x2000;   // Rewind
+        case AUDIO_VOL_UP:            return 0x10;
+        case AUDIO_VOL_DOWN:          return 0x20;
+        case AUDIO_MUTE:              return 0x40;
+        case TRANSPORT_PLAY_PAUSE:    return 0x80;
+        case TRANSPORT_NEXT_TRACK:    return 0x100;
+        case TRANSPORT_PREV_TRACK:    return 0x200;
+        case TRANSPORT_STOP:          return 0x400;
+        case TRANSPORT_STOP_EJECT:    return 0x800;
+        case TRANSPORT_FAST_FORWARD:  return 0x1000;
+        case TRANSPORT_REWIND:        return 0x2000;
         //case return 0x4000;   // Stop/eject
         //case return 0x8000;   // Internet browser
     };
diff --git a/keyboard/onekey/Makefile.vusb b/keyboard/onekey/Makefile.vusb
new file mode 100644 (file)
index 0000000..fb1fbdf
--- /dev/null
@@ -0,0 +1,88 @@
+# Target file name (without extension).
+TARGET = onekey_vusb
+
+# Directory common source filess exist
+TMK_DIR = ../../tmk_core
+
+# Directory keyboard dependent files exist
+TARGET_DIR = .
+
+# keyboard dependent files
+SRC =  keymap.c \
+       matrix.c \
+       led.c
+
+CONFIG_H = config.h
+
+
+# MCU name, you MUST set this to match the board you are using
+# type "make clean" after changing this, so all files will be rebuilt
+#MCU = atmega168p
+MCU = atmega328p
+
+
+# Processor frequency.
+#   Normally the first thing your program should do is set the clock prescaler,
+#   so your program will run at the correct speed.  You should also set this
+#   variable to same clock speed.  The _delay_ms() macro uses this, and many
+#   examples use this variable to calculate timings.  Do not add a "UL" here.
+F_CPU = 12000000
+
+
+# Build Options
+#   comment out to disable the options.
+#
+#MOUSEKEY_ENABLE = yes # Mouse keys
+#EXTRAKEY_ENABLE = yes # Audio control and System control
+#NKRO_ENABLE = yes     # USB Nkey Rollover
+
+
+
+#---------------- Programming Options --------------------------
+AVRDUDE = avrdude
+# Type: avrdude -c ? to get a full listing.
+AVRDUDE_PROGRAMMER = usbasp
+AVRDUDE_PORT =
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level.  Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude> 
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+#AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS = -p $(MCU) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS += $(AVRDUDE_NO_VERIFY)
+AVRDUDE_FLAGS += $(AVRDUDE_VERBOSE)
+AVRDUDE_FLAGS += $(AVRDUDE_ERASE_COUNTER)
+
+PROGRAM_CMD = $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
+
+
+# Boot Section Size in bytes
+#   Teensy halfKay   512
+#   Atmel DFU loader 4096
+#   LUFA bootloader  4096
+#   USBasp           2048
+OPT_DEFS += -DBOOTLOADER_SIZE=2048
+
+
+# Search Path
+VPATH += $(TARGET_DIR)
+VPATH += $(TMK_DIR)
+
+
+include $(TMK_DIR)/protocol.mk
+include $(TMK_DIR)/common.mk
+include $(TMK_DIR)/protocol/vusb.mk
+include $(TMK_DIR)/rules.mk
diff --git a/keyboard/onekey/usbconfig.h b/keyboard/onekey/usbconfig.h
new file mode 100644 (file)
index 0000000..d0ca4c7
--- /dev/null
@@ -0,0 +1,377 @@
+/* Name: usbconfig.h
+ * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
+ * Author: Christian Starkjohann
+ * Creation Date: 2005-04-01
+ * Tabsize: 4
+ * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
+ * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
+ * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
+ */
+
+#ifndef __usbconfig_h_included__
+#define __usbconfig_h_included__
+
+
+/*
+General Description:
+This file is an example configuration (with inline documentation) for the USB
+driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
+also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
+wire the lines to any other port, as long as D+ is also wired to INT0 (or any
+other hardware interrupt, as long as it is the highest level interrupt, see
+section at the end of this file).
+*/
+
+/* ---------------------------- Hardware Config ---------------------------- */
+
+#define USB_CFG_IOPORTNAME      D
+/* This is the port where the USB bus is connected. When you configure it to
+ * "B", the registers PORTB, PINB and DDRB will be used.
+ */
+#define USB_CFG_DMINUS_BIT      3
+/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
+ * This may be any bit in the port.
+ */
+#define USB_CFG_DPLUS_BIT       2
+/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
+ * This may be any bit in the port. Please note that D+ must also be connected
+ * to interrupt pin INT0! [You can also use other interrupts, see section
+ * "Optional MCU Description" below, or you can connect D- to the interrupt, as
+ * it is required if you use the USB_COUNT_SOF feature. If you use D- for the
+ * interrupt, the USB interrupt will also be triggered at Start-Of-Frame
+ * markers every millisecond.]
+ */
+#define USB_CFG_CLOCK_KHZ       (F_CPU/1000)
+/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
+ * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
+ * require no crystal, they tolerate +/- 1% deviation from the nominal
+ * frequency. All other rates require a precision of 2000 ppm and thus a
+ * crystal!
+ * Since F_CPU should be defined to your actual clock rate anyway, you should
+ * not need to modify this setting.
+ */
+#define USB_CFG_CHECK_CRC       0
+/* Define this to 1 if you want that the driver checks integrity of incoming
+ * data packets (CRC checks). CRC checks cost quite a bit of code size and are
+ * currently only available for 18 MHz crystal clock. You must choose
+ * USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
+ */
+
+/* ----------------------- Optional Hardware Config ------------------------ */
+
+/* #define USB_CFG_PULLUP_IOPORTNAME   D */
+/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
+ * V+, you can connect and disconnect the device from firmware by calling
+ * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
+ * This constant defines the port on which the pullup resistor is connected.
+ */
+/* #define USB_CFG_PULLUP_BIT          4 */
+/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
+ * above) where the 1.5k pullup resistor is connected. See description
+ * above for details.
+ */
+
+/* --------------------------- Functional Range ---------------------------- */
+
+#define USB_CFG_HAVE_INTRIN_ENDPOINT    1
+/* Define this to 1 if you want to compile a version with two endpoints: The
+ * default control endpoint 0 and an interrupt-in endpoint (any other endpoint
+ * number).
+ */
+#define USB_CFG_HAVE_INTRIN_ENDPOINT3   1
+/* Define this to 1 if you want to compile a version with three endpoints: The
+ * default control endpoint 0, an interrupt-in endpoint 3 (or the number
+ * configured below) and a catch-all default interrupt-in endpoint as above.
+ * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
+ */
+#define USB_CFG_EP3_NUMBER              3
+/* If the so-called endpoint 3 is used, it can now be configured to any other
+ * endpoint number (except 0) with this macro. Default if undefined is 3.
+ */
+/* #define USB_INITIAL_DATATOKEN           USBPID_DATA1 */
+/* The above macro defines the startup condition for data toggling on the
+ * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
+ * Since the token is toggled BEFORE sending any data, the first packet is
+ * sent with the oposite value of this configuration!
+ */
+#define USB_CFG_IMPLEMENT_HALT          0
+/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
+ * for endpoint 1 (interrupt endpoint). Although you may not need this feature,
+ * it is required by the standard. We have made it a config option because it
+ * bloats the code considerably.
+ */
+#define USB_CFG_SUPPRESS_INTR_CODE      0
+/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
+ * want to send any data over them. If this macro is defined to 1, functions
+ * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
+ * you need the interrupt-in endpoints in order to comply to an interface
+ * (e.g. HID), but never want to send any data. This option saves a couple
+ * of bytes in flash memory and the transmit buffers in RAM.
+ */
+#define USB_CFG_INTR_POLL_INTERVAL      10
+/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
+ * interval. The value is in milliseconds and must not be less than 10 ms for
+ * low speed devices.
+ */
+#define USB_CFG_IS_SELF_POWERED         0
+/* Define this to 1 if the device has its own power supply. Set it to 0 if the
+ * device is powered from the USB bus.
+ */
+#define USB_CFG_MAX_BUS_POWER           100
+/* Set this variable to the maximum USB bus power consumption of your device.
+ * The value is in milliamperes. [It will be divided by two since USB
+ * communicates power requirements in units of 2 mA.]
+ */
+#define USB_CFG_IMPLEMENT_FN_WRITE      1
+/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
+ * transfers. Set it to 0 if you don't need it and want to save a couple of
+ * bytes.
+ */
+#define USB_CFG_IMPLEMENT_FN_READ       0
+/* Set this to 1 if you need to send control replies which are generated
+ * "on the fly" when usbFunctionRead() is called. If you only want to send
+ * data from a static buffer, set it to 0 and return the data from
+ * usbFunctionSetup(). This saves a couple of bytes.
+ */
+#define USB_CFG_IMPLEMENT_FN_WRITEOUT   0
+/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
+ * You must implement the function usbFunctionWriteOut() which receives all
+ * interrupt/bulk data sent to any endpoint other than 0. The endpoint number
+ * can be found in 'usbRxToken'.
+ */
+#define USB_CFG_HAVE_FLOWCONTROL        0
+/* Define this to 1 if you want flowcontrol over USB data. See the definition
+ * of the macros usbDisableAllRequests() and usbEnableAllRequests() in
+ * usbdrv.h.
+ */
+#define USB_CFG_DRIVER_FLASH_PAGE       0
+/* If the device has more than 64 kBytes of flash, define this to the 64 k page
+ * where the driver's constants (descriptors) are located. Or in other words:
+ * Define this to 1 for boot loaders on the ATMega128.
+ */
+#define USB_CFG_LONG_TRANSFERS          0
+/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
+ * in a single control-in or control-out transfer. Note that the capability
+ * for long transfers increases the driver size.
+ */
+/* #define USB_RX_USER_HOOK(data, len)     if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
+/* This macro is a hook if you want to do unconventional things. If it is
+ * defined, it's inserted at the beginning of received message processing.
+ * If you eat the received message and don't want default processing to
+ * proceed, do a return after doing your things. One possible application
+ * (besides debugging) is to flash a status LED on each packet.
+ */
+/* #define USB_RESET_HOOK(resetStarts)     if(!resetStarts){hadUsbReset();} */
+/* This macro is a hook if you need to know when an USB RESET occurs. It has
+ * one parameter which distinguishes between the start of RESET state and its
+ * end.
+ */
+/* #define USB_SET_ADDRESS_HOOK()              hadAddressAssigned(); */
+/* This macro (if defined) is executed when a USB SET_ADDRESS request was
+ * received.
+ */
+#define USB_COUNT_SOF                   0
+/* define this macro to 1 if you need the global variable "usbSofCount" which
+ * counts SOF packets. This feature requires that the hardware interrupt is
+ * connected to D- instead of D+.
+ */
+/* #ifdef __ASSEMBLER__
+ * macro myAssemblerMacro
+ *     in      YL, TCNT0
+ *     sts     timer0Snapshot, YL
+ *     endm
+ * #endif
+ * #define USB_SOF_HOOK                    myAssemblerMacro
+ * This macro (if defined) is executed in the assembler module when a
+ * Start Of Frame condition is detected. It is recommended to define it to
+ * the name of an assembler macro which is defined here as well so that more
+ * than one assembler instruction can be used. The macro may use the register
+ * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
+ * immediately after an SOF pulse may be lost and must be retried by the host.
+ * What can you do with this hook? Since the SOF signal occurs exactly every
+ * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
+ * designs running on the internal RC oscillator.
+ * Please note that Start Of Frame detection works only if D- is wired to the
+ * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
+ */
+#define USB_CFG_CHECK_DATA_TOGGLING     0
+/* define this macro to 1 if you want to filter out duplicate data packets
+ * sent by the host. Duplicates occur only as a consequence of communication
+ * errors, when the host does not receive an ACK. Please note that you need to
+ * implement the filtering yourself in usbFunctionWriteOut() and
+ * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
+ * for each control- and out-endpoint to check for duplicate packets.
+ */
+#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH   0
+/* define this macro to 1 if you want the function usbMeasureFrameLength()
+ * compiled in. This function can be used to calibrate the AVR's RC oscillator.
+ */
+#define USB_USE_FAST_CRC                0
+/* The assembler module has two implementations for the CRC algorithm. One is
+ * faster, the other is smaller. This CRC routine is only used for transmitted
+ * messages where timing is not critical. The faster routine needs 31 cycles
+ * per byte while the smaller one needs 61 to 69 cycles. The faster routine
+ * may be worth the 32 bytes bigger code size if you transmit lots of data and
+ * run the AVR close to its limit.
+ */
+
+/* -------------------------- Device Description --------------------------- */
+
+#define USB_CFG_VENDOR_ID       (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
+/* USB vendor ID for the device, low byte first. If you have registered your
+ * own Vendor ID, define it here. Otherwise you may use one of obdev's free
+ * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
+ * *** IMPORTANT NOTE ***
+ * This template uses obdev's shared VID/PID pair for Vendor Class devices
+ * with libusb: 0x16c0/0x5dc.  Use this VID/PID pair ONLY if you understand
+ * the implications!
+ */
+#define USB_CFG_DEVICE_ID       (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
+/* This is the ID of the product, low byte first. It is interpreted in the
+ * scope of the vendor ID. If you have registered your own VID with usb.org
+ * or if you have licensed a PID from somebody else, define it here. Otherwise
+ * you may use one of obdev's free shared VID/PID pairs. See the file
+ * USB-IDs-for-free.txt for details!
+ * *** IMPORTANT NOTE ***
+ * This template uses obdev's shared VID/PID pair for Vendor Class devices
+ * with libusb: 0x16c0/0x5dc.  Use this VID/PID pair ONLY if you understand
+ * the implications!
+ */
+#define USB_CFG_DEVICE_VERSION  0x00, 0x01
+/* Version number of the device: Minor number first, then major number.
+ */
+#define USB_CFG_VENDOR_NAME     't', '.', 'm', '.', 'k', '.'
+#define USB_CFG_VENDOR_NAME_LEN 6
+/* These two values define the vendor name returned by the USB device. The name
+ * must be given as a list of characters under single quotes. The characters
+ * are interpreted as Unicode (UTF-16) entities.
+ * If you don't want a vendor name string, undefine these macros.
+ * ALWAYS define a vendor name containing your Internet domain name if you use
+ * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
+ * details.
+ */
+#define USB_CFG_DEVICE_NAME     'P', 'S', '/', '2', ' ', 'k', 'e', 'y', 'b', 'o', 'a', 'r', 'd', ' ', 'c', 'o', 'n', 'v', 'e', 'r', 't', 'e', 'r'
+#define USB_CFG_DEVICE_NAME_LEN 23
+/* Same as above for the device name. If you don't want a device name, undefine
+ * the macros. See the file USB-IDs-for-free.txt before you assign a name if
+ * you use a shared VID/PID.
+ */
+/*#define USB_CFG_SERIAL_NUMBER   'N', 'o', 'n', 'e' */
+/*#define USB_CFG_SERIAL_NUMBER_LEN   0 */
+/* Same as above for the serial number. If you don't want a serial number,
+ * undefine the macros.
+ * It may be useful to provide the serial number through other means than at
+ * compile time. See the section about descriptor properties below for how
+ * to fine tune control over USB descriptors such as the string descriptor
+ * for the serial number.
+ */
+#define USB_CFG_DEVICE_CLASS        0
+#define USB_CFG_DEVICE_SUBCLASS     0
+/* See USB specification if you want to conform to an existing device class.
+ * Class 0xff is "vendor specific".
+ */
+#define USB_CFG_INTERFACE_CLASS     3   /* HID */
+#define USB_CFG_INTERFACE_SUBCLASS  1   /* Boot */
+#define USB_CFG_INTERFACE_PROTOCOL  1   /* Keyboard */
+/* See USB specification if you want to conform to an existing device class or
+ * protocol. The following classes must be set at interface level:
+ * HID class is 3, no subclass and protocol required (but may be useful!)
+ * CDC class is 2, use subclass 2 and protocol 1 for ACM
+ */
+#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    0
+/* Define this to the length of the HID report descriptor, if you implement
+ * an HID device. Otherwise don't define it or define it to 0.
+ * If you use this define, you must add a PROGMEM character array named
+ * "usbHidReportDescriptor" to your code which contains the report descriptor.
+ * Don't forget to keep the array and this define in sync!
+ */
+
+/* #define USB_PUBLIC static */
+/* Use the define above if you #include usbdrv.c instead of linking against it.
+ * This technique saves a couple of bytes in flash memory.
+ */
+
+/* ------------------- Fine Control over USB Descriptors ------------------- */
+/* If you don't want to use the driver's default USB descriptors, you can
+ * provide our own. These can be provided as (1) fixed length static data in
+ * flash memory, (2) fixed length static data in RAM or (3) dynamically at
+ * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
+ * information about this function.
+ * Descriptor handling is configured through the descriptor's properties. If
+ * no properties are defined or if they are 0, the default descriptor is used.
+ * Possible properties are:
+ *   + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
+ *     at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
+ *     used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
+ *     you want RAM pointers.
+ *   + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
+ *     in static memory is in RAM, not in flash memory.
+ *   + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
+ *     the driver must know the descriptor's length. The descriptor itself is
+ *     found at the address of a well known identifier (see below).
+ * List of static descriptor names (must be declared PROGMEM if in flash):
+ *   char usbDescriptorDevice[];
+ *   char usbDescriptorConfiguration[];
+ *   char usbDescriptorHidReport[];
+ *   char usbDescriptorString0[];
+ *   int usbDescriptorStringVendor[];
+ *   int usbDescriptorStringDevice[];
+ *   int usbDescriptorStringSerialNumber[];
+ * Other descriptors can't be provided statically, they must be provided
+ * dynamically at runtime.
+ *
+ * Descriptor properties are or-ed or added together, e.g.:
+ * #define USB_CFG_DESCR_PROPS_DEVICE   (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
+ *
+ * The following descriptors are defined:
+ *   USB_CFG_DESCR_PROPS_DEVICE
+ *   USB_CFG_DESCR_PROPS_CONFIGURATION
+ *   USB_CFG_DESCR_PROPS_STRINGS
+ *   USB_CFG_DESCR_PROPS_STRING_0
+ *   USB_CFG_DESCR_PROPS_STRING_VENDOR
+ *   USB_CFG_DESCR_PROPS_STRING_PRODUCT
+ *   USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
+ *   USB_CFG_DESCR_PROPS_HID
+ *   USB_CFG_DESCR_PROPS_HID_REPORT
+ *   USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
+ *
+ * Note about string descriptors: String descriptors are not just strings, they
+ * are Unicode strings prefixed with a 2 byte header. Example:
+ * int  serialNumberDescriptor[] = {
+ *     USB_STRING_DESCRIPTOR_HEADER(6),
+ *     'S', 'e', 'r', 'i', 'a', 'l'
+ * };
+ */
+
+#define USB_CFG_DESCR_PROPS_DEVICE                  0
+#define USB_CFG_DESCR_PROPS_CONFIGURATION           USB_PROP_IS_DYNAMIC
+//#define USB_CFG_DESCR_PROPS_CONFIGURATION           0
+#define USB_CFG_DESCR_PROPS_STRINGS                 0
+#define USB_CFG_DESCR_PROPS_STRING_0                0
+#define USB_CFG_DESCR_PROPS_STRING_VENDOR           0
+#define USB_CFG_DESCR_PROPS_STRING_PRODUCT          0
+#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER    0
+//#define USB_CFG_DESCR_PROPS_HID                     USB_PROP_IS_DYNAMIC
+#define USB_CFG_DESCR_PROPS_HID                     0
+#define USB_CFG_DESCR_PROPS_HID_REPORT              USB_PROP_IS_DYNAMIC
+//#define USB_CFG_DESCR_PROPS_HID_REPORT              0
+#define USB_CFG_DESCR_PROPS_UNKNOWN                 0
+
+/* ----------------------- Optional MCU Description ------------------------ */
+
+/* The following configurations have working defaults in usbdrv.h. You
+ * usually don't need to set them explicitly. Only if you want to run
+ * the driver on a device which is not yet supported or with a compiler
+ * which is not fully supported (such as IAR C) or if you use a differnt
+ * interrupt than INT0, you may have to define some of these.
+ */
+/* #define USB_INTR_CFG            MCUCR */
+/* #define USB_INTR_CFG_SET        ((1 << ISC00) | (1 << ISC01)) */
+/* #define USB_INTR_CFG_CLR        0 */
+/* #define USB_INTR_ENABLE         GIMSK */
+/* #define USB_INTR_ENABLE_BIT     INT0 */
+/* #define USB_INTR_PENDING        GIFR */
+/* #define USB_INTR_PENDING_BIT    INTF0 */
+/* #define USB_INTR_VECTOR         INT0_vect */
+
+#endif /* __usbconfig_h_included__ */
index 04ba0d60e3bb4986d55ab11a8a94c4f054cf1c60..3b53c0a046764e6b50c120c03c03c2451a3ab417 100644 (file)
@@ -70,7 +70,14 @@ endif
 
 ifdef KEYMAP_SECTION_ENABLE
     OPT_DEFS += -DKEYMAP_SECTION_ENABLE
-    EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
+
+    ifeq ($(strip $(MCU)),atmega32u2)
+       EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr35.x
+    else ifeq ($(strip $(MCU)),atmega32u4)
+       EXTRALDFLAGS = -Wl,-L$(TMK_DIR),-Tldscript_keymap_avr5.x
+    else
+       EXTRALDFLAGS = $(error no ldscript for keymap section)
+    endif
 endif
 
 # Version string
index 1f15bd091861735b1b621510edb1e161035896ea..339b3ee67edf6628f30b33fc64cd63ea834b1a96 100644 (file)
@@ -131,10 +131,17 @@ void process_action(keyrecord_t *record)
                     case MODS_TAP_TOGGLE:
                         if (event.pressed) {
                             if (tap_count <= TAPPING_TOGGLE) {
-                                register_mods(mods);
+                                if (mods & get_mods()) {
+                                    dprint("MODS_TAP_TOGGLE: toggle mods off\n");
+                                    unregister_mods(mods);
+                                } else {
+                                    dprint("MODS_TAP_TOGGLE: toggle mods on\n");
+                                    register_mods(mods);
+                                }
                             }
                         } else {
                             if (tap_count < TAPPING_TOGGLE) {
+                                dprint("MODS_TAP_TOGGLE: release : unregister_mods\n");
                                 unregister_mods(mods);
                             }
                         }
index 32ef07216d21952948c2f7f0b5d5d73cf2ff92cd..da93f77b2276760850e157364882497de2962145 100644 (file)
@@ -255,6 +255,7 @@ enum layer_pram_tap_op {
 #define ACTION_LAYER_TAP(layer, key)                (ACT_LAYER_TAP<<12 | (layer)<<8 | (key))
 /* Default Layer */
 #define ACTION_DEFAULT_LAYER_SET(layer)             ACTION_DEFAULT_LAYER_BIT_SET((layer)/4, 1<<((layer)%4))
+#define ACTION_DEFAULT_LAYER_TOGGLE(layer)          ACTION_DEFAULT_LAYER_BIT_XOR((layer)/4, 1<<((layer)%4))
 /* Layer Operation */
 #define ACTION_LAYER_CLEAR(on)                      ACTION_LAYER_BIT_AND(0, 0, (on))
 #define ACTION_LAYER_MOMENTARY(layer)               ACTION_LAYER_ON_OFF(layer)
@@ -266,7 +267,7 @@ enum layer_pram_tap_op {
 #define ACTION_LAYER_ON_OFF(layer)                  ACTION_LAYER_TAP((layer), OP_ON_OFF)
 #define ACTION_LAYER_OFF_ON(layer)                  ACTION_LAYER_TAP((layer), OP_OFF_ON)
 #define ACTION_LAYER_SET_CLEAR(layer)               ACTION_LAYER_TAP((layer), OP_SET_CLEAR)
-#define ACTION_LAYER_MODS(layer, mods)              ACTION_LAYER_TAP((layer), 0xe0 | (mods)&0x0f)
+#define ACTION_LAYER_MODS(layer, mods)              ACTION_LAYER_TAP((layer), 0xe0 | ((mods)&0x0f))
 /* With Tapping */
 #define ACTION_LAYER_TAP_KEY(layer, key)            ACTION_LAYER_TAP((layer), (key))
 #define ACTION_LAYER_TAP_TOGGLE(layer)              ACTION_LAYER_TAP((layer), OP_TAP_TOGGLE)
index ba93fc8b2324b7cb96e9a5744a21eee89c3f588d..b2891bf4bc9cc34a72dc42f5cf6b2bcd5699e0d4 100644 (file)
@@ -34,6 +34,8 @@ void action_macro_play(const macro_t *macro_p)
     macro_t macro = END;
     uint8_t interval = 0;
 
+    uint8_t mod_storage = 0;
+
     if (!macro_p) return;
     while (true) {
         switch (MACRO_READ()) {
@@ -42,6 +44,7 @@ void action_macro_play(const macro_t *macro_p)
                 dprintf("KEY_DOWN(%02X)\n", macro);
                 if (IS_MOD(macro)) {
                     add_weak_mods(MOD_BIT(macro));
+                    send_keyboard_report();
                 } else {
                     register_code(macro);
                 }
@@ -51,6 +54,7 @@ void action_macro_play(const macro_t *macro_p)
                 dprintf("KEY_UP(%02X)\n", macro);
                 if (IS_MOD(macro)) {
                     del_weak_mods(MOD_BIT(macro));
+                    send_keyboard_report();
                 } else {
                     unregister_code(macro);
                 }
@@ -64,6 +68,17 @@ void action_macro_play(const macro_t *macro_p)
                 interval = MACRO_READ();
                 dprintf("INTERVAL(%u)\n", interval);
                 break;
+            case MOD_STORE:
+                mod_storage = get_mods();
+                break;
+            case MOD_RESTORE:
+                set_mods(mod_storage);
+                send_keyboard_report();
+                break;
+            case MOD_CLEAR:
+                clear_mods();
+                send_keyboard_report();
+                break;
             case 0x04 ... 0x73:
                 dprintf("DOWN(%02X)\n", macro);
                 register_code(macro);
index aedc32ec6b2c428e53cd24d3d5c105eb1f1143eb..4cf2216dad0a6a0571dd5ecc579f874c266f70c7 100644 (file)
@@ -64,6 +64,9 @@ enum macro_command_id{
     /* 0x74 - 0x83 */
     WAIT                = 0x74,
     INTERVAL,
+    MOD_STORE,
+    MOD_RESTORE,
+    MOD_CLEAR,
 
     /* 0x84 - 0xf3 (reserved for keycode up) */
 
@@ -82,6 +85,9 @@ enum macro_command_id{
 #define TYPE(key)       DOWN(key), UP(key)
 #define WAIT(ms)        WAIT, (ms)
 #define INTERVAL(ms)    INTERVAL, (ms)
+#define STORE()         MOD_STORE
+#define RESTORE()       MOD_RESTORE
+#define CLEAR()         MOD_CLEAR
 
 /* key down */
 #define D(key)          DOWN(KC_##key)
@@ -93,6 +99,12 @@ enum macro_command_id{
 #define W(ms)           WAIT(ms)
 /* interval */
 #define I(ms)           INTERVAL(ms)
+/* store modifier(s) */
+#define SM()            STORE()
+/* restore modifier(s) */
+#define RM()            RESTORE()
+/* clear modifier(s) */
+#define CM()            CLEAR()
 
 /* for backward comaptibility */
 #define MD(key)         DOWN(KC_##key)
index dbee630d18175127e4d3aa333245ef2875d74dc9..f81877dd9f489a34e5c6bb896b75d5c47681ebb6 100644 (file)
@@ -76,7 +76,7 @@ void send_keyboard_report(void) {
 void add_key(uint8_t key)
 {
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro) {
+    if (keyboard_protocol && keyboard_nkro) {
         add_key_bit(key);
         return;
     }
@@ -87,7 +87,7 @@ void add_key(uint8_t key)
 void del_key(uint8_t key)
 {
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro) {
+    if (keyboard_protocol && keyboard_nkro) {
         del_key_bit(key);
         return;
     }
@@ -160,7 +160,7 @@ uint8_t has_anymod(void)
 uint8_t get_first_key(void)
 {
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro) {
+    if (keyboard_protocol && keyboard_nkro) {
         uint8_t i = 0;
         for (; i < KEYBOARD_REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
             ;
index b002a585622029f998a94adf8d95d2fa0ce7672b..d6684b2d57405c24c116a00f38538aecf28a8cbe 100644 (file)
@@ -19,7 +19,7 @@ void bootmagic(void)
     }
 
     /* do scans in case of bounce */
-    print("boogmagic scan: ... ");
+    print("bootmagic scan: ... ");
     uint8_t scan = 100;
     while (scan--) { matrix_scan(); _delay_ms(10); }
     print("done.\n");
index 1b6808be0ef15513f7f01df55117ddb1b7eedaf2..465aa21c7bccf3b7c5697bdae38e8178a165567f 100644 (file)
@@ -178,7 +178,9 @@ static void print_eeconfig(void)
 
 static bool command_common(uint8_t code)
 {
+#ifdef KEYBOARD_LOCK_ENABLE
     static host_driver_t *host_driver = 0;
+#endif
     switch (code) {
 #ifdef SLEEP_LED_ENABLE
         case KC_Z:
@@ -228,13 +230,13 @@ static bool command_common(uint8_t code)
             break;
         case KC_D:
             if (debug_enable) {
-                print("\ndebug: on\n");
+                print("\ndebug: off\n");
                 debug_matrix   = false;
                 debug_keyboard = false;
                 debug_mouse    = false;
                 debug_enable   = false;
             } else {
-                print("\ndebug: off\n");
+                print("\ndebug: on\n");
                 debug_enable   = true;
             }
             break;
@@ -315,6 +317,9 @@ static bool command_common(uint8_t code)
             print_val_hex8(host_keyboard_leds());
             print_val_hex8(keyboard_protocol);
             print_val_hex8(keyboard_idle);
+#ifdef NKRO_ENABLE
+            print_val_hex8(keyboard_nkro);
+#endif
             print_val_hex32(timer_count);
 
 #ifdef PROTOCOL_PJRC
index fc66dc0efcb5759c4812f905effd8ae62ffa3ac1..f34027120093530c1f9b274a5374e5ad68cec7e8 100644 (file)
@@ -85,15 +85,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define KC_LCAP KC_LOCKING_CAPS
 #define KC_LNUM KC_LOCKING_NUM
 #define KC_LSCR KC_LOCKING_SCROLL
-#define KC_ERAS KC_ALT_ERASE,
+#define KC_ERAS KC_ALT_ERASE
 #define KC_CLR  KC_CLEAR
 /* Japanese specific */
 #define KC_ZKHK KC_GRAVE
 #define KC_RO   KC_INT1
 #define KC_KANA KC_INT2
 #define KC_JYEN KC_INT3
+#define KC_JPY  KC_INT3
 #define KC_HENK KC_INT4
 #define KC_MHEN KC_INT5
+/* Korean specific */
+#define KC_HAEN KC_LANG1
+#define KC_HANJ KC_LANG2
 /* Keypad */
 #define KC_P1   KC_KP_1
 #define KC_P2   KC_KP_2
@@ -113,6 +117,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define KC_PPLS KC_KP_PLUS
 #define KC_PEQL KC_KP_EQUAL
 #define KC_PENT KC_KP_ENTER
+/* Unix function key */
+#define KC_EXEC KC_EXECUTE
+#define KC_SLCT KC_SELECT
+#define KC_AGIN KC_AGAIN
+#define KC_PSTE KC_PASTE
 /* Mousekey */
 #define KC_MS_U KC_MS_UP
 #define KC_MS_D KC_MS_DOWN
@@ -156,6 +165,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define KC_WSTP KC_WWW_STOP
 #define KC_WREF KC_WWW_REFRESH
 #define KC_WFAV KC_WWW_FAVORITES
+/* Jump to bootloader */
+#define KC_BTLD KC_BOOTLOADER
 /* Transparent */
 #define KC_TRANSPARENT  1
 #define KC_TRNS KC_TRANSPARENT
@@ -426,6 +437,9 @@ enum internal_special_keycodes {
     KC_MEDIA_FAST_FORWARD,
     KC_MEDIA_REWIND,    /* 0xBC */
 
+    /* Jump to bootloader */
+    KC_BOOTLOADER       = 0xBF,
+
     /* Fn key */
     KC_FN0              = 0xC0,
     KC_FN1,
index 9f4fab521662ab84f4069e30a45b6eec2d9337cf..f6a151721940d481cbbb3531b8da491a37c59777 100644 (file)
@@ -20,7 +20,9 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "action_layer.h"
 #include "action.h"
 #include "action_macro.h"
+#include "wait.h"
 #include "debug.h"
+#include "bootloader.h"
 
 
 static action_t keycode_to_action(uint8_t keycode);
@@ -122,7 +124,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
 /* translates keycode to action */
 static action_t keycode_to_action(uint8_t keycode)
 {
-    action_t action;
+    action_t action = {};
     switch (keycode) {
         case KC_A ... KC_EXSEL:
         case KC_LCTRL ... KC_RGUI:
@@ -140,6 +142,11 @@ static action_t keycode_to_action(uint8_t keycode)
         case KC_TRNS:
             action.code = ACTION_TRANSPARENT;
             break;
+        case KC_BOOTLOADER:
+            clear_keyboard();
+            wait_ms(50);
+            bootloader_jump(); // not return
+            break;
         default:
             action.code = ACTION_NO;
             break;
index 402a247b9a45ba76f800e6cdc1ca45ab88d9e436..d5fc051bf52ed573382f8edd8ed2085ceb887204 100644 (file)
@@ -28,6 +28,14 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define USB_LED_KANA                    4
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void led_set(uint8_t usb_led);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif
index 20702e94c96304612fd72c5ba1ee66dc9e8e1d54..57a36ac42b56b203e913868ae1c78db4fa241b17 100644 (file)
@@ -6,11 +6,11 @@ Download and Install
 --------------------
 ### 1. Install Tools
 
-1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC with your favorite package manager.
+1. **Toolchain** On Windows install [Atmel AVR Toolchain][atmelgcc] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack] or your favorite package manager. On Linux you can install AVR GCC with your favorite package manager.
 
-2. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog].
+2. **Programmer** Install [dfu-programmer][dfu-prog]. GUI tool [Atmel FLIP][flip] also can be used on Windows.
 
-3. **Driver** On Windows you start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. In case of `dfu-programmer` use its driver.
+3. **Driver** On Windows when you start DFU bootloader on the chip first time you will see **Found New Hardware Wizard** to install driver. If you install device driver properly you will find chip name like **ATmega32U4** under **LibUSB-Win32 Devices** tree on **Device Manager**. If not you shall need to update its driver on **Device Manager**. You will find the driver in `FLIP` install directory like: `C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\`. In case of `dfu-programmer` install driver distributed with it.
 
 If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader].
 
@@ -20,7 +20,7 @@ You can find firmware source at github:
 
 - <https://github.com/tmk/tmk_keyboard>
 
-If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from:
+If you are familiar with [`git`][git] tools you are recommended to use it but you can also download zip archive from:
 
 - <https://github.com/tmk/tmk_keyboard/archive/master.zip>
 
@@ -28,7 +28,7 @@ If you are familiar with `Git` tools you are recommended to use it but you can a
 Build firmware
 --------------
 ### 1. Open terminal
-Open terminal window to get access to commands. Use Cygwin(or MingGW) `shell terminal` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up.
+Open terminal window to get access to commands. Use Cygwin(or MingGW) shell terminal in Windows or `Terminal.app` on Mac OSX.
 
 ### 2. Change directory
 Move to project directory in the firmware source.
@@ -53,60 +53,65 @@ Now you have **hex** file to program on current directory. This **hex** is only
 How to program controller depends on controller chip and its board design. To program AVR USB chips you'll need to start it up in bootloader mode. Most of boards with the chip have a push button to let bootloader come up. Consult with your controller board manual.
 
 ### 2. Program with DFU bootloader
-Stock AVR USB chip including ATmega32U4 has DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. Open source command line tool `dfu-programmer` also supports AVR chips, it runs on Linux, Mac OSX and even Windows.
+Stock AVR USB chips have DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. `FLIP` has two version of tool, GUI app and command line program. If you want GUI see tutorial below. Open source alternative `dfu-programmer` also supports AVR chips, it is command line tool and runs on Linux, Mac OSX and even Windows.
 
-To program AVR chip with DFU bootloader use `FLIP` or `dfu-programmer`.
-If you have a proper program command in `Makefile` just type this.
 
-`FLIP` has two version of tool, GUI app and command line program. If you want GUI see tutorial below.
-To use command line tool run this command. Note that you need to set PATH variable properly.
+To program with command of `FLIP` run this. Note that you need to set PATH variable properly.
 
     $ make -f Makefile.<variant> flip
 
-Or to program with `dfu-programmer` run:
+With `dfu-programmer` run this.
 
     $ make -f Makefile.<variant> dfu
 
+Or you can execute the command directly as the following.
+
+    $ dfu-programmer <controller> erase --force
+    $ dfu-programmer <controller> flash <your_firmware.hex>
+    $ dfu-programmer <controller> reset
+
+`<controller>` part will be `atmega32u4` or `atmega32u2` in most cases. See manual of the command for the detail. On Linux and Mac OSX you will need proper permission to program a controller and you can use `sudo` command for this purpose probably. On Linux you also can configure `udev` rules to set permission.
+
+
 #### FLIP GUI tutorial
-1. On menu bar click Device -> Select, then. `ATmega32u4`.
-2. On menu bar click Settings -> Communication -> USB, then click 'Open' button on 'USB Port Connection' dialog.
-At this point you'll see grey-outed widgets on the app get colored and ready.
+1. On menu bar click **Device** -> **Select**, then choose your chip name. (In most cases **ATmega32U2** or **ATmega32U4**)
+2. On menu bar click **Settings** -> **Communication** -> **USB**, then click **Open** button on **USB Port Connection** dialog. At this point you'll have to plug into USB and start bootloader.
 
-3. On menu bar click File -> Load HEX File, then select your firmware hex file on File Selector dialog.
-4. On 'Operations Flow' panel click 'Run' button to load the firmware binary to the chip. Note that you should keep 'Erase', 'Blank Check', 'Program' and 'Verify' check boxes selected.
-5. Re-plug USB cord or click 'Start Application' button to restart your controller.
+3. On menu bar click **File** -> **Load HEX File**, then select your firmware hex file on File Selector dialog.
+4. On **Operations Flow** panel click **Run** button to load the firmware binary to the chip. Note that you should keep **Erase**, **Blank Check**, **Program** and **Verify** check boxes selected.
+5. Re-plug USB cord or click **Start Application** button to restart your controller.
 Done.
 
-See also these instructions if you need.
+See also these instructions if needed.
 
 - <http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP>
 - <http://www.atmel.com/Images/doc7769.pdf>
 
 
-### 3. Program with Teensy Loader
-If you have PJRC Teensy see instruction of `Teensy Loader`.
+##### Troubleshoot
+* **FLIP: AtLibUsbDfu.dll not found**
+Remove current driver and re-install one FLIP provides from DeviceManager of WIndows. See <http://imgur.com/a/bnwzy>
 
-- <http://www.pjrc.com/teensy/loader.html>
 
-Or use this command if you have command line version of Teensy Loader installed.
+### 3. Program with Other programmer
+If you are using PJRC Teensy consult with instruction of [Teensy Loader][teensy-loader]. Or run this target with `make` after you install command line version of it.
 
     $ make -f Makefile.<variant> teensy
 
-
-### 4. Program with Other programmer
-You may want to use other programmer like `avrdude` with AVRISPmkII, Arduino or USBasp. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in Makefile.
+You may want to use other programmer like [`avrdude`][avrdude]. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in Makefile. See below.
 
     $ make -f Makefile.<variant> program
 
 
+[atmelgcc]:     http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx
 [cygwin]:       https://www.cygwin.com/
 [mingw]:        http://www.mingw.org/
-[mhv]:          https://infernoembedded.com/products/avr-tools
-[winavr]:       http://winavr.sourceforge.net/
 [crosspack]:    http://www.obdev.at/products/crosspack/index.html
 [flip]:         http://www.atmel.com/tools/FLIP.aspx
 [dfu-prog]:     http://dfu-programmer.sourceforge.net/
 [teensy-loader]:http://www.pjrc.com/teensy/loader.html
+[avrdude]:      http://savannah.nongnu.org/projects/avrdude/
+[git]:          https://git-scm.com/
 
 
 
@@ -122,6 +127,7 @@ Set your MCU and its clock in Hz.
 
     # Boot Section Size in *bytes*
     #   Teensy halfKay   512
+    #   Teensy++ halfKay 2048
     #   Atmel DFU loader 4096
     #   LUFA bootloader  4096
     OPT_DEFS += -DBOOTLOADER_SIZE=4096
@@ -141,7 +147,7 @@ Optional. Note that ***comment out*** with `#` to disable them.
     #BACKLIGHT_ENABLE = yes     # Enable keyboard backlight functionality
 
 ### 3. Programmer
-Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`. Not needed if you use `FLIP`, `dfu-programmer` or `Teensy Loader`.
+Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`.
 
     # avrdude with AVRISPmkII
     PROGRAM_CMD = avrdude -p $(MCU) -c avrispmkII -P USB -U flash:w:$(TARGET).hex
index d4a129b208150062ff8a7bf7705396ce1d1f32a5..566936c69640f64809f9a22910bba427c634903b 100644 (file)
@@ -368,17 +368,37 @@ Default Layer also has bitwise operations, they are executed when key is release
     MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END )
 
 #### 2.3.1 Macro Commands
+- **MACRO()**
+- **MACRO_NONE**
+
 - **I()**   change interval of stroke.
 - **D()**   press key
 - **U()**   release key
 - **T()**   type key(press and release)
 - **W()**   wait
+- **SM()**  store modifier state
+- **RM()**  restore modifier state
+- **CM()**  clear modifier state
 - **END**   end mark
 
 #### 2.3.2 Examples
+***TBD***
+
+    const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+    {
+        switch (id) {
+            case HELLO:
+                return (record->event.pressed ?
+                        MACRO( I(0), T(H), T(E), T(L), T(L), W(255), T(O), END ) :
+                        MACRO_NONE );
+            case ALT_TAB:
+                return (record->event.pressed ?
+                        MACRO( D(LALT), D(TAB), END ) :
+                        MACRO( U(TAB), END ));
+        }
+        return MACRO_NONE;
+    }
 
-***TODO: sample implementation***
-See `keyboard/hhkb/keymap.c` for sample.
 
 
 
diff --git a/tmk_core/doc/other_projects.md b/tmk_core/doc/other_projects.md
deleted file mode 100644 (file)
index bf980b0..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-Other Keyboard Firmware Projects
-================================
-## PJRC USB Keyboard/Mouse Example[USB][PJRC][Teensy][AVR]
-- <http://www.pjrc.com/teensy/usb_keyboard.html>
-- <http://www.pjrc.com/teensy/usb_mouse.html>
-
-## kbupgrade[USB][V-USB][AVR]
-- <http://github.com/rhomann/kbupgrade>
-- <http://geekhack.org/showwiki.php?title=Island:8406>
-
-## c64key[USB][V-USB][AVR]
-- <http://symlink.dk/projects/c64key/>
-
-## rump[USB][V-USB][AVR]
-- <http://mg8.org/rump/>
-- <http://github.com/clee/rump>
-
-## dulcimer[USB][V-USB][AVR]
-- <http://www.schatenseite.de/dulcimer.html>
-
-## humblehacker-keyboard[USB][LUFA][AVR][Ergo]
-- <http://github.com/humblehacker>
-- <http://www.humblehacker.com/keyboard/>
-- <http://geekhack.org/showwiki.php?title=Island:6292>
-
-## ps2avr[PS/2][AVR]
-- <http://sourceforge.net/projects/ps2avr/>
-
-## ErgoDox[Ergo][Split][USB][AVR]
-- <http://geekhack.org/index.php?topic=22780.0>
-- <https://github.com/benblazak/ergodox-firmware>
-- <https://github.com/cub-uanic/tmk_keyboard>
-
-## Suka's keyboard collection[Ergo][Split][3DPrinting][USB][AVR]
-- <http://deskthority.net/workshop-f7/my-diy-keyboard-collection-or-how-i-became-a-kb-geek-t2534.html>
-- <https://github.com/frobiac/adnw>
-
-## bpiphany's AVR-Keyboard[PJRC][AVR][USB]
-- <https://github.com/BathroomEpiphanies/AVR-Keyboard>
-- <http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions>
-- <http://deskthority.net/wiki/Phantom>
-
-## USB-USB keyboard remapper[converter][USB-USB][AVR][Arduino]
-- <http://forum.colemak.com/viewtopic.php?pid=10837>
-- <https://github.com/darkytoothpaste/keymapper>
-
-## USB-USB converter threads[converter][USB-USB]
-- <http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html>
-- <http://geekhack.org/index.php?topic=19458.0>
-
-## kbdbabel.org[converter][vintage][protocol][8051]
-Great resource of vintage keyboard protocol information and code
-
-- <http://www.kbdbabel.org/>
-
-## Haata's kiibohd Controller[converter][vintage][protocol][AVR][PJRC][Cortex]
-A lots of vintage keyboard protocol supports
-
-- <http://gitorious.org/kiibohd-controller>
-
-## Kinesis ergonomic keyboard firmware replacement[V-USB][LUFA][Ergo]
-- <https://github.com/chrisandreae/kinesis-firmware>
diff --git a/tmk_core/ldscript_keymap_avr35.x b/tmk_core/ldscript_keymap_avr35.x
new file mode 100644 (file)
index 0000000..6665020
--- /dev/null
@@ -0,0 +1,268 @@
+/*
+ * linker script for configurable keymap
+ *
+ * This adds keymap section which places keymap at fixed address and
+ * is based on binutils-avr ldscripts(/usr/lib/ldscripts/avr5.x).
+ */
+OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
+OUTPUT_ARCH(avr:35)
+MEMORY
+{
+  /* With keymap section
+   *
+   * Flash Map of ATMega32U4(32KB)
+   * +------------+ 0x0000
+   * | .vectors   |
+   * | .progmem   |
+   * | .init0-9   | > text region
+   * | .text      |
+   * | .fini9-0   |
+   * |            |
+   * |------------| _etext
+   * | .data      |
+   * | .bss       | > data region
+   * | .noinit    |
+   * |            |
+   * |------------| 0x6800
+   * | .keymap    | > keymap region(2KB)
+   * |------------| 0x7000
+   * | bootloader | 4KB
+   * +------------+ 0x7FFF
+   */
+  text   (rx)   : ORIGIN = 0, LENGTH = 64K
+  keymap (rw!x) : ORIGIN = 0x6800, LENGTH = 2K
+  data   (rw!x) : ORIGIN = 0x800060, LENGTH = 0xffa0
+  eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
+  fuse      (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
+  lock      (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
+  signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
+}
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  .hash          : { *(.hash)          }
+  .dynsym        : { *(.dynsym)                }
+  .dynstr        : { *(.dynstr)                }
+  .gnu.version   : { *(.gnu.version)   }
+  .gnu.version_d   : { *(.gnu.version_d)       }
+  .gnu.version_r   : { *(.gnu.version_r)       }
+  .rel.init      : { *(.rel.init)              }
+  .rela.init     : { *(.rela.init)     }
+  .rel.text      :
+    {
+      *(.rel.text)
+      *(.rel.text.*)
+      *(.rel.gnu.linkonce.t*)
+    }
+  .rela.text     :
+    {
+      *(.rela.text)
+      *(.rela.text.*)
+      *(.rela.gnu.linkonce.t*)
+    }
+  .rel.fini      : { *(.rel.fini)              }
+  .rela.fini     : { *(.rela.fini)     }
+  .rel.rodata    :
+    {
+      *(.rel.rodata)
+      *(.rel.rodata.*)
+      *(.rel.gnu.linkonce.r*)
+    }
+  .rela.rodata   :
+    {
+      *(.rela.rodata)
+      *(.rela.rodata.*)
+      *(.rela.gnu.linkonce.r*)
+    }
+  .rel.data      :
+    {
+      *(.rel.data)
+      *(.rel.data.*)
+      *(.rel.gnu.linkonce.d*)
+    }
+  .rela.data     :
+    {
+      *(.rela.data)
+      *(.rela.data.*)
+      *(.rela.gnu.linkonce.d*)
+    }
+  .rel.ctors     : { *(.rel.ctors)     }
+  .rela.ctors    : { *(.rela.ctors)    }
+  .rel.dtors     : { *(.rel.dtors)     }
+  .rela.dtors    : { *(.rela.dtors)    }
+  .rel.got       : { *(.rel.got)               }
+  .rela.got      : { *(.rela.got)              }
+  .rel.bss       : { *(.rel.bss)               }
+  .rela.bss      : { *(.rela.bss)              }
+  .rel.plt       : { *(.rel.plt)               }
+  .rela.plt      : { *(.rela.plt)              }
+  /* Internal text space or external memory.  */
+  .text   :
+  {
+    *(.vectors)
+    KEEP(*(.vectors))
+    /* For data that needs to reside in the lower 64k of progmem.  */
+    *(.progmem.gcc*)
+    *(.progmem*)
+    . = ALIGN(2);
+     __trampolines_start = . ;
+    /* The jump trampolines for the 16-bit limited relocs will reside here.  */
+    *(.trampolines)
+    *(.trampolines*)
+     __trampolines_end = . ;
+    /* For future tablejump instruction arrays for 3 byte pc devices.
+       We don't relax jump/call instructions within these sections.  */
+    *(.jumptables)
+    *(.jumptables*)
+    /* For code that needs to reside in the lower 128k progmem.  */
+    *(.lowtext)
+    *(.lowtext*)
+     __ctors_start = . ;
+     *(.ctors)
+     __ctors_end = . ;
+     __dtors_start = . ;
+     *(.dtors)
+     __dtors_end = . ;
+    KEEP(SORT(*)(.ctors))
+    KEEP(SORT(*)(.dtors))
+    /* From this point on, we don't bother about wether the insns are
+       below or above the 16 bits boundary.  */
+    *(.init0)  /* Start here after reset.  */
+    KEEP (*(.init0))
+    *(.init1)
+    KEEP (*(.init1))
+    *(.init2)  /* Clear __zero_reg__, set up stack pointer.  */
+    KEEP (*(.init2))
+    *(.init3)
+    KEEP (*(.init3))
+    *(.init4)  /* Initialize data and BSS.  */
+    KEEP (*(.init4))
+    *(.init5)
+    KEEP (*(.init5))
+    *(.init6)  /* C++ constructors.  */
+    KEEP (*(.init6))
+    *(.init7)
+    KEEP (*(.init7))
+    *(.init8)
+    KEEP (*(.init8))
+    *(.init9)  /* Call main().  */
+    KEEP (*(.init9))
+    *(.text)
+    . = ALIGN(2);
+    *(.text.*)
+    . = ALIGN(2);
+    *(.fini9)  /* _exit() starts here.  */
+    KEEP (*(.fini9))
+    *(.fini8)
+    KEEP (*(.fini8))
+    *(.fini7)
+    KEEP (*(.fini7))
+    *(.fini6)  /* C++ destructors.  */
+    KEEP (*(.fini6))
+    *(.fini5)
+    KEEP (*(.fini5))
+    *(.fini4)
+    KEEP (*(.fini4))
+    *(.fini3)
+    KEEP (*(.fini3))
+    *(.fini2)
+    KEEP (*(.fini2))
+    *(.fini1)
+    KEEP (*(.fini1))
+    *(.fini0)  /* Infinite loop after program termination.  */
+    KEEP (*(.fini0))
+     _etext = . ;
+  }  > text
+  .data          : AT (ADDR (.text) + SIZEOF (.text))
+  {
+     PROVIDE (__data_start = .) ;
+    *(.data)
+    *(.data*)
+    *(.rodata)  /* We need to include .rodata here if gcc is used */
+    *(.rodata*) /* with -fdata-sections.  */
+    *(.gnu.linkonce.d*)
+    . = ALIGN(2);
+     _edata = . ;
+     PROVIDE (__data_end = .) ;
+  }  > data
+  .bss   : AT (ADDR (.bss))
+  {
+     PROVIDE (__bss_start = .) ;
+    *(.bss)
+    *(.bss*)
+    *(COMMON)
+     PROVIDE (__bss_end = .) ;
+  }  > data
+   __data_load_start = LOADADDR(.data);
+   __data_load_end = __data_load_start + SIZEOF(.data);
+  /* Global data not cleared after reset.  */
+  .noinit  :
+  {
+     PROVIDE (__noinit_start = .) ;
+    *(.noinit*)
+     PROVIDE (__noinit_end = .) ;
+     _end = . ;
+     PROVIDE (__heap_start = .) ;
+  }  > data
+  /* keymap region is located at end of flash
+   * .fn_actions        Fn actions definitions
+   * .keymaps           Mapping layers
+   */
+  .keymap :
+  {
+    PROVIDE(__keymap_start = .) ;
+    *(.keymap.fn_actions)   /* 32*actions = 64bytes */
+    . = ALIGN(0x40);
+    *(.keymap.keymaps)      /* rest of .keymap section */
+    *(.keymap*)
+    /* . = ALIGN(0x800); */ /* keymap section takes 2KB- */
+  } > keymap = 0x00         /* zero fill */
+  .eeprom  :
+  {
+    *(.eeprom*)
+     __eeprom_end = . ;
+  }  > eeprom
+  .fuse  :
+  {
+    KEEP(*(.fuse))
+    KEEP(*(.lfuse))
+    KEEP(*(.hfuse))
+    KEEP(*(.efuse))
+  }  > fuse
+  .lock  :
+  {
+    KEEP(*(.lock*))
+  }  > lock
+  .signature  :
+  {
+    KEEP(*(.signature*))
+  }  > signature
+  /* Stabs debugging sections.  */
+  .stab 0 : { *(.stab) }
+  .stabstr 0 : { *(.stabstr) }
+  .stab.excl 0 : { *(.stab.excl) }
+  .stab.exclstr 0 : { *(.stab.exclstr) }
+  .stab.index 0 : { *(.stab.index) }
+  .stab.indexstr 0 : { *(.stab.indexstr) }
+  .comment 0 : { *(.comment) }
+  /* DWARF debug sections.
+     Symbols in the DWARF debugging sections are relative to the beginning
+     of the section so we begin them at 0.  */
+  /* DWARF 1 */
+  .debug          0 : { *(.debug) }
+  .line           0 : { *(.line) }
+  /* GNU DWARF 1 extensions */
+  .debug_srcinfo  0 : { *(.debug_srcinfo) }
+  .debug_sfnames  0 : { *(.debug_sfnames) }
+  /* DWARF 1.1 and DWARF 2 */
+  .debug_aranges  0 : { *(.debug_aranges) }
+  .debug_pubnames 0 : { *(.debug_pubnames) }
+  /* DWARF 2 */
+  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
+  .debug_abbrev   0 : { *(.debug_abbrev) }
+  .debug_line     0 : { *(.debug_line) }
+  .debug_frame    0 : { *(.debug_frame) }
+  .debug_str      0 : { *(.debug_str) }
+  .debug_loc      0 : { *(.debug_loc) }
+  .debug_macinfo  0 : { *(.debug_macinfo) }
+}
index c09693e514da423b6cff47ad9bf140b43f9fcdb9..9b46e6c36fff00eb99016b469fbc81498032b9a4 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * linker script for configurable keymap
  *
  * This adds keymap section which places keymap at fixed address and
@@ -8,7 +8,7 @@ OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
 OUTPUT_ARCH(avr:5)
 MEMORY
 {
-  /* With keymap section 
+  /* With keymap section
    *
    * Flash Map of ATMega32U4(32KB)
    * +------------+ 0x0000
@@ -212,7 +212,7 @@ SECTIONS
   {
     PROVIDE(__keymap_start = .) ;
     *(.keymap.fn_actions)   /* 32*actions = 64bytes */
-    . = ALIGN(0x40); 
+    . = ALIGN(0x40);
     *(.keymap.keymaps)      /* rest of .keymap section */
     *(.keymap*)
     /* . = ALIGN(0x800); */ /* keymap section takes 2KB- */
index 85fdeabdd14215a024645ca312b4275b540f4453..345630aa90d54dd259f3d995c60d36274e033661 100644 (file)
@@ -53,6 +53,7 @@
 #include "lufa.h"
 
 uint8_t keyboard_idle = 0;
+/* 0: Boot Protocol, 1: Report Protocol(default) */
 uint8_t keyboard_protocol = 1;
 static uint8_t keyboard_led_stats = 0;
 
@@ -179,7 +180,6 @@ void EVENT_USB_Device_Reset(void)
 void EVENT_USB_Device_Suspend()
 {
     print("[S]");
-    matrix_power_down();
 #ifdef SLEEP_LED_ENABLE
     sleep_led_enable();
 #endif
@@ -218,6 +218,9 @@ void EVENT_USB_Device_StartOfFrame(void)
 
 /** Event handler for the USB_ConfigurationChanged event.
  * This is fired when the host sets the current configuration of the USB device after enumeration.
+ *
+ * ATMega32u2 supports dual bank(ping-pong mode) only on endpoint 3 and 4,
+ * it is safe to use singl bank for all endpoints.
  */
 void EVENT_USB_Device_ConfigurationChanged(void)
 {
@@ -242,7 +245,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
 #ifdef CONSOLE_ENABLE
     /* Setup Console HID Report Endpoints */
     ConfigSuccess &= ENDPOINT_CONFIG(CONSOLE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN,
-                                     CONSOLE_EPSIZE, ENDPOINT_BANK_DOUBLE);
+                                     CONSOLE_EPSIZE, ENDPOINT_BANK_SINGLE);
 #if 0
     ConfigSuccess &= ENDPOINT_CONFIG(CONSOLE_OUT_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_OUT,
                                      CONSOLE_EPSIZE, ENDPOINT_BANK_SINGLE);
@@ -347,10 +350,7 @@ void EVENT_USB_Device_ControlRequest(void)
                     Endpoint_ClearSETUP();
                     Endpoint_ClearStatusStage();
 
-                    keyboard_protocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00);
-#ifdef NKRO_ENABLE
-                    keyboard_nkro = !!keyboard_protocol;
-#endif
+                    keyboard_protocol = (USB_ControlRequest.wValue & 0xFF);
                     clear_keyboard();
                 }
             }
@@ -397,7 +397,7 @@ static void send_keyboard(report_keyboard_t *report)
 
     /* Select the Keyboard Report Endpoint */
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro) {
+    if (keyboard_protocol && keyboard_nkro) {
         /* Report protocol - NKRO */
         Endpoint_SelectEndpoint(NKRO_IN_EPNUM);
 
index a5a07a7a858718d467a10c68f8a04dc3647a7782..fa3034b3fe0351f71aeaeadbebbfd5da16e19595 100644 (file)
@@ -59,10 +59,16 @@ static inline void query(void);
 static inline void reset(void);
 static inline uint32_t response(void);
 
-#define out_hi_delay(intervals)  do { out_hi(); _delay_us(NEXT_KBD_TIMING * intervals); } while (0);
-#define out_lo_delay(intervals)  do { out_lo(); _delay_us(NEXT_KBD_TIMING * intervals); } while (0);
-#define query_delay(intervals)   do { query();  _delay_us(NEXT_KBD_TIMING * intervals); } while (0);
-#define reset_delay(intervals)   do { reset();  _delay_us(NEXT_KBD_TIMING * intervals); } while (0);
+/* The keyboard sends signal with 50us pulse width on OUT line
+ * while it seems to miss the 50us pulse on In line.
+ * next_kbd_set_leds() often fails to sync LED status with 50us
+ * but it works well with 51us(+1us) on TMK converter(ATMeaga32u2) at least.
+ * TODO: test on Teensy and Pro Micro configuration
+ */
+#define out_hi_delay(intervals)  do { out_hi(); _delay_us((NEXT_KBD_TIMING+1) * intervals); } while (0);
+#define out_lo_delay(intervals)  do { out_lo(); _delay_us((NEXT_KBD_TIMING+1) * intervals); } while (0);
+#define query_delay(intervals)   do { query();  _delay_us((NEXT_KBD_TIMING+1) * intervals); } while (0);
+#define reset_delay(intervals)   do { reset();  _delay_us((NEXT_KBD_TIMING+1) * intervals); } while (0);
 
 void next_kbd_init(void)
 {
@@ -79,6 +85,7 @@ void next_kbd_init(void)
 
 void next_kbd_set_leds(bool left, bool right)
 {
+    cli();
     out_lo_delay(9);
     
     out_hi_delay(3);
@@ -98,6 +105,7 @@ void next_kbd_set_leds(bool left, bool right)
     
     out_lo_delay(7);
     out_hi();
+    sei();
 }
 
 #define NEXT_KBD_READ (NEXT_KBD_IN_PIN&(1<<NEXT_KBD_IN_BIT))
index 44822b7e43e2500daabb11a5c3faa49a1c3b2ce1..569205bf302262306c017e5db338c6bad437217e 100644 (file)
@@ -68,7 +68,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #endif
 
 /* debug for signal timing, see debug pin with oscilloscope */
-#define SERIAL_SOFT_DEBUG
 #ifdef SERIAL_SOFT_DEBUG
     #define SERIAL_SOFT_DEBUG_INIT()    (DDRD |= 1<<7)
     #define SERIAL_SOFT_DEBUG_TGL()     (PORTD ^= 1<<7)
@@ -176,7 +175,7 @@ void serial_send(uint8_t data)
 ISR(SERIAL_SOFT_RXD_VECT)
 {
     SERIAL_SOFT_DEBUG_TGL();
-    SERIAL_SOFT_RXD_INT_ENTER()
+    SERIAL_SOFT_RXD_INT_ENTER();
 
     uint8_t data = 0;
 
diff --git a/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/Arduino_Makefile_master b/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/Arduino_Makefile_master
deleted file mode 160000 (submodule)
index 94c560c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 94c560c854c7a1dfc35e9de9db05de1b202de6c6
diff --git a/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/RTClib b/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/RTClib
deleted file mode 160000 (submodule)
index c30fcdf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit c30fcdf1f112de581de7b145a97630539e5cff44
diff --git a/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/generic_storage b/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/generic_storage
deleted file mode 160000 (submodule)
index 7776233..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 77762338286535dabb9c94b87060e33e487ff0f3
diff --git a/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/xmem2 b/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/xmem2
deleted file mode 160000 (submodule)
index 77b0334..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 77b033420485f7d3d35430c0e8d4d844aa894834
index 28151f9d59369e5192129f249bc892db62c3a8f1..fe002c0d961d75fb72da070e5b8d959ca8ebd967 100644 (file)
@@ -10,15 +10,24 @@ uint16_t usb_hid_time_stamp;
 
 void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf)
 {
-    ::memcpy(&usb_hid_keyboard_report, buf, sizeof(report_keyboard_t));
-    usb_hid_time_stamp = millis();
+    bool is_error = false;
+    report_keyboard_t *report = (report_keyboard_t *)buf;
+
+    dprintf("keyboard input:  %02X %02X", report->mods, report->reserved);
+    for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
+        if (IS_ERROR(report->keys[i])) {
+            is_error = true;
+        }
+        dprintf(" %02X", report->keys[i]);
+    }
+    dprint("\r\n");
 
-    debug("KBDReport: ");
-    debug_hex(usb_hid_keyboard_report.mods);
-    debug(" --");
-    for (uint8_t i = 0; i < 6; i++) {
-        debug(" ");
-        debug_hex(usb_hid_keyboard_report.keys[i]);
+    // ignore error and not send report to computer
+    if (is_error) {
+        dprint("Error usage! \r\n");
+        return;
     }
-    debug("\r\n");
+
+    ::memcpy(&usb_hid_keyboard_report, buf, sizeof(report_keyboard_t));
+    usb_hid_time_stamp = millis();
 }
index 860fc1a9310da970ebecba597c150802f522f37e..0ae84d912fd452b1a9a2000402b487e91569f1c7 100644 (file)
@@ -425,7 +425,6 @@ ifneq (, $(findstring 0.7, $(shell dfu-programmer --version 2>&1)))
 else
        dfu-programmer $(MCU) erase
 endif
-       dfu-programmer $(MCU) erase
        dfu-programmer $(MCU) flash $(TARGET).hex
        dfu-programmer $(MCU) reset