Browse Source

Merge remote-tracking branch 'remotes/jackhumbert/master' into bépo

Didier Loiseau 9 years ago
parent
commit
b9014c7575
100 changed files with 1102 additions and 8958 deletions
  1. 94 0
      .gitattributes
  2. 11 3
      .gitignore
  3. 12 0
      .gitmodules
  4. 31 0
      .travis.yml
  5. 0 71
      1-setup-path-win.bat
  6. 0 41
      2-setup-environment-win.bat
  7. 0 60
      BUILD_GUIDE.md
  8. 28 0
      Dockerfile
  9. 0 323
      HAND_WIRE.md
  10. 519 0
      Makefile
  11. 0 312
      README.md
  12. 0 243
      TMK_README.md
  13. 0 26
      VAGRANT_GUIDE.md
  14. 98 88
      Vagrantfile
  15. 0 72
      avr_setup.sh
  16. 226 0
      build_keyboard.mk
  17. 57 0
      build_test.mk
  18. 26 0
      common.mk
  19. 0 141
      converter/adb_usb/Makefile
  20. 0 73
      converter/adb_usb/Makefile.pjrc
  21. 0 103
      converter/adb_usb/README.md
  22. 0 63
      converter/adb_usb/config.h
  23. 0 16
      converter/adb_usb/keymap_ansi.c
  24. 0 30
      converter/adb_usb/keymap_common.c
  25. 0 212
      converter/adb_usb/keymap_common.h
  26. 0 58
      converter/adb_usb/keymap_hasu.c
  27. 0 16
      converter/adb_usb/keymap_iso.c
  28. 0 27
      converter/adb_usb/led.c
  29. 0 296
      converter/adb_usb/matrix.c
  30. 0 82
      converter/ascii_usb/Makefile
  31. 0 38
      converter/ascii_usb/README
  32. 0 70
      converter/ascii_usb/config.h
  33. 0 42
      converter/ascii_usb/keymap.c
  34. 0 25
      converter/ascii_usb/led.c
  35. 0 195
      converter/ascii_usb/matrix.c
  36. 0 93
      converter/ibm4704_usb/Makefile
  37. 0 72
      converter/ibm4704_usb/README.md
  38. 0 61
      converter/ibm4704_usb/config.h
  39. 0 182
      converter/ibm4704_usb/ibm4704.txt
  40. 0 17
      converter/ibm4704_usb/keymap_50key.c
  41. 0 50
      converter/ibm4704_usb/keymap_alps102key.c
  42. 0 30
      converter/ibm4704_usb/keymap_common.c
  43. 0 146
      converter/ibm4704_usb/keymap_common.h
  44. 0 85
      converter/ibm4704_usb/keymap_hasu.c
  45. 0 50
      converter/ibm4704_usb/keymap_plain.c
  46. 0 24
      converter/ibm4704_usb/led.c
  47. 0 162
      converter/ibm4704_usb/matrix.c
  48. 0 96
      converter/m0110_usb/Makefile
  49. 0 98
      converter/m0110_usb/Makefile.teensy
  50. 0 96
      converter/m0110_usb/Makefile.tmk_rev1
  51. 0 96
      converter/m0110_usb/Makefile.tmk_rev2
  52. 0 79
      converter/m0110_usb/README.md
  53. 0 62
      converter/m0110_usb/config.h
  54. 0 37
      converter/m0110_usb/keymap_common.c
  55. 0 133
      converter/m0110_usb/keymap_common.h
  56. 0 137
      converter/m0110_usb/keymap_default.c
  57. 0 87
      converter/m0110_usb/keymap_hasu.c
  58. 0 73
      converter/m0110_usb/keymap_intl.c
  59. 0 71
      converter/m0110_usb/keymap_spacefn.c
  60. 0 32
      converter/m0110_usb/led.c
  61. 0 142
      converter/m0110_usb/matrix.c
  62. 0 74
      converter/news_usb/Makefile.pjrc
  63. 0 62
      converter/news_usb/config_pjrc.h
  64. 0 125
      converter/news_usb/keymap.c
  65. 0 26
      converter/news_usb/led.c
  66. 0 142
      converter/news_usb/matrix.c
  67. 0 87
      converter/next_usb/Makefile
  68. 0 63
      converter/next_usb/Makefile.pjrc
  69. 0 45
      converter/next_usb/README
  70. 0 190
      converter/next_usb/config.h
  71. 0 177
      converter/next_usb/keymap.c
  72. 0 60
      converter/next_usb/led.c
  73. 0 271
      converter/next_usb/matrix.c
  74. BIN
      converter/next_usb/next_timings.jpg
  75. 0 83
      converter/pc98_usb/Makefile
  76. 0 67
      converter/pc98_usb/README
  77. 0 123
      converter/pc98_usb/config.h
  78. 0 208
      converter/pc98_usb/keymap.c
  79. 0 33
      converter/pc98_usb/led.c
  80. 0 211
      converter/pc98_usb/matrix.c
  81. 0 105
      converter/ps2_usb/Makefile
  82. 0 46
      converter/ps2_usb/Makefile.mbed
  83. 0 75
      converter/ps2_usb/Makefile.pjrc
  84. 0 98
      converter/ps2_usb/Makefile.tmk_rev1
  85. 0 98
      converter/ps2_usb/Makefile.tmk_rev2
  86. 0 107
      converter/ps2_usb/Makefile.vusb
  87. 0 84
      converter/ps2_usb/README.md
  88. 0 173
      converter/ps2_usb/config.h
  89. 0 60
      converter/ps2_usb/config_mbed.h
  90. 0 147
      converter/ps2_usb/config_tmk_rev1.h
  91. 0 85
      converter/ps2_usb/config_tmk_rev2.h
  92. 0 31
      converter/ps2_usb/keymap_common.c
  93. 0 173
      converter/ps2_usb/keymap_common.h
  94. 0 34
      converter/ps2_usb/keymap_jis.c
  95. 0 32
      converter/ps2_usb/keymap_plain.c
  96. 0 61
      converter/ps2_usb/keymap_spacefn.c
  97. 0 33
      converter/ps2_usb/led.c
  98. 0 46
      converter/ps2_usb/main.cpp
  99. 0 486
      converter/ps2_usb/matrix.c
  100. 0 0
      converter/ps2_usb/usbconfig.h

+ 94 - 0
.gitattributes

@@ -0,0 +1,94 @@
+# auto for anything unspecified
+* text=auto
+
+# sources
+*.c text
+*.cc text
+*.cxx text
+*.cpp text
+*.c++ text
+*.hpp text
+*.h text
+*.h++ text
+*.hh text
+*.bat    text
+*.coffee text
+*.css    text
+*.htm    text
+*.html   text
+*.inc    text
+*.ini    text
+*.js     text
+*.jsx    text
+*.json   text
+*.less   text
+*.php    text
+*.pl     text
+*.py     text
+*.rb     text
+*.sass   text
+*.scm    text
+*.scss   text
+*.sh     text
+*.sql    text
+*.styl   text
+*.ts     text
+*.xml    text
+*.xhtml  text
+
+# make files (need to always use lf for compatibility with Windows 10 bash)
+Makefile eol=lf
+*.mk eol=lf
+
+# make files (need to always use lf for compatibility with Windows 10 bash)
+*.sh eol=lf
+
+# documentation
+*.markdown   text
+*.md         text
+*.mdwn       text
+*.mdown      text
+*.mkd        text
+*.mkdn       text
+*.mdtxt      text
+*.mdtext     text
+*.txt        text
+AUTHORS      text
+CHANGELOG    text
+CHANGES      text
+CONTRIBUTING text
+COPYING      text
+INSTALL      text
+license      text
+LICENSE      text
+NEWS         text
+readme       text
+*README*     text
+TODO         text
+
+GRAPHICS
+*.ai   binary
+*.bmp  binary
+*.eps  binary
+*.gif  binary
+*.ico  binary
+*.jng  binary
+*.jp2  binary
+*.jpg  binary
+*.jpeg binary
+*.jpx  binary
+*.jxr  binary
+*.pdf  binary
+*.png  binary
+*.psb  binary
+*.psd  binary
+*.svg  text
+*.svgz binary
+*.tif  binary
+*.tiff binary
+*.wbmp binary
+*.webp binary
+
+# hex files
+*.hex binary
+*.eep binary

+ 11 - 3
.gitignore

@@ -1,9 +1,11 @@
-keyboard/planck/dfu-programmer.exe
 .dep
 *.o
 *.eep
 *.elf
 *.hex
+!util/bootloader.hex
+!quantum/tools/eeprom_reset.hex
+*.log
 *.lss
 *.lst
 *.map
@@ -12,12 +14,18 @@ keyboard/planck/dfu-programmer.exe
 tags
 *~
 build/
+.build/
 *.bak
 .vagrant/
+quantum/version.h
+.idea/
+CMakeLists.txt
 .DS_STORE
 
-# Eclipse Settings
+# Eclipse/PyCharm/Other IDE Settings
 .cproject
 .project
 .settings/
-
+.idea
+.browse.VC.db*
+*.stackdump

+ 12 - 0
.gitmodules

@@ -0,0 +1,12 @@
+[submodule "lib/chibios"]
+	path = lib/chibios
+	url = https://github.com/ChibiOS/ChibiOS.git
+[submodule "lib/chibios-contrib"]
+	path = lib/chibios-contrib
+	url = https://github.com/ChibiOS/ChibiOS-Contrib.git
+[submodule "lib/ugfx"]
+	path = lib/ugfx
+	url = https://bitbucket.org/Tectu/ugfx
+[submodule "lib/googletest"]
+	path = lib/googletest
+	url = https://github.com/google/googletest

File diff suppressed because it is too large
+ 31 - 0
.travis.yml


+ 0 - 71
1-setup-path-win.bat

@@ -1,71 +0,0 @@
-@SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
-@ECHO OFF
-SET CMDLINERUNSTR=%SystemRoot%\system32\cmd.exe
-
-SET NEWPATH1="C:\MinGW\msys\1.0\bin"
-SET NEWPATH2="C:\MinGW\bin"
-
-:: Make sure paths exist
-IF NOT EXIST !NEWPATH1! (ECHO Path not found: %NEWPATH1% && GOTO ExitBatch)
-IF NOT EXIST !NEWPATH2! (ECHO Path not found: %NEWPATH2% && GOTO ExitBatch)
-
-:: Add paths
-CALL :AddPath %NEWPATH1%
-CALL :AddPath %NEWPATH2%
-
-:: Branch to UpdateEnv if we need to update
-IF DEFINED UPDATE (GOTO UpdateEnv)
-
-GOTO ExitBatch
-
-:: -----------------------------------------------------------------------------
-
-:UpdateEnv
-ECHO Making updated PATH go live . . .
-REG delete HKCU\Environment /F /V TEMPVAR > nul 2>&1
-setx TEMPVAR 1 > nul 2>&1
-REG delete HKCU\Environment /F /V TEMPVAR > nul 2>&1
-IF NOT !cmdcmdline! == !CMDLINERUNSTR! (CALL :KillExplorer)
-GOTO ExitBatch
-
-:: -----------------------------------------------------------------------------
-
-:ExitBatch
-ENDLOCAL
-PAUSE
-EXIT /b
-
-:: -----------------------------------------------------------------------------
-
-:AddPath <pathToAdd>
-ECHO %PATH% | FINDSTR /C:"%~1" > nul
-IF ERRORLEVEL 1 (
-	REG add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /f /v PATH /t REG_SZ /d "%PATH%;%~1"  > nul 2>&1
-	IF ERRORLEVEL 0 (
-		ECHO Adding   %1 . . . Success!
-		SET "PATH=%PATH%;%~1"
-		SET UPDATE=1
-	) ELSE (
-		ECHO Adding   %1 . . . FAILED. Run this script with administrator privileges.
-	)	
-) ELSE (
-	ECHO Skipping %1 - Already in PATH
-	)
-EXIT /b
-
-:: -----------------------------------------------------------------------------
-
-:KillExplorer
-
-ECHO Your desktop is being restarted, please wait. . .   
-ping -n 5 127.0.0.1 > NUL 2>&1   
-ECHO Killing process Explorer.exe. . .   
-taskkill /f /im explorer.exe   
-ECHO.   
-ECHO Your desktop is now loading. . .   
-ping -n 5 127.0.0.1 > NUL 2>&1   
-ECHO.   
-ping -n 5 127.0.0.1 > NUL 2>&1   
-START explorer.exe
-START explorer.exe %CD%
-EXIT /b

+ 0 - 41
2-setup-environment-win.bat

@@ -1,41 +0,0 @@
-@echo off
-setx /M test test > nul 2>&1
-if NOT ["%errorlevel%"]==["0"] (
-	echo FAILED. Rerun with administrator privileges.
-	pause
-	exit
-) 
-
-echo ------------------------------------------
-echo Installing wget and unzip
-echo ------------------------------------------
-mingw-get install msys-wget-bin msys-unzip-bin
-cd \MinGW\bin
-
-mkdir temp
-cd temp
-echo ------------------------------------------
-echo Installing dfu-programmer.
-echo ------------------------------------------
-wget http://iweb.dl.sourceforge.net/project/dfu-programmer/dfu-programmer/0.7.2/dfu-programmer-win-0.7.2.zip
-unzip dfu-programmer-win-0.7.2.zip
-copy dfu-programmer.exe ..
-
-echo ------------------------------------------
-echo Downloading driver
-echo ------------------------------------------
-wget http://iweb.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip
-unzip libusb-win32-bin-1.2.6.0.zip
-cp libusb-win32-bin-1.2.6.0\bin\x86\libusb0_x86.dll ../libusb0.dll
-
-echo ------------------------------------------
-echo Installing driver. Accept prompt.
-echo ------------------------------------------
-pnputil -i -a dfu-prog-usb-1.2.2\atmel_usb_dfu.inf
-
-cd ..
-rm -rf temp
-
-echo ------------------------------------------
-echo Finished!
-pause

File diff suppressed because it is too large
+ 0 - 60
BUILD_GUIDE.md


+ 28 - 0
Dockerfile

@@ -0,0 +1,28 @@
+FROM debian:jessie
+MAINTAINER Erik Dasque <erik@frenchguys.com>
+
+RUN apt-get update
+RUN apt-get install --no-install-recommends -y build-essential \
+    gcc \
+    unzip \
+    wget \
+    zip \
+    gcc-avr \
+    binutils-avr \
+    avr-libc \
+    dfu-programmer \
+    dfu-util \
+    gcc-arm-none-eabi \
+    binutils-arm-none-eabi \
+    libnewlib-arm-none-eabi \
+    git
+
+RUN apt-get clean
+RUN rm -rf /var/lib/apt/lists/*
+
+ENV keyboard=ergodox
+ENV keymap=default
+
+VOLUME /qmk
+WORKDIR /qmk
+CMD make clean ; make keyboard=${keyboard} keymap=${keymap}

File diff suppressed because it is too large
+ 0 - 323
HAND_WIRE.md


+ 519 - 0
Makefile

@@ -0,0 +1,519 @@
+ifndef VERBOSE
+.SILENT:
+endif
+
+# Never run this makefile in parallel, as it could screw things up
+# It won't affect the submakes, so you still get the speedup from specifying -jx
+.NOTPARALLEL:
+
+# Allow the silent with lower caps to work the same way as upper caps
+ifdef silent
+    SILENT = $(silent)
+endif
+
+ifdef SILENT
+    SUB_IS_SILENT := $(SILENT)
+endif
+
+# We need to make sure that silent is always turned off at the top level
+# Otherwise the [OK], [ERROR] and [WARN] messags won't be displayed correctly
+override SILENT := false
+
+ON_ERROR := error_occured=1
+
+STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST))
+ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
+ROOT_DIR := $(dir $(ROOT_MAKEFILE))
+ifeq ($(ROOT_DIR),)
+    ROOT_DIR := .
+endif
+ABS_STARTING_MAKEFILE := $(abspath $(STARTING_MAKEFILE))
+ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE))
+ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE))
+ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE))
+STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR))
+TEST_DIR := $(ROOT_DIR)/.build/test
+
+MAKEFILE_INCLUDED=yes
+
+# Helper function to process the newt element of a space separated path 
+# It works a bit like the traditional functional head tail
+# so the CURRENT_PATH_ELEMENT will beome the new head
+# and the PATH_ELEMENTS are the rest that are still unprocessed
+define NEXT_PATH_ELEMENT
+    $$(eval CURRENT_PATH_ELEMENT := $$(firstword  $$(PATH_ELEMENTS)))
+    $$(eval PATH_ELEMENTS := $$(wordlist  2,9999,$$(PATH_ELEMENTS)))
+endef
+
+# We change the / to spaces so that we more easily can work with the elements 
+# separately
+PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
+# Initialize the path elements list for further processing
+$(eval $(call NEXT_PATH_ELEMENT))
+
+# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct 
+# variables depending on which directory you stand in.
+# It's really a very simple if else chain, if you squint enough, 
+# but the makefile syntax makes it very verbose. 
+# If we are in a subfolder of keyboards
+ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
+    $(eval $(call NEXT_PATH_ELEMENT))
+    KEYBOARD := $(CURRENT_PATH_ELEMENT)
+    $(eval $(call NEXT_PATH_ELEMENT))
+    # If we are in a subfolder of keymaps, or in other words in a keymap
+    # folder
+    ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
+        $(eval $(call NEXT_PATH_ELEMENT))
+        KEYMAP := $(CURRENT_PATH_ELEMENT)
+     # else if we are not in the keyboard folder itself
+    else ifneq ($(CURRENT_PATH_ELEMENT),)
+        # the we can assume it's a subproject, as no other folders
+        # should have make files in them
+        SUBPROJECT := $(CURRENT_PATH_ELEMENT)
+        $(eval $(call NEXT_PATH_ELEMENT))
+        # if we are inside a keymap folder of a subproject
+        ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
+            $(eval $(call NEXT_PATH_ELEMENT))
+            KEYMAP := $(CURRENT_PATH_ELEMENT)
+        endif
+    endif
+endif
+
+# Only consider folders with makefiles, to prevent errors in case there are extra folders
+KEYBOARDS := $(notdir $(patsubst %/Makefile,%,$(wildcard $(ROOT_DIR)/keyboards/*/Makefile)))
+
+#Compability with the old make variables, anything you specify directly on the command line
+# always overrides the detected folders
+ifdef keyboard
+    KEYBOARD := $(keyboard)
+endif
+ifdef sub
+    SUBPROJECT := $(sub)
+endif
+ifdef subproject
+    SUBPROJECT := $(subproject)
+endif
+ifdef keymap
+    KEYMAP := $(keymap)
+endif
+
+# Uncomment these for debugging
+#$(info Keyboard: $(KEYBOARD))
+#$(info Keymap: $(KEYMAP))
+#$(info Subproject: $(SUBPROJECT))
+#$(info Keyboards: $(KEYBOARDS))
+
+
+# Set the default goal depening on where we are running make from
+# this handles the case where you run make without any arguments
+.DEFAULT_GOAL := all
+ifneq ($(KEYMAP),)
+    ifeq ($(SUBPROJECT),)
+         # Inside a keymap folder, just build the keymap, with the 
+         # default subproject
+        .DEFAULT_GOAL := $(KEYBOARD)-$(KEYMAP)
+    else
+         # Inside a subproject keyamp folder, build the keymap
+         # for that subproject
+        .DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-$(KEYMAP)
+    endif
+else ifneq ($(SUBPROJECT),)
+     # Inside a subproject folder, build all keymaps for that subproject
+    .DEFAULT_GOAL := $(KEYBOARD)-$(SUBPROJECT)-allkm
+else ifneq ($(KEYBOARD),)
+     # Inside a keyboard folder, build all keymaps for all subprojects
+     # Note that this is different from the old behaviour, which would
+     # build only the default keymap of the default keyboard
+    .DEFAULT_GOAL := $(KEYBOARD)-allsp-allkm
+endif
+
+
+# Compare the start of the RULE variable with the first argument($1)
+# If the rules equals $1 or starts with $1-, RULE_FOUND is set to true
+#     and $1 is removed from the RULE variable
+# Otherwise the RULE_FOUND variable is set to false, and RULE left as it was
+# The function is a bit tricky, since there's no built in $(startswith) function
+define COMPARE_AND_REMOVE_FROM_RULE_HELPER
+    ifeq ($1,$$(RULE))
+        RULE:=
+        RULE_FOUND := true
+    else
+        STARTDASH_REMOVED=$$(subst START$1-,,START$$(RULE))
+        ifneq ($$(STARTDASH_REMOVED),START$$(RULE))
+            RULE_FOUND := true
+            RULE := $$(STARTDASH_REMOVED)
+        else
+            RULE_FOUND := false
+        endif
+    endif
+endef
+
+# This makes it easier to call COMPARE_AND_REMOVE_FROM_RULE, since it makes it behave like
+# a function that returns the value
+COMPARE_AND_REMOVE_FROM_RULE = $(eval $(call COMPARE_AND_REMOVE_FROM_RULE_HELPER,$1))$(RULE_FOUND)
+
+
+# Recursively try to find a match for the start of the rule to be checked
+# $1 The list to be checked
+# If a match is found, then RULE_FOUND is set to true
+# and MATCHED_ITEM to the item that was matched
+define TRY_TO_MATCH_RULE_FROM_LIST_HELPER3
+    ifneq ($1,)
+        ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,$$(firstword $1)),true)
+            MATCHED_ITEM := $$(firstword $1)
+        else 
+            $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$$(wordlist 2,9999,$1)))
+        endif
+    endif
+endef
+
+# A recursive helper function for finding the longest match
+# $1 The list to be checed
+# It works by always removing the currently matched item from the list 
+# and call itself recursively, until a match is found
+define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
+    # Stop the recursion when the list is empty 
+    ifneq ($1,)
+        RULE_BEFORE := $$(RULE)
+        $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER3,$1))
+        # If a match is found in the current list, otherwise just return what we had before
+        ifeq ($$(RULE_FOUND),true)
+            # Save the best match so far and call itself recursivel
+            BEST_MATCH := $$(MATCHED_ITEM)
+            BEST_MATCH_RULE := $$(RULE)
+            RULE_FOUND := false
+            RULE := $$(RULE_BEFORE)
+            $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$$(filter-out $$(MATCHED_ITEM),$1)))
+        endif
+     endif
+endef
+
+
+# Recursively try to find the longest match for the start of the rule to be checked
+# $1 The list to be checked
+# If a match is found, then RULE_FOUND is set to true
+# and MATCHED_ITEM to the item that was matched
+define TRY_TO_MATCH_RULE_FROM_LIST_HELPER
+    BEST_MATCH :=
+    $$(eval $$(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER2,$1))
+    ifneq ($$(BEST_MATCH),)
+        RULE_FOUND := true
+        RULE := $$(BEST_MATCH_RULE)
+        MATCHED_ITEM := $$(BEST_MATCH)
+    else
+        RULE_FOUND := false
+        MATCHED_ITEM :=
+    endif
+endef
+
+# Make it easier to call TRY_TO_MATCH_RULE_FROM_LIST
+TRY_TO_MATCH_RULE_FROM_LIST = $(eval $(call TRY_TO_MATCH_RULE_FROM_LIST_HELPER,$1))$(RULE_FOUND)
+
+define ALL_IN_LIST_LOOP
+    OLD_RULE$1 := $$(RULE)
+    $$(eval $$(call $1,$$(ITEM$1)))
+    RULE := $$(OLD_RULE$1)
+endef
+
+define PARSE_ALL_IN_LIST
+    $$(foreach ITEM$1,$2,$$(eval $$(call ALL_IN_LIST_LOOP,$1)))
+endef
+
+# The entry point for rule parsing
+# parses a rule in the format <keyboard>-<subproject>-<keymap>-<target>
+# but this particular function only deals with the first <keyboard> part
+define PARSE_RULE
+    RULE := $1
+    COMMANDS :=
+    # If the rule starts with allkb, then continue the parsing from
+    # PARSE_ALL_KEYBOARDS
+    ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkb),true)
+        $$(eval $$(call PARSE_ALL_KEYBOARDS))
+    else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,test),true)
+        $$(eval $$(call PARSE_TEST))
+    # If the rule starts with the name of a known keyboard, then continue
+    # the parsing from PARSE_KEYBOARD
+    else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true)
+        $$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
+    # Otherwise use the KEYBOARD variable, which is determined either by
+    # the current directory you run make from, or passed in as an argument
+    else ifneq ($$(KEYBOARD),)
+        $$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD)))
+    else
+        $$(info make: *** No rule to make target '$1'. Stop.)
+        # Notice the tab instead of spaces below!
+		exit 1
+    endif
+endef
+
+# $1 = Keyboard
+# Parses a rule in the format <subproject>-<keymap>-<target>
+# the keyboard is already known when entering this function
+define PARSE_KEYBOARD
+    CURRENT_KB := $1
+    # A subproject is any keyboard subfolder with a makefile
+    SUBPROJECTS := $$(notdir $$(patsubst %/Makefile,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/*/Makefile)))
+    # if the rule starts with allsp, then continue with looping over all subprojects
+    ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allsp),true)
+        $$(eval $$(call PARSE_ALL_SUBPROJECTS))
+    # A special case for matching the defaultsp (default subproject)
+    else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,defaultsp),true)
+        $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
+    # If the rule starts with the name of a known subproject
+    else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(SUBPROJECTS)),true)
+        $$(eval $$(call PARSE_SUBPROJECT,$$(MATCHED_ITEM)))
+    # Try to use the SUBPROJECT variable, which is either determined by the
+    # directory which invoked make, or passed as an argument to make
+    else ifneq ($$(SUBPROJECT),)
+        $$(eval $$(call PARSE_SUBPROJECT,$$(SUBPROJECT)))
+	# If there's no matching subproject, we assume it's the default
+	# This will allow you to leave the subproject part of the target out
+    else 
+        $$(eval $$(call PARSE_SUBPROJECT,))
+    endif
+endef
+
+# if we are going to compile all keyboards, match the rest of the rule
+# for each of them
+define PARSE_ALL_KEYBOARDS
+    $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS)))
+endef
+
+# $1 Subproject
+# When entering this, the keyboard and subproject are known, so now we need
+# to determine which keymaps are going to get compiled
+define PARSE_SUBPROJECT
+    # If we want to compile the default subproject, then we need to 
+    # include the correct makefile to determine the actual name of it
+    CURRENT_SP := $1
+    ifeq ($$(CURRENT_SP),)
+        CURRENT_SP := defaultsp
+    endif
+    ifeq ($$(CURRENT_SP),defaultsp)
+        SUBPROJECT_DEFAULT=
+        $$(eval include $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/Makefile)
+        CURRENT_SP := $$(SUBPROJECT_DEFAULT)
+    endif
+    # If current subproject is empty (the default was not defined), and we have a list of subproject
+    # then make all of them
+    ifeq ($$(CURRENT_SP),)
+        ifneq ($$(SUBPROJECTS),)
+            CURRENT_SP := allsp
+         endif
+    endif
+    # The special allsp is handled later
+    ifneq ($$(CURRENT_SP),allsp) 
+        # get a list of all keymaps
+        KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/keymaps/*/.)))
+        ifneq ($$(CURRENT_SP),)
+            # if the subproject is defined, then also look for keymaps inside the subproject folder
+            SP_KEYMAPS := $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(CURRENT_KB)/$$(CURRENT_SP)/keymaps/*/.)))
+            KEYMAPS := $$(sort $$(KEYMAPS) $$(SP_KEYMAPS))
+        endif
+        # if the rule after removing the start of it is empty (we haven't specified a kemap or target)
+        # compile all the keymaps
+        ifeq ($$(RULE),)
+            $$(eval $$(call PARSE_ALL_KEYMAPS))
+        # The same if allkm was specified
+        else ifeq ($$(call COMPARE_AND_REMOVE_FROM_RULE,allkm),true)
+            $$(eval $$(call PARSE_ALL_KEYMAPS))
+        # Try to match the specified keyamp with the list of known keymaps
+        else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYMAPS)),true)
+            $$(eval $$(call PARSE_KEYMAP,$$(MATCHED_ITEM)))
+        # Otherwise try to match the keymap from the current folder, or arguments to the make command
+        else ifneq ($$(KEYMAP),)
+            $$(eval $$(call PARSE_KEYMAP,$$(KEYMAP)))
+        # No matching keymap found, so we assume that the rest of the rule is the target
+        # If we haven't been able to parse out a subproject, then make all of them
+        # This is consistent with running make without any arguments from the keyboard
+        # folder
+        else ifeq ($1,)
+            $$(eval $$(call PARSE_ALL_SUBPROJECTS))
+        # Otherwise, make all keymaps, again this is consistent with how it works without
+        # any arguments
+        else
+            $$(eval $$(call PARSE_ALL_KEYMAPS))
+        endif
+    else
+        # As earlier mentione,d when allsb is specified, we call our self recursively
+        # for all of the subprojects
+        $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$(SUBPROJECTS)))
+    endif
+endef
+
+# If we want to parse all subprojects, but the keyboard doesn't have any, 
+# then use defaultsp instead
+define PARSE_ALL_SUBPROJECTS
+    ifeq ($$(SUBPROJECTS),)
+        $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
+    else
+        $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS)))
+    endif
+endef
+
+# $1 Keymap
+# This is the meat of compiling a keyboard, when entering this, everything is known
+# keyboard, subproject, and keymap
+# Note that we are not directly calling the command here, but instead building a list,
+# which will later be processed
+define PARSE_KEYMAP
+    CURRENT_KM = $1
+    # The rest of the rule is the target
+    # Remove the leading "-" from the target, as it acts as a separator
+    MAKE_TARGET := $$(patsubst -%,%,$$(RULE))
+    # We need to generate an unique indentifer to append to the COMMANDS list
+    COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB)_SUBPROJECT_$(CURRENT_SP)_KEYMAP_$$(CURRENT_KM)
+    # If we are compiling a keyboard without a subproject, we want to display just the name
+    # of the keyboard, otherwise keyboard/subproject
+    ifeq ($$(CURRENT_SP),)
+        KB_SP := $(CURRENT_KB)
+    else
+        KB_SP := $(CURRENT_KB)/$$(CURRENT_SP)
+    endif
+    # Format it in bold
+    KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR)
+    # Specify the variables that we are passing forward to submake
+    MAKE_VARS := KEYBOARD=$$(CURRENT_KB) SUBPROJECT=$$(CURRENT_SP) KEYMAP=$$(CURRENT_KM)
+    # And the first part of the make command
+    MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET)
+    # The message to display
+    MAKE_MSG := $$(MSG_MAKE_KB)
+    # We run the command differently, depending on if we want more output or not
+    # The true version for silent output and the false version otherwise
+    $$(eval $$(call BUILD))
+endef
+
+define BUILD
+    MAKE_VARS += VERBOSE=$(VERBOSE) COLOR=$(COLOR)
+    COMMANDS += $$(COMMAND)
+    COMMAND_true_$$(COMMAND) := \
+        printf "$$(MAKE_MSG)" | \
+        $$(MAKE_MSG_FORMAT); \
+        LOG=$$$$($$(MAKE_CMD) $$(MAKE_VARS) SILENT=true 2>&1) ; \
+        if [ $$$$? -gt 0 ]; \
+            then $$(PRINT_ERROR_PLAIN); \
+        elif [ "$$$$LOG" != "" ] ; \
+            then $$(PRINT_WARNING_PLAIN); \
+        else \
+            $$(PRINT_OK); \
+        fi;
+    COMMAND_false_$$(COMMAND) := \
+        printf "$$(MAKE_MSG)\n\n"; \
+        $$(MAKE_CMD) $$(MAKE_VARS) SILENT=false; \
+        if [ $$$$? -gt 0 ]; \
+            then error_occured=1; \
+        fi;
+endef
+
+# Just parse all the keymaps for a specifc keyboard
+define PARSE_ALL_KEYMAPS
+    $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYMAP,$$(KEYMAPS)))
+endef
+
+define BUILD_TEST
+    TEST_NAME := $1
+    MAKE_TARGET := $2
+    COMMAND := $1
+    MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
+    MAKE_VARS := TEST=$$(TEST_NAME)
+    MAKE_MSG := $$(MSG_MAKE_TEST)
+    $$(eval $$(call BUILD))
+    ifneq ($$(MAKE_TARGET),clean)
+        TEST_EXECUTABLE := $$(TEST_DIR)/$$(TEST_NAME).elf
+        TESTS += $$(TEST_NAME)
+        TEST_MSG := $$(MSG_TEST)
+        $$(TEST_NAME)_COMMAND := \
+            printf "$$(TEST_MSG)\n"; \
+            $$(TEST_EXECUTABLE); \
+            if [ $$$$? -gt 0 ]; \
+                then error_occured=1; \
+            fi; \
+            printf "\n";
+    endif
+endef
+
+define PARSE_TEST
+    TESTS :=
+    TEST_NAME := $$(firstword $$(subst -, ,$$(RULE)))
+    TEST_TARGET := $$(subst $$(TEST_NAME),,$$(subst $$(TEST_NAME)-,,$$(RULE)))
+    ifeq ($$(TEST_NAME),all)
+        MATCHED_TESTS := $$(TEST_LIST)
+    else
+        MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),))
+    endif
+    $$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
+endef
+
+
+# Set the silent mode depending on if we are trying to compile multiple keyboards or not
+# By default it's on in that case, but it can be overriden by specifying silent=false 
+# from the command line
+define SET_SILENT_MODE
+    ifdef SUB_IS_SILENT
+        SILENT_MODE := $(SUB_IS_SILENT)
+    else ifeq ($$(words $$(COMMANDS)),1)
+        SILENT_MODE := false
+    else
+        SILENT_MODE := true
+    endif
+endef
+
+include $(ROOT_DIR)/message.mk
+
+RUN_COMMAND = \
+$(COMMAND_$(SILENT_MODE)_$(COMMAND))
+
+# Allow specifying just the subproject, in the keyboard directory, which will compile all keymaps
+SUBPROJECTS := $(notdir $(patsubst %/Makefile,%,$(wildcard ./*/Makefile)))
+.PHONY: $(SUBPROJECTS)
+$(SUBPROJECTS): %: %-allkm 
+
+# Let's match everything, we handle all the rule parsing ourselves
+.PHONY: %
+%: 
+	# Check if we have the CMP tool installed
+	cmp --version >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
+	# Check if the submodules are dirty, and display a warning if they are
+	git submodule status --recursive 2>/dev/null | \
+	while IFS= read -r x; do \
+		case "$$x" in \
+			\ *) ;; \
+			*) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
+		esac \
+	done
+	$(eval $(call PARSE_RULE,$@))
+	$(eval $(call SET_SILENT_MODE))
+	# Run all the commands in the same shell, notice the + at the first line
+	# it has to be there to allow parallel execution of the submake
+	# This always tries to compile everything, even if error occurs in the middle
+	# But we return the error code at the end, to trigger travis failures
+	+error_occured=0; \
+	$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND)) \
+	if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\
+	$(foreach TEST,$(TESTS),$($(TEST)_COMMAND)) \
+	if [ $$error_occured -gt 0 ]; then printf "$(MSG_ERRORS)" & exit $$error_occured; fi;\
+
+# All should compile everything
+.PHONY: all
+all: all-keyboards test-all
+
+# Define some shortcuts, mostly for compability with the old syntax
+.PHONY: all-keyboards
+all-keyboards: allkb-allsp-allkm
+
+.PHONY: all-keyboards-defaults
+all-keyboards-defaults: allkb-allsp-default
+
+.PHONY: test
+test: test-all
+
+.PHONY: test-clean
+test-clean: test-all-clean
+
+# Generate the version.h file
+GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S")
+BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S")
+$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h)
+$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h)
+
+include $(ROOT_DIR)/testlist.mk

File diff suppressed because it is too large
+ 0 - 312
README.md


+ 0 - 243
TMK_README.md

@@ -1,243 +0,0 @@
-# TMK Documenation
-
-Features
---------
-These features can be used in your keyboard.
-
-* Multi-layer Keymap  - Multiple keyboard layouts with layer switching
-* Mouse key           - Mouse control with keyboard
-* System Control Key  - Power Down, Sleep, Wake Up and USB Remote Wake up
-* Media Control Key   - Volume Down/Up, Mute, Next/Prev track, Play, Stop and etc
-* USB NKRO            - 120 keys(+ 8 modifiers) simultaneously
-* PS/2 mouse support  - PS/2 mouse(TrackPoint) as composite device
-* Keyboard protocols  - PS/2, ADB, M0110, Sun and other old keyboard protocols
-* User Function       - Customizable function of key with writing code
-* Macro               - Very primitive at this time
-* Keyboard Tricks     - Oneshot modifier and modifier with tapping feature
-* Debug Console       - Messages for debug and interaction with firmware
-* Virtual DIP Switch  - Configurations stored EEPROM(Boot Magic)
-* Locking CapsLock    - Mechanical switch support for CapsLock
-* Breathing Sleep LED - Sleep indicator with charm during USB suspend
-* Backlight           - Control backlight levels
-
-
-
-Projects
---------
-You can find some keyboard specific projects under `converter` and `keyboard` directory.
-
-## Main projects
-
-### OLKB products
-* [planck](keyboard/planck/)                - [Planck] Ortholinear 40% keyboard
-* [preonic](keyboard/preonic/)              - [Preonic] Ortholinear 50% keyboard
-* [atomic](keyboard/atomic/)                - [Atomic] Ortholinear 60% keyboard
-
-### Ergodox EZ
-* [ergodox_ez](keyboard/ergodox_ez)         - [Ergodox_EZ] Assembled split keyboard
-
-## Other projects
-
-### converter
-* [ps2_usb](converter/ps2_usb/)             - [PS/2 keyboard to USB][GH_ps2]
-* [adb_usb](converter/adb_usb/)             - [ADB keyboard to USB][GH_adb]
-* [m0110_usb](converter/m0110_usb)          - [Macintosh 128K/512K/Plus keyboard to USB][GH_m0110]
-* [terminal_usb](converter/terminal_usb/)   - [IBM Model M terminal keyboard(PS/2 scancode set3) to USB][GH_terminal]
-* [news_usb](converter/news_usb/)           - [Sony NEWS keyboard to USB][GH_news]
-* [x68k_usb](converter/x68k_usb/)           - [Sharp X68000 keyboard to USB][GH_x68k]
-* [sun_usb](converter/sun_usb/)             - [Sun] to USB(type4, 5 and 3?)
-* [pc98_usb](converter/pc98_usb/)           - [PC98] to USB
-* [usb_usb](converter/usb_usb/)             - USB to USB(experimental)
-* [ascii_usb](converter/ascii_usb/)         - ASCII(Serial console terminal) to USB
-* [ibm4704_usb](converter/ibm4704_usb)      - [IBM 4704 keyboard Converter][GH_ibm4704]
-
-### keyboard
-* [hhkb](keyboard/hhkb/)                    - [Happy Hacking Keyboard pro][GH_hhkb] hasu's main board
-* [gh60](keyboard/gh60/)                    - [GH60] DIY 60% keyboard [prototype][GH60_proto] hasu's second board
-* [hbkb](keyboard/hbkb/)                    - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
-* [hid_liber](keyboard/hid_liber/)          - [HID liberation][HID_liber] controller (by alaricljs)
-* [phantom](keyboard/phantom/)              - [Phantom] keyboard (by Tranquilite)
-* [IIgs_Standard](keyboard/IIgs/)           - Apple [IIGS] keyboard mod(by JeffreySung)
-* [macway](keyboard/macway/)                - [Compact keyboard mod][GH_macway] [retired]
-* [KMAC](keyboard/kmac/)                    - Korean custom keyboard
-* [Lightsaber](keyboard/lightsaber/)        - Korean custom keyboard
-* [Infinity](keyboard/infinity/)            - Massdrop [Infinity keyboard][Infinity]
-* [NerD](keyboard/nerd/)                    - Korean custom keyboard
-* [KittenPaw](keyboard/kitten_paw)          - Custom Majestouch controller
-* [Lightpad](keyboard/lightpad)             - Korean custom keypad
-* [ghost_squid](keyboard/ghost_squid/)      - [The Ghost Squid][ghost_squid] controller for [Cooler Master QuickFire XT][cmxt]
-
-### Extenal projects using tmk_keyboard
-* [ErgoDox_cub-uanic][cub-uanic]            - Split Ergonomic Keyboard [ErgoDox][ergodox_org]
-* [mcdox][mcdox_tmk]                        - [mcdox][mcdox]
-
-
-[GH_macway]:    http://geekhack.org/showwiki.php?title=Island:11930
-[GH_hhkb]:      http://geekhack.org/showwiki.php?title=Island:12047
-[GH_ps2]:       http://geekhack.org/showwiki.php?title=Island:14618
-[GH_adb]:       http://geekhack.org/showwiki.php?title=Island:14290
-[GH_hhkb_bt]:   http://geekhack.org/showwiki.php?title=Island:20851
-[GH_m0110]:     http://geekhack.org/showwiki.php?title=Island:24965
-[GH_news]:      http://geekhack.org/showwiki.php?title=Island:25759
-[GH_terminal]:  http://geekhack.org/showwiki.php?title=Island:27272
-[GH_x68k]:      http://geekhack.org/showwiki.php?title=Island:29060
-[GH_hbkb]:      http://geekhack.org/showwiki.php?title=Island:29483
-[GH_ibm4704]:   http://geekhack.org/index.php?topic=54706.0
-[HID_liber]:    http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
-[Phantom]:      http://geekhack.org/index.php?topic=26742
-[GH60]:         http://geekhack.org/index.php?topic=34959
-[GH60_proto]:   http://geekhack.org/index.php?topic=37570.0
-[PC98]:         http://en.wikipedia.org/wiki/NEC_PC-9801
-[Sun]:          http://en.wikipedia.org/wiki/Sun-3
-[IIGS]:         http://en.wikipedia.org/wiki/Apple_IIGS
-[Infinity]:     https://www.massdrop.com/buy/infinity-keyboard-kit
-[ghost_squid]:  http://deskthority.net/wiki/Costar_replacement_controllers#The_Ghost_Squid
-[cmxt]:         http://gaming.coolermaster.com/en/products/keyboards/quickfirext/
-[ergodox_org]:  http://ergodox.org/
-[cub-uanic]:    https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
-[mcdox]:        https://github.com/DavidMcEwan/mcdox
-[mcdox_tmk]:    https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox
-[Planck]:       http://olkb.co/planck
-[Preonic]:      http://olkb.co/preonic
-[Atomic]:       http://olkb.co/atomic
-[Ergodox_EZ]:   https://www.indiegogo.com/projects/ergodox-ez-an-incredible-mechanical-keyboard
-
-
-License
--------
-**GPLv2** or later. Some protocol files are under **Modified BSD License**.
-
-Third party libraries like LUFA, PJRC and V-USB have their own license respectively.
-
-
-
-Build Firmware and Program Controller
--------------------------------------
-See [doc/build.md](tmk_core/doc/build.md), or the README in the particular keyboard/* folder.
-
-
-
-Change your keymap
-------------------
-See [doc/keymap.md](tmk_core/doc/keymap.md).
-
-
-
-Magic Commands
---------------
-To see help press `Magic` + `H`.
-
-`Magic` key combination is `LShift` + `RShift` in many project, but `Power` key on ADB converter. 
-`Magic` keybind can be vary on each project, check `config.h` in project directory.
-
-Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed.
-
-    ----- Command Help -----
-    c:      enter console mode
-    d:      toggle debug enable
-    x:      toggle matrix debug
-    k:      toggle keyboard debug
-    m:      toggle mouse debug
-    v:      print device version & info
-    t:      print timer count
-    s:      print status
-    e:	    print eeprom config
-    n:	    toggle NKRO
-    0/F10:  switch to Layer0
-    1/F1:   switch to Layer1
-    2/F2:   switch to Layer2
-    3/F3:   switch to Layer3
-    4/F4:   switch to Layer4
-    PScr:   power down/remote wake-up
-    Caps:   Lock Keyboard(Child Proof)
-    Paus:   jump to bootloader
-
-
-
-Boot Magic Configuration - Virtual DIP Switch
----------------------------------------------
-Boot Magic are executed during boot up time. Press Magic key below then plug in keyboard cable.
-Note that you must use keys of **Layer 0** as Magic keys. These settings are stored in EEPROM so that retain your configure over power cycles.
-
-To avoid configuring accidentally additive salt key `KC_SPACE` also needs to be pressed along with the following configuration keys. The salt key is configurable in `config.h`. See [tmk_core/common/bootmagic.h](tmk_core/common/bootmagic.h).
-
-#### General
-- Skip reading EEPROM to start with default configuration(`ESC`)
-- Clear configuration stored in EEPROM to reset configuration(`Backspace`)
-
-#### Bootloader
-- Kick up Bootloader(`B`)
-
-#### Debug
-- Debug enable(`D`)
-- Debug matrix enable(`D`+`X`)
-- Debug keyboard enable(`D`+`K`)
-- Debug mouse enable(`D`+`M`)
-
-#### Keymap
-- Swap Control and CapsLock(`Left Control`)
-- Change CapsLock to Control(`Caps Lock`)
-- Swap LeftAlt and Gui(`Left Alt`)
-- Swap RightAlt and Gui(`Right Alt`)
-- Disable Gui(`Left Gui`)
-- Swap Grave and Escape(`Grave`)
-- Swap BackSlash and BackSpace(`Back Slash`)
-- Enable NKRO on boot(`N`)
-
-#### Default Layer
-- Set Default Layer to 0(`0`)
-- Set Default Layer to 1(`1`)
-- Set Default Layer to 2(`2`)
-- Set Default Layer to 3(`3`)
-- Set Default Layer to 4(`4`)
-- Set Default Layer to 5(`5`)
-- Set Default Layer to 6(`6`)
-- Set Default Layer to 7(`7`)
-
-
-
-Mechanical Locking support
---------------------------
-This feature makes it possible for you to use mechanical locking switch for `CapsLock`, `NumLock` 
-or `ScrollLock`. To enable this feature define these macros in `config.h` and use `KC_LCAP`, `KC_LN
-UM` or `KC_LSCR` in keymap for locking key instead of normal `KC_CAPS`, `KC_NLCK` or `KC_SLCK`. Res
-ync option tries to keep switch state consistent with keyboard LED state.
- 
-    #define LOCKING_SUPPORT_ENABLE
-    #define LOCKING_RESYNC_ENABLE
-
-
-
-Start Your Own Project
------------------------
-**TBD**
-
-
-
-Debugging
---------
-Use PJRC's `hid_listen` to see debug messages. You can use the tool for debug even if firmware use LUFA stack.
-
-You can use xprintf() to display debug info on `hid_listen`, see `tmk_core/common/xprintf.h`.
-
-
-
-Files and Directories
--------------------
-### Top
-* tmk_core/     - core library
-* keyboard/     - keyboard projects
-* converter/    - protocol converter projects
-* doc/          - documents
-
-
-
-Coding Style
--------------
-- Doesn't use Tab to indent, use 4-spaces instead.
-
-
-
-Other Keyboard Firmware Projects
-------------------
-You can learn a lot about keyboard firmware from these. See [doc/other_projects.md](tmk_core/doc/other_projects.md).

+ 0 - 26
VAGRANT_GUIDE.md

@@ -1,26 +0,0 @@
-# Quick Start Directions
-
-This project includes a Vagrantfile that will allow you to build a new firmware for your keyboard very easily without major changes to your primary operating system. This also ensures that when you clone the project and perform a build, you have the exact same environment as anyone else using the Vagrantfile to build. This makes it much easier for people to help you troubleshoot any issues you encounter.
-
-## Requirements
-
-Using the Vagrantfile in this repository requires you have [Vagrant](http://www.vagrantup.com/) as well as [VirtualBox](https://www.virtualbox.org/) (or [VMware Workstation](https://www.vmware.com/products/workstation) and [Vagrant VMware plugin](http://www.vagrantup.com/vmware) but the (paid) VMware plugin requires a licensed copy of VMware Workstation/Fusion).
-
-*COMPATIBILITY NOTICE* Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12.
-
-Other than having Vagrant and Virtualbox installed and possibly a restart of your computer afterwards, you can simple run a 'vagrant up' anywhere inside the folder where you checked out this project and it will start a Linux virtual machine that contains all the tools required to build this project. There is a post Vagrant startup hint that will get you off on the right foot, otherwise you can also reference the build documentation below.
-
-Build Firmware and Program Controller
--------------------------------------
-See [doc/build.md](tmk_core/doc/build.md), or the README in the particular keyboard/* folder.
-
-Change your keymap
-------------------
-See [doc/keymap.md](tmk_core/doc/keymap.md).
-
-## Flashing the firmware
-
-The "easy" way to flash the firmware is using a tool from your host OS like the Teensy programming app. [ErgoDox EZ](keyboard/ergodox_ez/readme.md) gives a great example.
-
-If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version.
-	

+ 98 - 88
Vagrantfile

@@ -1,88 +1,98 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-Vagrant.configure(2) do |config|
-  # You can only have one config.vm.box uncommented at a time
-
-  # Comment this and uncomment another if you don't want to use the minimal Arch box
-  config.vm.box = "dragon788/arch-ala-elasticdog"
-
-  # VMware/Virtualbox 64 bit
-  # config.vm.box = "phusion/ubuntu-14.04-amd64"
-  #
-  # VMware/Virtualbox 64 bit
-  #config.vm.box = "puphpet/centos65-x64"
-  #
-  # The opensuse boxes don't have dfu-util in their default repositories
-  #
-  # The virtualbox version has tools issues
-  # VMware/Virtualbox 64 bit
-  #config.vm.box = "bento/opensuse-13.2-x86_64"
-  #
-  # Virtualbox only
-  #config.vm.box = "bento/opensuse-13.2-i386"
-  # config.vm.box = ""
-  # config.vm.box = ""
-
-  # This section allows you to customize the Virtualbox VM
-  # settings, ie showing the GUI or upping the memory
-  # or cores if desired
-  config.vm.provider "virtualbox" do |vb|
-    # Hide the VirtualBox GUI when booting the machine
-    vb.gui = false
-    # Uncomment the below lines if you want to program
-    # your Teensy via the VM rather than your host OS
-    #vb.customize ['modifyvm', :id, '--usb', 'on']
-    #vb.customize ['usbfilter', 'add', '0',
-    #    	  '--target', :id,
-    #    	  '--name', 'teensy',
-    #    	  '--vendorid', '0x16c0',
-    #    	  '--productid','0x0478'
-    #		 ] 
-    # Customize the amount of memory on the VM:
-    vb.memory = "512"
-  end
-
-  # This section allows you to customize the VMware VM
-  # settings, ie showing the GUI or upping the memory
-  # or cores if desired
-  config.vm.provider "vmware_workstation" do |vmw|
-    # Hide the VMware GUI when booting the machine
-    vmw.gui = false 
- 
-    # Customize the amount of memory on the VM:
-    vmw.memory = "512"
-  end
-
-  config.vm.provider "vmware_fusion" do |vmf|
-    # Hide the vmfare GUI when booting the machine
-    vmf.gui = false
- 
-    # Customize the amount of memory on the VM:
-    vmf.memory = "512"
-  end
-  
-  # This script ensures the required packages for AVR programming are installed
-  # It also ensures the system always gets the latest updates when powered on
-  # If this causes issues you can run a 'vagrant destroy' and then
-  # add a # before ,args: and run 'vagrant up' to get a working
-  # non-updated box and then attempt to troubleshoot or open a Github issue 
-  
-  config.vm.provision "shell", run: "always", path: "avr_setup.sh", args: "-update"
-
-  config.vm.post_up_message = """
-  Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win)
-  or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool
-
-  Change directory (cd) to the keyboard you wish to program 
-  (Optionally) modify your layout, 
-  then run 'make clean' 
-  and then 'make' to compile the .eep and .hex files.
-
-  Or you can copy and paste the example line below. 
- 
-  cd /vagrant; cd keyboard; cd ergodox_ez; make clean; make
-  
-
-  """
-end
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant.configure(2) do |config|
+  # You can only have one config.vm.box uncommented at a time
+
+  # Comment this and uncomment another if you don't want to use the minimal Arch box
+  #config.vm.box = "dragon788/arch-ala-elasticdog"
+
+  # VMware/Virtualbox 64 bit
+  config.vm.box = "phusion/ubuntu-14.04-amd64"
+  #
+  # VMware/Virtualbox 64 bit
+  #config.vm.box = "puphpet/centos65-x64"
+  #
+  # The opensuse boxes don't have dfu-util in their default repositories
+  #
+  # The virtualbox version has tools issues
+  # VMware/Virtualbox 64 bit
+  #config.vm.box = "bento/opensuse-13.2-x86_64"
+  #
+  # Virtualbox only
+  #config.vm.box = "bento/opensuse-13.2-i386"
+  # config.vm.box = ""
+  # config.vm.box = ""
+
+  # This section allows you to customize the Virtualbox VM
+  # settings, ie showing the GUI or upping the memory
+  # or cores if desired
+  config.vm.provider "virtualbox" do |vb|
+    # Hide the VirtualBox GUI when booting the machine
+    vb.gui = false
+    # Uncomment the below lines if you want to program
+    # your Teensy via the VM rather than your host OS
+    #vb.customize ['modifyvm', :id, '--usb', 'on']
+    #vb.customize ['usbfilter', 'add', '0',
+    #    	  '--target', :id,
+    #    	  '--name', 'teensy',
+    #    	  '--vendorid', '0x16c0',
+    #    	  '--productid','0x0478'
+    #		 ]
+    # Customize the amount of memory on the VM:
+    vb.memory = "512"
+  end
+
+  # This section allows you to customize the VMware VM
+  # settings, ie showing the GUI or upping the memory
+  # or cores if desired
+  config.vm.provider "vmware_workstation" do |vmw|
+    # Hide the VMware GUI when booting the machine
+    vmw.gui = false
+
+    # Customize the amount of memory on the VM:
+    vmw.memory = "512"
+  end
+
+  config.vm.provider "vmware_fusion" do |vmf|
+    # Hide the vmfare GUI when booting the machine
+    vmf.gui = false
+
+    # Customize the amount of memory on the VM:
+    vmf.memory = "512"
+  end
+
+  # Docker provider pulls from hub.docker.com respecting docker.image if
+  # config.vm.box is nil. Note that this bind-mounts from the current dir to
+  # /vagrant in the guest, so unless your UID is 1000 to match vagrant in the
+  # image, you'll need to: chmod -R a+rw .
+  config.vm.provider "docker" do |docker, override|
+    override.vm.box = nil
+    docker.image = "jesselang/debian-vagrant:jessie"
+    docker.has_ssh = true
+  end
+
+  # This script ensures the required packages for AVR programming are installed
+  # It also ensures the system always gets the latest updates when powered on
+  # If this causes issues you can run a 'vagrant destroy' and then
+  # add a # before ,args: and run 'vagrant up' to get a working
+  # non-updated box and then attempt to troubleshoot or open a Github issue
+
+  config.vm.provision "shell", run: "always", path: "./util/install_dependencies.sh", args: "-update"
+
+  config.vm.post_up_message = <<-EOT
+  Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win)
+  or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool
+
+  Change directory (cd) to the keyboard you wish to program
+  (Optionally) modify your layout,
+  then run 'make clean'
+  and then 'make' to compile the .eep and .hex files.
+
+  Or you can copy and paste the example line below.
+
+  cd /vagrant; cd keyboards; cd ergodox; make clean; make
+
+
+  EOT
+end

+ 0 - 72
avr_setup.sh

@@ -1,72 +0,0 @@
-#!/usr/bin/env bash
-# This script will attempt to setup the Linux dependencies for compiling QMK/TMK
-
-# This could probably go much lower, but since we are including an Arch vagrant,
-# making it the first match makes sense
-
-if [[ -n "$(type -P pacman )" ]]; then
-  # Arch linux and derivatives like Apricity
-  # Future improvements:
-  # Allow user to speed up package installs using powerpill/wget tweaks
-  # Always run the pacman mirror update script if possible when vagrant comes up
-  # This will ensure that users never get stalled on a horribly slow mirror
-  pacman -Syyu --needed --noconfirm
-  pacman -S --needed --noconfirm \
-    base-devel \
-    avr-gcc \
-    avr-binutils \
-    avr-libc \
-    dfu-util
-
-elif [[ -n "$(type -P apt-get)" ]]; then
-  # Debian and derivatives
-  # This block performs completely non-interactive updates {{
-  export DEBIAN_FRONTEND=noninteractive
-  export DEBCONF_NONINTERACTIVE_SEEN=true
-  echo "grub-pc hold" | dpkg --set-selections
-  apt-get -y update
-  apt-get -y --allow-unauthenticated upgrade \
-	  -o Dpkg::Options::="--force-confdef" \
-	  -o Dpkg::Options::="--force-confold"
-  # }}
-  apt-get install -y \
-    build-essential \
-    gcc \
-    unzip \
-    wget \
-    zip \
-    gcc-avr \
-    binutils-avr \
-    avr-libc \
-    dfu-util
-  
-elif [[ -n "$(type -P yum)" ]]; then
-  # Fedora, CentOS or RHEL and derivatives
-  yum -y makecache && yum -y update
-  yum -y install \
-    gcc \
-    glibc-headers \
-    kernel-devel \
-    kernel-headers \
-    make \
-    perl \
-    git \
-    wget \
-    avr-binutils \
-    avr-gcc \
-    avr-libc \
-    dfu-util
-
-elif [[ -n "$(type -P zypper)" ]]; then
-  # openSUSE
-  zypper --non-interactive refresh  && zypper --non-interactive update
-  zypper --non-interactive install \
-    git \
-    make \
-    gcc \
-    kernel-devel \
-    patch \
-    wget \
-    dfu-programmer
-
-fi

+ 226 - 0
build_keyboard.mk

@@ -0,0 +1,226 @@
+ifndef VERBOSE
+.SILENT:
+endif
+
+.DEFAULT_GOAL := all
+
+include common.mk
+
+ifneq ($(SUBPROJECT),)
+	TARGET ?= $(KEYBOARD)_$(SUBPROJECT)_$(KEYMAP)
+	KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)_$(SUBPROJECT)
+else
+	TARGET ?= $(KEYBOARD)_$(KEYMAP)
+	KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD)
+endif
+
+# Force expansion
+TARGET := $(TARGET)
+
+
+MASTER ?= left
+ifdef master
+	MASTER = $(master)
+endif
+
+ifeq ($(MASTER),right)	
+	OPT_DEFS += -DMASTER_IS_ON_RIGHT
+else 
+	ifneq ($(MASTER),left)
+$(error MASTER does not have a valid value(left/right))
+	endif
+endif
+
+
+
+KEYBOARD_PATH := keyboards/$(KEYBOARD)
+KEYBOARD_C := $(KEYBOARD_PATH)/$(KEYBOARD).c
+
+ifneq ("$(wildcard $(KEYBOARD_C))","")
+    include $(KEYBOARD_PATH)/rules.mk
+else 
+    $(error "$(KEYBOARD_C)" does not exist)
+endif
+
+
+ifneq ($(SUBPROJECT),)
+    SUBPROJECT_PATH := keyboards/$(KEYBOARD)/$(SUBPROJECT)
+    SUBPROJECT_C := $(SUBPROJECT_PATH)/$(SUBPROJECT).c
+    ifneq ("$(wildcard $(SUBPROJECT_C))","")
+        OPT_DEFS += -DSUBPROJECT_$(SUBPROJECT)
+        include $(SUBPROJECT_PATH)/rules.mk
+    else 
+        $(error "$(SUBPROJECT_PATH)/$(SUBPROJECT).c" does not exist)
+    endif
+endif
+
+# We can assume a ChibiOS target When MCU_FAMILY is defined, since it's not used for LUFA
+ifdef MCU_FAMILY
+	PLATFORM=CHIBIOS
+else
+	PLATFORM=AVR
+endif
+
+ifeq ($(PLATFORM),CHIBIOS)
+	include $(TMK_PATH)/protocol/chibios.mk
+	include $(TMK_PATH)/chibios.mk
+	OPT_OS = chibios
+	ifneq ("$(wildcard $(SUBPROJECT_PATH)/bootloader_defs.h)","")
+		OPT_DEFS += -include $(SUBPROJECT_PATH)/bootloader_defs.h
+	else ifneq ("$(wildcard $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
+		OPT_DEFS += -include $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h
+	else ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","")
+		OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h
+	else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","")
+		OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h
+	endif
+endif
+
+CONFIG_H = $(KEYBOARD_PATH)/config.h
+ifneq ($(SUBPROJECT),)
+	ifneq ("$(wildcard $(SUBPROJECT_C))","")
+		CONFIG_H = $(SUBPROJECT_PATH)/config.h
+	endif
+endif
+
+# Save the defines and includes here, so we don't include any keymap specific ones 
+PROJECT_DEFS := $(OPT_DEFS)
+PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(SUBPROJECT_PATH) $(KEYBOARD_PATH)
+PROJECT_CONFIG := $(CONFIG_H)
+
+MAIN_KEYMAP_PATH := $(KEYBOARD_PATH)/keymaps/$(KEYMAP)
+MAIN_KEYMAP_C := $(MAIN_KEYMAP_PATH)/keymap.c
+SUBPROJ_KEYMAP_PATH := $(SUBPROJECT_PATH)/keymaps/$(KEYMAP)
+SUBPROJ_KEYMAP_C := $(SUBPROJ_KEYMAP_PATH)/keymap.c
+ifneq ("$(wildcard $(SUBPROJ_KEYMAP_C))","")
+    -include $(SUBPROJ_KEYMAP_PATH)/Makefile
+    KEYMAP_C := $(SUBPROJ_KEYMAP_C)
+    KEYMAP_PATH := $(SUBPROJ_KEYMAP_PATH)
+else ifneq ("$(wildcard $(MAIN_KEYMAP_C))","")
+    -include $(MAIN_KEYMAP_PATH)/Makefile
+    KEYMAP_C := $(MAIN_KEYMAP_C)
+    KEYMAP_PATH := $(MAIN_KEYMAP_PATH)
+else
+    $(error "$(MAIN_KEYMAP_C)/keymap.c" does not exist)
+endif
+
+
+# Object files directory
+#     To put object files in current directory, use a dot (.), do NOT make
+#     this an empty or blank macro!
+KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
+
+
+ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
+	CONFIG_H = $(KEYMAP_PATH)/config.h
+endif
+
+# # project specific files
+SRC += $(KEYBOARD_C) \
+	$(KEYMAP_C) \
+	$(QUANTUM_DIR)/quantum.c \
+	$(QUANTUM_DIR)/keymap_common.c \
+	$(QUANTUM_DIR)/keycode_config.c \
+	$(QUANTUM_DIR)/process_keycode/process_leader.c
+
+ifneq ($(SUBPROJECT),)
+	SRC += $(SUBPROJECT_C)
+endif
+
+ifndef CUSTOM_MATRIX
+	SRC += $(QUANTUM_DIR)/matrix.c
+endif
+
+ifeq ($(strip $(MIDI_ENABLE)), yes)
+    OPT_DEFS += -DMIDI_ENABLE
+	SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
+endif
+
+ifeq ($(strip $(VIRTSER_ENABLE)), yes)
+    OPT_DEFS += -DVIRTSER_ENABLE
+endif
+
+ifeq ($(strip $(AUDIO_ENABLE)), yes)
+    OPT_DEFS += -DAUDIO_ENABLE
+	SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
+	SRC += $(QUANTUM_DIR)/audio/audio.c
+	SRC += $(QUANTUM_DIR)/audio/voices.c
+	SRC += $(QUANTUM_DIR)/audio/luts.c
+endif
+
+ifeq ($(strip $(UCIS_ENABLE)), yes)
+	OPT_DEFS += -DUCIS_ENABLE
+	UNICODE_ENABLE = yes
+endif
+
+ifeq ($(strip $(UNICODE_ENABLE)), yes)
+    OPT_DEFS += -DUNICODE_ENABLE
+	SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
+endif
+
+ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
+	OPT_DEFS += -DRGBLIGHT_ENABLE
+	SRC += $(QUANTUM_DIR)/light_ws2812.c
+	SRC += $(QUANTUM_DIR)/rgblight.c
+endif
+
+ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
+	OPT_DEFS += -DTAP_DANCE_ENABLE
+	SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
+endif
+
+ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
+	SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
+	OPT_DEFS += $(SERIAL_DEFS)
+	VAPTH += $(SERIAL_PATH)
+endif
+
+# Optimize size but this may cause error "relocation truncated to fit"
+#EXTRALDFLAGS = -Wl,--relax
+
+# Search Path
+VPATH += $(KEYMAP_PATH)
+ifneq ($(SUBPROJECT),)
+	VPATH += $(SUBPROJECT_PATH)
+endif
+VPATH += $(KEYBOARD_PATH)
+VPATH += $(COMMON_VPATH)
+
+
+include $(TMK_PATH)/common.mk
+SRC += $(TMK_COMMON_SRC)
+OPT_DEFS += $(TMK_COMMON_DEFS)
+EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
+
+ifeq ($(PLATFORM),AVR)
+	include $(TMK_PATH)/protocol/lufa.mk
+	include $(TMK_PATH)/avr.mk
+endif
+
+ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
+	VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
+	VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
+	include $(VISUALIZER_PATH)/visualizer.mk
+endif
+
+OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
+$(KEYMAP_OUTPUT)_SRC := $(SRC)
+$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) -DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\" 
+$(KEYMAP_OUTPUT)_INC :=  $(VPATH) $(EXTRAINCDIRS)
+$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
+$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC)
+$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
+$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
+$(KEYBOARD_OUTPUT)_CONFIG  := $(PROJECT_CONFIG)
+
+# Default target.
+all: build sizeafter
+
+# Change the build target to build a HEX file or a library.
+build: elf hex
+#build: elf hex eep lss sym
+#build: lib
+
+
+include $(TMK_PATH)/rules.mk
+

+ 57 - 0
build_test.mk

@@ -0,0 +1,57 @@
+ifndef VERBOSE
+.SILENT:
+endif
+
+.DEFAULT_GOAL := all
+
+include common.mk
+
+TARGET=test/$(TEST)
+
+GTEST_OUTPUT = $(BUILD_DIR)/gtest
+
+TEST_OBJ = $(BUILD_DIR)/test_obj
+
+OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
+
+GTEST_INC := \
+	$(LIB_PATH)/googletest/googletest/include\
+	$(LIB_PATH)/googletest/googlemock/include\
+	
+GTEST_INTERNAL_INC :=\
+	$(LIB_PATH)/googletest/googletest\
+	$(LIB_PATH)/googletest/googlemock
+
+$(GTEST_OUTPUT)_SRC :=\
+	googletest/src/gtest-all.cc\
+	googletest/src/gtest_main.cc\
+	googlemock/src/gmock-all.cc
+
+$(GTEST_OUTPUT)_DEFS := 
+$(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
+
+LDFLAGS += -lstdc++ -lpthread -shared-libgcc
+CREATE_MAP := no
+
+VPATH +=\
+	$(LIB_PATH)/googletest\
+	$(LIB_PATH)/googlemock
+
+all: elf
+
+VPATH += $(COMMON_VPATH)
+
+include $(TMK_PATH)/common.mk
+include $(QUANTUM_PATH)/serial_link/tests/rules.mk
+
+$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
+$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
+$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
+
+include $(TMK_PATH)/native.mk
+include $(TMK_PATH)/rules.mk
+
+
+$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
+$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
+

+ 26 - 0
common.mk

@@ -0,0 +1,26 @@
+include message.mk
+
+# Directory common source files exist
+TOP_DIR = .
+TMK_DIR = tmk_core
+TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
+LIB_PATH = $(TOP_DIR)/lib
+
+QUANTUM_DIR = quantum
+QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
+
+BUILD_DIR := $(TOP_DIR)/.build
+
+SERIAL_DIR := $(QUANTUM_DIR)/serial_link
+SERIAL_PATH := $(QUANTUM_PATH)/serial_link
+SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
+SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
+SERIAL_DEFS += -DSERIAL_LINK_ENABLE
+
+COMMON_VPATH := $(TOP_DIR)
+COMMON_VPATH += $(TMK_PATH)
+COMMON_VPATH += $(QUANTUM_PATH)
+COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
+COMMON_VPATH += $(QUANTUM_PATH)/audio
+COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
+COMMON_VPATH += $(SERIAL_PATH)

+ 0 - 141
converter/adb_usb/Makefile

@@ -1,141 +0,0 @@
-#----------------------------------------------------------------------------
-# 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
-#MCU = at90usb1287
-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
-#   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

+ 0 - 73
converter/adb_usb/Makefile.pjrc

@@ -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

+ 0 - 103
converter/adb_usb/README.md

@@ -1,103 +0,0 @@
-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.
-
-Discuss: http://geekhack.org/showwiki.php?title=Island:14290
-
-
-
-README FIRST
-------------
-https://github.com/tmk/tmk_keyboard
-https://github.com/tmk/tmk_keyboard/tree/master/converter/adb_usb
-
-Also check these when you are in trouble.
-
-https://github.com/tmk/tmk_keyboard/wiki
-https://github.com/tmk/tmk_keyboard/labels/NOTE
-
-
-Wiring
-------
-Connect ADB pins to controller just by 3 lines(Vcc, GND, Data). By default Data line uses port PD0.
-
-ADB female socket from the front:
-
-      ,--_--.
-     / o4 3o \      1: DATA
-    | o2   1o |     2: Power SW
-     -  ===  -      3: VCC
-      `-___-'       4: GND
-
-This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable. The external pull-up resistor(1K-10K Ohm) on Data is strongly recommended.(It is almost must!)
-https://github.com/tmk/tmk_keyboard/wiki/FAQ#pull-up-resistor
-
-Pull-up resister:
-
-    Keyboard       Conveter
-                   ,------.
-    5V------+------|VCC   |
-            |      |      |
-           [R]     |      |
-            |      |      |
-    Signal--+------|PD0   |
-                   |      |
-    GND------------|GND   |
-                   `------'
-    R: 1K Ohm resistor
-
-
-Define following macros for ADB connection in config.h if you use other than port PD0.
-
-    ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT
-
-
-Build
------
-See doc/build.md. In short,
-
-    $ make clean
-    $ make
-
-You can select keymap(ansi is default) like this:
-
-    $ make KEYMAP=[ansi|iso|hasu]
-
-
-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.
-
-
-Magic command
--------------
-To get help press `h` holding Magic key. Magic key is `Power key`.
-
-
-Locking CapsLock
-----------------
-Many of old ADB keyboards have mechanical push-lock switch for Capslock key and this converter supports the locking Capslock key by default. See README in top directory for more detail about this feature.
-https://github.com/tmk/tmk_keyboard/blob/master/README.md#mechanical-locking-support
-
-Also you may want to remove locking pin from the push-lock switch to use capslock as a normal momentary switch.
-
-
-Notes
------
-Not-extended ADB keyboards have no discrimination between right modifier and left one,
-you will always see left control even if you press right control key.
-Apple Extended Keyboard and Apple Extended Keyboard II can discriminate both side
-modifiers except for GUI key(Windows/Command).
-
-And most ADB keyboard has no diodes in its matrix so they are not NKRO,
-though ADB protocol itself supports it. See protocol/adb.c for more info.
-
-If keyboard has ISO layout you need to use ISO keymap with `make KEYMAP=iso`. With ANSI
-keymap you will suffer from swapped keys problem.
-
-https://github.com/tmk/tmk_keyboard/issues/35
-
-EOF

+ 0 - 63
converter/adb_usb/config.h

@@ -1,63 +0,0 @@
-/*
-Copyright 2011 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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x0ADB
-#define DEVICE_VER      0x0101
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         ADB keyboard converter
-#define DESCRIPTION     convert ADB keyboard to USB
-
-/* matrix size */
-#define MATRIX_ROWS 16  // keycode bit: 3-0
-#define MATRIX_COLS 8   // keycode bit: 6-4
-
-#define MATRIX_ROW(code)    ((code)>>3&0x0F)
-#define MATRIX_COL(code)    ((code)&0x07)
-
-
-/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
-#define LOCKING_SUPPORT_ENABLE
-/* Locking resynchronize hack */
-#define LOCKING_RESYNC_ENABLE
-
-
-/* legacy keymap support */
-#define USE_LEGACY_KEYMAP
-
-
-/* ADB port setting */
-#define ADB_PORT        PORTD
-#define ADB_PIN         PIND
-#define ADB_DDR         DDRD
-#define ADB_DATA_BIT    0
-//#define ADB_PSW_BIT     1       // optional
-
-/* key combination for command */
-#ifndef __ASSEMBLER__
-#include "adb.h"
-#include "matrix.h"
-#define IS_COMMAND() ( \
-    matrix_is_on(MATRIX_ROW(ADB_POWER), MATRIX_COL(ADB_POWER)) \
-)
-#endif
-
-#endif

+ 0 - 16
converter/adb_usb/keymap_ansi.c

@@ -1,16 +0,0 @@
-#include "keymap_common.h"
-
-
-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,
-    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,
-    LCTL,LALT,LGUI,          SPC,                               RALT,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
-    ),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-};

+ 0 - 30
converter/adb_usb/keymap_common.c

@@ -1,30 +0,0 @@
-/*
-Copyright 2011,2012,2013 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"
-
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
-}

+ 0 - 212
converter/adb_usb/keymap_common.h

@@ -1,212 +0,0 @@
-/*
-Copyright 2011,2012,2013 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/>.
-*/
-#ifndef KEYMAP_COMMON_H
-#define KEYMAP_COMMON_H
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/pgmspace.h>
-#include "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "report.h"
-#include "print.h"
-#include "debug.h"
-#include "keymap.h"
-
-
-extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
-extern const uint16_t fn_actions[];
-
-
-/* M0115 Apple Extended Keyboard ANSI
- * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
- * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |Pwr|
- * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
- * ,-----------------------------------------------------------. ,-----------. ,---------------.
- * |  `|  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 |Opt |Cmd |         Space           |     |Opt |Ctrl  | |Lef|Dow|Rig| |      0|  .|   |
- * `-----------------------------------------------------------' `-----------' `---------------'
- */
-#define KEYMAP_EXT_ANSI( \
-    K35,  K7A,K78,K63,K76, K60,K61,K62,K64, K65,K6D,K67,K6F, K69,K6B,K71,              K7F, \
-    K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74,  K47,K51,K4B,K43, \
-    K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A, K75,K77,K79,  K59,K5B,K5C,K4E, \
-    K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,    K24,               K56,K57,K58,K45, \
-    K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,        K7B,     K3E,      K53,K54,K55,     \
-    K36,K3A,K37,        K31,                        K7C,K7D, K3B,K3D,K3C,  K52,    K41,K4C  \
-) { \
-    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
-    { KC_##K08, KC_##K09, KC_NUBS,  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_##K1F }, \
-    { 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_PENT,  KC_##K35, KC_##K36, KC_##K37 }, \
-    { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO    }, \
-    { KC_F17,   KC_##K41, KC_NO,    KC_##K43, KC_F18,   KC_##K45, KC_NO,    KC_##K47 }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_##K4B, KC_##K4C, KC_NO,    KC_##K4E, KC_F18   }, \
-    { KC_F19,   KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
-    { KC_##K58, KC_##K59, KC_F20,   KC_##K5B, KC_##K5C, KC_INT3,  KC_INT1,  KC_PCMM  }, \
-    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_LANG2, KC_##K67 }, \
-    { KC_LANG1, KC_##K69, KC_F16,   KC_##K6B, KC_NO,    KC_##K6D, KC_APP,   KC_##K6F }, \
-    { KC_NO,    KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
-    { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_NO,    KC_##K7F }  \
-}
-
-/* M0115 Apple Extended Keyboard ISO
- * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
- * |Esc|   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |Pwr|
- * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
- * ,-----------------------------------------------------------. ,-----------. ,---------------.
- * |  `|  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|  [|  ]|Retur| |Del|End|PgD| |  7|  8|  9|  -|
- * |------------------------------------------------------`    | `-----------' |---------------|
- * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  #|    |               |  4|  5|  6|  +|
- * |-----------------------------------------------------------|     ,---.     |---------------|
- * |Shif|  \|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|Shift     |     |Up |     |  1|  2|  3|   |
- * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
- * |Ctrl |Opt |Cmd |         Space           |     |Opt |Ctrl  | |Lef|Dow|Rig| |      0|  .|   |
- * `-----------------------------------------------------------' `-----------' `---------------'
- */
-#define KEYMAP_EXT_ISO( \
-    K35,  K7A,K78,K63,K76, K60,K61,K62,K64, K65,K6D,K67,K6F, K69,K6B,K71,              K7F, \
-    K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74,  K47,K51,K4B,K43, \
-    K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K24, K75,K77,K79,  K59,K5B,K5C,K4E, \
-    K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,K2A,                   K56,K57,K58,K45, \
-    K38,K0A,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,    K7B,     K3E,      K53,K54,K55,     \
-    K36,K3A,K37,        K31,                        K7C,K7D, K3B,K3D,K3C,  K52,    K41,K4C  \
-) { \
-    { 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_##K1F }, \
-    { 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_PENT,  KC_##K35, KC_##K36, KC_##K37 }, \
-    { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO    }, \
-    { KC_F17,   KC_##K41, KC_NO,    KC_##K43, KC_F18,   KC_##K45, KC_NO,    KC_##K47 }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_##K4B, KC_##K4C, KC_NO,    KC_##K4E, KC_F18   }, \
-    { KC_F19,   KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
-    { KC_##K58, KC_##K59, KC_F20,   KC_##K5B, KC_##K5C, KC_INT3,  KC_INT1,  KC_PCMM  }, \
-    { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_LANG2, KC_##K67 }, \
-    { KC_LANG1, KC_##K69, KC_F16,   KC_##K6B, KC_NO,    KC_##K6D, KC_APP,   KC_##K6F }, \
-    { KC_NO,    KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
-    { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_NO,    KC_##K7F }  \
-}
-
-
-
-
-/* M0116 Apple Standard Keyboard ANSI
-*                     +-------+
-*                     | power |
-*                     +-------+
-* +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
-* |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
-* +---------------------------------------------------------+ +---+---+---+---+
-* | 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 | - |
-* +---------------------------------------------------------+ +---+---+---+---+
-* | shift  | z | x | c | v | b | n | m | , | . | / |  shift | | 1 | 2 | 3 |   |
-* +---------------------------------------------------------+ +-------+---|ent|
-* |cap|opt|comnd| ` |                   | \ |lef|rig|dwn|up | |   0   | . |   |
-* +---------------------------------------------------------+ +-------+---+---+
-*/
-#define KEYMAP_M0116_ANSI( \
-                           K7F,                                              \
-   K35,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K51,K4B,K43, \
-   K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,     K59,K5B,K5C,K45, \
-   K36,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27,    K24, K56,K57,K58,K4E, \
-   K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C,        K7B, K53,K54,K55,     \
-   K39,K3A,K37,K32,        K31,        K2A,K3B,K3C,K3D,K3E, K52,    K41,K4C  \
-) { \
-  { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
-  { KC_##K08, KC_##K09, KC_NO,    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_##K1F }, \
-  { 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_NO,    KC_##K35, KC_##K36, KC_##K37 }, \
-  { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO    }, \
-  { KC_NO,    KC_##K41, KC_NO,    KC_##K43, KC_NO,    KC_##K45, KC_NO,    KC_##K47 }, \
-  { KC_NO,    KC_NO,    KC_NO,    KC_##K4B, KC_##K4C, KC_NO,    KC_##K4E, KC_NO    }, \
-  { KC_NO,    KC_##K51, 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_NO,    KC_NO   , KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-  { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-  { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-  { KC_NO   , KC_NO,    KC_NO   , KC_##K7B, KC_NO,    KC_NO,    KC_NO,    KC_##K7F }  \
-}
-
-#endif
-
-
-/*
-ADB ANSI/ISO Keymapping Note
-============================
-ANSI
-,-----------    ----------.
-| *a|  1|  2     =|Backspa|
-|-----------    ----------|
-|Tab  |  Q|     |  ]|   *c|
-|-----------    ----------|
-|CapsLo|  A|    '|Return  |
-|-----------    ----------|
-|Shift   |      Shift     |
-`-----------    ----------'
-
-ISO
-,-----------    ----------.
-| *a|  1|  2     =|Backspa|
-|-----------    ----------|
-|Tab  |  Q|     |  ]|Retur|
-|-----------    -----`    |
-|CapsLo|  A|    '| *c|    |
-|-----------    ----------|
-|Shif| *b|      Shift     |
-`-----------    ----------'
-
-ADB Keyboard scan code:
-        ADB scan code   USB usage
-        -------------   ---------
-Key     ANSI    ISO     ANSI    ISO
----------------------------------------------
-*a      0x32    0x0A    0x35    0x35
-*b      ----    0x32    ----    0x64
-*c      0x2A    0x2A    0x31    0x31(or 0x32)
-
-
-TMK ADB-USB mapping:
-ADB     USB(ANSI)   USB(ISO)
----------------------------------
-0x32    0x35        0x64
-0x0A    ----        0x35
-0x2A    0x31        0x31(or 0x32)
-
-Note that mappings of ADB code 0x32 are diffrent between ANSI and ISO keyboard.
-https://github.com/tmk/tmk_keyboard/issues/35
- */

+ 0 - 58
converter/adb_usb/keymap_hasu.c

@@ -1,58 +0,0 @@
-#include "keymap_common.h"
-
-
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* Default Layer: plain keymap
-     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
-     * |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|  -|  =|Backspa| |Ins|Hom|PgU| |NmL|  =|  /|  *|
-     * |-----------------------------------------------------------| |-----------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  Fn0| |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 |Ctrl | |Lef|Dow|Rig| |      0|  .|   |
-     * `-----------------------------------------------------------' `-----------' `---------------'
-     */
-    KEYMAP_EXT_ANSI(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO,
-    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,FN0,      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,
-    LCTL,LGUI,LALT,          SPC,                               RGUI,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
-    ),
-
-    /* Default Layer: plain keymap
-     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.             ,---.
-     * |`  |   |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|             |   |
-     * `---'   `---------------' `---------------' `---------------' `-----------'             `---'
-     * ,-----------------------------------------------------------. ,-----------. ,---------------.
-     * |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Delete | |Ins|Hom|PgU| |NmL|Mb1|Mb2|Mb3|
-     * |-----------------------------------------------------------| |-----------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|PrS|ScL|Pau|Up |Ins|  Fn0| |Del|End|PgD| |MwD|McU|MwU|MwD|
-     * |-----------------------------------------------------------| `-----------' |---------------|
-     * |CapsLo|VoD|VoU|Mut|  F|  G|  H|  J|Hom|PgU|Lef|Rig|Return  |               |McL|McD|McR|MwU|
-     * |-----------------------------------------------------------|     ,---.     |---------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|End|PgD|Dow|Shift     |     |PgU|     |MwL|McD|MwR|   |
-     * |-----------------------------------------------------------| ,-----------. |-----------|Mb3|
-     * |Ctrl |Gui |Alt |         Space             |Alt |Gui |Ctrl | |Hom|PgD|End| |    Mb1|Mb2|   |
-     * `-----------------------------------------------------------' `-----------' `---------------'
-     */
-    KEYMAP_EXT_ANSI(
-    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12,           PSCR,SLCK,BRK,                    NO, 
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,      INS, HOME,PGUP,    NLCK,BTN1,BTN2,BTN3,
-    TAB, Q,   W,   E,   R,   T,   Y,   U,   PSCR,SLCK,PAUS,UP,  INS, FN0,      DEL, END, PGDN,    WH_D,MS_U,WH_U,WH_D,
-    LCAP,VOLD,VOLU,MUTE,F,   G,   H,   J,   HOME,PGUP,LEFT,RGHT,     ENT,                         MS_L,MS_D,MS_R,WH_U,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   END, PGDN,DOWN,          RSFT,          PGUP,         WH_L,MS_D,WH_R,
-    LCTL,LGUI,LALT,          SPC,                               RGUI,RCTL,     HOME,PGDN,END,     BTN1,     BTN2,BTN3
-    ),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-    [0] = ACTION_LAYER_TAP_KEY(1, KC_BSLS),
-};

+ 0 - 16
converter/adb_usb/keymap_iso.c

@@ -1,16 +0,0 @@
-#include "keymap_common.h"
-
-
-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,
-    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,
-    LCTL,LALT,LGUI,          SPC,                               RALT,RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
-    ),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-};

+ 0 - 27
converter/adb_usb/led.c

@@ -1,27 +0,0 @@
-/*
-Copyright 2011 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 <util/delay.h>
-#include "adb.h"
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-    adb_host_kbd_led(~usb_led);
-}

+ 0 - 296
converter/adb_usb/matrix.c

@@ -1,296 +0,0 @@
-/*
-Copyright 2011 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/>.
-*/
-
-/*
- * scan matrix
- */
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#include "print.h"
-#include "util.h"
-#include "debug.h"
-#include "adb.h"
-#include "matrix.h"
-#include "report.h"
-#include "host.h"
-
-
-#if (MATRIX_COLS > 16)
-#   error "MATRIX_COLS must not exceed 16"
-#endif
-#if (MATRIX_ROWS > 255)
-#   error "MATRIX_ROWS must not exceed 255"
-#endif
-
-
-static bool is_modified = false;
-static report_mouse_t mouse_report = {};
-
-// matrix state buffer(1:on, 0:off)
-#if (MATRIX_COLS <= 8)
-static uint8_t matrix[MATRIX_ROWS];
-#else
-static uint16_t matrix[MATRIX_ROWS];
-#endif
-
-#ifdef MATRIX_HAS_GHOST
-static bool matrix_has_ghost_in_row(uint8_t row);
-#endif
-static void register_key(uint8_t key);
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-void matrix_init(void)
-{
-    adb_host_init();
-    // wait for keyboard to boot up and receive command
-    _delay_ms(1000);
-    // Enable keyboard left/right modifier distinction
-    // Addr:Keyboard(0010), Cmd:Listen(10), Register3(11)
-    // upper byte: reserved bits 0000, device address 0010
-    // lower byte: device handler 00000011
-    adb_host_listen(0x2B,0x02,0x03);
-
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
-
-    debug_enable = true;
-    //debug_matrix = true;
-    //debug_keyboard = true;
-    //debug_mouse = true;
-    print("debug enabled.\n");
-    return;
-}
-
-#ifdef ADB_MOUSE_ENABLE
-
-#ifdef MAX
-#undef MAX
-#endif
-#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
-
-void adb_mouse_task(void)
-{
-    uint16_t codes;
-    int16_t x, y;
-    static int8_t mouseacc; 
-    _delay_ms(12);  // delay for preventing overload of poor ADB keyboard controller
-    codes = adb_host_mouse_recv();
-    // If nothing received reset mouse acceleration, and quit. 
-    if (!codes) {
-        mouseacc = 1;
-        return;
-    };
-    // Bit sixteen is button.
-    if (~codes & (1 << 15))
-        mouse_report.buttons |= MOUSE_BTN1;
-    if (codes & (1 << 15))
-        mouse_report.buttons &= ~MOUSE_BTN1;
-    // lower seven bits are movement, as signed int_7. 
-    // low byte is X-axis, high byte is Y. 
-    y = (codes>>8 & 0x3F);
-    x = (codes>>0 & 0x3F);
-    // bit seven and fifteen is negative
-    // usb does not use int_8, but int_7 (measuring distance) with sign-bit. 
-    if (codes & (1 << 6))
-          x = (x-0x40);
-    if (codes & (1 << 14))
-         y = (y-0x40);
-    // Accelerate mouse. (They weren't meant to be used on screens larger than 320x200).
-    x *= mouseacc;
-    y *= mouseacc;
-    // Cap our two bytes per axis to one byte. 
-    // Easier with a MIN-function, but since -MAX(-a,-b) = MIN(a,b)...
-	 // I.E. MIN(MAX(x,-127),127) = -MAX(-MAX(x, -127), -127) = MIN(-MIN(-x,127),127)
-    mouse_report.x = -MAX(-MAX(x, -127), -127);
-    mouse_report.y = -MAX(-MAX(y, -127), -127);
-    if (debug_mouse) {
-            print("adb_host_mouse_recv: "); print_bin16(codes); print("\n");
-            print("adb_mouse raw: [");
-            phex(mouseacc); print(" ");
-            phex(mouse_report.buttons); print("|");
-            print_decs(mouse_report.x); print(" ");
-            print_decs(mouse_report.y); print("]\n");
-    }
-    // Send result by usb. 
-    host_mouse_send(&mouse_report);
-    // increase acceleration of mouse
-    mouseacc += ( mouseacc < ADB_MOUSE_MAXACC ? 1 : 0 );
-    return;
-}
-#endif
-
-uint8_t matrix_scan(void)
-{
-    /* extra_key is volatile and more convoluted than necessary because gcc refused
-    to generate valid code otherwise. Making extra_key uint8_t and constructing codes
-    here via codes = extra_key<<8 | 0xFF; would consistently fail to even LOAD
-    extra_key from memory, and leave garbage in the high byte of codes. I tried
-    dozens of code variations and it kept generating broken assembly output. So
-    beware if attempting to make extra_key code more logical and efficient. */
-    static volatile uint16_t extra_key = 0xFFFF;
-    uint16_t codes;
-    uint8_t key0, key1;
-
-    is_modified = false;
-
-    codes = extra_key;
-    extra_key = 0xFFFF;
-
-    if ( codes == 0xFFFF )
-    {
-        _delay_ms(12);  // delay for preventing overload of poor ADB keyboard controller
-        codes = adb_host_kbd_recv();
-    }
-    key0 = codes>>8;
-    key1 = codes&0xFF;
-
-    if (debug_matrix && codes) {
-        print("adb_host_kbd_recv: "); phex16(codes); print("\n");
-    }
-
-    if (codes == 0) {                           // no keys
-        return 0;
-    } else if (codes == 0x7F7F) {   // power key press
-        register_key(0x7F);
-    } else if (codes == 0xFFFF) {   // power key release
-        register_key(0xFF);
-    } else if (key0 == 0xFF) {      // error
-        xprintf("adb_host_kbd_recv: ERROR(%d)\n", codes);
-        return key1;
-    } else {
-        register_key(key0);
-        if (key1 != 0xFF)       // key1 is 0xFF when no second key.
-            extra_key = key1<<8 | 0xFF; // process in a separate call
-    }
-
-    return 1;
-}
-
-bool matrix_is_modified(void)
-{
-    return is_modified;
-}
-
-inline
-bool matrix_has_ghost(void)
-{
-#ifdef MATRIX_HAS_GHOST
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        if (matrix_has_ghost_in_row(i))
-            return true;
-    }
-#endif
-    return false;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
-inline
-#if (MATRIX_COLS <= 8)
-uint8_t matrix_get_row(uint8_t row)
-#else
-uint16_t matrix_get_row(uint8_t row)
-#endif
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    if (!debug_matrix) return;
-#if (MATRIX_COLS <= 8)
-    print("r/c 01234567\n");
-#else
-    print("r/c 0123456789ABCDEF\n");
-#endif
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        phex(row); print(": ");
-#if (MATRIX_COLS <= 8)
-        pbin_reverse(matrix_get_row(row));
-#else
-        pbin_reverse16(matrix_get_row(row));
-#endif
-#ifdef MATRIX_HAS_GHOST
-        if (matrix_has_ghost_in_row(row)) {
-            print(" <ghost");
-        }
-#endif
-        print("\n");
-    }
-}
-
-uint8_t matrix_key_count(void)
-{
-    uint8_t count = 0;
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-#if (MATRIX_COLS <= 8)
-        count += bitpop(matrix[i]);
-#else
-        count += bitpop16(matrix[i]);
-#endif
-    }
-    return count;
-}
-
-#ifdef MATRIX_HAS_GHOST
-inline
-static bool matrix_has_ghost_in_row(uint8_t row)
-{
-    // no ghost exists in case less than 2 keys on
-    if (((matrix[row] - 1) & matrix[row]) == 0)
-        return false;
-
-    // ghost exists in case same state as other row
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
-        if (i != row && (matrix[i] & matrix[row]) == matrix[row])
-            return true;
-    }
-    return false;
-}
-#endif
-
-inline
-static void register_key(uint8_t key)
-{
-    uint8_t col, row;
-    col = key&0x07;
-    row = (key>>3)&0x0F;
-    if (key&0x80) {
-        matrix[row] &= ~(1<<col);
-    } else {
-        matrix[row] |=  (1<<col);
-    }
-    is_modified = true;
-}

+ 0 - 82
converter/ascii_usb/Makefile

@@ -1,82 +0,0 @@
-# Target file name (without extension).
-TARGET = ascii_usb
-
-# 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 \
-	protocol/serial_uart.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 = 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
-
-
-#
-# 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
-
-
-# Build Options
-#   *Comment out* to disable the options.
-#
-#MOUSEKEY_ENABLE = yes	# Mouse keys
-#EXTRAKEY_ENABLE = yes	# Audio control and System control
-CONSOLE_ENABLE = yes	# Console for debug
-#NKRO_ENABLE = yes	# USB Nkey Rollover
-
-
-# Boot Section Size in bytes
-#   Teensy halfKay   512
-#   Atmel DFU loader 4096
-#   LUFA bootloader  4096
-OPT_DEFS += -DBOOTLOADER_SIZE=4096
-
-
-# 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

+ 0 - 38
converter/ascii_usb/README

@@ -1,38 +0,0 @@
-ASCII to USB keyboard protocol converter
-========================================
-This converts serial console terminal into USB keyboard, tested with TRS-80 model 100 TELCOM application.
-Target MCU is ATMega32u4 but other USB capable AVR will also work.
-
-
-Hardware
---------
-Connect RX, TX and GND to UART pin of AVR. Note that you may need line driver/level shifter like MAX232 to interface high voltage of RS-232C.
-
-
-
-Build Firmware
---------------
-Configure UART setting and Just use 'make'
-
-    $ cd ascii_usb
-    $ make
-
-Then, load the binary to MCU with your favorite programmer.
-
-
-
-Limitation
-----------
-- This cannot see key up event, you cannot hold a key.
-- Alt, Gui(Win/Mac) modifier key are not available.
-
-
-
-TRS-80 model 100
-----------------
-Use TELCOM program with setting: 19200bps/8bit/odd parity/1stop bit
-To set this configuration push Stat(F3) and input '9801D,10'. Then push Term(F4) to connect.
-
-
-
-

+ 0 - 70
converter/ascii_usb/config.h

@@ -1,70 +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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x5C01
-#define DEVICE_VER      0x0100
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         ASCII keyboard converter
-#define DESCRIPTION     converts Serial Console Terminal into USB keyboard
-
-
-/* matrix size */
-#define MATRIX_ROWS     16
-#define MATRIX_COLS     16
-
-/* key combination for command */
-#define IS_COMMAND()    ( \
-    host_get_first_key() == KC_BRK \
-)
-
-
-/*
- * Serial(USART) configuration
- *     asynchronous, positive logic, 19200baud, bit order: LSB first
- *     1-start bit, 8-data bit, odd parity, 1-stop bit
- */
-#ifdef __AVR_ATmega32U4__
-    #define SERIAL_UART_BAUD       19200
-    #define SERIAL_UART_DATA       UDR1
-    #define SERIAL_UART_UBRR       ((F_CPU/(16UL*SERIAL_UART_BAUD))-1)
-    #define SERIAL_UART_RXD_VECT   USART1_RX_vect
-    #define SERIAL_UART_TXD_READY  (UCSR1A&(1<<UDRE1))
-    #define SERIAL_UART_INIT()     do { \
-        UBRR1L = (uint8_t) SERIAL_UART_UBRR;       /* baud rate */ \
-        UBRR1H = (uint8_t) (SERIAL_UART_UBRR>>8);  /* baud rate */ \
-        UCSR1B |= (1<<RXCIE1) | (1<<RXEN1); /* RX interrupt, RX: enable */ \
-        UCSR1B |= (0<<TXCIE1) | (1<<TXEN1); /* TX interrupt, TX: enable */ \
-        UCSR1C |= (1<<UPM11) | (1<<UPM10);  /* parity: none(00), even(01), odd(11) */ \
-        sei(); \
-    } while(0)
-#else
-    #error "USART configuration is needed."
-#endif
-
-/* disable action features */
-#define NO_ACTION_LAYER
-#define NO_ACTION_TAPPING
-#define NO_ACTION_ONESHOT
-#define NO_ACTION_MACRO
-#define NO_ACTION_FUNCTION
-
-
-#endif

+ 0 - 42
converter/ascii_usb/keymap.c

@@ -1,42 +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 <stdbool.h>
-#include <avr/pgmspace.h>
-#include "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "action_util.h"
-#include "util.h"
-#include "print.h"
-#include "keymap.h"
-
-
-// Keymap is not used. See matrix.c.
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    return KC_NO;
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    return (action_t) { .code = ACTION_NO };
-}

+ 0 - 25
converter/ascii_usb/led.c

@@ -1,25 +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 "serial.h"
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-}

+ 0 - 195
converter/ascii_usb/matrix.c

@@ -1,195 +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 <stdbool.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#include "print.h"
-#include "util.h"
-#include "matrix.h"
-#include "debug.h"
-#include "action_util.h"
-#include "protocol/serial.h"
-
-
-/*
- * Not use Matrix.
- *
- * ROW: 16(4bits)
- * COL: 16(4bits)
- *
- *    8bit wide
- *   +---------+
- *  0|00 ... 0F|
- *  1|08 ... 1F|
- *  :|   ...   |
- *  :|   ...   |
- *  E|E0 ... EF|
- *  F|F0 ... FF|
- *   +---------+
- */
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-void matrix_init(void)
-{
-    debug_matrix = true;
-    serial_init();
-
-    debug("init\n");
-    return;
-}
-
-static void type_key(uint16_t keycode)
-{
-    if (keycode == 0) return;
-
-    uint8_t mods = keycode>>8;
-    uint8_t key = keycode&0xFF;
-    if (mods) {
-        add_mods(mods);
-        send_keyboard_report();
-    }
-
-    add_key(key);
-    send_keyboard_report();
-
-    del_key(key);
-    send_keyboard_report();
-
-    if (mods) {
-        del_mods(mods);
-        send_keyboard_report();
-    }
-}
-static uint16_t code2key(uint8_t code)
-{
-    // ASCII to key combination in US laout
-    switch (code) {
-        case 0x01 ... 0x08:                                 // Ctrl-[a-z]
-            return MOD_BIT(KC_LCTRL)<<8 | (KC_A + (code-0x01));
-        case 0x09: return KC_TAB;                           // TAB(Ctrl-i)
-        case 0x0A ... 0x0C:                                 // Ctrl-[a-z]
-            return MOD_BIT(KC_LCTRL)<<8 | (KC_A + (code-0x01));
-        case 0x0D: return KC_ENTER;                         // Enter(Ctrl-m)
-        case 0x0E ... 0x1A:                                 // Ctrl-[a-z]
-            return MOD_BIT(KC_LCTRL)<<8 | (KC_A + (code-0x01));
-        case 0x1B: return KC_ESC;
-        case 0x1C: return KC_RIGHT;
-        case 0x1D: return KC_LEFT;
-        case 0x1E: return KC_UP;
-        case 0x1F: return KC_DOWN;
-        case 0x20: return KC_SPACE;
-        case 0x21: return MOD_BIT(KC_LSHIFT)<<8 | KC_1;     // !
-        case 0x22: return MOD_BIT(KC_LSHIFT)<<8 | KC_QUOTE; // "
-        case 0x23: return MOD_BIT(KC_LSHIFT)<<8 | KC_3;     // #
-        case 0x24: return MOD_BIT(KC_LSHIFT)<<8 | KC_4;     // $
-        case 0x25: return MOD_BIT(KC_LSHIFT)<<8 | KC_5;     // %
-        case 0x26: return MOD_BIT(KC_LSHIFT)<<8 | KC_7;     // &
-        case 0x27: return KC_QUOTE;                         // '
-        case 0x28: return MOD_BIT(KC_LSHIFT)<<8 | KC_9;     // (
-        case 0x29: return MOD_BIT(KC_LSHIFT)<<8 | KC_0;     // )
-        case 0x2A: return MOD_BIT(KC_LSHIFT)<<8 | KC_8;     // *
-        case 0x2B: return MOD_BIT(KC_LSHIFT)<<8 | KC_EQUAL; // +
-        case 0x2C: return KC_COMMA;                         // ,
-        case 0x2D: return KC_MINUS;                         // -
-        case 0x2E: return KC_DOT;                           // .
-        case 0x2F: return KC_SLASH;                         // /
-        case 0x30: return KC_0;
-        case 0x31 ... 0x39: // 1-9
-            return KC_1 + (code-0x31);
-        case 0x3A: return MOD_BIT(KC_LSHIFT)<<8 | KC_SCLN;  // :
-        case 0x3B: return KC_SCLN;                          // ;
-        case 0x3C: return MOD_BIT(KC_LSHIFT)<<8 | KC_COMMA; // <
-        case 0x3D: return KC_EQUAL;                         // =
-        case 0x3E: return MOD_BIT(KC_LSHIFT)<<8 | KC_DOT;   // >
-        case 0x3F: return MOD_BIT(KC_LSHIFT)<<8 | KC_SLASH; // ?
-        case 0x40: return MOD_BIT(KC_LSHIFT)<<8 | KC_2;     // @
-        case 0x41 ... 0x5A: // A-Z
-            return MOD_BIT(KC_LSHIFT)<<8 | (KC_A + (code-0x41));
-        case 0x5B: return KC_LBRACKET;                      // [
-        case 0x5C: return KC_BSLASH;                        //
-        case 0x5D: return KC_RBRACKET;                      // ]
-        case 0x5E: return MOD_BIT(KC_LSHIFT)<<8 | KC_6;     // ^
-        case 0x5F: return MOD_BIT(KC_LSHIFT)<<8 | KC_MINUS; // _
-        case 0x61 ... 0x7A: // a-z
-            return KC_A + (code-0x61);
-        case 0x7B: return MOD_BIT(KC_LSHIFT)<<8 | KC_LBRACKET; // {
-        case 0x7C: return MOD_BIT(KC_LSHIFT)<<8 | KC_BSLASH;   // |
-        case 0x7D: return MOD_BIT(KC_LSHIFT)<<8 | KC_RBRACKET; // }
-        case 0x7E: return MOD_BIT(KC_LSHIFT)<<8 | KC_GRAVE; // }
-        case 0x7F: return KC_DELETE;                        //
-    }
-    return 0;
-}
-
-uint8_t matrix_scan(void)
-{
-    uint16_t code = serial_recv2();
-    if (code == -1) {
-        return 0;
-    }
-
-    print_hex8(code); print(" ");
-
-    // echo back
-    serial_send(code);
-    type_key(code2key(code));
-    
-
-    return code;
-}
-
-inline
-bool matrix_has_ghost(void)
-{
-    return false;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return false;
-}
-
-inline
-matrix_row_t matrix_get_row(uint8_t row)
-{
-    return 0;
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 0123456789ABCDEF\n");
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        phex(row); print(": ");
-        pbin_reverse(matrix_get_row(row));
-        print("\n");
-    }
-}

+ 0 - 93
converter/ibm4704_usb/Makefile

@@ -1,93 +0,0 @@
-# Target file name (without extension).
-TARGET = ibm4704_usb
-
-# 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 \
-	protocol/ibm4704.c
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_plain.c $(SRC)
-endif
-
-CONFIG_H = config.h
-
-
-# MCU name
-#MCU = at90usb1287
-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
-#   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
-#NKRO_ENABLE = yes	# USB Nkey Rollover - not yet supported in LUFA
-
-
-# Search Path
-VPATH += $(TARGET_DIR)
-VPATH += $(TMK_DIR)
-
-include $(TMK_DIR)/protocol.mk
-include $(TMK_DIR)/protocol/lufa.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk

+ 0 - 72
converter/ibm4704_usb/README.md

@@ -1,72 +0,0 @@
-IBM 4704 to USB keyboard converter
-==================================
-This firmware converts IBM 4704 keyboard protocol to USB HID.
-
-Keyboard initialization process takes a few seconds at start up. During that you will hear buzzer from the keyboard. **You need to plug USB cable after hooking up your keyboard to the converter.**
-
-
-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.
-
-
-
-Supported Keyboard
-------------------
-### IBM capacitive switch models:
-- 6019273 Model 100 50-key (grid layout)      http://kishy.ca/?p=894
-- 6019284 Model 200 62-key Alpha(60% layout)  http://kishy.ca/?p=894
-- 6019303 Model 300 77-key Expanded Alpha     http://deskthority.net/photos-f62/ibm-6019303-t8502.html
-- 6020218 Model 400 107-key Full key          http://kishy.ca/?p=894
-
-### Alps switch(vintage Green) models:
-
-- 5954339 Japanese 102-key    http://deskthority.net/post87127.html#p87127
-- 6112883 Japanese 102-key    http://geekhack.org/index.php?topic=52888.msg1194489#msg1194489
-- 6112884 Japanese 102-key    http://geekhack.org/index.php?topic=50437.msg1193047#msg1193047
-- 6341739 Chinese 102-key     http://geekhack.org/index.php?topic=52888.msg1176566#msg1176566
-
-
-Connector
----------
-Keyboard Plug from front:
-
-    DSUB-9
-    -------------
-    \ N 2 3 4 5 /
-     \ N N N N /
-      ---------
-    2   GND
-    3   VCC 5V
-    4   DATA
-    5   CLOCK
-    N   No connection/No pin.
-
-
-Connection
-----------
-In case of using ATMega32U4(Teensy2.0):
-
-1. Supply power with VCC and GND.
-2. Connect CLOCK to PD1 and DATA to PD0. You can change pin with config.h.
-3. Optionally you may need pull-up register. 1KOhm probably work.
-
-
-Build Firmware
---------------
-Just run `make`:
-
-    $ make
-
-To select keymap:
-
-    $ make KEYMAP=[plain|...]
-
-
-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.

+ 0 - 61
converter/ibm4704_usb/config.h

@@ -1,61 +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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include <avr/interrupt.h>
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x4707
-#define DEVICE_VER      0x0001
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         IBM 4704 keyboard converter
-#define DESCRIPTION     convert IBM 4704 keyboard to USB
-
-
-/* matrix size */
-#define MATRIX_ROWS 16  // keycode bit3-6 
-#define MATRIX_COLS 8   // keycode bit0-2
-
-
-/* key combination for command */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RCTRL)) || \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-
-/* Pin configuration */
-#define IBM4704_CLOCK_PORT  PORTD
-#define IBM4704_CLOCK_PIN   PIND
-#define IBM4704_CLOCK_DDR   DDRD
-#define IBM4704_CLOCK_BIT   1
-#define IBM4704_DATA_PORT   PORTD
-#define IBM4704_DATA_PIN    PIND
-#define IBM4704_DATA_DDR    DDRD
-#define IBM4704_DATA_BIT    0
-
-/* Pin interrupt on rising edge of clock */
-#define IBM4704_INT_INIT()  do { EICRA |= ((1<<ISC11)|(1<<ISC10)); } while (0)
-#define IBM4704_INT_ON()    do { EIFR |= (1<<INTF1); EIMSK |= (1<<INT1); } while (0)
-#define IBM4704_INT_OFF()   do { EIMSK &= ~(1<<INT1); } while (0)
-#define IBM4704_INT_VECT    INT1_vect
-
-
-#endif

+ 0 - 182
converter/ibm4704_usb/ibm4704.txt

@@ -1,182 +0,0 @@
-IBM 4704 Keyboard
-=================
-IBM capacitive switch models:
-    6019273 Model 100 50-key (grid layout)      http://kishy.ca/?p=894
-    6019284 Model 200 62-key Alpha(60% layout)  http://kishy.ca/?p=894
-    6019303 Model 300 77-key Expanded Alpha     http://deskthority.net/photos-f62/ibm-6019303-t8502.html
-    6020218 Model 400 107-key Full key          http://kishy.ca/?p=894
-
-Alps switch(vintage Green) models:
-    5954339 Japanese 102-key    http://deskthority.net/post87127.html#p87127
-    6112883 Japanese 102-key    http://geekhack.org/index.php?topic=52888.msg1194489#msg1194489
-    6112884 Japanese 102-key    http://geekhack.org/index.php?topic=50437.msg1193047#msg1193047
-    6341739 Chinese 102-key     http://geekhack.org/index.php?topic=52888.msg1176566#msg1176566
-
-Resourse
---------
-The IBM 4704: lots of pictures and info
-http://kishy.dyndns.org/?p=648#more-648 
-
-Brochure:
-http://ed-thelen.org/comp-hist/IBM-ProdAnn/4700.pdf
-
-
-
-IBM 4704 Keyboard Protocol
-==========================
-On powering up keyboard sends keyboard ID; A3h for 6019284(62-key), for example.
-After that the keyboard enters FC command mode and waits for parameter data from host
-so that it doesn't send any scancode until you send 'FF'(End of FC command mode).
-
-    Keyboard                    ID
-    -------------------------------
-    Model 100 50-key            A2h
-    Model 200 62-key            A3h
-    Model 300 77-key            A4h
-    Model 400 107-key           A5h
-    Japanese/Chinese 102-key    A6h
-
-
-Connector
----------
-    Keyboard Plug from front
-
-    DSUB-9
-    -------------
-    \ N 2 3 4 5 /
-     \ N N N N /
-      ---------
-    2   GND
-    3   VCC 5V
-    4   DATA
-    5   CLOCK
-    N   No connection/No pin.
-
-
-Keyboard to Host
-----------------
-Data bits are LSB first and Pairty is odd. Clock has around 60us high and 30us low part.
-
-            ____       __   __   __   __   __   __   __   __   __   _______
-    Clock       \_____/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/
-                 ____ ____ ____ ____ ____ ____ ____ ____ ____ ____    
-    Data    ____/    X____X____X____X____X____X____X____X____X____X________
-                Start   0    1    2    3    4    5    6    7    P  Stop
-
-Start bit:  can be long as 300-350us.
-Inhibit:    Pull Data line down to inhibit keyboard to send.
-Timing:     Host reads bit while Clock is hi.(rising edge)
-Stop bit:   Keyboard pulls down Data line to lo after 9th clock.
-
-
-Host to Keyboard
-----------------
-Data bits are LSB first and Pairty is odd. Clock has around 60us high and 30us low part.
-
-            ____        __   __   __   __   __   __   __   __   __   ________
-    Clock       \______/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/  \_/
-                ^   ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ___
-    Data    ____|__/    X____X____X____X____X____X____X____X____X____X   \___
-                |  Start   0    1    2    3    4    5    6    7    P   Stop
-                Request by host
-
-Start bit:  can be long as 300-350us.
-Request:    Host pulls Clock line down to request to send a command.
-Timing:     After Request keyboard pull up Data and down Clock line to low for start bit.
-            After request host release Clock line once Data line becomes hi.
-            Host wirtes a bit while Clock is hi and Keyboard reads while low.
-Stop bit:   Host releases or pulls up Data line to hi after 9th clock and waits for keybaord pull down the line to lo.
-
-
-Scancodes
----------
-Keyboard doesn't send Break code for all keys except for Alt by default.
-
-    6019284 62-key:
-    ,-----------------------------------------------------------.
-    |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|???|BS |
-    |-----------------------------------------------------------|
-    |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P| ¢|  \|  PD2|
-    |-----------------------------------------------------------|
-    |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '| {}| PD3|
-    |-----------------------------------------------------------|
-    |Shif| <>|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|???|Shift |
-    |-----------------------------------------------------------|
-    |Reset|blk|Alt  |         Space             |Alt  |blk|Enter|
-    `-----------------------------------------------------------'
-    +----------+---------------------+----------+----------+
-    |`       00|PD1     04|Caps    20|LShift  30|Reset   31|
-    |1       18|q       05|a       21|<>      3E|Rblank  41|
-    |2       19|w       06|s       22|z       32|Alt     3F|
-    |3       1A|e       13|d       23|x       33|Space   40|
-    |4       10|r       14|f       24|c       34|Alt     3F|
-    |5       11|t       15|g       25|v       35|Lblank  42|
-    |6       12|y       16|h       26|b       36|Enter   2F|
-    |7       08|u       17|j       27|n       37|          |
-    |8       09|i       01|k       28|m       38|          |
-    |9       0A|o       02|l       29|,       39|          |
-    |0       0F|p       03|;       2A|.       3A|          |
-    |-       1F|¢      1B|'       2B|/       3B|          |
-    |=       0D|\       1C|{}      2C|???     3C|          |
-    |???     0C|PD2     1D|PD3     2D|RShift  3D|          |
-    |BS      0E|          |          |          |          |
-    +----------+---------------------+----------+----------+
-    Bit7 is 'press flag' which set 1 on press and 0 on release when break code is enabled.
-
-NOTE: When break code is enabled the key sends scancode with setting 7th bit on press
-and without it on release. That is, '`' sends 80h on press and 00h on release.
-
-
-Keyboard command
-----------------
-Keyboard accepts these commands from host.
-
-        Description                             Entry point
-    -----------------------------------------------------------
-    FF  Soft Reset                              0008h
-    FE  Resend                                  00e8h
-    FD  Buzzer(emits a short beep)              00edh
-    FC  Set Key Flag                            00f6h
-    FB  Soft Reset                              0008h
-    FA  Reset                                   0000h
-    
-
-Keyboard response
------------------
-Keyobard sends these bytes to host.
-
-        Description                             Entry point
-    -----------------------------------------------------------
-    FE  Overflow(key event/receive data)        00c5h, 0346h
-        Memory test error                       0224h
-    FD  Command out of bound                    00d8h
-        Key out of bound
-    7E  Read/Parity error in receive from host  00bch
-
-
-Set Key Flag command(FC)
-------------------------
-After 'Power on Reset' firmware enters this command mode and waits for data from host,
-so that you don't need to send 'FC' and it doesn't send any scancode until you send 'FF'.
-
-Data sent from host:
-
-    bit: 7   6 ... 0
-         en  |     |
-         |   `-----`--- scan code
-         `------------- enable bit(0: enable repeat, 1: enable break)
-
-    00-79   Enable repeat
-    80-F9   Enable break(FA-FF are used as other commands, see above.)
-    FE      Resend(011ah) no need to use
-    FF      End(0114h) exits FC command mode.
-
-Response from keyboard:
-    FD      Out of bound - Invalid scancode
-    --      OK - No response means that command is accepted.
-
-Examples:
-    To enable break code of all keys.
-
-    FC 80 81 ... F7 FF
-

+ 0 - 17
converter/ibm4704_usb/keymap_50key.c

@@ -1,17 +0,0 @@
-#include "keymap_common.h"
-
-
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    KEYMAP_50(
-    F1,  F2,  F3,   F4,  F5,  F6,   F7,  F8,  F9,  F10,  \
-    1,   2,   3,    4,   5,   6,    7,   8,   9,   0,    \
-    Q,   W,   E,    R,   T,   Y,    U,   I,   O,   P,    \
-    A,   S,   D,    F,   G,   H,    J,   K,   L,   SCLN, \
-    Z,   X,   C,    V,   B,   N,    M,   COMM,DOT, SLSH  \
-    ),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-};
-
-

+ 0 - 50
converter/ibm4704_usb/keymap_alps102key.c

@@ -1,50 +0,0 @@
-#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),
-};

+ 0 - 30
converter/ibm4704_usb/keymap_common.c

@@ -1,30 +0,0 @@
-/*
-Copyright 2011,2012,2013 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"
-
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
-}

+ 0 - 146
converter/ibm4704_usb/keymap_common.h

@@ -1,146 +0,0 @@
-/*
-Copyright 2011,2012,2013 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/>.
-*/
-#ifndef KEYMAP_COMMON_H
-#define KEYMAP_COMMON_H
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/pgmspace.h>
-#include "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "report.h"
-#include "print.h"
-#include "debug.h"
-#include "keymap.h"
-
-
-// 32*8(256) byte array which converts PS/2 code into USB code
-extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
-extern const uint16_t fn_actions[];
-
-
-/* 107-key */
-#define KEYMAP( \
-    K46,K64,     K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E,   K6A,K6B,K6C,    K47,K48,K49,K4A, \
-    K56,K66,     K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D,       K6D,K6E,K6F,    K4B,K4C,K4D,K4E, \
-    K71,K77,     K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D,       K70,K65,K72,    K50,K51,K52,K53, \
-    K44,K45,     K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D,       K74,K75,K76,    K5E,K58,K59,K5A, \
-    K54,K55,     K31,K41,K3F,        K40,                        K42,K2F,       K78,K67,K79,    K5B,K5C,K5D,K57  \
-) { \
-    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_NO    }, \
-    { KC_##K08, KC_##K09, KC_##K0A, KC_NO,    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_NO,    KC_##K1F }, \
-    { 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_NO,    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_NO,    KC_##K44, KC_##K45, KC_##K46, KC_##K47 }, \
-    { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO    }, \
-    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
-    { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K64, KC_##K65, KC_##K66, KC_##K67 }, \
-    { KC_NO,    KC_NO,    KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F }, \
-    { KC_##K70, KC_##K71, KC_##K72, KC_NO,    KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
-    { KC_##K78, KC_##K79, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }  \
-}
-
-/* 77-key */
-#define KEYMAP_77( \
-    K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E,   K6A,K6B,K6C, \
-    K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D,       K6D,K6E,K6F, \
-    K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D,       K70,K65,K72, \
-    K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D,       K74,K75,K76, \
-    K31,K41,K3F,        K40,                        K42,K2F,       K78,K67,K79  \
-) KEYMAP( \
-    F1,  F2,    K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E,    K6A,K6B,K6C,    NLCK,PSLS,PAST,PMNS, \
-    F3,  F4,    K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D,        K6D,K6E,K6F,    P7,  P8,  P9,  PPLS, \
-    F5,  F6,    K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D,        K70,K65,K72,    P4,  P5,  P6,  PPLS, \
-    F7,  F8,    K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D,        K74,K75,K76,    P1,  P2,  P3,  PENT, \
-    F9,  F10,   K31,K41,K3F,        K40,                        K42,K2F,        K78,K67,K79     P0,  P0,  PDOT,PENT  \
-)
-
-/* 62-key */
-#define KEYMAP_62( \
-    K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, \
-    K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D, \
-    K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D, \
-    K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D, \
-    K31,K41,K3F,        K40,                        K42,K2F  \
-) KEYMAP( \
-    F1,  F2,    K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E,   INS, HOME,PGUP,     NLCK,PSLS,PAST,PMNS, \
-    F3,  F4,    K04,K05,K06,K13,K14,K15,K16,K17,K01,K02,K03,K1B,K1C,K1D,       DEL, END, PGDN,     P7,  P8,  P9,  PPLS, \
-    F5,  F6,    K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K2A,K2B,K2C,K2D,       PSCR,SLCK,PAUS,     P4,  P5,  P6,  PPLS, \
-    F7,  F8,    K30,K3E,K32,K33,K34,K35,K36,K37,K38,K39,K3A,K3B,K3C,K3D,       F11, UP,  F12,      P1,  P2,  P3,  PENT, \
-    F9,  F10,   K31,K41,K3F,        K40,                        K42,K2F,       LEFT,DOWN,RGHT,     P0,  P0,  PDOT,PENT  \
-)
-
-/* 50-key */
-#define KEYMAP_50( \
-    K00,K01,K02,    K03,K04,K05,    K20,K21,K22,K23, \
-    K08,K09,K0A,    K0B,K0C,K0D,    K28,K29,K2A,K35, \
-    K10,K11,K12,    K13,K14,K15,    K30,K31,K32,K36, \
-    K18,K19,K1A,    K1B,K1C,K1D,    K38,K39,K3A,K37, \
-    K16,K1E,K0E,    K0F,K1F,K17,    K33,K3B,K2B,K3F  \
-) { \
-    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_NO,    KC_NO,   }, \
-    { 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_##K1F }, \
-    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_NO,    KC_##K35, KC_##K36, KC_##K37 }, \
-    { KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_NO,    KC_NO,    KC_NO,    KC_##K3F }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { 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

+ 0 - 85
converter/ibm4704_usb/keymap_hasu.c

@@ -1,85 +0,0 @@
-#include "keymap_common.h"
-
-
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* 0: default
-     * ,-----------------------------------------------------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|???|BS |
-     * |-----------------------------------------------------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|
-     * |-----------------------------------------------------------|
-     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|xxx|Ret |
-     * |-----------------------------------------------------------|
-     * |Shif|xxx|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|xxx|Shift |
-     * |-----------------------------------------------------------|
-     * |Ctrl |Gui|Alt  |         Space             |Alt  |Gui|Ctrl |
-     * `-----------------------------------------------------------'
-     */
-    KEYMAP_62(
-    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,NO,  ENT, \
-    LSFT,NO,  Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, FN2, NO,  FN0, \
-    LCTL,LGUI,LALT,          FN3,                               RGUI,RCTL \
-    ),
-
-    KEYMAP_62(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL, \
-    CAPS,NO,  NO,  NO,  NO,  NO,  NO,  NO,  PSCR,SLCK,PAUS, UP, NO,  BSPC, \
-    LCTL,VOLD,VOLU,MUTE,NO,  NO,  PAST,PSLS,HOME,PGUP,LEFT,RGHT,NO,  ENT, \
-    LSFT,NO,  NO,  NO,  NO,  NO,  NO,  PPLS,PMNS,END, PGDN,DOWN,NO,  TRNS, \
-    LCTL,LGUI,LALT,          SPC,                               RGUI,RCTL \
-    ),
-
-    KEYMAP_62(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL, \
-    TAB, NO,  NO,  NO,  NO,  NO,  WH_L,WH_D,WH_U,WH_R,WSTP,WBAK,WFWD,BSPC, \
-    LCTL,NO,  ACL0,ACL1,ACL2,NO,  MS_L,MS_D,MS_U,MS_R,TRNS,NO,  NO,  ENT, \
-    LSFT,NO,  NO,  NO,  NO,  NO,  BTN3,BTN2,BTN1,BTN4,BTN5,NO,  NO,  RSFT,\
-    LCTL,LGUI,LALT,          BTN1,                              RGUI,RCTL \
-    ),
-
-    KEYMAP_62(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL, \
-    TAB, HOME,PGDN,UP,  PGUP,END, HOME,PGDN,PGUP,END, NO,  NO,  NO,  BSPC, \
-    LCTL,NO,  LEFT,DOWN,RGHT,NO,  LEFT,DOWN,UP,  RGHT,NO,  NO,  NO,  ENT, \
-    LSFT,NO,  NO,  NO,  NO,  NO,  NO,  HOME,PGDN,PGUP,END, TRNS,NO,  RSFT, \
-    LCTL,LGUI,LALT,          SPC,                               RGUI,RCTL \
-    ),
-
-    KEYMAP_62(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, INS, DEL, \
-    TAB, NO,  NO,  NO,  NO,  NO,  WH_L,WH_D,MS_U,WH_U,WH_R,BTN4,BTN5,FN4, \
-    LCTL,VOLD,VOLU,MUTE,NO,  NO,  BTN2,MS_L,MS_D,MS_R,BTN1,NO,  NO,  ENT, \
-    LSFT,NO,  NO,  NO,  NO,  NO,  BTN3,BTN2,BTN1,BTN4,BTN5,NO,  NO,  NO, \
-    LCTL,LGUI,LALT,          TRNS,                              RGUI,RCTL \
-    ),
-};
-
-enum macro_id {
-    ALT_TAB,
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-    [0] = ACTION_LAYER_MOMENTARY(1),
-    [1] = ACTION_LAYER_TAP_KEY(2, KC_SCLN),
-    [2] = ACTION_LAYER_TAP_KEY(3, KC_SLASH),
-    [3] = ACTION_LAYER_TAP_KEY(4, KC_SPC),
-    [4] = ACTION_MACRO(ALT_TAB),
-};
-
-/*
- * Macro definition
- */
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
-{
-    keyevent_t event = record->event;
-
-    switch (id) {
-        case ALT_TAB:
-            return (event.pressed ?
-                    MACRO( D(LALT), D(TAB), END ) :
-                    MACRO( U(TAB), END ));
-    }
-    return MACRO_NONE;
-}

+ 0 - 50
converter/ibm4704_usb/keymap_plain.c

@@ -1,50 +0,0 @@
-#include "keymap_common.h"
-
-
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* 0: default
-     * ,-----------------------------------------------------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|???|BS |
-     * |-----------------------------------------------------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|    \|
-     * |-----------------------------------------------------------|
-     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|Ret|Ret |
-     * |-----------------------------------------------------------|
-     * |Shif|Shf|  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|???|Shift |
-     * |-----------------------------------------------------------|
-     * |Ctrl |Gui|Alt  |         Space             |Alt* |Gui|Fn   |
-     * `-----------------------------------------------------------'
-     */
-    KEYMAP(
-    F1,  F2,    GRV, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, NO,  BSPC,     INS, HOME,PGUP,     NLCK,PSLS,PAST,PMNS, \
-    F3,  F4,    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,BSLS,          DEL, END, PGDN,     P7,  P8,  P9,  PPLS, \
-    F5,  F6,    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,ENT, ENT,           PSCR,SLCK,PAUS,     P4,  P5,  P6,  PPLS, \
-    F7,  F8,    LSFT,LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,NO,  RSFT,          F11, UP,  F12,      P1,  P2,  P3,  PENT, \
-    F9,  F10,   LCTL,LGUI,LALT,          SPC,                               RGUI,FN0,           LEFT,DOWN,RGHT,     P0,  P0,  PDOT,PENT  \
-    ),
-
-    /* 1: HHKB
-     * ,-----------------------------------------------------------.
-     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|???|Del|
-     * |-----------------------------------------------------------|
-     * |Caps |   |   |   |   |   |   |   |Psc|Slk|Pau| Up|   |  Ins|
-     * |-----------------------------------------------------------|
-     * |Ctrl  |VoD|VoU|VoM|   |   |  *|  /|Hom|PgU|Lef|Rig|Ret|Ret |
-     * |-----------------------------------------------------------|
-     * |Shif|Shi|   |   |   |   |   |  +|  -|End|PgD|Dow|???|Shift |
-     * |-----------------------------------------------------------|
-     * |Ctrl |Gui|Alt  |         Space             |Alt* |Gui|Fn   |
-     * `-----------------------------------------------------------'
-     */
-    KEYMAP(
-    F1,  F2,    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, NO,  DEL,      INS, HOME,PGUP,     NLCK,PSLS,PAST,PMNS, \
-    F3,  F4,    CAPS,NO,  NO,  NO,  NO,  NO,  NO,  NO,  PSCR,SLCK,PAUS, UP, NO,  INS,           DEL, END, PGDN,     P7,  P8,  P9,  PPLS, \
-    F5,  F6,    TRNS,VOLD,VOLU,MUTE,NO,  NO,  PAST,PSLS,HOME,PGUP,LEFT,RGHT,ENT, ENT,           PSCR,SLCK,PAUS,     P4,  P5,  P6,  PPLS, \
-    F7,  F8,    TRNS,TRNS,NO,  NO,  NO,  NO,  NO,  PPLS,PMNS,END, PGDN,DOWN,NO,  TRNS,          F11, UP,  F12,      P1,  P2,  P3,  PENT, \
-    F9,  F10,   TRNS,TRNS,TRNS,          TRNS,                              TRNS,TRNS,          LEFT,DOWN,RGHT,     P0,  P0,  PDOT,PENT  \
-    ),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-    [0] = ACTION_LAYER_MOMENTARY(1),
-};

+ 0 - 24
converter/ibm4704_usb/led.c

@@ -1,24 +0,0 @@
-/*
-Copyright 2011 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)
-{
-}

+ 0 - 162
converter/ibm4704_usb/matrix.c

@@ -1,162 +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 <stdbool.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#include "action.h"
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "ibm4704.h"
-#include "matrix.h"
-
-
-static void matrix_make(uint8_t code);
-static void matrix_break(uint8_t code);
-static void matrix_clear(void);
-
-
-/*
- * Matrix Array usage:
- * IBM 4704 scan codes are assigned into 128(16x8)-cell matrix.
- *
- *    8bit wide
- *   +---------+
- *  0|         |
- *  :|   XX    | 00-7F
- *  f|         |
- *   +---------+
- *
- * Exceptions:
- */
-static uint8_t matrix[MATRIX_ROWS];
-
-// scan code bits  7654 3210
-// R:row/C:column  -RRR RCCC
-#define ROW(code)      ((code>>3)&0x0f)
-#define COL(code)      (code&0x07)
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-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 < 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
-        xprintf("s%02X:r%02X ", code, ibm4704_recv());
-    }
-    while (ibm4704_send(0xFF)) { _delay_ms(10); } // End
-    print("End\n");
-}
-
-
-void matrix_setup(void)
-{
-    ibm4704_init();
-}
-
-void matrix_init(void)
-{
-    debug_enable = true;
-
-    print("IBM 4704 converter\n");
-    matrix_clear();
-    _delay_ms(2000);    // wait for keyboard starting up
-    xprintf("Keyboard ID: %02X\n", ibm4704_recv());
-    enable_break();
-}
-
-/*
- * IBM 4704 Scan Code
- */
-uint8_t matrix_scan(void)
-{
-    uint8_t code = ibm4704_recv();
-    if (code==0xFF) {
-        // Not receivd
-        return 0;
-    } else if ((code&0x7F) >= 0x7A) {
-        // 0xFF-FA and 0x7F-7A is not scancode
-        xprintf("Error: %02X\n", code);
-        matrix_clear();
-        return 0;
-    } else if (code&0x80) {
-        dprintf("%02X\n", code);
-        matrix_make(code);
-    } else {
-        dprintf("%02X\n", code);
-        matrix_break(code);
-    }
-    return 1;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
-inline
-uint8_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 01234567\n");
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        xprintf("%02X: %08b\n", row, bitrev(matrix_get_row(row)));
-    }
-}
-
-
-
-inline
-static void matrix_make(uint8_t code)
-{
-    matrix[ROW(code)] |= 1<<COL(code);
-}
-
-inline
-static void matrix_break(uint8_t code)
-{
-    matrix[ROW(code)] &= ~(1<<COL(code));
-}
-
-inline
-static void matrix_clear(void)
-{
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
-}

+ 0 - 96
converter/m0110_usb/Makefile

@@ -1,96 +0,0 @@
-# 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

+ 0 - 98
converter/m0110_usb/Makefile.teensy

@@ -1,98 +0,0 @@
-# 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 = 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
-
-
-#
-# 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=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 - 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

+ 0 - 96
converter/m0110_usb/Makefile.tmk_rev1

@@ -1,96 +0,0 @@
-# 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

+ 0 - 96
converter/m0110_usb/Makefile.tmk_rev2

@@ -1,96 +0,0 @@
-# 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

+ 0 - 79
converter/m0110_usb/README.md

@@ -1,79 +0,0 @@
-M0110/M0110A to USB keyboard converter
-======================================
-This firmware converts the protocol of Apple Macintosh keyboard **M0110**, **M0110A** and **M0120** into USB. Target of this project is USB AVR controller like **ATmega32U2** and **ATmega32U4**. Using this converter you can revive these retro keyboards with modern computer.
-
-Read README of top directory too.
-
-Pictures of **M0110 + M0120** and **M0110A**.
-
-![M0110+M0120](http://i.imgur.com/dyvXb2Tm.jpg)
-![M0110A](http://i.imgur.com/HuHOEoHm.jpg)
-
-
-- M0110A support was contributed by [skagon@github](https://github.com/skagon).
-- M0120 also is supported. keys(+ * / and ,) on M0120 are recognized as cursor keys.
-
-
-
-Update
-------
-- 2013/08: Change port for signals `PF` to `PD`
-- 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now.
-- 2014/06: Change keymaps
-- 2015/03: Add support for "International"(ISO) keyboard(keymap_intl.c)
-
-
-
-Building Hardware
------------------
-You need [TMK converter] or AVR dev board like PJRC [Teensy]. Port of the MCU `PD1` is assigned to `CLOCK` line and `PD0` to `DATA` by default, you can change pin configuration with editing `config.h`.
-
-[![M0110 Converter](http://i.imgur.com/4G2ZOegm.jpg)](http://i.imgur.com/4G2ZOeg.jpg)
-
-### 4P4C phone handset cable
-Note that original cable used with Mac is **straight** while phone handset cable is **crossover**.
-
-<http://en.wikipedia.org/wiki/Modular_connector#4P4C>
-
-Close-up picture of handset cable. You can see one end of plug has reverse color codes against the other. Click to enlarge.
-[![4P4C cable](http://i.imgur.com/3S9P1mYm.jpg?1)](http://i.imgur.com/3S9P1mY.jpg?1)
-
-[Teensy]: http://www.pjrc.com/teensy/
-[TMK converter]: https://github.com/tmk/keyboard_converter
-
-
-### Socket Pinout
-- <http://pinouts.ru/Inputs/MacKeyboard_pinout.shtml>
-
-![Jack fig](http://www.kbdbabel.org/conn/kbd_connector_macplus.png)
-
-
-### Pull-up Resistor
-You may need pull-up resistors on signal lines(`CLOCK`, `DATA`) in particular when you have long or coiled cable. **1k-10k Ohm** will be OK for this purpose. In that case the converter may not read signal from keyboard correctly without pull-up resistors.
-
-
-
-Building Firmware
------------------
-To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to change compile options and pin configuration. Also `KEYMAP` option can be used to select keymap.
-
-    $ git clone git://github.com/tmk/tmk_keyboard.git (or download source)
-    $ cd m0110_usb
-    $ make -f Makefile.rev2 clean
-    $ make -f Makefile.rev2 [KEYMAP={default|intl|spacefn|hasu}]
-
-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.
-
-
-
-Debug
------
-You can use [PJRC HID listen](http://www.pjrc.com/teensy/hid_listen.html) to see debug output. The converter has some functions for debug, press `<Magic>+H` simultaneously to get help.
-
-- Magic combo: `Shift+Option+⌘` or `Shift+Option+Ctrl`(`Shift+Alt+Gui` or `Shift+Alt+Control`)

+ 0 - 62
converter/m0110_usb/config.h

@@ -1,62 +0,0 @@
-/*
-Copyright 2011,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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x0110
-#define DEVICE_VER      0x0101
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         M0110 keyboard converter
-#define DESCRIPTION     convert M0110 keyboard to USB
-
-
-/* matrix size */
-#define MATRIX_ROWS 14
-#define MATRIX_COLS 8
-
-
-/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
-#define LOCKING_SUPPORT_ENABLE
-/* Locking resynchronize hack */
-#define LOCKING_RESYNC_ENABLE
-
-
-/* magic key */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LGUI)) || \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_LALT) | MOD_BIT(KC_LCTL)) \
-)
-
-/* boot magic key */
-#define BOOTMAGIC_KEY_SALT                      KC_FN0
-#define BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL       KC_LCAP
-
-
-/* ports */
-#define M0110_CLOCK_PORT        PORTD
-#define M0110_CLOCK_PIN         PIND
-#define M0110_CLOCK_DDR         DDRD
-#define M0110_CLOCK_BIT         1
-#define M0110_DATA_PORT         PORTD
-#define M0110_DATA_PIN          PIND
-#define M0110_DATA_DDR          DDRD
-#define M0110_DATA_BIT          0
-
-#endif

+ 0 - 37
converter/m0110_usb/keymap_common.c

@@ -1,37 +0,0 @@
-/*
-Copyright 2011,2012,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 <avr/pgmspace.h>
-#include "action.h"
-#include "keycode.h"
-#include "keymap.h"
-#include "keymap_common.h"
-
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-}
-
-/* translates Fn index to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    action_t action;
-    action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
-    return action;
-}

+ 0 - 133
converter/m0110_usb/keymap_common.h

@@ -1,133 +0,0 @@
-/*
-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
-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 <avr/pgmspace.h>
-#include "keycode.h"
-#include "keymap.h"
-
-
-extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
-extern const uint16_t fn_actions[];
-
-
-/* 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.
- *
- * ,---------------------------------------------------------. ,---------------.
- * |  `|  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         |Ent|  \|Lft|Rgt|Dn | |      0|  .|   |
- * `---------------------------------------------------------' `---------------'
- *
- * M0110A 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|   | | 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|  38| 4D| | 53| 54| 55|   |
- * `---------------------------------------------------------' |-----------| 4C|
- * |   3A|     37|             31            | 2A| 46| 42| 48| |     52| 41|   |
- * `---------------------------------------------------------' `---------------'
- *
- * 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|      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, \
-    K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,      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,        K4D,  K53,K54,K55,K4C, \
-    K3A,K37,            K31,            K34,K2A,K46,K42,K48,  K52,    K41      \
-) { \
-    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
-    { KC_##K08, KC_##K09, KC_NO,    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_##K1F }, \
-    { 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_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_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    }, \
-    { KC_##K68, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K6D, KC_NO,    KC_NO    }, \
-}
-
-/* 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,          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 }, \
-    { 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_##K1F }, \
-    { 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_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_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    }, \
-    { KC_##K68, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K6D, KC_NO,    KC_NO    }, \
-}

+ 0 - 137
converter/m0110_usb/keymap_default.c

@@ -1,137 +0,0 @@
-/*
-Copyright 2011,2012,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
-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:
-     * 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|  -|
-     * |---------------------------------------------------------| |---------------|
-     * |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|
-     *      |Opt|Mac |         Space               |Fn  |Opt|      |      0|  .|   |
-     *      `-----------------------------------------------'      `---------------'
-     * M0110A
-     * ,---------------------------------------------------------. ,---------------.
-     * |  `|  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|  -|
-     * |-----------------------------------------------------'   | |---------------|
-     * |Ctrl  |  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,EQL, PSLS,PAST,
-    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, FN13,LEFT,RGHT,DOWN,    P0,       PDOT
-    ),
-    /* Cursor Layer:
-     * M0110                                                       M0120
-     * ,---------------------------------------------------------. ,---------------.
-     * |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|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,  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, FN13,HOME,END, PGDN,    P0,       PDOT
-    ),
-};
-
-
-/*
- * 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_RALT, KC_BSLASH),
-};

+ 0 - 87
converter/m0110_usb/keymap_hasu.c

@@ -1,87 +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
-     * ,---------------------------------------------------------.
-     * |  `|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|Backs|
-     * |---------------------------------------------------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|  \|
-     * |---------------------------------------------------------|
-     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L| Fn|  '|Return|
-     * |---------------------------------------------------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,| Fn|Shift   |
-     * `---------------------------------------------------------'
-     *      |Fn |alt |           Fn                |Gui |Fn |
-     *      `-----------------------------------------------'
-     */
-    [0] = KEYMAP(
-    ESC, 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,         P7,  P8,  P9,  PMNS,
-    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   FN3, QUOT,     ENT,     P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, FN1,           UP,      P1,  P2,  P3,  PENT,
-    FN0, LALT,               FN2,                LGUI,BSLS,LEFT,RGHT,DOWN,    P0,       PDOT
-    ),
-    // IJKL cursor
-    [1] = KEYMAP(
-    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
-    CAPS,NO,  NO,  NO,  NO,  NO,  HOME,PGDN,UP,  PGUP,END, NO,  NO,           P7,  P8,  P9,  PMNS,
-    LCTL,VOLD,VOLU,MUTE,NO,  NO,  HOME,LEFT,DOWN,RGHT,END, NO,       ENT,     P4,  P5,  P6,  PPLS,
-    LSFT,NO,  NO,  NO,  NO,  NO,  HOME,PGDN,PGUP,END, NO,            PGUP,    P1,  P2,  P3,  PENT,
-    TRNS,LALT,               SPC,                LGUI,BSLS,HOME,END, PGDN,    P0,       PDOT
-    ),
-    // HJKL cursor
-    [2] = KEYMAP(
-    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
-    CAPS,NO,  NO,  NO,  NO,  NO,  HOME,PGDN,UP,  PGUP,END, NO,  NO,           P7,  P8,  P9,  PMNS,
-    LCTL,VOLD,VOLU,MUTE,NO,  NO,  LEFT,DOWN,UP,  RGHT,NO,  NO,       ENT,     P4,  P5,  P6,  PPLS,
-    LSFT,NO,  NO,  NO,  NO,  NO,  HOME,PGDN,PGUP,END, TRNS,          PGUP,    P1,  P2,  P3,  PENT,
-    TRNS,LALT,               SPC,                LGUI,BSLS,HOME,END, PGDN,    P0,       PDOT
-    ),
-    // Mousekey
-    [3] = KEYMAP(
-    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
-    CAPS,Q,   W,   E,   R,   T,   WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD,         P7,  P8,  P9,  PMNS,
-    LCTL,VOLD,VOLU,MUTE,NO,  NO,  BTN2,MS_L,MS_D,MS_R,BTN1,NO,       ENT,     P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   BTN2,BTN1,BTN4,BTN5,NO,            PGUP,    P1,  P2,  P3,  PENT,
-    NO,  LALT,               TRNS,               LGUI,BSLS,HOME,END, PGDN,    P0,       PDOT
-    ),
-    // Mousekey
-    [4] = KEYMAP(
-    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
-    CAPS,Q,   W,   E,   R,   T,   WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD,         P7,  P8,  P9,  PMNS,
-    LCTL,VOLD,VOLU,MUTE,NO,  NO,  BTN2,MS_L,MS_D,MS_R,TRNS,NO,       ENT,     P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   BTN2,BTN1,BTN4,BTN5,NO,            PGUP,    P1,  P2,  P3,  PENT,
-    NO,  LALT,               BTN1,               LGUI,BSLS,HOME,END, PGDN,    P0,       PDOT
-    ),
-};
-
-
-/*
- * Fn action definition
- */
-const uint16_t fn_actions[] PROGMEM = {
-    [0]  = ACTION_LAYER_MOMENTARY(1),
-    [1]  = ACTION_LAYER_TAP_KEY(2, KC_SLASH),
-    [2]  = ACTION_LAYER_TAP_KEY(3, KC_SPACE),
-    [3]  = ACTION_LAYER_TAP_KEY(4, KC_SCOLON),
-};

+ 0 - 73
converter/m0110_usb/keymap_intl.c

@@ -1,73 +0,0 @@
-/*
-Copyright 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
-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 keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
-    /* International keyboard
-     * 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|  [|  ]|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|  ,|  ,|  /|        | |  1|  2|  3|   |
-     * `---------------------------------------------------------' |-----------|Ent|
-     *      |Opt|Mac |         Space               |Fn  |   |      |      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,              P1,  P2,  P3,  PENT,
-         LALT,LGUI,               SPC,                     FN0,               P0,       PDOT
-    ),
-    /* Cursor Layer
-     * ,---------------------------------------------------------. ,---------------.
-     * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delet| |Nlk|  -|  +|  *|
-     * |---------------------------------------------------------| |---------------|
-     * |Caps |Hom| Up|PgU|   |   |   |   |Psc|Slk|Pau|Up |   |Ret| |  7|  8|  9|  /|
-     * |------------------------------------------------------,  | |---------------|
-     * |Ctrl  |Lef|Dow|Rig|   |   |   |   |Hom|PgU|Lef|Rig|Ins|  | |  4|  5|  6|  ,|
-     * |---------------------------------------------------------| |---------------|
-     * |Shif|  <|End|   |PgD|   |   |   |   |End|PgD|Dow|        | |  1|  2|  3|   |
-     * `---------------------------------------------------------' |-----------|Ent|
-     *      |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,              P1,  P2,  P3,  PENT,
-         LALT,LGUI,               SPC,                     FN0,               P0,       PDOT
-    ),
-};
-
-
-/*
- * Fn action definition
- */
-const uint16_t fn_actions[] PROGMEM = {
-    [0]  = ACTION_LAYER_MOMENTARY(1),
-};

+ 0 - 71
converter/m0110_usb/keymap_spacefn.c

@@ -1,71 +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|  /|
-     * |---------------------------------------------------------| |---------------|
-     * |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|
-     *      |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,
-    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,               FN0,                RGUI,BSLS,LEFT,RGHT,DOWN,    P0,       PDOT
-    ),
-    [1] = KEYMAP(
-    ESC, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, DEL,     NLCK,EQL, PSLS,PAST,
-    TRNS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP,  END, PSCR,SLCK,PAUS,         P7,  P8,  P9,  PMNS,
-    LCTL,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,           PGUP,    P1,  P2,  P3,  PENT,
-    TRNS,TRNS,               TRNS,               TRNS,INS, HOME,END, PGDN,    P0,       PDOT
-    ),
-};
-
-/*
- * Fn action definition
- */
-const uint16_t fn_actions[] PROGMEM = {
-    [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
-    [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV),    // tilde
-};

+ 0 - 32
converter/m0110_usb/led.c

@@ -1,32 +0,0 @@
-/*
-Copyright 2011 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 <avr/io.h>
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-    if (usb_led &  (1<<USB_LED_CAPS_LOCK)) {
-        DDRD |= (1<<6);
-        PORTD |= (1<<6);
-    } else {
-        DDRD |= (1<<6);
-        PORTD &= ~(1<<6);
-    }
-}

+ 0 - 142
converter/m0110_usb/matrix.c

@@ -1,142 +0,0 @@
-/*
-Copyright 2011,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/>.
-*/
-
-/*
- * scan matrix
- */
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#include "print.h"
-#include "util.h"
-#include "debug.h"
-#include "host.h"
-#include "led.h"
-#include "m0110.h"
-#include "matrix.h"
-
-
-#define CAPS        0x39
-#define CAPS_BREAK  (CAPS | 0x80)
-#define ROW(key)    ((key)>>3&0x0F)
-#define COL(key)    ((key)&0x07)
-
-
-static bool is_modified = false;
-
-// matrix state buffer(1:on, 0:off)
-static uint8_t *matrix;
-static uint8_t _matrix0[MATRIX_ROWS];
-
-static void register_key(uint8_t key);
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-void matrix_init(void)
-{
-    m0110_init();
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00;
-    matrix = _matrix0;
-    return;
-}
-
-uint8_t matrix_scan(void)
-{
-    uint8_t key;
-
-    is_modified = false;
-    key = m0110_recv_key();
-
-    if (key == M0110_NULL) {
-        return 0;
-    } else if (key == M0110_ERROR) {
-        return 0;
-    } else {
-        is_modified = true;
-        register_key(key);
-    }
-
-    if (debug_enable) {
-        print("["); phex(key); print("]\n");
-    }
-    return 1;
-}
-
-bool matrix_is_modified(void)
-{
-    return is_modified;
-}
-
-inline
-bool matrix_has_ghost(void)
-{
-    return false;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
-inline
-uint8_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 01234567\n");
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        phex(row); print(": ");
-        pbin_reverse(matrix_get_row(row));
-        print("\n");
-    }
-}
-
-uint8_t matrix_key_count(void)
-{
-    uint8_t count = 0;
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        count += bitpop(matrix[i]);
-    }
-    return count;
-}
-
-inline
-static void register_key(uint8_t key)
-{
-    if (key&0x80) {
-        matrix[ROW(key)] &= ~(1<<COL(key));
-    } else {
-        matrix[ROW(key)] |=  (1<<COL(key));
-    }
-}

+ 0 - 74
converter/news_usb/Makefile.pjrc

@@ -1,74 +0,0 @@
-#
-# Makefile for PJRC Teensy
-#
-
-
-# Target file name (without extension).
-TARGET = news_usb_pjrc
-
-# 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 \
-	news.c
-
-CONFIG_H = config_pjrc.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)
-
-
-
-#---------------- 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/pjrc.mk
-include $(TMK_DIR)/protocol.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk

+ 0 - 62
converter/news_usb/config_pjrc.h

@@ -1,62 +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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x5021
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         SONY NEWS keyboard converter
-#define DESCRIPTION     converts SONY NEWS protocol into USB
-
-
-/* matrix size */
-#define MATRIX_ROWS 16  // keycode bit: 3-0
-#define MATRIX_COLS 8   // keycode bit: 6-4
-
-
-/* legacy keymap support */
-#define USE_LEGACY_KEYMAP
-
-
-/* key combination for command */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \
-    keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-/* Asynchronous USART
- * 8-data bit, non parity, 1-stop bit, no flow control
- */
-#ifdef __AVR_ATmega32U4__
-#   define NEWS_KBD_RX_VECT        USART1_RX_vect
-#   define NEWS_KBD_RX_DATA        UDR1
-#   define NEWS_KBD_RX_BAUD        9600
-#   define NEWS_KBD_RX_UBBR        ((F_CPU/(16UL*NEWS_KBD_RX_BAUD))-1)
-#   define NEWS_KBD_RX_INIT()      do { \
-        UBRR1L = (uint8_t) NEWS_KBD_RX_UBBR; \
-        UBRR1H = (uint8_t) (NEWS_KBD_RX_UBBR>>8); \
-        UCSR1B |= (1<<RXCIE1) | (1<<RXEN1); \
-    } while(0)
-#else
-#   error "USART configuration is needed."
-#endif
-
-#endif

+ 0 - 125
converter/news_usb/keymap.c

@@ -1,125 +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 <stdbool.h>
-#include <avr/pgmspace.h>
-#include "keycode.h"
-#include "util.h"
-#include "keymap.h"
-
-
-
-
-// Following macros help you to define a keymap with the form of actual keyboard layout.
-
-/* SONY NEWS NWP-5461 */
-#define KEYMAP( \
-    K7A,    K01,K02,K03,K04,K05,  K06,K07,K08,K09,K0A,  K68,K69,          K64,K65,K52, \
-    K0B,K0C,K0D,K0E,K0F,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19, K6A, K4B,K4C,K4D,K4E, \
-    K1A,K1B,K1C,K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,     K6B, K4F,K50,K51,K56, \
-    K28,K29,K2A,K2B,K2C,K2D,K2E,K2F,K30,K31,K32,K33,K34,    K35, K6C, K53,K54,K55,K5A, \
-    K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,        K42, K6D, K57,K59,K58,     \
-    K43,K44,K45,        K46,        K47,            K48,K49,K4A, K6E, K66,K5B,K5C,K5D  \
-) { \
-    { KC_NO,    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_##K1F }, \
-    { 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_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \
-    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
-    { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K64, KC_##K65, KC_##K66, KC_NO    }, \
-    { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-    { KC_NO,    KC_NO,    KC_##K7A, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }  \
-}
-
-
-// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
-static const uint8_t PROGMEM fn_layer[] = {
-    0,              // Fn0
-    0,              // Fn1
-    0,              // Fn2
-    0,              // Fn3
-    0,              // Fn4
-    0,              // Fn5
-    0,              // Fn6
-    0               // Fn7
-};
-
-// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
-// See layer.c for details.
-static const uint8_t PROGMEM fn_keycode[] = {
-    KC_NO,          // Fn0
-    KC_NO,          // Fn1
-    KC_NO,          // Fn2
-    KC_NO,          // Fn3
-    KC_NO,          // Fn4
-    KC_NO,          // Fn5
-    KC_NO,          // Fn6
-    KC_NO           // Fn7
-};
-
-
-static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* 0: default
-     * ,---.   ,------------------------, ,------------------------. ,---------.
-     * |Pow|   | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10| | F11| F12| ,-----------.
-     * `---'   `------------------------' `------------------------' `---------' |  *|  /|  +|
-     * ,-------------------------------------------------------------. ,---. ,---------------|
-     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|  \|  BS | |Hlp| |  7|  8|  9|  -|
-     * |-------------------------------------------------------------| |---| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|Del|   | |Ins| |  4|  5|  6|  ,|
-     * |---------------------------------------------------------'   | |---| |---------------|
-     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  `|Return| |Clr| |  1|  2|  3|   |
-     * |-------------------------------------------------------------| |---| |-----------|Ent|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /|   |Shift   | |PgU| |  0|  .| Up|   |
-     * |-------------------------------------------------------------| |---| |---------------|
-     * |Alt  |Gui |Alt |         Space     |          |Gui|App|Ctrl  | |PgD| |Tab|Lef|Dow|Rig|
-     * `-------------------------------------------------------------' `---' `---------------'
-     */
-    KEYMAP(
-    PWR,      F1,  F2,  F3,  F4,  F5,       F6,  F7,  F8,  F9,  F10,      F11, F12,            PAST,PSLS,PPLS,
-    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSLS,BSPC,   HELP,   P7,  P8,  P9,  PMNS,
-    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,DEL,         INS,    P4,  P5,  P6,  PCMM,
-    LCTL,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,GRV,      ENT,    CLR,    P1,  P2,  P3,  PENT,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RO,            RSFT,   PGUP,   P0,  PDOT,UP,
-    LALT,CAPS,LALT,          SPC,      ERAS,                    RALT,RGUI,RCTL,   PGDN,   TAB, LEFT,DOWN,RGHT
-    ),
-};
-
-
-uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
-{
-    return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
-}
-
-uint8_t keymap_fn_layer(uint8_t index)
-{
-    return pgm_read_byte(&fn_layer[index]);
-}
-
-uint8_t keymap_fn_keycode(uint8_t index)
-{
-    return pgm_read_byte(&fn_keycode[index]);
-}

+ 0 - 26
converter/news_usb/led.c

@@ -1,26 +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 "news.h"
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-    // not supported now
-}

+ 0 - 142
converter/news_usb/matrix.c

@@ -1,142 +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 <stdbool.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#include "print.h"
-#include "util.h"
-#include "news.h"
-#include "matrix.h"
-#include "debug.h"
-
-
-/*
- * Matrix Array usage:
- *
- * ROW: 16
- * COL:8
- *
- *    8bit wide
- *   +---------+
- *  0|00 ... 07|
- *  1|08 ... 0F|
- *  :|   ...   |
- *  :|   ...   |
- *  E|70 ... 77|
- *  F|78 ... 7F|
- *   +---------+
- *
- */
-static uint8_t matrix[MATRIX_ROWS];
-#define ROW(code)      ((code>>3)&0xF)
-#define COL(code)      (code&0x07)
-
-static bool is_modified = false;
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-void matrix_init(void)
-{
-    news_init();
-
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
-
-    return;
-}
-
-uint8_t matrix_scan(void)
-{
-    is_modified = false;
-
-    uint8_t code;
-    code = news_recv();
-    if (code == 0) {
-        return 0;
-    }
-
-    phex(code); print(" ");
-    if (code&0x80) {
-        // break code
-        if (matrix_is_on(ROW(code), COL(code))) {
-            matrix[ROW(code)] &= ~(1<<COL(code));
-            is_modified = true;
-        }
-    } else {
-        // make code
-        if (!matrix_is_on(ROW(code), COL(code))) {
-            matrix[ROW(code)] |=  (1<<COL(code));
-            is_modified = true;
-        }
-    }
-    return code;
-}
-
-bool matrix_is_modified(void)
-{
-    return is_modified;
-}
-
-inline
-bool matrix_has_ghost(void)
-{
-    return false;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
-inline
-uint8_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 01234567\n");
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        phex(row); print(": ");
-        pbin_reverse(matrix_get_row(row));
-        print("\n");
-    }
-}
-
-uint8_t matrix_key_count(void)
-{
-    uint8_t count = 0;
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        count += bitpop(matrix[i]);
-    }
-    return count;
-}

+ 0 - 87
converter/next_usb/Makefile

@@ -1,87 +0,0 @@
-# Target file name (without extension).
-TARGET = next_usb
-
-# 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 = at90usb162       # Teensy 1.0
-#MCU = atmega32u4       # Teensy 2.0
-#MCU = at90usb646       # Teensy++ 1.0
-#MCU = at90usb1286      # Teensy++ 2.0
-MCU = atmega32u2       # TMK converter
-
-
-# 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(+60)
-#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
-
-
-# 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
-EXTRAKEY_ENABLE = yes	# Audio control and System control
-CONSOLE_ENABLE = yes	# Console for debug(+400)
-COMMAND_ENABLE = yes    # Commands for debug and configuration
-#NKRO_ENABLE = yes	# USB Nkey Rollover
-
-SRC += next_kbd.c
-
-
-# Search Path
-VPATH += $(TARGET_DIR)
-VPATH += $(TMK_DIR)
-
-
-include $(TMK_DIR)/protocol.mk
-include $(TMK_DIR)/protocol/lufa.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk

+ 0 - 63
converter/next_usb/Makefile.pjrc

@@ -1,63 +0,0 @@
-# Target file name (without extension).
-TARGET = next_usb
-
-# 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 = 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
-EXTRAKEY_ENABLE = yes	# Audio control and System control
-CONSOLE_ENABLE = yes	# Console for debug(+400)
-COMMAND_ENABLE = yes    # Commands for debug and configuration
-#NKRO_ENABLE = yes	# USB Nkey Rollover
-
-SRC += next_kbd.c
-
-
-# Search Path
-VPATH += $(TARGET_DIR)
-VPATH += $(TMK_DIR)
-
-
-include $(TMK_DIR)/protocol.mk
-include $(TMK_DIR)/protocol/pjrc.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk

+ 0 - 45
converter/next_usb/README

@@ -1,45 +0,0 @@
-NeXT non-ADB Keyboard Converter
--------------------------------
-
-Cable connector inside keyboard case:
-+-----+
-|Black|\
-|Green|-\
-|Yello|--\--------  to computer via Mini-Din 5a Connector
-|Orang|--/--------
-|Red  |-/
-|Brown|/
-+-----+
-
-Black  - Ground to outer metal part of Mini Din 5a connector (not used)
-Green  - Ground
-Yellow - Power button signal 
-Orange - Keyboard Out
-Red    - Keyboard In
-Brown  - Vcc
-
-ATmega32u4 connections (pinout provided for Arduino Pro Micro):
-
-Keyboard out (orange) : PD0 (pin 3)
-Keyboard in  (red)    : PD1 (pin 2)
-Power Button (yellow) : PD4 (pin 4)
-Ground       (black)  : GND
-Vcc          (brown)  : VCC
-
-See attached next_timings.jpg file for a detailed illustration of NeXT keyboard protocol timings.
-
-Power button signal line is normally high when the keyboard is powered/initialized.  It is pulled to ground when pressed.  The converter automatically translates this to a "normal" keypress with code 0x5A.  This connection is technically optional, the only side effect of not making this connection is the power key will do nothing.
-
-Converter is based heavily on Ladyada's original "USB NeXT Keyboard with Arduino Micro" tutorial (http://learn.adafruit.com/usb-next-keyboard-with-arduino-micro/overview).  If you build this converter, show Adafruit some love and do it using an Arduino Micro (http://www.adafruit.com/products/1315) or their ATmega 32u4 Breakout Board (http://www.adafruit.com/products/296).  Arduino Micro should work fine using the Arduino Pro Micro configuration above, same pins numbers and everything.
-
-TODO:
------
-
-I believe it might be possible to run the keyboard off of 3V; during testing I observed that the keyboard could sometimes function even without Vcc connected as long as the ground connection was good and the Keyboard In line was connected.  If that works it should be easy to do a Bluetooth conversion and run the keyboard right off of a LiPo battery without a boost circuit
-
-Utilize second LED as status indicator for good initialization; also try to make hot plugging much more robust.
-
-Figure a better use for the Power button.  Too easy to hit it by mistake to use for Suspend or Power Off - maybe move cap to different part of the board and consider that
-
-Figure out a better use for the lock LEDs.  Right now they just light up when you press shift.  Lame.  Maybe implement proper Caps/Num/Scroll Locks
-

+ 0 - 190
converter/next_usb/config.h

@@ -1,190 +0,0 @@
-/*
-NeXT non-ADB Keyboard USB Converter
- 
-Copyright 2013, Benjamin Gould (bgould@github.com)
-
-Based on:
-TMK firmware code Copyright 2011,2012 Jun WAKO <wakojun@gmail.com>
-Arduino code by "Ladyada" Limor Fried (http://ladyada.net/, http://adafruit.com/), released under BSD license
-
-Timing reference thanks to http://m0115.web.fc2.com/ (dead link), http://cfile7.uf.tistory.com/image/14448E464F410BF22380BB
-Pinouts thanks to http://www.68k.org/~degs/nextkeyboard.html
-Keycodes from http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/sys/arch/next68k/dev/
-
-This software is licensed with a Modified BSD License.
-All of this is supposed to be Free Software, Open Source, DFSG-free,
-GPL-compatible, and OK to use in both free and proprietary applications.
-Additions and corrections to this file are welcome.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions and the following disclaimer in
-  the documentation and/or other materials provided with the
-  distribution.
-
-* Neither the name of the copyright holders nor the names of
-  contributors may be used to endorse or promote products derived
-  from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0xBCBC
-#define DEVICE_VER      0x0500
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         NeXT Keyboard to USB converter
-#define DESCRIPTION     USB converter for NeXT non-ADB Keyboard
-
-/* matrix size */
-#define MATRIX_ROWS 12  // keycode bit: 3-0
-#define MATRIX_COLS  8  // keycode bit: 6-4
-
-#define DEBUG_ON_INIT 1
-
-//#define TEENSY_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 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
-
-// this is the debugging LED that flashes when a key is being pressed
-// comment out in order to disable debugging LED
-#define NEXT_KBD_LED1_PORT  PORTD
-#define NEXT_KBD_LED1_PIN   PIND
-#define NEXT_KBD_LED1_DDR   DDRD
-#define NEXT_KBD_LED1_BIT   5
-
-#define NEXT_KBD_LED1_ON    NEXT_KBD_LED1_PORT &= ~(1<<NEXT_KBD_LED1_BIT);
-#define NEXT_KBD_LED1_OFF   NEXT_KBD_LED1_PORT |=  (1<<NEXT_KBD_LED1_BIT);
-
-// reserved for future use
-#define NEXT_KBD_LED2_PORT  PORTB
-#define NEXT_KBD_LED2_PIN   PINB
-#define NEXT_KBD_LED2_DDR   DDRB
-#define NEXT_KBD_LED2_BIT   6
-
-#define NEXT_KBD_LED2_ON    NEXT_KBD_LED2_PORT &= ~(1<<NEXT_KBD_LED2_BIT);
-#define NEXT_KBD_LED2_OFF   NEXT_KBD_LED2_PORT |=  (1<<NEXT_KBD_LED2_BIT);
-
-// corresponds to the Keyboard In wire on the NeXT connector
-// (red wire in NeXT connector) - pin 2 on the Pro Micro
-#define NEXT_KBD_OUT_PORT  PORTD
-#define NEXT_KBD_OUT_PIN   PIND
-#define NEXT_KBD_OUT_DDR   DDRD
-#define NEXT_KBD_OUT_BIT   1
-
-// corresponds to the Keyboard Out wire on the NeXT connector
-// (orange wire in NeXT connector) - pin 3 on the Pro Micro
-#define NEXT_KBD_IN_PORT   PORTD
-#define NEXT_KBD_IN_PIN    PIND
-#define NEXT_KBD_IN_DDR    DDRD
-#define NEXT_KBD_IN_BIT    0
-
-// this pin is an input for the power key on the NeXT keyboard
-// as the keyboard is powered on this should be normally high;
-// if it is pulled low it means the power button is being preseed
-// (yellow wire in NeXT connector) - pin 4 on the Pro Micro
-#define NEXT_KBD_PWR_PORT  PORTD
-#define NEXT_KBD_PWR_PIN   PIND
-#define NEXT_KBD_PWR_DDR   DDRD
-#define NEXT_KBD_PWR_BIT   4
-
-#endif
-//============== End of Arduino Pro Micro Configuration ===============
-
-
-//================ Start of Teensy 2.0 Configuration =================
-#ifdef TEENSY_CONFIG
-
-// this is the debugging LED that flashes when a key is being pressed
-// comment out in order to disable debugging LED
-#define NEXT_KBD_LED_PORT  PORTD
-#define NEXT_KBD_LED_PIN   PIND
-#define NEXT_KBD_LED_DDR   DDRD
-#define NEXT_KBD_LED_BIT   6
-
-#define NEXT_KBD_LED_ON  NEXT_KBD_LED_PORT |=  (1<<NEXT_KBD_LED_BIT);
-#define NEXT_KBD_LED_OFF NEXT_KBD_LED_PORT &= ~(1<<NEXT_KBD_LED_BIT);
-
-// corresponds to the Keyboard In wire on the NeXT connector
-// (red wire in NeXT connector)
-#define NEXT_KBD_OUT_PORT  PORTB
-#define NEXT_KBD_OUT_PIN   PINB
-#define NEXT_KBD_OUT_DDR   DDRB
-#define NEXT_KBD_OUT_BIT   1
-
-// corresponds to the Keyboard Out wire on the NeXT connector
-// (orange wire in NeXT connector)
-#define NEXT_KBD_IN_PORT   PORTB
-#define NEXT_KBD_IN_PIN    PINB
-#define NEXT_KBD_IN_DDR    DDRB
-#define NEXT_KBD_IN_BIT    0
-
-#endif
-//================= End of Teensy 2.0 Configuration ==================
-
-
-//================ Start of TMK converter Configuration =================
-#ifdef TMK_CONFIG
-
-// this is the debugging LED that flashes when a key is being pressed
-// comment out in order to disable debugging LED
-#define NEXT_KBD_LED1_PORT  PORTD
-#define NEXT_KBD_LED1_PIN   PIND
-#define NEXT_KBD_LED1_DDR   DDRD
-#define NEXT_KBD_LED1_BIT   6
-
-#define NEXT_KBD_LED1_ON    NEXT_KBD_LED1_PORT |=  (1<<NEXT_KBD_LED1_BIT);
-#define NEXT_KBD_LED1_OFF   NEXT_KBD_LED1_PORT &= ~(1<<NEXT_KBD_LED1_BIT);
-
-// corresponds to the Keyboard In wire on the NeXT connector
-#define NEXT_KBD_OUT_PORT  PORTD
-#define NEXT_KBD_OUT_PIN   PIND
-#define NEXT_KBD_OUT_DDR   DDRD
-#define NEXT_KBD_OUT_BIT   1
-
-// corresponds to the Keyboard Out wire on the NeXT connector
-#define NEXT_KBD_IN_PORT   PORTD
-#define NEXT_KBD_IN_PIN    PIND
-#define NEXT_KBD_IN_DDR    DDRD
-#define NEXT_KBD_IN_BIT    0
-
-// this pin is an input for the power key on the NeXT keyboard
-// as the keyboard is powered on this should be normally high;
-// if it is pulled low it means the power button is being preseed
-#define NEXT_KBD_PWR_PORT  PORTD
-#define NEXT_KBD_PWR_PIN   PIND
-#define NEXT_KBD_PWR_DDR   DDRD
-#define NEXT_KBD_PWR_BIT   4
-
-#endif
-//================= End of TMK converter Configuration ==================
-
-/* 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_RALT))) || \
-    (keyboard_report->mods == (MOD_BIT(KC_RGUI) | MOD_BIT(KC_RGUI)))  \
-)

+ 0 - 177
converter/next_usb/keymap.c

@@ -1,177 +0,0 @@
-/*
-NeXT non-ADB Keyboard USB Converter
- 
-Copyright 2013, Benjamin Gould (bgould@github.com)
-
-Based on:
----------
-* TMK firmware code Copyright 2011,2012 Jun WAKO <wakojun@gmail.com>
-* Arduino code by "Ladyada" Limor Fried (http://ladyada.net/, http://adafruit.com/) \
-    released under BSD license \
-    https://github.com/adafruit/USB-NeXT-Keyboard
-
-Timing reference thanks to http://m0115.web.fc2.com/ (dead link), http://cfile7.uf.tistory.com/image/14448E464F410BF22380BB
-Pinouts thanks to http://www.68k.org/~degs/nextkeyboard.html
-Keycodes from http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/sys/arch/next68k/dev/
-
-This software is licensed with a Modified BSD License.
-All of this is supposed to be Free Software, Open Source, DFSG-free,
-GPL-compatible, and OK to use in both free and proprietary applications.
-Additions and corrections to this file are welcome.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions and the following disclaimer in
-  the documentation and/or other materials provided with the
-  distribution.
-
-* Neither the name of the copyright holders nor the names of
-  contributors may be used to endorse or promote products derived
-  from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/pgmspace.h>
-#include "keycode.h"
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "keymap.h"
-#include "keycode.h"
-
-// 32*8(256) byte array which converts PS/2 code into USB code
-static const uint16_t PROGMEM fn_actions[] = {
-    ACTION_LAYER_MOMENTARY(1),                  // FN0 - left command key
-    ACTION_LAYER_MOMENTARY(1),                  // FN1 - right command key
-    ACTION_KEY(KC_BSLS),                        // FN2 - number pad slash & backslash
-    ACTION_MODS_KEY(MOD_LSFT, KC_BSLS),         // FN3 - number pad equals & pipe
-    ACTION_MODS_KEY(MOD_LCTL, KC_Z),            // FN4 - cmd+undo  on layer 1
-    ACTION_MODS_KEY(MOD_LCTL, KC_X),            // FN5 - cmd+cut   on layer 1
-    ACTION_MODS_KEY(MOD_LCTL, KC_C),            // FN6 - cmd+copy  on layer 1
-    ACTION_MODS_KEY(MOD_LCTL, KC_V),            // FN7 - cmd+paste on layer 1
-};
-
-/* This is the physical layout that I am starting with:
- *   Note: there is some strangeness on the number pad; 
- *         the equal sign shifts to pipe and forward slash shifts to backslash
- * ,-----------------------------------------------------------. ,-----------. ,---------------.
- * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|   BS  | |VUp|Pwr|BrU| |`  |  =|  /|  *|
- * |-----------------------------------------------------------| |-----------| |---------------|
- * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|     | |VDn|   |BrD| |  7|  8|  9|  -|
- * |------------------------------------------------------     | `---'   `---' |-----------|---|
- * |Ctrl  |  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|
- * |Alt  |Cmd  |              Space                |Cmd  |Alt  | |Lef|Dow|Rig| |      0|  .|   |
- * `-----------------------------------------------------------' `-----------' `---------------'
- *
- * Keymap array:
- *     8 bytes
- *   +---------+
- *  0|         |
- *  :|         | 0x00-0x87
- *  ;|         |
- * 11|         |
- *   +---------+
- */
-#define KEYMAP( \
-    K49,K4A,K4B,K4C,K4D,K50,K4F,K4E,K1E,K1F,K20,K1D,K1C,K1B,  K1A,K58,K19,  K26,K27,K28,K25, \
-    K41,K42,K43,K44,K45,K48,K47,K46,K06,K07,K08,K05,K04,K03,  K02,    K01,  K21,K22,K23,K24, \
-    K57,K39,K3A,K3B,K3C,K3D,K40,K3F,K3E,K2D,K2C,K2B,    K2A,                K12,K18,K13,K15, \
-    K56,    K31,K32,K33,K34,K35,K37,K36,K2E,K2F,K30,    K55,      K16,      K11,K17,K14,     \
-    K52,K54,                  K38,                  K53,K51,  K09,K0F,K10,  K0B,    K0C,K0D  \
-) { \
-    { KC_NO,    KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
-    { KC_##K08, KC_##K09, KC_##K10, KC_##K0B, KC_##K0C, KC_##K0D, KC_NO,    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_##K1F }, \
-    { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
-    { KC_##K28, KC_NO,    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_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F }, \
-    { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57 }, \
-    { KC_##K58, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,   }, \
-}
-
-
-static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    
-    /* Layer 0: default
-     * ,-----------------------------------------------------------. ,-----------. ,---------------.
-     * |Esc|  1|  2|  3|  4|  5|  6|  7|  8|  9|  0|  -|  =|   BS  | |Ins|Ref|Hom| |`  |  =|  /|  *|
-     * |-----------------------------------------------------------| |-----------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]|     | |Del|   |End| |  7|  8|  9|  -|
-     * |-----------------------------------------------------'     | `---'   `---' |-----------|---|
-     * |Ctrl  |  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|
-     * |Fn0  |Alt  |              Space                |LGui |Fn1  | |Lef|Dow|Rig| |      0|  .|   |
-     * `-----------------------------------------------------------' `-----------' `---------------'
-     */
-    KEYMAP(
-    ESC, 1,   2,   3,   4,   5,   6,   7,   8,   9,   0,   MINS,EQL, BSPC,  INS, WREF,HOME,  GRV, FN3, FN2, PAST,
-    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,NO,    DEL,      END,   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,     RSFT,       UP,         P1,  P2,  P3,  
-    FN0, LALT,                    SPC,                          LGUI,FN1,  LEFT,DOWN,RGHT,  P0,       PDOT,PENT
-    
-    ),
-
-    /* Layer 1: extra keys
-     * ,-----------------------------------------------------------. ,-----------. ,---------------.
-     * |Grv| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|   BS  | |VUp|VMu|PgU| |`  |  =|  /|  *|
-     * |-----------------------------------------------------------| |-----------| |---------------|
-     * |Tab  |Pau|  W|  E|  R|  T|  Y|  U|  I|  O|PSc|  \|  ]|     | |VDn|   |PgD| |  7|  8|  9|  -|
-     * |-----------------------------------------------------'     | `---'   `---' |-----------|---|
-     * |Ctrl  |  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  '|  Return|               |  4|  5|  6|  +|
-     * |-----------------------------------------------------------|     ,---.     |---------------|
-     * |Shift   |UND|CUT|COP|PST|  B|  N|  M|  ,|  .|  /|Shift     |     |Up |     |  1|  2|  3|   |
-     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
-     * |Fn0  |Alt  |              Space                |RGui |Fn1  | |Lef|Dow|Rig| |      0|  .|   |
-     * `-----------------------------------------------------------' `-----------' `---------------'
-     */
-    KEYMAP(
-    
-    GRV, F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9,  F10, F11, F12, TRNS,  VOLU,MUTE,PGUP,  TRNS,TRNS,TRNS,TRNS,
-    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,TRNS,                    TRNS,                         TRNS,TRNS,  TRNS,TRNS,TRNS,  TRNS,     TRNS,TRNS
-    
-    )
-};
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
-}

+ 0 - 60
converter/next_usb/led.c

@@ -1,60 +0,0 @@
-/*
-NeXT non-ADB Keyboard USB Converter
- 
-Copyright 2013, Benjamin Gould (bgould@github.com)
-
-Based on:
-TMK firmware code Copyright 2011,2012 Jun WAKO <wakojun@gmail.com>
-Arduino code by "Ladyada" Limor Fried (http://ladyada.net/, http://adafruit.com/), released under BSD license
-
-Timing reference thanks to http://m0115.web.fc2.com/ (dead link), http://cfile7.uf.tistory.com/image/14448E464F410BF22380BB
-Pinouts thanks to http://www.68k.org/~degs/nextkeyboard.html
-Keycodes from http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/sys/arch/next68k/dev/
-
-This software is licensed with a Modified BSD License.
-All of this is supposed to be Free Software, Open Source, DFSG-free,
-GPL-compatible, and OK to use in both free and proprietary applications.
-Additions and corrections to this file are welcome.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions and the following disclaimer in
-  the documentation and/or other materials provided with the
-  distribution.
-
-* Neither the name of the copyright holders nor the names of
-  contributors may be used to endorse or promote products derived
-  from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-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);
-    }
-}

+ 0 - 271
converter/next_usb/matrix.c

@@ -1,271 +0,0 @@
-/*
-NeXT non-ADB Keyboard USB Converter
- 
-Copyright 2013, Benjamin Gould (bgould@github.com)
-
-Based on:
-TMK firmware code Copyright 2011,2012 Jun WAKO <wakojun@gmail.com>
-Arduino code by "Ladyada" Limor Fried (http://ladyada.net/, http://adafruit.com/), released under BSD license
-
-Timing reference thanks to http://m0115.web.fc2.com/ (dead link), http://cfile7.uf.tistory.com/image/14448E464F410BF22380BB
-Pinouts thanks to http://www.68k.org/~degs/nextkeyboard.html
-Keycodes from http://ftp.netbsd.org/pub/NetBSD/NetBSD-release-6/src/sys/arch/next68k/dev/
-
-This software is licensed with a Modified BSD License.
-All of this is supposed to be Free Software, Open Source, DFSG-free,
-GPL-compatible, and OK to use in both free and proprietary applications.
-Additions and corrections to this file are welcome.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright
-  notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-  notice, this list of conditions and the following disclaimer in
-  the documentation and/or other materials provided with the
-  distribution.
-
-* Neither the name of the copyright holders nor the names of
-  contributors may be used to endorse or promote products derived
-  from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-*/
-
-#include <stdint.h>
-#include <stdbool.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#include "print.h"
-#include "util.h"
-#include "serial.h"
-#include "matrix.h"
-#include "debug.h"
-#include "matrix.h"
-#include "next_kbd.h"
-
-static void matrix_make(uint8_t code);
-static void matrix_break(uint8_t code);
-
-static uint8_t matrix[MATRIX_ROWS];
-#define ROW(code)      ((code>>3)&0xF)
-#define COL(code)      (code&0x07)
-
-static bool is_modified = false;
-
-/* number of matrix rows */
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-/* number of matrix columns */
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-#ifndef NEXT_KBD_LED1_ON
-#define NEXT_KBD_LED1_ON
-#endif
-
-#ifndef NEXT_KBD_LED1_OFF
-#define NEXT_KBD_LED1_OFF
-#endif
-
-#define NEXT_KBD_PWR_READ (NEXT_KBD_PWR_PIN&(1<<NEXT_KBD_PWR_BIT))
-
-static bool power_state = false;
-
-/* intialize matrix for scanning. should be called once. */
-void matrix_init(void)
-{
-#ifdef DEBUG_ON_INIT
-    debug_enable = true;
-#endif
-
-    // I've found that the matrix likes a little while for things to 
-    // settle down before it gets started.  Not sure why :)
-    _delay_ms(250);
-    
-    dprintf("[ Intializing NeXT keyboard ]\n");
-    NEXT_KBD_LED1_DDR |=  (1<<NEXT_KBD_LED1_BIT);  // LED pin to output
-    NEXT_KBD_LED1_ON;
-    
-    NEXT_KBD_PWR_DDR &= ~(1<<NEXT_KBD_PWR_BIT);  // Power Button pin to input
-    NEXT_KBD_PWR_PIN |=  (1<<NEXT_KBD_PWR_BIT);  // KBD_PWR pull up
-    
-    power_state = NEXT_KBD_PWR_READ ? false : true;
-    dprintf("Initial power button state: %b\n", power_state);
-    
-    next_kbd_init();
-
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
-
-#ifdef NEXT_KBD_INIT_FLASH_LEDS
-    dprintf("flashing LEDs:");
-    // flash the LEDs after initialization
-    bool leds_on = true;
-    for (uint8_t i = 0; i <= 6; i++)
-    {
-        leds_on = leds_on ? false : true;
-        dprintf(" %b", leds_on); 
-        next_kbd_set_leds(leds_on, leds_on);
-        _delay_ms(250);
-    }
-    dprintf("\n");
-#endif
-
-    dprintf("[ NeXT keyboard initialized ]\n");
-
-    return;
-}
-
-#define NEXT_KBD_KEYCODE(response)               (uint8_t)((response&0xFF)>>1)
-#define NEXT_KBD_PRESSED_KEYCODE(response)       (uint8_t)(((response)&0xF00)==0x400)
-#define NEXT_KBD_PRESSED(response, mask)         (uint8_t)(((response)&mask)>0)
-#define NEXT_KBD_PRESSED_CONTROL(response)       NEXT_KBD_PRESSED(response,0x01000)
-#define NEXT_KBD_PRESSED_SHIFT_LEFT(response)    NEXT_KBD_PRESSED(response,0x02000)
-#define NEXT_KBD_PRESSED_SHIFT_RGHT(response)    NEXT_KBD_PRESSED(response,0x04000)
-#define NEXT_KBD_PRESSED_CMD_LEFT(response)      NEXT_KBD_PRESSED(response,0x08000)
-#define NEXT_KBD_PRESSED_CMD_RGHT(response)      NEXT_KBD_PRESSED(response,0x10000)
-#define NEXT_KBD_PRESSED_ALT_LEFT(response)      NEXT_KBD_PRESSED(response,0x20000)
-#define NEXT_KBD_PRESSED_ALT_RGHT(response)      NEXT_KBD_PRESSED(response,0x40000)
-#define NEXT_KBD_MAKE_OR_BREAK(key, code) \
-    do { \
-        if (NEXT_KBD_PRESSED_##key(resp) > 0) \
-            matrix_make(code); \
-        else \
-            matrix_break(code); \
-    } while (0);
-
-#define NEXT_KBD_PWR_KEYCODE 0x58
-
-/* scan all key states on matrix */
-uint8_t matrix_scan(void)
-{
-    _delay_ms(5);
-    
-    //next_kbd_set_leds(false, false);
-    NEXT_KBD_LED1_OFF;
-    
-    is_modified = false;
-    
-    if (!NEXT_KBD_PWR_READ) {
-        matrix_make(NEXT_KBD_PWR_KEYCODE);
-        power_state = 1;
-        if (is_modified)
-        {
-            dprintf("Power state 1\n");
-            
-        }
-    } else {
-        matrix_break(NEXT_KBD_PWR_KEYCODE);
-        power_state = 0;
-        if (is_modified)
-        {
-            dprintf("Power state 0\n");
-            
-        }
-    }
-    
-    uint32_t resp = (next_kbd_recv());
-    
-    if (resp == NEXT_KBD_KMBUS_IDLE)
-    {
-        return 0;
-    }
-    
-    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, \
-        NEXT_KBD_KEYCODE(resp), \
-        NEXT_KBD_PRESSED_KEYCODE(resp), \
-        NEXT_KBD_PRESSED_CONTROL(resp), \
-        NEXT_KBD_PRESSED_SHIFT_LEFT(resp), \
-        NEXT_KBD_PRESSED_SHIFT_RGHT(resp), \
-        NEXT_KBD_PRESSED_CMD_LEFT(resp), \
-        NEXT_KBD_PRESSED_CMD_RGHT(resp), \
-        NEXT_KBD_PRESSED_ALT_LEFT(resp), \
-        NEXT_KBD_PRESSED_ALT_RGHT(resp) \
-    );
-    
-    // Modifier keys don't return keycode; have to check the upper bits    
-    NEXT_KBD_MAKE_OR_BREAK(ALT_RGHT,   0x51);
-    NEXT_KBD_MAKE_OR_BREAK(ALT_LEFT,   0x52);
-    NEXT_KBD_MAKE_OR_BREAK(CMD_RGHT,   0x53);
-    NEXT_KBD_MAKE_OR_BREAK(CMD_LEFT,   0x54);
-    NEXT_KBD_MAKE_OR_BREAK(SHIFT_RGHT, 0x55);
-    NEXT_KBD_MAKE_OR_BREAK(SHIFT_LEFT, 0x56);
-    NEXT_KBD_MAKE_OR_BREAK(CONTROL,    0x57);
-    NEXT_KBD_MAKE_OR_BREAK(KEYCODE,    NEXT_KBD_KEYCODE(resp));
-    
-    return 1;
-}
-
-/* whether modified from previous scan. used after matrix_scan. */
-bool matrix_is_modified()
-{
-    return is_modified;
-}
-
-/* whether a switch is on */
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
-/* matrix state on row */
-inline
-uint8_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-/* print matrix for debug */
-void matrix_print(void)
-{
-}
-
-inline
-static void matrix_make(uint8_t code)
-{
-    if (!matrix_is_on(ROW(code), COL(code))) {
-        matrix[ROW(code)] |= 1<<COL(code);
-        is_modified = true;
-    }
-}
-
-inline
-static void matrix_break(uint8_t code)
-{
-    if (matrix_is_on(ROW(code), COL(code))) {
-        matrix[ROW(code)] &= ~(1<<COL(code));
-        is_modified = true;
-    }
-}

BIN
converter/next_usb/next_timings.jpg


+ 0 - 83
converter/pc98_usb/Makefile

@@ -1,83 +0,0 @@
-# Target file name (without extension).
-TARGET = pc98_usb
-
-# 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 \
-	protocol/serial_uart.c
-#	protocol/serial_soft.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 = 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
-
-
-#
-# 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
-
-
-# Build Options
-#   *Comment out* to disable the options.
-#
-MOUSEKEY_ENABLE = yes	# Mouse keys
-EXTRAKEY_ENABLE = yes	# Audio control and System control
-CONSOLE_ENABLE = yes	# Console for debug
-#NKRO_ENABLE = yes	# USB Nkey Rollover
-
-
-# Boot Section Size in bytes
-#   Teensy halfKay   512
-#   Atmel DFU loader 4096
-#   LUFA bootloader  4096
-OPT_DEFS += -DBOOTLOADER_SIZE=4096
-
-
-# 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

+ 0 - 67
converter/pc98_usb/README

@@ -1,67 +0,0 @@
-PC98 to USB keyboard protocol converter
-=======================================
-Target MCU is ATMega32u4 but other USB capable AVR will also work.
-
-
-Connector
----------
-
-    8Pin mini DIN
-       ___ ___
-      /  |_|  \
-     / 8  7  6 \
-    | 5    4  3 |
-     \_ 2   1 _/
-       \_____/  
-     (receptacle)
-
-
-Wiring: You can change this with editing config.h.
-
-    Pin mini DIN        MCU
-    ----------------------------------
-    1  ~RST(TXD)        PD3
-    2   GND             GND
-    3  ~RDY             PD4
-    4   RXD             PD2
-    5  ~RTY             PD5
-    6   NC                 
-    7   NC                 
-    8   5V              VCC
-
-
-
-
-Protocol
---------
-Signal: Asynchronous, Positive logic, 19200baud, Least bit first
-Frame format: 1-Start bit(Lo), 8-Data bits, Odd-Parity, 1-Stop bit
-
-
-
-Build Firmware
---------------
-Just use 'make'
-
-    $ cd pc98_usb
-    $ make
-
-Then, load the binary to MCU with your favorite programmer.
-
-
-
-Other PC98 converter projects and resource
-------------------------------------------
-PC98 to USB
-http://davy.nyacom.net/kbd98usb/
-
-PC98 to PS/2
-http://www.tsp.ne.jp/~sawada/mago/c_gka98at.htm
-http://www.tsp.ne.jp/~sawada/mago/src/gka98at.asm
-
-PC98 keyboard commands
-http://www.webtech.co.jp/company/doc/undocumented_mem/io_kb.txt
-
-
-Inhibit repeating key:
-0x9C, 0x70

+ 0 - 123
converter/pc98_usb/config.h

@@ -1,123 +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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x9898
-#define DEVICE_VER      0x0100
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         PC98 keyboard converter
-#define DESCRIPTION     converts PC98 keyboard protocol into USB
-
-
-/* matrix size */
-#define MATRIX_ROWS     16
-#define MATRIX_COLS     8
-
-/* key combination for command */
-#define IS_COMMAND()    ( \
-    host_get_first_key() == KC_CANCEL \
-)
-
-
-/* PC98 Reset Port shared with TXD */
-#define PC98_RST_DDR    DDRD
-#define PC98_RST_PORT   PORTD
-#define PC98_RST_BIT    3
-/* PC98 Ready Port */
-#define PC98_RDY_DDR    DDRD
-#define PC98_RDY_PORT   PORTD
-#define PC98_RDY_BIT    4
-/* PC98 Retry Port */
-#define PC98_RTY_DDR    DDRD
-#define PC98_RTY_PORT   PORTD
-#define PC98_RTY_BIT    5
-
-/*
- * PC98 Serial(USART) configuration
- *     asynchronous, positive logic, 19200baud, bit order: LSB first
- *     1-start bit, 8-data bit, odd parity, 1-stop bit
- */
-/*
- * Software Serial
- */
-#define SERIAL_SOFT_BAUD                19200
-#define SERIAL_SOFT_PARITY_ODD
-#define SERIAL_SOFT_BIT_ORDER_LSB
-#define SERIAL_SOFT_LOGIC_POSITIVE
-/* RXD Port */
-#define SERIAL_SOFT_RXD_DDR             DDRD
-#define SERIAL_SOFT_RXD_PORT            PORTD
-#define SERIAL_SOFT_RXD_PIN             PIND
-#define SERIAL_SOFT_RXD_BIT             2
-#define SERIAL_SOFT_RXD_READ()          (SERIAL_SOFT_RXD_PIN&(1<<SERIAL_SOFT_RXD_BIT))
-/* RXD Interupt */
-#define SERIAL_SOFT_RXD_VECT            INT2_vect
-#define SERIAL_SOFT_RXD_INIT()          do { \
-    /* pin configuration: input with pull-up */ \
-    SERIAL_SOFT_RXD_DDR &= ~(1<<SERIAL_SOFT_RXD_BIT); \
-    SERIAL_SOFT_RXD_PORT |= (1<<SERIAL_SOFT_RXD_BIT); \
-    /* enable interrupt: INT2(falling edge) */ \
-    EICRA |= ((1<<ISC21)|(0<<ISC20)); \
-    EIMSK |= (1<<INT2); \
-    sei(); \
-} while (0)
-#define SERIAL_SOFT_RXD_INT_ENTER()
-#define SERIAL_SOFT_RXD_INT_EXIT()      do { \
-    /* clear interrupt  flag */ \
-    EIFR = (1<<INTF2); \
-} while (0)
-/* TXD Port */
-#define SERIAL_SOFT_TXD_DDR             DDRD
-#define SERIAL_SOFT_TXD_PORT            PORTD
-#define SERIAL_SOFT_TXD_PIN             PIND
-#define SERIAL_SOFT_TXD_BIT             3
-#define SERIAL_SOFT_TXD_HI()            do { SERIAL_SOFT_TXD_PORT |=  (1<<SERIAL_SOFT_TXD_BIT); } while (0)
-#define SERIAL_SOFT_TXD_LO()            do { SERIAL_SOFT_TXD_PORT &= ~(1<<SERIAL_SOFT_TXD_BIT); } while (0)
-#define SERIAL_SOFT_TXD_INIT()          do { \
-    /* pin configuration: output */ \
-    SERIAL_SOFT_TXD_DDR |= (1<<SERIAL_SOFT_TXD_BIT); \
-    /* idle */ \
-    SERIAL_SOFT_TXD_ON(); \
-} while (0)
-
-
-/*
- * Hardware Serial(UART)
- */
-#ifdef __AVR_ATmega32U4__
-    #define SERIAL_UART_BAUD       19200
-    #define SERIAL_UART_DATA       UDR1
-    #define SERIAL_UART_UBRR       ((F_CPU/(16UL*SERIAL_UART_BAUD))-1)
-    #define SERIAL_UART_RXD_VECT   USART1_RX_vect
-    #define SERIAL_UART_TXD_READY  (UCSR1A&(1<<UDRE1))
-    #define SERIAL_UART_INIT()     do { \
-        UBRR1L = (uint8_t) SERIAL_UART_UBRR;       /* baud rate */ \
-        UBRR1H = (uint8_t) (SERIAL_UART_UBRR>>8);  /* baud rate */ \
-        UCSR1B |= (1<<RXCIE1) | (1<<RXEN1); /* RX interrupt, RX: enable */ \
-        UCSR1B |= (0<<TXCIE1) | (1<<TXEN1); /* TX interrupt, TX: enable */ \
-        UCSR1C |= (1<<UPM11) | (1<<UPM10);  /* parity: none(00), even(01), odd(11) */ \
-        sei(); \
-    } while(0)
-#else
-    #error "USART configuration is needed."
-#endif
-
-
-#endif

+ 0 - 208
converter/pc98_usb/keymap.c

@@ -1,208 +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 <stdbool.h>
-#include <avr/pgmspace.h>
-#include "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "util.h"
-#include "keymap.h"
-
-
-
-
-/* PC-9801-98-S02   Raku Raku keyboard(Luckyboard) Normal Mode
-  ,---------------------------------------------------------------.
-  | 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E|
-  `---------------------------------------------------------------'
-  ,---------------------------------------------------------------.
-  |    00| 01| 02| 03| 04| 05|  58|  71| 06| 07| 08| 09| 0A|    0E|
-  |---------------------------------------------------------------|
-  |   0F| 10| 11| 12| 13| 14|    3A     | 15| 16| 17| 18| 19|   1C|
-  |---------------------------------------------------------'.    |
-  |  74| 20| 21| 22| 23| 24|  3B  |  3C  | 25| 26| 27| 28| 29|    |
-  |---------------------------------------------------------------|
-  | 70| 2A| 2B| 2C| 2D| 2E| 38|  3D   | 39| 2F| 30| 31| 32| 33| 70|
-  `---------------------------------------------------------------'
-          | 73|   51|   5B|   59|       34|   5A|   35| xx|
-          `-----------------------------------------------'
-  xx: 74 35 F4 B5
-*/
-#define KEYMAP( \
-    K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K36, K37, K3F, K3E, \
-      K00,  K01, K02, K03, K04, K05,  K58, K71,   K06, K07, K08, K09, K0A,    K0E,  \
-      K0F,  K10, K11, K12, K13, K14,     K3A,     K15, K16, K17, K18, K19,    K1C,  \
-      K74, K20, K21, K22, K23, K24,   K3B,  K3C,   K25, K26, K27, K28, K29,         \
-      K70,K2A, K2B, K2C, K2D, K2E, K38,  K3D,  K39, K2F, K30, K31, K32, K33,        \
-               K73,  K51, K5B, K59,        K34,        K5A,  K35                    \
-) { \
-    { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
-    { KC_##K08, KC_##K09, KC_##K0A, KC_NO,    KC_NO,    KC_NO,    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_NO,    KC_NO,    KC_##K1C, KC_NO,    KC_NO,    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_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_##K51, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, 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_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_##K70, KC_##K71, KC_NO,    KC_##K73, KC_##K74, KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }  \
-}
-
-
-
-static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /*
-  ,---------------------------------------------------------------.
-  | 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E|
-  `---------------------------------------------------------------'
-  ,---------------------------------------------------------------.
-  |    00| 01| 02| 03| 04| 05|  58|  71| 06| 07| 08| 09| 0A|    0E|
-  |---------------------------------------------------------------|
-  |   0F| 10| 11| 12| 13| 14|    3A     | 15| 16| 17| 18| 19|   1C|
-  |---------------------------------------------------------------|
-  |  74| 20| 21| 22| 23| 24|  MINS|   EQL| 25| 26| 27| 28| 29|    |
-  |---------------------------------------------------------------|
-  | 70| 2A| 2B| 2C| 2D| 2E| 38|  3D   | 39| 2F| 30| 31| 32| 33| 70|
-  `---------------------------------------------------------------'
-          | 73|   51|   5B|   59|       34|   5A|   35| xx|
-          `-----------------------------------------------'
-    */
-    KEYMAP(
-  CANCEL,COPY,  F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9, F10, F11, F12, F13, FN6,
-      ESC,    1,   2,   3,   4,   5,   FN4, FN5,    6,   7,   8,   9,   0,   BSPC,
-      TAB,    Q,   W,   E,   R,   T,      UP,       Y,   U,   I,   O,   P,   ENT,
-      LCTL,  A,   S,   D,   F,   G,  MINS,  EQL,     H,   J,   K,   L, FN2,
-      LSFT, Z,   X,   C,   V,   B, GRV, BSLS, QUOT,   N,   M,COMM, DOT, FN1,
-              LGUI, LALT, LCTL, LSFT,      SPC,      SPC,   RALT
-    ),
-    KEYMAP(
-    PAUS,COPY,  F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9, F10, F11, F12, F13, F14,
-      GRV,   F1,  F2,  F3,  F4,  F5,    NO, NO,    F6,  F7,  F8,  F9, F10,    DEL,
-      TAB,    Q,   W,   E,   R,   T,      UP,    HOME,PGDN,PGUP, END,   P,   ENT,
-      LCTL,  A,   S,   D,   F,   G,  MINS,  EQL,  LEFT,DOWN,  UP,RGHT,SCLN,
-      LSFT, Z,   X,   C,   V,   B, INS, DOWN,  DEL,HOME,PGDN,PGUP, END,TRNS,
-              LGUI, LALT, LCTL, LSFT,      SPC,      SPC,   RALT
-    ),
-    KEYMAP(
-    PAUS,COPY,  F1,  F2,  F3,  F4,  F5,  F6,  F7,  F8,  F9, F10, F11, F12, F13, F14,
-      GRV,   F1,  F2,  F3,  F4,  F5,    NO, NO,    F6,  F7,  F8,  F9, F10,    DEL,
-      TAB,    Q,   W,   E,   R,   T,      UP,    WH_L,WH_D,WH_U,WH_R,   P,   ENT,
-      LCTL,  A,   S,   D,   F,   G,  MINS,  EQL,  MS_L,MS_D,MS_U,MS_R,TRNS,
-      LSFT, Z,   X,   C,   V,   B, INS, DOWN, BTN3,BTN2,BTN1,BTN4,BTN5,TRNS,
-              LGUI, LALT, LCTL, LSFT,      SPC,      SPC,   RALT
-    ),
-};
-static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {};
-
-/*
- * Macro definition
- */
-enum macro_id {
-    LBRACKET,
-    RBRACKET,
-    DUMMY,
-};
-
-const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
-{
-    keyevent_t event = record->event;
-    //uint8_t tap_count = record->tap_count;
-
-    switch (id) {
-        case LBRACKET:
-            return (event.pressed ?
-                    MACRO( T(LBRC), END ) :
-                    MACRO( T(LBRC), END ) );
-        case RBRACKET:
-            return (event.pressed ?
-                    MACRO( T(RBRC), END ) :
-                    MACRO( T(RBRC), END ) );
-    }
-    return MACRO_NONE;
-}
-
-/*
- * Action function
- */
-void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
-{
-/*
-    keyevent_t event = record->event;
-    uint8_t tap_count = record->tap_count;
-    switch (id) {
-        case 0xFF:
-            action_macro_play(get_macro(opt, event.pressed));
-            break;
-    }
-*/
-}
-
-
-/*
- * Fn actions
- */
-static const uint16_t PROGMEM fn_actions[] = {
-    ACTION_LAYER_TAP_TOGGLE(0),                  // FN0
-    ACTION_LAYER_TAP_KEY(1, KC_SLASH),           // FN1
-    ACTION_LAYER_TAP_KEY(2, KC_SCLN),            // FN2
-    ACTION_LAYER_MOMENTARY(2),                   // FN3
-    ACTION_MACRO(LBRACKET),                      // FN4
-    ACTION_MACRO(RBRACKET),                      // FN5
-    ACTION_MACRO(DUMMY),                         // FN6
-};
-
-
-
-
-
-
-/*
- * No need to edit.
- */
-#define KEYMAPS_SIZE    (sizeof(keymaps) / sizeof(keymaps[0]))
-#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    if (layer < KEYMAPS_SIZE) {
-        return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-    } else {
-        // fall back to layer 0
-        return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
-    }
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    action_t action;
-    if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
-        action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
-    } else {
-        action.code = ACTION_NO;
-    }
-    return action;
-}

+ 0 - 33
converter/pc98_usb/led.c

@@ -1,33 +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 "serial.h"
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-    uint8_t sun_led = 0;
-    if (usb_led & (1<<USB_LED_NUM_LOCK))    sun_led |= (1<<0);
-    if (usb_led & (1<<USB_LED_COMPOSE))     sun_led |= (1<<1);
-    if (usb_led & (1<<USB_LED_SCROLL_LOCK)) sun_led |= (1<<2);
-    if (usb_led & (1<<USB_LED_CAPS_LOCK))   sun_led |= (1<<3);
-
-    serial_send(0x0E);
-    serial_send(sun_led);
-}

+ 0 - 211
converter/pc98_usb/matrix.c

@@ -1,211 +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 <stdbool.h>
-#include <avr/io.h>
-#include <util/delay.h>
-#include "print.h"
-#include "util.h"
-#include "matrix.h"
-#include "debug.h"
-#include "protocol/serial.h"
-
-
-/*
- * Matrix Array usage:
- *
- * ROW: 16(4bits)
- * COL:  8(3bits)
- *
- *    8bit wide
- *   +---------+
- *  0|00 ... 07|
- *  1|08 ... 0F|
- *  :|   ...   |
- *  :|   ...   |
- *  E|70 ... 77|
- *  F|78 ... 7F|
- *   +---------+
- */
-static uint8_t matrix[MATRIX_ROWS];
-#define ROW(code)      ((code>>3)&0xF)
-#define COL(code)      (code&0x07)
-
-static bool is_modified = false;
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-static void pc98_inhibit_repeat(void)
-{
-    uint8_t code;
-
-    while (serial_recv()) ;
-RETRY:
-    PC98_RDY_PORT |= (1<<PC98_RDY_BIT);
-    _delay_ms(500);
-    serial_send(0x9C);
-
-    PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
-    _delay_ms(100);
-    while (!(code = serial_recv())) ;
-    print("PC98: send 9C: "); print_hex8(code); print("\n");
-    if (code != 0xFA) goto RETRY;
-
-
-
-    PC98_RDY_PORT |= (1<<PC98_RDY_BIT);
-    _delay_ms(100);
-    serial_send(0x70);
-
-    PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
-    _delay_ms(100);
-    //code = serial_recv();
-    while (!(code = serial_recv())) ;
-    print("PC98: send 70: "); print_hex8(code); print("\n");
-    if (code != 0xFA) goto RETRY;
-}
-
-void matrix_init(void)
-{
-    PC98_RST_DDR |= (1<<PC98_RST_BIT);
-    PC98_RDY_DDR |= (1<<PC98_RDY_BIT);
-    PC98_RTY_DDR |= (1<<PC98_RTY_BIT);
-    PC98_RST_PORT |= (1<<PC98_RST_BIT);
-    PC98_RDY_PORT |= (1<<PC98_RDY_BIT);
-    PC98_RTY_PORT |= (1<<PC98_RTY_BIT);
-
-
-    serial_init();
-
-    // PC98 reset
-/*
-    PC98_RST_PORT &= ~(1<<PC98_RST_BIT);
-    _delay_us(15);
-    PC98_RST_PORT |= (1<<PC98_RST_BIT);
-    _delay_us(13);
-    PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
-*/
-
-    _delay_ms(500);
-    pc98_inhibit_repeat();
-
-
-    // PC98 ready
-    PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
-
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
-
-    debug("init\n");
-    return;
-}
-
-uint8_t matrix_scan(void)
-{
-    is_modified = false;
-
-    uint16_t code;
-    PC98_RDY_PORT |= (1<<PC98_RDY_BIT);
-    _delay_us(30);
-    code = serial_recv2();
-    PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
-    if (code == -1) return 0;
-
-if (code == 0x60) {
-    pc98_inhibit_repeat();
-
-/*
-    PC98_RDY_PORT |= (1<<PC98_RDY_BIT);
-    _delay_ms(100);
-    serial_send(0x96);
-    PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT);
-*/
-
-    return 0;
-}
-
-    print_hex8(code); print(" ");
-
-    if (code&0x80) {
-        // break code
-        if (matrix_is_on(ROW(code), COL(code))) {
-            matrix[ROW(code)] &= ~(1<<COL(code));
-            is_modified = true;
-        }
-    } else {
-        // make code
-        if (!matrix_is_on(ROW(code), COL(code))) {
-            matrix[ROW(code)] |=  (1<<COL(code));
-            is_modified = true;
-        }
-    }
-    return code;
-}
-
-bool matrix_is_modified(void)
-{
-    return is_modified;
-}
-
-inline
-bool matrix_has_ghost(void)
-{
-    return false;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
-inline
-uint8_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 01234567\n");
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        phex(row); print(": ");
-        pbin_reverse(matrix_get_row(row));
-        print("\n");
-    }
-}
-
-uint8_t matrix_key_count(void)
-{
-    uint8_t count = 0;
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        count += bitpop(matrix[i]);
-    }
-    return count;
-}

+ 0 - 105
converter/ps2_usb/Makefile

@@ -1,105 +0,0 @@
-# 
-# Makefile for Teensy
-#
-# Target file name (without extension).
-TARGET = ps2_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
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_plain.c $(SRC)
-endif
-
-CONFIG_H = config.h
-
-
-# MCU name
-#MCU = at90usb1287
-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
-#   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
-NKRO_ENABLE = yes	# USB Nkey Rollover - not yet supported in LUFA
-
-
-# PS/2 Options
-#
-#PS2_USE_USART = yes	# uses hardware USART engine for PS/2 signal receive(recomened)
-PS2_USE_INT = yes	# uses external interrupt for falling edge of PS/2 clock pin
-#PS2_USE_BUSYWAIT = yes	# uses primitive reference code
-
-
-# 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.mk
-include $(TMK_DIR)/protocol/lufa.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk

+ 0 - 46
converter/ps2_usb/Makefile.mbed

@@ -1,46 +0,0 @@
-PROJECT = ps2_usb
-
-TMK_DIR = ../../tmk_core
-MBED_DIR = $(TMK_DIR)/tool/mbed/mbed-sdk
-
-#VPATH += $(MBED_DIR):$(TMK_DIR)
-vpath %.s .:$(MBED_DIR):$(TMK_DIR)
-vpath %.c .:$(MBED_DIR):$(TMK_DIR)
-vpath %.cpp .:$(MBED_DIR):$(TMK_DIR)
-
-OBJDIR = ./build
-
-OBJECTS = \
-	$(OBJDIR)/protocol/ps2_busywait.o \
-	$(OBJDIR)/protocol/ps2_io_mbed.o \
-	$(OBJDIR)/./keymap_common.o \
-	$(OBJDIR)/./matrix.o \
-	$(OBJDIR)/./led.o \
-	$(OBJDIR)/./main.o
-
-ifdef KEYMAP
-    OBJECTS := $(OBJDIR)/keymap_$(KEYMAP).o $(OBJECTS)
-else
-    OBJECTS := $(OBJDIR)/keymap_plain.o $(OBJECTS)
-endif
-
-CONFIG_H = config_mbed.h
-
-SYS_OBJECTS = 
-
-INCLUDE_PATHS = -I.
-
-LIBRARY_PATHS = 
-LIBRARIES = 
-
-# Build Options
-#   Comment out to disable
-#BOOTMAGIC_ENABLE = yes
-MOUSEKEY_ENABLE = yes
-
-
-#include $(TMK_DIR)/tool/mbed/mk20d50m.mk
-include $(TMK_DIR)/tool/mbed/lpc11u35_501.mk
-include $(TMK_DIR)/tool/mbed/mbed.mk
-include $(TMK_DIR)/tool/mbed/common.mk
-include $(TMK_DIR)/tool/mbed/gcc.mk

+ 0 - 75
converter/ps2_usb/Makefile.pjrc

@@ -1,75 +0,0 @@
-# Target file name (without extension).
-TARGET = ps2_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
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_plain.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
-EXTRAKEY_ENABLE = yes	# Audio control and System control
-CONSOLE_ENABLE = yes	# Console for debug(+400)
-COMMAND_ENABLE = yes    # Commands for debug and configuration
-NKRO_ENABLE = yes	# USB Nkey Rollover
-
-
-# PS/2 Options
-#
-#PS2_USE_USART = yes	# uses hardware USART engine for PS/2 signal receive(recomened)
-#PS2_USE_INT = yes	# uses external interrupt for falling edge of PS/2 clock pin
-PS2_USE_BUSYWAIT = yes	# uses primitive reference code
-
-
-# Search Path
-VPATH += $(TARGET_DIR)
-VPATH += $(TMK_DIR)
-
-
-include $(TMK_DIR)/protocol.mk
-include $(TMK_DIR)/protocol/pjrc.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk

+ 0 - 98
converter/ps2_usb/Makefile.tmk_rev1

@@ -1,98 +0,0 @@
-# 
-# Makefile for TMK keyboard converter rev2
-#     https://github.com/tmk/keyboard_converter#pcb-rev1
-#
-# Target file name (without extension).
-TARGET = ps2_usb_tmk_rev1
-
-# 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
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_plain.c $(SRC)
-endif
-
-CONFIG_H = config_tmk_rev1.h
-
-
-# MCU name
-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)
-
-
-# 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(+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
-#NKRO_ENABLE = yes	# USB Nkey Rollover - not yet supported in LUFA
-
-
-# PS/2 Options
-#
-PS2_USE_USART = yes	# uses hardware USART engine for PS/2 signal receive(recomened)
-#PS2_USE_BUSYWAIT = yes	# uses primitive reference code
-
-
-# Search Path
-VPATH += $(TARGET_DIR)
-VPATH += $(TMK_DIR)
-
-include $(TMK_DIR)/protocol.mk
-include $(TMK_DIR)/protocol/lufa.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk

+ 0 - 98
converter/ps2_usb/Makefile.tmk_rev2

@@ -1,98 +0,0 @@
-# 
-# Makefile for TMK keyboard converter rev2
-#     https://github.com/tmk/keyboard_converter#pcb-rev2
-#
-# Target file name (without extension).
-TARGET = ps2_usb_tmk_rev2
-
-# 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
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_plain.c $(SRC)
-endif
-
-CONFIG_H = config_tmk_rev2.h
-
-
-# MCU name
-MCU = atmega32u2
-
-# 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)
-
-
-# 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(+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
-#NKRO_ENABLE = yes	# USB Nkey Rollover - not yet supported in LUFA
-
-
-# PS/2 Options
-#
-PS2_USE_INT = yes	# uses external interrupt for falling edge of PS/2 clock pin
-#PS2_USE_BUSYWAIT = yes	# uses primitive reference code
-
-
-# Search Path
-VPATH += $(TARGET_DIR)
-VPATH += $(TMK_DIR)
-
-include $(TMK_DIR)/protocol.mk
-include $(TMK_DIR)/protocol/lufa.mk
-include $(TMK_DIR)/common.mk
-include $(TMK_DIR)/rules.mk

+ 0 - 107
converter/ps2_usb/Makefile.vusb

@@ -1,107 +0,0 @@
-# Target file name (without extension).
-TARGET = ps2_usb_vusb
-
-# 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
-
-ifdef KEYMAP
-    SRC := keymap_$(KEYMAP).c $(SRC)
-else
-    SRC := keymap_plain.c $(SRC)
-endif
-
-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
-
-
-# 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 = atmega168
-
-
-# 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 = 20000000
-
-
-# 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
-NO_UART = yes		# UART is unavailable
-
-
-
-#---------------- 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

+ 0 - 84
converter/ps2_usb/README.md

@@ -1,84 +0,0 @@
-PS/2 to USB keyboard converter
-==============================
-This firmware converts PS/2 keyboard protocol to USB.(It supports Scan Code Set 2.)
-
-
-Connect Wires
--------------
-In case of Teensy2.0(ATMega32U4):
-
-1. Connect **Vcc** and **GND**.
-2. Connect **Clock** and **Data** line. 
-    - **Interrupt**:   **Clock** is on `PD1` and **Data** on `PD0`.(Recommended. Soarer's converter compatible)
-    - **Busywait**:    **Clock** is on `PD1` and **Data** on `PD0`.
-    - **USART**:       **Clock** is on `PD5` and **Data** on `PD2`.
-3. Optionally you need pull-up resistor. 1K-10K Ohm is OK.
-
-To change pin configuration edit **config.h** and **Makefile**.
-
-
-Build Firmware
---------------
-For **PJRC Teensy** just run `make`:
-
-    $ make clean
-    $ make
-
-To select keymap:
-
-    $ make clean
-    $ make KEYMAP=[plain|jis|spacefn|...]
-
-After that you will find HEX file `ps2_usb_lufa.hex` in current directory.
-
-
-- For **TMK converter Rev.1** use `make -f Makefile.tmk_rev1` instead of `make` and HEX file is `ps2_usb_tmk_rev1.hex`.
-
-- For **TMK converter Rev.2** use `make -f Makefile.tmk_rev2` instead of `make` and HEX file is `ps2_usb_tmk_rev2.hex`.
-
-
-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 README.md of top directory) and existent keymap files.
-
-
-PS/2 signal handling implementations
-------------------------------------
-Following three methods can be used to implement PS/2 signal handling.
-
-### Simple and stupid busy-wait(ps2_busywait.c)
-    This is expected to implemented with portable C code for reference.
-### Interrupt driven(ps2_interrupt.c)
-    Uses pin interrupt to detect falling edge of clock line.
-### USART hardware module(ps2_usart.c)
-    Uses AVR USART engine to receive PS/2 signal.
-
-To select method edit Makefile.
-
-
-V-USB Support
--------------
-With V-USB you can use this converter on ATmega(168/328) but it doesn't support NKRO at this time.
-
-Circuit:
-
-                    +---+   +---------------+
-    USB            GND  |   |   ATmega168   |
-    ===                 C3  |               |
-    5V <-------+--------+---|Vcc,AVCC       |        PS/2
-               R1           |               |        ====
-    D- <----+--+-----R2-----|INT1        RXD|------->DATA
-    D+ <----|---+----R3-----|INT0        XCK|------->CLOCK
-            Z1  Z2          |               |      ->5V
-    GND<----+---+--+--+-----|GND            |      ->GND
-                   |  |     |               |
-                   |  C2-+--|XTAL1          |
-                   |     X1 |               |
-                   +--C3-+--|XTAL2          |
-                            +---------------+
-    R1:     1.5K Ohm
-    R2,R3:  68 Ohm
-    Z1,Z2:  Zenner 3.6V
-    C1,C2:  22pF
-    C3:     0.1uF
-    X1:     Crystal 20MHz(16MHz/12MHz)

+ 0 - 173
converter/ps2_usb/config.h

@@ -1,173 +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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include <avr/interrupt.h>
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x6512
-#define DEVICE_VER      0x0001
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         PS/2 keyboard converter
-#define DESCRIPTION     convert PS/2 keyboard to USB
-
-
-/* matrix size */
-#define MATRIX_ROWS 32  // keycode bit: 3-0
-#define MATRIX_COLS 8   // keycode bit: 6-4
-
-
-/* key combination for command */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \
-    keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-//#define NO_SUSPEND_POWER_DOWN
-
-
-/*
- * PS/2 Busywait
- */
-#ifdef PS2_USE_BUSYWAIT
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   1
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    0
-#endif
-
-/*
- * PS/2 Pin interrupt
- */
-#ifdef PS2_USE_INT
-/* uses INT1 for clock line(ATMega32U4) */
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   1
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    0
-#define PS2_INT_INIT()  do {    \
-    EICRA |= ((1<<ISC11) |      \
-              (0<<ISC10));      \
-} while (0)
-#define PS2_INT_ON()  do {      \
-    EIMSK |= (1<<INT1);         \
-} while (0)
-#define PS2_INT_OFF() do {      \
-    EIMSK &= ~(1<<INT1);        \
-} while (0)
-#define PS2_INT_VECT    INT1_vect
-#endif
-
-/*
- * PS/2 USART
- */
-#ifdef PS2_USE_USART
-#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)
-/* XCK for clock line and RXD for data line */
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   5
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    2
-/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
-/* set DDR of CLOCK as input to be slave */
-#define PS2_USART_INIT() do {   \
-    PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT);   \
-    PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT);     \
-    UCSR1C = ((1 << UMSEL10) |  \
-              (3 << UPM10)   |  \
-              (0 << USBS1)   |  \
-              (3 << UCSZ10)  |  \
-              (0 << UCPOL1));   \
-    UCSR1A = 0;                 \
-    UBRR1H = 0;                 \
-    UBRR1L = 0;                 \
-} while (0)
-#define PS2_USART_RX_INT_ON() do {  \
-    UCSR1B = ((1 << RXCIE1) |       \
-              (1 << RXEN1));        \
-} while (0)
-#define PS2_USART_RX_POLL_ON() do { \
-    UCSR1B = (1 << RXEN1);          \
-} while (0)
-#define PS2_USART_OFF() do {    \
-    UCSR1C = 0;                 \
-    UCSR1B &= ~((1 << RXEN1) |  \
-                (1 << TXEN1));  \
-} while (0)
-#define PS2_USART_RX_READY      (UCSR1A & (1<<RXC1))
-#define PS2_USART_RX_DATA       UDR1
-#define PS2_USART_ERROR         (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
-#define PS2_USART_RX_VECT       USART1_RX_vect
-#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__)
-/* XCK for clock line and RXD for data line */
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   4
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    0
-/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
-/* set DDR of CLOCK as input to be slave */
-#define PS2_USART_INIT() do {   \
-    PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT);   \
-    PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT);     \
-    UCSR0C = ((1 << UMSEL00) |  \
-              (3 << UPM00)   |  \
-              (0 << USBS0)   |  \
-              (3 << UCSZ00)  |  \
-              (0 << UCPOL0));   \
-    UCSR0A = 0;                 \
-    UBRR0H = 0;                 \
-    UBRR0L = 0;                 \
-} while (0)
-#define PS2_USART_RX_INT_ON() do {  \
-    UCSR0B = ((1 << RXCIE0) |       \
-              (1 << RXEN0));        \
-} while (0)
-#define PS2_USART_RX_POLL_ON() do { \
-    UCSR0B = (1 << RXEN0);          \
-} while (0)
-#define PS2_USART_OFF() do {    \
-    UCSR0C = 0;                 \
-    UCSR0B &= ~((1 << RXEN0) |  \
-                (1 << TXEN0));  \
-} while (0)
-#define PS2_USART_RX_READY      (UCSR0A & (1<<RXC0))
-#define PS2_USART_RX_DATA       UDR0
-#define PS2_USART_ERROR         (UCSR0A & ((1<<FE0) | (1<<DOR0) | (1<<UPE0)))
-#define PS2_USART_RX_VECT       USART_RX_vect
-#endif
-#endif
-
-#endif

+ 0 - 60
converter/ps2_usb/config_mbed.h

@@ -1,60 +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/>.
-*/
-
-#ifndef CONFIG_MBED_H
-#define CONFIG_MBED_H
-
-
-#if 0
-// duplicated name against mbed USBDeivce
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x6512
-#endif
-#define DEVICE_VER      0x0001
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         PS/2 keyboard converter
-#define DESCRIPTION     convert PS/2 keyboard to USB
-
-
-/* matrix size */
-#define MATRIX_ROWS 32  // keycode bit: 3-0
-#define MATRIX_COLS 8   // keycode bit: 6-4
-
-
-/* key combination for command */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \
-    keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-/*
- * PS/2 Busywait
- */
-#ifdef PS2_USE_BUSYWAIT
-#   define PS2_CLOCK_PORT  PORTD
-#   define PS2_CLOCK_PIN   PIND
-#   define PS2_CLOCK_DDR   DDRD
-#   define PS2_CLOCK_BIT   5
-#   define PS2_DATA_PORT   PORTD
-#   define PS2_DATA_PIN    PIND
-#   define PS2_DATA_DDR    DDRD
-#   define PS2_DATA_BIT    2
-#endif
-
-
-#endif

+ 0 - 147
converter/ps2_usb/config_tmk_rev1.h

@@ -1,147 +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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include <avr/interrupt.h>
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x6512
-#define DEVICE_VER      0x0001
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         PS/2 keyboard converter
-#define DESCRIPTION     convert PS/2 keyboard to USB
-
-
-/* matrix size */
-#define MATRIX_ROWS 32  // keycode bit: 3-0
-#define MATRIX_COLS 8   // keycode bit: 6-4
-
-
-/* key combination for command */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \
-    keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-//#define NO_SUSPEND_POWER_DOWN
-
-
-/*
- * PS/2 Busywait
- */
-#ifdef PS2_USE_BUSYWAIT
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   5
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    2
-#endif
-
-/*
- * PS/2 USART
- */
-#ifdef PS2_USE_USART
-#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__)
-/* XCK for clock line and RXD for data line */
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   5
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    2
-/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
-/* set DDR of CLOCK as input to be slave */
-#define PS2_USART_INIT() do {   \
-    PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT);   \
-    PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT);     \
-    UCSR1C = ((1 << UMSEL10) |  \
-              (3 << UPM10)   |  \
-              (0 << USBS1)   |  \
-              (3 << UCSZ10)  |  \
-              (0 << UCPOL1));   \
-    UCSR1A = 0;                 \
-    UBRR1H = 0;                 \
-    UBRR1L = 0;                 \
-} while (0)
-#define PS2_USART_RX_INT_ON() do {  \
-    UCSR1B = ((1 << RXCIE1) |       \
-              (1 << RXEN1));        \
-} while (0)
-#define PS2_USART_RX_POLL_ON() do { \
-    UCSR1B = (1 << RXEN1);          \
-} while (0)
-#define PS2_USART_OFF() do {    \
-    UCSR1C = 0;                 \
-    UCSR1B &= ~((1 << RXEN1) |  \
-                (1 << TXEN1));  \
-} while (0)
-#define PS2_USART_RX_READY      (UCSR1A & (1<<RXC1))
-#define PS2_USART_RX_DATA       UDR1
-#define PS2_USART_ERROR         (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
-#define PS2_USART_RX_VECT       USART1_RX_vect
-#elif defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__)
-/* XCK for clock line and RXD for data line */
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   4
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    0
-/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
-/* set DDR of CLOCK as input to be slave */
-#define PS2_USART_INIT() do {   \
-    PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT);   \
-    PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT);     \
-    UCSR0C = ((1 << UMSEL00) |  \
-              (3 << UPM00)   |  \
-              (0 << USBS0)   |  \
-              (3 << UCSZ00)  |  \
-              (0 << UCPOL0));   \
-    UCSR0A = 0;                 \
-    UBRR0H = 0;                 \
-    UBRR0L = 0;                 \
-} while (0)
-#define PS2_USART_RX_INT_ON() do {  \
-    UCSR0B = ((1 << RXCIE0) |       \
-              (1 << RXEN0));        \
-} while (0)
-#define PS2_USART_RX_POLL_ON() do { \
-    UCSR0B = (1 << RXEN0);          \
-} while (0)
-#define PS2_USART_OFF() do {    \
-    UCSR0C = 0;                 \
-    UCSR0B &= ~((1 << RXEN0) |  \
-                (1 << TXEN0));  \
-} while (0)
-#define PS2_USART_RX_READY      (UCSR0A & (1<<RXC0))
-#define PS2_USART_RX_DATA       UDR0
-#define PS2_USART_ERROR         (UCSR0A & ((1<<FE0) | (1<<DOR0) | (1<<UPE0)))
-#define PS2_USART_RX_VECT       USART_RX_vect
-#endif
-#endif
-
-#endif

+ 0 - 85
converter/ps2_usb/config_tmk_rev2.h

@@ -1,85 +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/>.
-*/
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-#include <avr/interrupt.h>
-
-#define VENDOR_ID       0xFEED
-#define PRODUCT_ID      0x6512
-#define DEVICE_VER      0x0001
-#define MANUFACTURER    t.m.k.
-#define PRODUCT         PS/2 keyboard converter
-#define DESCRIPTION     convert PS/2 keyboard to USB
-
-
-/* matrix size */
-#define MATRIX_ROWS 32  // keycode bit: 3-0
-#define MATRIX_COLS 8   // keycode bit: 6-4
-
-
-/* key combination for command */
-#define IS_COMMAND() ( \
-    keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
-)
-
-
-//#define NO_SUSPEND_POWER_DOWN
-
-
-/*
- * PS/2 Busywait
- */
-#ifdef PS2_USE_BUSYWAIT
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   1
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    0
-#endif
-
-/*
- * PS/2 Pin interrupt
- */
-#ifdef PS2_USE_INT
-/* uses INT1 for clock line(ATMega32U4) */
-#define PS2_CLOCK_PORT  PORTD
-#define PS2_CLOCK_PIN   PIND
-#define PS2_CLOCK_DDR   DDRD
-#define PS2_CLOCK_BIT   1
-#define PS2_DATA_PORT   PORTD
-#define PS2_DATA_PIN    PIND
-#define PS2_DATA_DDR    DDRD
-#define PS2_DATA_BIT    0
-#define PS2_INT_INIT()  do {    \
-    EICRA |= ((1<<ISC11) |      \
-              (0<<ISC10));      \
-} while (0)
-#define PS2_INT_ON()  do {      \
-    EIMSK |= (1<<INT1);         \
-} while (0)
-#define PS2_INT_OFF() do {      \
-    EIMSK &= ~(1<<INT1);        \
-} while (0)
-#define PS2_INT_VECT    INT1_vect
-#endif
-
-#endif

+ 0 - 31
converter/ps2_usb/keymap_common.c

@@ -1,31 +0,0 @@
-/*
-Copyright 2011,2012,2013 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"
-#include "progmem.h"
-
-
-/* translates key to keycode */
-uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
-{
-    return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
-}
-
-/* translates Fn keycode to action */
-action_t keymap_fn_to_action(uint8_t keycode)
-{
-    return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
-}

+ 0 - 173
converter/ps2_usb/keymap_common.h

@@ -1,173 +0,0 @@
-/*
-Copyright 2011,2012,2013 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/>.
-*/
-#ifndef KEYMAP_COMMON_H
-#define KEYMAP_COMMON_H
-
-#include <stdint.h>
-#include <stdbool.h>
-#include "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "report.h"
-#include "print.h"
-#include "debug.h"
-#include "keymap.h"
-
-
-// 32*8(256) byte array which converts PS/2 code into USB code
-extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
-extern const uint16_t fn_actions[];
-
-
-/* All keys */
-#define KEYMAP_ALL( \
-    K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07,     KFC,K7E,KFE,                   \
-    K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD,  K77,KCA,K7C,K7B, \
-    K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA,  K6C,K75,K7D,     \
-    K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,    K5A,               K6B,K73,K74,K79, \
-    K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,        K59,     KF5,      K69,K72,K7A,     \
-    K14,K9F,K11,        K29,                K91,KA7,KAF,K94, KEB,KF2,KF4,  K70,    K71,KDA, \
-                                                                                            \
-    K61,                     /* for European ISO */                                         \
-    K51, K13, K6A, K64, K67, /* for Japanese JIS */                                         \
-    K08, K10, K18, K20, K28, K30, K38, K40, K48, K50, K57, K5F, /* F13-24 */                \
-    KB7, KBF, KDE,           /* System Power, Sleep, Wake */                                \
-    KA3, KB2, KA1,           /* Mute, Volume Up, Volume Down */                             \
-    KCD, K95, KBB, KB4, KD0, /* Next, Previous, Stop, Pause, Media Select */                \
-    KC8, KAB, KC0,           /* Mail, Calculator, My Computer */                            \
-    K90, KBA, KB8, KB0,      /* WWW Search, Home, Back, Forward */                          \
-    KA8, KA0, K98            /* WWW Stop, Refresh, Favorites */                             \
-) { \
-    { KC_NO,    KC_##K01, KC_NO,    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_NO    }, \
-    { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_NO    }, \
-    { KC_##K18, KC_NO,    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_NO    }, \
-    { KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_NO    }, \
-    { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_NO    }, \
-    { KC_##K38, KC_NO,    KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO    }, \
-    { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_NO    }, \
-    { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO    }, \
-    { KC_##K50, KC_##K51, KC_##K52, KC_NO,    KC_##K54, KC_##K55, KC_NO,    KC_##K57 }, \
-    { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_NO,    KC_##K5D, KC_NO,    KC_##K5F }, \
-    { KC_NO,    KC_##K61, KC_NO,    KC_NO,    KC_##K64, KC_NO,    KC_##K66, KC_##K67 }, \
-    { KC_NO,    KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
-    { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_##K83, KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_##K90, KC_##K91, KC_NO,    KC_NO,    KC_##K94, KC_##K95, KC_NO,    KC_NO    }, \
-    { KC_##K98, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_##K9F }, \
-    { KC_##KA0, KC_##KA1, KC_NO,    KC_##KA3, KC_NO,    KC_NO,    KC_NO,    KC_##KA7 }, \
-    { KC_##KA8, KC_NO,    KC_NO,    KC_##KAB, KC_NO,    KC_NO,    KC_NO,    KC_##KAF }, \
-    { KC_##KB0, KC_NO,    KC_##KB2, KC_NO,    KC_##KB4, KC_NO,    KC_NO,    KC_##KB7 }, \
-    { KC_##KB8, KC_NO,    KC_##KBA, KC_##KBB, KC_NO,    KC_NO,    KC_NO,    KC_##KBF }, \
-    { KC_##KC0, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_##KC8, KC_NO,    KC_##KCA, KC_NO,    KC_NO,    KC_##KCD, KC_NO,    KC_NO    }, \
-    { KC_##KD0, KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_##KDA, KC_NO,    KC_NO,    KC_NO,    KC_##KDE, KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_##KE9, KC_NO,    KC_##KEB, KC_##KEC, KC_NO,    KC_NO,    KC_NO    }, \
-    { KC_##KF0, KC_##KF1, KC_##KF2, KC_NO,    KC_##KF4, KC_##KF5, KC_NO,    KC_NO    }, \
-    { KC_NO,    KC_NO,    KC_##KFA, KC_NO,    KC_##KFC, KC_##KFD, KC_##KFE, KC_NO    }, \
-}
-
-/* US layout */
-#define KEYMAP( \
-    K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07,     KFC,K7E,KFE,                   \
-    K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD,  K77,KCA,K7C,K7B, \
-    K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA,  K6C,K75,K7D,     \
-    K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,    K5A,               K6B,K73,K74,K79, \
-    K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,        K59,     KF5,      K69,K72,K7A,     \
-    K14,K9F,K11,        K29,                K91,KA7,KAF,K94, KEB,KF2,KF4,  K70,    K71,KDA  \
-) \
-KEYMAP_ALL( \
-    K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07,     KFC,K7E,KFE,                   \
-    K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD,  K77,KCA,K7C,K7B, \
-    K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA,  K6C,K75,K7D,     \
-    K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,    K5A,               K6B,K73,K74,K79, \
-    K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,        K59,     KF5,      K69,K72,K7A,     \
-    K14,K9F,K11,        K29,                K91,KA7,KAF,K94, KEB,KF2,KF4,  K70,    K71,KDA, \
-                                                                                            \
-    NUBS,                                                                                   \
-    RO, KANA, JYEN, HENK, MHEN,                                                             \
-    F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,                             \
-    SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE,                                                \
-    AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN,                                               \
-    MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT,         \
-    MAIL, CALCULATOR, MY_COMPUTER,                                                          \
-    WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD,                                            \
-    WWW_STOP, WWW_REFRESH, WWW_FAVORITES                                                    \
-)
-
-/* ISO layout */
-#define KEYMAP_ISO( \
-    K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07,     KFC,K7E,KFE,                   \
-    K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD,  K77,KCA,K7C,K7B, \
-    K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,     KF1,KE9,KFA,  K6C,K75,K7D,     \
-    K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D,K5A,               K6B,K73,K74,K79, \
-    K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,    K59,     KF5,      K69,K72,K7A,     \
-    K14,K9F,K11,        K29,                K91,KA7,KAF,K94, KEB,KF2,KF4,  K70,    K71,KDA  \
-) \
-KEYMAP_ALL( \
-    K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07,     KFC,K7E,KFE,                   \
-    K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD,  K77,KCA,K7C,K7B, \
-    K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA,  K6C,K75,K7D,     \
-    K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,    K5A,               K6B,K73,K74,K79, \
-    K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,        K59,     KF5,      K69,K72,K7A,     \
-    K14,K9F,K11,        K29,                K91,KA7,KAF,K94, KEB,KF2,KF4,  K70,    K71,KDA, \
-                                                                                            \
-    K61,                                                                                    \
-    RO, KANA, JYEN, HENK, MHEN,                                                             \
-    F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,                             \
-    SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE,                                                \
-    AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN,                                               \
-    MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT,         \
-    MAIL, CALCULATOR, MY_COMPUTER,                                                          \
-    WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD,                                            \
-    WWW_STOP, WWW_REFRESH, WWW_FAVORITES                                                    \
-)
-
-/* JIS layout */
-#define KEYMAP_JIS( \
-    K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07,         KFC,K7E,KFE,                   \
-    K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD,  K77,KCA,K7C,K7B, \
-    K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,         KF1,KE9,KFA,  K6C,K75,K7D,     \
-    K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D,    K5A,               K6B,K73,K74,K79, \
-    K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,K51,        K59,     KF5,      K69,K72,K7A,     \
-    K14,K9F,K11,    K67,K29,K64,K13,            K91,KA7,KAF,K94, KEB,KF2,KF4,  K70,    K71,KDA  \
-) \
-KEYMAP_ALL( \
-    K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07,     KFC,K7E,KFE,                   \
-    K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD,  K77,KCA,K7C,K7B, \
-    K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA,  K6C,K75,K7D,     \
-    K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,    K5A,               K6B,K73,K74,K79, \
-    K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,        K59,     KF5,      K69,K72,K7A,     \
-    K14,K9F,K11,        K29,                K91,KA7,KAF,K94, KEB,KF2,KF4,  K70,    K71,KDA, \
-                                                                                            \
-    NUBS,                                                                                   \
-    K51, K13, K6A, K64, K67,                                                                \
-    F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,                             \
-    SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE,                                                \
-    AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN,                                               \
-    MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT,         \
-    MAIL, CALCULATOR, MY_COMPUTER,                                                          \
-    WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD,                                            \
-    WWW_STOP, WWW_REFRESH, WWW_FAVORITES                                                    \
-)
-
-#endif

+ 0 - 34
converter/ps2_usb/keymap_jis.c

@@ -1,34 +0,0 @@
-/*
- * JIS layout Japanese keyboard
- */
-#include "keymap_common.h"
-
-const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-    /* 0: JIS LAYOUT
-     * ,---.   ,---------------. ,---------------. ,---------------. ,-----------.     ,-----------.
-     * |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|  -|  =| JY|Bsp| |Ins|Hom|PgU| |NmL|  /|  *|  -|
-     * |-----------------------------------------------------------| |-----------| |---------------|
-     * |Tab  |  Q|  W|  E|  R|  T|  Y|  U|  I|  O|  P|  [|  ]| Ret | |Del|End|PgD| |  7|  8|  9|   |
-     * |------------------------------------------------------`    | `-----------' |-----------|  +|
-     * |CapsLo|  A|  S|  D|  F|  G|  H|  J|  K|  L|  ;|  :|  \|    |               |  4|  5|  6|   |
-     * |-----------------------------------------------------------|     ,---.     |---------------|
-     * |Shift   |  Z|  X|  C|  V|  B|  N|  M|  ,|  ,|  /| RO|Shift |     |Up |     |  1|  2|  3|   |
-     * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
-     * |Ctrl |Gui |Alt |MHEN| Space  |HENK|KANA|Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| |      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, JYEN,BSPC,     INS, HOME,PGUP,    NLCK,PSLS,PAST,PMNS,
-    TAB, Q,   W,   E,   R,   T,   Y,   U,   I,   O,   P,   LBRC,RBRC,               DEL, END, PGDN,    P7,  P8,  P9,
-    CAPS,A,   S,   D,   F,   G,   H,   J,   K,   L,   SCLN,QUOT,BSLS,     ENT,                         P4,  P5,  P6,  PPLS,
-    LSFT,Z,   X,   C,   V,   B,   N,   M,   COMM,DOT, SLSH,RO,            RSFT,          UP,           P1,  P2,  P3,
-    LCTL,LGUI,LALT,     MHEN,SPC, HENK,KANA,               RALT,RGUI,APP, RCTL,     LEFT,DOWN,RGHT,    P0,       PDOT,PENT
-    ),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-};

+ 0 - 32
converter/ps2_usb/keymap_plain.c

@@ -1,32 +0,0 @@
-#include "keymap_common.h"
-
-
-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|  .|   |
-     * `-----------------------------------------------------------' `-----------' `---------------'
-     */
-    KEYMAP(
-    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,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
-    ),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-};

+ 0 - 61
converter/ps2_usb/keymap_spacefn.c

@@ -1,61 +0,0 @@
-/*
- * SpaceFN layout
- * http://geekhack.org/index.php?topic=51069.0
- */
-#include "keymap_common.h"
-
-
-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|  .|   |
-     * `-----------------------------------------------------------' `-----------' `---------------'
-     */
-    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
-    ),
-
-    /* 1: SpaceFN
-     * ,-----------------------------------------------------------.
-     * |`  | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete |
-     * |-----------------------------------------------------------|
-     * |     |   |   |Esc|   |   |   |Hom|Up |End|Psc|Slk|Pau|Ins  |
-     * |-----------------------------------------------------------|
-     * |      |   |   |   |   |   |PgU|Lef|Dow|Rig|   |   |        |
-     * |-----------------------------------------------------------|
-     * |        |   |   |   |   |Spc|PgD|`  |~  |   |Men|          |
-     * |-----------------------------------------------------------|
-     * |    |    |    |                        |    |    |    |    |
-     * `-----------------------------------------------------------'
-     */
-    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
-    ),
-};
-
-const uint16_t PROGMEM fn_actions[] = {
-    [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
-    [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV),    // tilde
-};
-

+ 0 - 33
converter/ps2_usb/led.c

@@ -1,33 +0,0 @@
-/*
-Copyright 2011 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 "ps2.h"
-#include "led.h"
-
-
-void led_set(uint8_t usb_led)
-{
-    uint8_t ps2_led = 0;
-    if (usb_led &  (1<<USB_LED_SCROLL_LOCK))
-        ps2_led |= (1<<PS2_LED_SCROLL_LOCK);
-    if (usb_led &  (1<<USB_LED_NUM_LOCK))
-        ps2_led |= (1<<PS2_LED_NUM_LOCK);
-    if (usb_led &  (1<<USB_LED_CAPS_LOCK))
-        ps2_led |= (1<<PS2_LED_CAPS_LOCK);
-    ps2_host_set_led(ps2_led);
-}

+ 0 - 46
converter/ps2_usb/main.cpp

@@ -1,46 +0,0 @@
-#include "mbed.h"
-#include "debug.h"
-#include "timer.h"
-#include "action.h"
-#include "keycode.h"
-#include "host.h"
-#include "host_driver.h"
-#include "mbed_driver.h"
- 
-
-// Button and LEDs of LPC11U35 board
-DigitalIn isp(P0_1);            // ISP button
-DigitalOut led_red(P0_20);
-DigitalOut led_green(P0_21);
-
-
-int main(void) {
-    isp.mode(PullUp);
-    led_red = 1;
-    led_green = 0;
-
-    timer_init();
-    host_set_driver(&mbed_driver);
-    keyboard_init();
-
-    //debug_enable = true;
-    xprintf("mbed_onekey ver.eee:\r\n");
-
-
-    bool last_isp = isp;
-    while (1) {
-        keyboard_task();
-
-        //led_green = !led_green;
-        if (last_isp == isp) continue;
-        last_isp = isp;
-        if (last_isp == 0) {
-            led_red = 0;    // on
-            dprintf("timer: %i\r\n", timer_read());
-            //register_code(KC_A);
-        } else {
-            led_red = 1;    // off
-            //unregister_code(KC_A);
-        }
-    }
-}

+ 0 - 486
converter/ps2_usb/matrix.c

@@ -1,486 +0,0 @@
-/*
-Copyright 2011 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 <stdbool.h>
-#include "action.h"
-#include "print.h"
-#include "util.h"
-#include "debug.h"
-#include "ps2.h"
-#include "matrix.h"
-
-
-static void matrix_make(uint8_t code);
-static void matrix_break(uint8_t code);
-static void matrix_clear(void);
-#ifdef MATRIX_HAS_GHOST
-static bool matrix_has_ghost_in_row(uint8_t row);
-#endif
-
-
-/*
- * Matrix Array usage:
- * 'Scan Code Set 2' is assigned into 256(32x8)cell matrix.
- * Hmm, it is very sparse and not efficient :(
- *
- * Notes:
- * Both 'Hanguel/English'(F1) and 'Hanja'(F2) collide with 'Delete'(E0 71) and 'Down'(E0 72).
- * These two Korean keys need exceptional handling and are not supported for now. Sorry.
- *
- *    8bit wide
- *   +---------+
- *  0|         |
- *  :|   XX    | 00-7F for normal codes(without E0-prefix)
- *  f|_________|
- * 10|         |
- *  :|  E0 YY  | 80-FF for E0-prefixed codes
- * 1f|         |     (<YY>|0x80) is used as matrix position.
- *   +---------+
- *
- * Exceptions:
- * 0x83:    F7(0x83) This is a normal code but beyond  0x7F.
- * 0xFC:    PrintScreen
- * 0xFE:    Pause
- */
-static uint8_t matrix[MATRIX_ROWS];
-#define ROW(code)      (code>>3)
-#define COL(code)      (code&0x07)
-
-// matrix positions for exceptional keys
-#define F7             (0x83)
-#define PRINT_SCREEN   (0xFC)
-#define PAUSE          (0xFE)
-
-static bool is_modified = false;
-
-
-inline
-uint8_t matrix_rows(void)
-{
-    return MATRIX_ROWS;
-}
-
-inline
-uint8_t matrix_cols(void)
-{
-    return MATRIX_COLS;
-}
-
-void matrix_init(void)
-{
-    debug_enable = true;
-    ps2_host_init();
-
-    // initialize matrix state: all keys off
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
-
-    return;
-}
-
-/*
- * PS/2 Scan Code Set 2: Exceptional Handling
- *
- * There are several keys to be handled exceptionally.
- * The scan code for these keys are varied or prefix/postfix'd
- * depending on modifier key state.
- *
- * Keyboard Scan Code Specification:
- *     http://www.microsoft.com/whdc/archive/scancode.mspx
- *     http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc
- *
- *
- * 1) Insert, Delete, Home, End, PageUp, PageDown, Up, Down, Right, Left
- *     a) when Num Lock is off
- *     modifiers | make                      | break
- *     ----------+---------------------------+----------------------
- *     Ohter     |                    <make> | <break>
- *     LShift    | E0 F0 12           <make> | <break>  E0 12
- *     RShift    | E0 F0 59           <make> | <break>  E0 59
- *     L+RShift  | E0 F0 12  E0 F0 59 <make> | <break>  E0 59 E0 12
- *
- *     b) when Num Lock is on
- *     modifiers | make                      | break
- *     ----------+---------------------------+----------------------
- *     Other     | E0 12              <make> | <break>  E0 F0 12
- *     Shift'd   |                    <make> | <break>
- *
- *     Handling: These prefix/postfix codes are ignored.
- *
- *
- * 2) Keypad /
- *     modifiers | make                      | break
- *     ----------+---------------------------+----------------------
- *     Ohter     |                    <make> | <break>
- *     LShift    | E0 F0 12           <make> | <break>  E0 12
- *     RShift    | E0 F0 59           <make> | <break>  E0 59
- *     L+RShift  | E0 F0 12  E0 F0 59 <make> | <break>  E0 59 E0 12
- *
- *     Handling: These prefix/postfix codes are ignored.
- *
- *
- * 3) PrintScreen
- *     modifiers | make         | break
- *     ----------+--------------+-----------------------------------
- *     Other     | E0 12  E0 7C | E0 F0 7C  E0 F0 12
- *     Shift'd   |        E0 7C | E0 F0 7C
- *     Control'd |        E0 7C | E0 F0 7C
- *     Alt'd     |           84 | F0 84
- *
- *     Handling: These prefix/postfix codes are ignored, and both scan codes
- *               'E0 7C' and 84 are seen as PrintScreen.
- *
- * 4) Pause
- *     modifiers | make(no break code)
- *     ----------+--------------------------------------------------
- *     Other     | E1 14 77 E1 F0 14 F0 77
- *     Control'd | E0 7E E0 F0 7E
- *
- *     Handling: Both code sequences are treated as a whole.
- *               And we need a ad hoc 'pseudo break code' hack to get the key off
- *               because it has no break code.
- *
- */
-uint8_t matrix_scan(void)
-{
-
-    // scan code reading states
-    static enum {
-        INIT,
-        F0,
-        E0,
-        E0_F0,
-        // Pause
-        E1,
-        E1_14,
-        E1_14_77,
-        E1_14_77_E1,
-        E1_14_77_E1_F0,
-        E1_14_77_E1_F0_14,
-        E1_14_77_E1_F0_14_F0,
-        // Control'd Pause
-        E0_7E,
-        E0_7E_E0,
-        E0_7E_E0_F0,
-    } state = INIT;
-
-
-    is_modified = false;
-
-    // 'pseudo break code' hack
-    if (matrix_is_on(ROW(PAUSE), COL(PAUSE))) {
-        matrix_break(PAUSE);
-    }
-
-    uint8_t code = ps2_host_recv();
-    if (code) xprintf("%i\r\n", code);
-    if (!ps2_error) {
-        switch (state) {
-            case INIT:
-                switch (code) {
-                    case 0xE0:
-                        state = E0;
-                        break;
-                    case 0xF0:
-                        state = F0;
-                        break;
-                    case 0xE1:
-                        state = E1;
-                        break;
-                    case 0x83:  // F7
-                        matrix_make(F7);
-                        state = INIT;
-                        break;
-                    case 0x84:  // Alt'd PrintScreen
-                        matrix_make(PRINT_SCREEN);
-                        state = INIT;
-                        break;
-                    case 0x00:  // Overrun [3]p.25
-                        matrix_clear();
-                        clear_keyboard();
-                        print("Overrun\n");
-                        state = INIT;
-                        break;
-                    default:    // normal key make
-                        if (code < 0x80) {
-                            matrix_make(code);
-                        } else {
-                            matrix_clear();
-                            clear_keyboard();
-                            xprintf("unexpected scan code at INIT: %02X\n", code);
-                        }
-                        state = INIT;
-                }
-                break;
-            case E0:    // E0-Prefixed
-                switch (code) {
-                    case 0x12:  // to be ignored
-                    case 0x59:  // to be ignored
-                        state = INIT;
-                        break;
-                    case 0x7E:  // Control'd Pause
-                        state = E0_7E;
-                        break;
-                    case 0xF0:
-                        state = E0_F0;
-                        break;
-                    default:
-                        if (code < 0x80) {
-                            matrix_make(code|0x80);
-                        } else {
-                            matrix_clear();
-                            clear_keyboard();
-                            xprintf("unexpected scan code at E0: %02X\n", code);
-                        }
-                        state = INIT;
-                }
-                break;
-            case F0:    // Break code
-                switch (code) {
-                    case 0x83:  // F7
-                        matrix_break(F7);
-                        state = INIT;
-                        break;
-                    case 0x84:  // Alt'd PrintScreen
-                        matrix_break(PRINT_SCREEN);
-                        state = INIT;
-                        break;
-                    case 0xF0:
-                        matrix_clear();
-                        clear_keyboard();
-                        xprintf("unexpected scan code at F0: F0(clear and cont.)\n");
-                        break;
-                    default:
-                    if (code < 0x80) {
-                        matrix_break(code);
-                    } else {
-                        matrix_clear();
-                        clear_keyboard();
-                        xprintf("unexpected scan code at F0: %02X\n", code);
-                    }
-                    state = INIT;
-                }
-                break;
-            case E0_F0: // Break code of E0-prefixed
-                switch (code) {
-                    case 0x12:  // to be ignored
-                    case 0x59:  // to be ignored
-                        state = INIT;
-                        break;
-                    default:
-                        if (code < 0x80) {
-                            matrix_break(code|0x80);
-                        } else {
-                            matrix_clear();
-                            clear_keyboard();
-                            xprintf("unexpected scan code at E0_F0: %02X\n", code);
-                        }
-                        state = INIT;
-                }
-                break;
-            // following are states of Pause
-            case E1:
-                switch (code) {
-                    case 0x14:
-                        state = E1_14;
-                        break;
-                    default:
-                        state = INIT;
-                }
-                break;
-            case E1_14:
-                switch (code) {
-                    case 0x77:
-                        state = E1_14_77;
-                        break;
-                    default:
-                        state = INIT;
-                }
-                break;
-            case E1_14_77:
-                switch (code) {
-                    case 0xE1:
-                        state = E1_14_77_E1;
-                        break;
-                    default:
-                        state = INIT;
-                }
-                break;
-            case E1_14_77_E1:
-                switch (code) {
-                    case 0xF0:
-                        state = E1_14_77_E1_F0;
-                        break;
-                    default:
-                        state = INIT;
-                }
-                break;
-            case E1_14_77_E1_F0:
-                switch (code) {
-                    case 0x14:
-                        state = E1_14_77_E1_F0_14;
-                        break;
-                    default:
-                        state = INIT;
-                }
-                break;
-            case E1_14_77_E1_F0_14:
-                switch (code) {
-                    case 0xF0:
-                        state = E1_14_77_E1_F0_14_F0;
-                        break;
-                    default:
-                        state = INIT;
-                }
-                break;
-            case E1_14_77_E1_F0_14_F0:
-                switch (code) {
-                    case 0x77:
-                        matrix_make(PAUSE);
-                        state = INIT;
-                        break;
-                    default:
-                        state = INIT;
-                }
-                break;
-            // Following are states of Control'd Pause
-            case E0_7E:
-                if (code == 0xE0)
-                    state = E0_7E_E0;
-                else
-                    state = INIT;
-                break;
-            case E0_7E_E0:
-                if (code == 0xF0)
-                    state = E0_7E_E0_F0;
-                else
-                    state = INIT;
-                break;
-            case E0_7E_E0_F0:
-                if (code == 0x7E)
-                    matrix_make(PAUSE);
-                state = INIT;
-                break;
-            default:
-                state = INIT;
-        }
-    }
-
-    // TODO: request RESEND when error occurs?
-/*
-    if (PS2_IS_FAILED(ps2_error)) {
-        uint8_t ret = ps2_host_send(PS2_RESEND);
-        xprintf("Resend: %02X\n", ret);
-    }
-*/
-    return 1;
-}
-
-bool matrix_is_modified(void)
-{
-    return is_modified;
-}
-
-inline
-bool matrix_has_ghost(void)
-{
-#ifdef MATRIX_HAS_GHOST
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        if (matrix_has_ghost_in_row(i))
-            return true;
-    }
-#endif
-    return false;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
-    return (matrix[row] & (1<<col));
-}
-
-inline
-uint8_t matrix_get_row(uint8_t row)
-{
-    return matrix[row];
-}
-
-void matrix_print(void)
-{
-    print("\nr/c 01234567\n");
-    for (uint8_t row = 0; row < matrix_rows(); row++) {
-        phex(row); print(": ");
-        pbin_reverse(matrix_get_row(row));
-#ifdef MATRIX_HAS_GHOST
-        if (matrix_has_ghost_in_row(row)) {
-            print(" <ghost");
-        }
-#endif
-        print("\n");
-    }
-}
-
-uint8_t matrix_key_count(void)
-{
-    uint8_t count = 0;
-    for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
-        count += bitpop(matrix[i]);
-    }
-    return count;
-}
-
-#ifdef MATRIX_HAS_GHOST
-inline
-static bool matrix_has_ghost_in_row(uint8_t row)
-{
-    // no ghost exists in case less than 2 keys on
-    if (((matrix[row] - 1) & matrix[row]) == 0)
-        return false;
-
-    // ghost exists in case same state as other row
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) {
-        if (i != row && (matrix[i] & matrix[row]) == matrix[row])
-            return true;
-    }
-    return false;
-}
-#endif
-
-
-inline
-static void matrix_make(uint8_t code)
-{
-    if (!matrix_is_on(ROW(code), COL(code))) {
-        matrix[ROW(code)] |= 1<<COL(code);
-        is_modified = true;
-    }
-}
-
-inline
-static void matrix_break(uint8_t code)
-{
-    if (matrix_is_on(ROW(code), COL(code))) {
-        matrix[ROW(code)] &= ~(1<<COL(code));
-        is_modified = true;
-    }
-}
-
-inline
-static void matrix_clear(void)
-{
-    for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
-}

+ 0 - 0
converter/ps2_usb/usbconfig.h


Some files were not shown because too many files changed in this diff