summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.vusb11
-rw-r--r--POWER.txt62
-rw-r--r--README4
-rw-r--r--adb_usb/Makefile20
-rw-r--r--adb_usb/README8
-rw-r--r--adb_usb/config.h4
-rw-r--r--command.c56
-rw-r--r--command.h2
-rw-r--r--common.mk (renamed from Makefile.common)15
-rw-r--r--hhkb/FUSE.txt40
-rw-r--r--hhkb/Makefile.iwrap91
-rw-r--r--hhkb/Makefile.pjrc (renamed from hhkb/Makefile)19
-rw-r--r--hhkb/Makefile.vusb29
-rw-r--r--hhkb/README113
-rw-r--r--hhkb/config_iwrap.h55
-rw-r--r--hhkb/config_pjrc.h6
-rw-r--r--hhkb/config_vusb.h12
-rw-r--r--hhkb/doc/Bluetooth.txt4
-rwxr-xr-xhhkb/doc/Bluetooth_img/.picasa.ini2
-rwxr-xr-xhhkb/doc/Bluetooth_img/BT_circuit.jpgbin0 -> 502118 bytes
-rw-r--r--hhkb/doc/HHKB_img/HHKB_TP1684.jpg (renamed from hhkb/doc/HHKB_TP1684.jpg)bin149082 -> 149082 bytes
-rw-r--r--hhkb/doc/HHKB_img/HHKB_chart1.jpg (renamed from hhkb/doc/HHKB_chart1.jpg)bin155342 -> 155342 bytes
-rw-r--r--hhkb/doc/HHKB_img/HHKB_chart2.jpg (renamed from hhkb/doc/HHKB_chart2.jpg)bin148225 -> 148225 bytes
-rw-r--r--hhkb/doc/HHKB_img/HHKB_connector.jpg (renamed from hhkb/doc/HHKB_connector.jpg)bin193900 -> 193900 bytes
-rw-r--r--hhkb/doc/HHKB_img/HHKB_controller.jpg (renamed from hhkb/doc/HHKB_controller.jpg)bin135100 -> 135100 bytes
-rw-r--r--hhkb/doc/HHKB_img/HHKB_keyswitch.jpg (renamed from hhkb/doc/HHKB_keyswitch.jpg)bin171469 -> 171469 bytes
-rw-r--r--hhkb/doc/HHKB_img/connector_contact.jpg (renamed from hhkb/doc/connector_contact.jpg)bin192830 -> 192830 bytes
-rw-r--r--hhkb/doc/HHKB_img/logic_analyzer.jpg (renamed from hhkb/doc/logic_analyzer.jpg)bin169564 -> 169564 bytes
-rw-r--r--hhkb/doc/HHKB_img/probe_contact.jpg (renamed from hhkb/doc/probe_contact.jpg)bin208477 -> 208477 bytes
-rw-r--r--hhkb/doc/HHKB_img/teensy_install.jpg (renamed from hhkb/doc/teensy_install.jpg)bin135851 -> 135851 bytes
-rw-r--r--hhkb/doc/HHKB_img/teensy_wiring.jpg (renamed from hhkb/doc/teensy_wiring.jpg)bin154695 -> 154695 bytes
-rw-r--r--hhkb/keymap.c115
-rw-r--r--hhkb/matrix.c66
-rw-r--r--hhkb/usbconfig.h16
-rw-r--r--host.c190
-rw-r--r--host.h89
-rw-r--r--host_driver.h33
-rw-r--r--iwrap.mk10
-rw-r--r--iwrap/iWRAP.txt376
-rw-r--r--iwrap/iwrap.c467
-rw-r--r--iwrap/iwrap.h49
-rw-r--r--iwrap/main.c378
-rw-r--r--iwrap/suart.S156
-rw-r--r--iwrap/suart.h8
-rw-r--r--iwrap/wd.h159
-rw-r--r--keyboard.c9
-rwxr-xr-xlayer.c4
-rw-r--r--macway/Makefile16
-rw-r--r--macway/config.h4
-rw-r--r--[-rwxr-xr-x]macway/doc/back.jpgbin122135 -> 122135 bytes
-rw-r--r--[-rwxr-xr-x]macway/doc/case.jpgbin146003 -> 146003 bytes
-rw-r--r--[-rwxr-xr-x]macway/doc/keys.jpgbin116365 -> 116365 bytes
-rw-r--r--[-rwxr-xr-x]macway/doc/side.jpgbin109755 -> 109755 bytes
-rw-r--r--[-rwxr-xr-x]macway/doc/switch.jpgbin115526 -> 115526 bytes
-rw-r--r--[-rwxr-xr-x]macway/doc/teensy.jpgbin165814 -> 165814 bytes
-rw-r--r--[-rwxr-xr-x]macway/doc/wiring.jpgbin165569 -> 165569 bytes
-rw-r--r--[-rwxr-xr-x]macway/doc/withHHKB.jpgbin152832 -> 152832 bytes
-rw-r--r--[-rwxr-xr-x]macway/doc/withThinkPad.jpgbin118993 -> 118993 bytes
-rw-r--r--main_vusb.c58
-rwxr-xr-x[-rw-r--r--]mousekey.c10
-rw-r--r--pjrc.mk (renamed from Makefile.pjrc)10
-rw-r--r--pjrc/host.c10
-rw-r--r--pjrc/main.c (renamed from main_pjrc.c)3
-rw-r--r--pjrc/pjrc.c76
-rw-r--r--pjrc/pjrc.h26
-rw-r--r--pjrc/usb.c34
-rw-r--r--pjrc/usb.h2
-rw-r--r--pjrc/usb_keyboard.c4
-rw-r--r--print.c13
-rw-r--r--print.h2
-rw-r--r--ps2_usb/Makefile18
-rw-r--r--ps2_usb/Makefile.vusb19
-rw-r--r--ps2_usb/config_pjrc.h4
-rw-r--r--ps2_usb/config_vusb.h4
-rw-r--r--ps2_usb/keymap.c6
-rw-r--r--ps2_usb/matrix.c1
-rw-r--r--report.h96
-rw-r--r--rules.mk (renamed from Makefile.rules)0
-rw-r--r--sendchar.h4
-rw-r--r--sendchar_null.c (renamed from vusb/host_vusb.h)10
-rw-r--r--sendchar_uart.c25
-rw-r--r--timer.c35
-rw-r--r--timer.h21
-rw-r--r--uart.c129
-rw-r--r--uart.h11
-rw-r--r--usb_keycodes.h8
-rw-r--r--vusb.mk17
-rw-r--r--vusb/main.c99
-rw-r--r--vusb/vusb.c (renamed from vusb/host.c)207
-rw-r--r--vusb/vusb.h27
90 files changed, 3150 insertions, 537 deletions
diff --git a/Makefile.vusb b/Makefile.vusb
deleted file mode 100644
index b8e71a8e36..0000000000
--- a/Makefile.vusb
+++ /dev/null
@@ -1,11 +0,0 @@
-OPT_DEFS += -DHOST_VUSB
-
-SRC = usbdrv.c \
- usbdrvasm.S \
- oddebug.c \
- sendchar_usart.c
-SRC += $(TARGET_SRC)
-
-
-# C source file search path
-VPATH = $(TARGET_DIR):$(COMMON_DIR):$(COMMON_DIR)/vusb:$(COMMON_DIR)/vusb/usbdrv
diff --git a/POWER.txt b/POWER.txt
new file mode 100644
index 0000000000..0abbbe48e8
--- /dev/null
+++ b/POWER.txt
@@ -0,0 +1,62 @@
+Time to Sleep
+=============
+USB suspend no activity on USB line for 3ms
+No Interaction no user interaction
+ matrix has no change
+ matrix has no switch on
+
+
+AVR Power Management
+====================
+
+V-USB suspend
+ USB suspend
+ http://vusb.wikidot.com/examples
+
+MCUSR MCU Status Register
+ WDRF Watchdog Reset Flag
+ BORF
+ EXTRF
+ PORF Power-on Reset Flag
+
+SMCR Sleep Mode Control Register
+ SE Sleep Enable
+ SM2:0
+ #define set_sleep_mode(mode) \
+ #define SLEEP_MODE_IDLE (0)
+ #define SLEEP_MODE_ADC _BV(SM0)
+ #define SLEEP_MODE_PWR_DOWN _BV(SM1)
+ #define SLEEP_MODE_PWR_SAVE (_BV(SM0) | _BV(SM1))
+ #define SLEEP_MODE_STANDBY (_BV(SM1) | _BV(SM2))
+ #define SLEEP_MODE_EXT_STANDBY (_BV(SM0) | _BV(SM1) | _BV(SM2))
+
+
+ACSR Analog Comparator Control and Status Register
+ To disable Analog Comparator
+ ACSR = 0x80;
+ or
+ ACSR &= ~_BV(ACIE);
+ ACSR |= _BV(ACD);
+
+ ACD: Analog Comparator Disable
+ When this bit is written logic one, the power to the Analog Comparator is
+ switched off. This bit can be set at any time to turn off the Analog
+ Comparator. This will reduce power consumption in Active and Idle mode.
+ When changing the ACD bit, the Analog Comparator Interrupt must be disabled
+ by clearing the ACIE bit in ACSR. Otherwise an interrupt can occur when
+ the bit is changed.
+
+DIDR1 Digital Input Disable Register 1
+ AIN1D
+ AIN0D
+ When this bit is written logic one, the digital input buffer on the AIN1/0 pin is disabled. The corresponding PIN Register bit will always read as zero when this bit is set. When an analog signal is applied to the AIN1/0 pin and the digital input from this pin is not needed, this bit should be written logic one to reduce power consumption in the digital input buffer.
+
+
+PRR Power Reduction Register
+ PRTWI
+ PRTIM2
+ PRTIM0
+ PRTIM1
+ PRSPI
+ PRUSART0
+ PRADC
diff --git a/README b/README
index 2aa0106b06..d85f512c71 100644
--- a/README
+++ b/README
@@ -96,8 +96,8 @@ Build Options
3. Choose optional modules as needed. Comment out to disable optional modules.
MOUSEKEY_ENABLE = yes # Mouse keys
PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
- USB_EXTRA_ENABLE = yes # Enhanced feature for Windows(Audio control and System control)
- USB_NKRO_ENABLE = yes # USB Nkey Rollover
+ EXTRAKEY_ENABLE = yes # Enhanced feature for Windows(Audio control and System control)
+ NKRO_ENABLE = yes # USB Nkey Rollover
<target>/config.h:
1. USB vendor/product ID and device description
diff --git a/adb_usb/Makefile b/adb_usb/Makefile
index 802b4248cb..56b342df94 100644
--- a/adb_usb/Makefile
+++ b/adb_usb/Makefile
@@ -8,11 +8,11 @@ COMMON_DIR = ..
TARGET_DIR = .
# keyboard dependent files
-TARGET_SRC = main_pjrc.c \
- keymap.c \
- matrix.c \
- led.c \
- adb.c
+SRC = main.c \
+ keymap.c \
+ matrix.c \
+ led.c \
+ adb.c
CONFIG_H = config.h
@@ -36,10 +36,10 @@ F_CPU = 16000000
# Build Options
# comment out to disable the options.
#
-MOUSEKEY_ENABLE = yes # Mouse keys
+#MOUSEKEY_ENABLE = yes # Mouse keys
#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
-USB_EXTRA_ENABLE = yes # Audio control and System control
-#USB_NKRO_ENABLE = yes # USB Nkey Rollover
+#EXTRAKEY_ENABLE = yes # Audio control and System control
+#NKRO_ENABLE = yes # USB Nkey Rollover
@@ -48,5 +48,5 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
-include $(COMMON_DIR)/Makefile.pjrc
-include $(COMMON_DIR)/Makefile.common
+include $(COMMON_DIR)/pjrc.mk
+include $(COMMON_DIR)/common.mk
diff --git a/adb_usb/README b/adb_usb/README
index b4bd35bb33..5d0e1bc86b 100644
--- a/adb_usb/README
+++ b/adb_usb/README
@@ -59,4 +59,12 @@ effort at this time.
),
+Notes
+-----
+Many ADB keyboards has 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 are the examples.
+Though ADB protocol itsef has the ability of distinction between right and left.
+And most ADB keyboard has no NKRO functionality, though ADB protocol itsef has that.
+
EOF
diff --git a/adb_usb/config.h b/adb_usb/config.h
index 27f31ca9e9..6431ede4cf 100644
--- a/adb_usb/config.h
+++ b/adb_usb/config.h
@@ -37,8 +37,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* key combination for command */
#define IS_COMMAND() ( \
- keyboard_report->mods == (BIT_LSHIFT | BIT_LCTRL | BIT_LALT | BIT_LGUI) || \
- keyboard_report->mods == (BIT_LSHIFT | BIT_RSHIFT) \
+ keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_LCTRL) | MOD_BIT(KB_LALT) | MOD_BIT(KB_LGUI)) || \
+ keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)) \
)
diff --git a/command.c b/command.c
index 0a07aebfc1..22f25e99c0 100644
--- a/command.c
+++ b/command.c
@@ -30,24 +30,49 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef HOST_PJRC
# include "jump_bootloader.h"
# include "usb_keyboard.h"
-# ifdef USB_EXTRA_ENABLE
+# ifdef EXTRAKEY_ENABLE
# include "usb_extra.h"
# endif
#endif
+#ifdef HOST_VUSB
+# include "usbdrv.h"
+#endif
+
+static uint8_t command_common(void);
static void help(void);
static void switch_layer(uint8_t layer);
+static bool last_print_enable;
uint8_t command_proc(void)
{
+ uint8_t processed = 0;
+ last_print_enable = print_enable;
+
if (!IS_COMMAND())
return 0;
- uint8_t processed = 1;
- bool last_print_enable = print_enable;
print_enable = true;
+ if (command_extra() || command_common()) {
+ processed = 1;
+ _delay_ms(500);
+ }
+ print_enable = last_print_enable;
+ return processed;
+}
+
+/* This allows to define extra commands. return 0 when not processed. */
+uint8_t command_extra(void) __attribute__ ((weak));
+uint8_t command_extra(void)
+{
+ return 0;
+}
+
+
+static uint8_t command_common(void)
+{
switch (host_get_first_key()) {
case KB_H:
help();
@@ -123,20 +148,26 @@ uint8_t command_proc(void)
print("usb_keyboard_idle_config:"); phex(usb_keyboard_idle_config); print("\n");
print("usb_keyboard_idle_count:"); phex(usb_keyboard_idle_count); print("\n");
#endif
+
+#ifdef HOST_VUSB
+# if USB_COUNT_SOF
+ print("usbSofCount: "); phex(usbSofCount); print("\n");
+# endif
+#endif
break;
-#ifdef USB_NKRO_ENABLE
+#ifdef NKRO_ENABLE
case KB_N:
// send empty report before change
host_clear_keyboard_report();
host_send_keyboard_report();
keyboard_nkro = !keyboard_nkro;
if (keyboard_nkro)
- print("USB_NKRO: enabled\n");
+ print("NKRO: enabled\n");
else
- print("USB_NKRO: disabled\n");
+ print("NKRO: disabled\n");
break;
#endif
-#ifdef USB_EXTRA_ENABLE
+#ifdef EXTRAKEY_ENABLE
case KB_ESC:
host_clear_keyboard_report();
host_send_keyboard_report();
@@ -175,12 +206,9 @@ uint8_t command_proc(void)
switch_layer(4);
break;
default:
- processed = 0;
+ return 0;
}
- if (processed)
- _delay_ms(500);
- print_enable = last_print_enable;
- return processed;
+ return 1;
}
static void help(void)
@@ -194,8 +222,8 @@ static void help(void)
print("v: print version\n");
print("t: print timer count\n");
print("s: print status\n");
-#ifdef USB_NKRO_ENABLE
- print("n: toggle USB_NKRO\n");
+#ifdef NKRO_ENABLE
+ print("n: toggle NKRO\n");
#endif
print("Backspace: clear matrix\n");
print("ESC: power down/wake up\n");
diff --git a/command.h b/command.h
index dca6da456b..4888f5ee0b 100644
--- a/command.h
+++ b/command.h
@@ -19,5 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define COMMAND
uint8_t command_proc(void);
+/* This allows to extend commands. Return 0 when command is not processed. */
+uint8_t command_extra(void);
#endif
diff --git a/Makefile.common b/common.mk
index 1922def001..17c6816f6c 100644
--- a/Makefile.common
+++ b/common.mk
@@ -19,17 +19,20 @@ ifdef PS2_MOUSE_ENABLE
OPT_DEFS += -DPS2_MOUSE_ENABLE
endif
-ifdef USB_EXTRA_ENABLE
- OPT_DEFS += -DUSB_EXTRA_ENABLE
+ifdef EXTRAKEY_ENABLE
+ OPT_DEFS += -DEXTRAKEY_ENABLE
endif
-ifdef USB_NKRO_ENABLE
- OPT_DEFS += -DUSB_NKRO_ENABLE
+ifdef NKRO_ENABLE
+ OPT_DEFS += -DNKRO_ENABLE
endif
ifdef $(or MOUSEKEY_ENABLE, PS2_MOUSE_ENABLE)
- OPT_DEFS += -DUSB_MOUSE_ENABLE
+ OPT_DEFS += -DMOUSE_ENABLE
endif
+# Search Path
+VPATH += $(COMMON_DIR)
-include $(COMMON_DIR)/Makefile.rules
+
+include $(COMMON_DIR)/rules.mk
diff --git a/hhkb/FUSE.txt b/hhkb/FUSE.txt
new file mode 100644
index 0000000000..40055e5ab1
--- /dev/null
+++ b/hhkb/FUSE.txt
@@ -0,0 +1,40 @@
+ATMega168P Fuse/Lock Bits
+=========================
+This configuration is from usbasploader's Makefile.
+
+ HFUSE 0xD6
+ LFUSE 0xDF
+ EFUSE 0x00
+ LOCK 0x3F(intact)
+
+#---------------------------------------------------------------------
+# ATMega168P
+#---------------------------------------------------------------------
+# Fuse extended byte:
+# 0x00 = 0 0 0 0 0 0 0 0 <-- BOOTRST (boot reset vector at 0x1800)
+# \+/
+# +------- BOOTSZ (00 = 2k bytes)
+# Fuse high byte:
+# 0xd6 = 1 1 0 1 0 1 1 0
+# ^ ^ ^ ^ ^ \-+-/
+# | | | | | +------ BODLEVEL 0..2 (110 = 1.8 V)
+# | | | | + --------- EESAVE (preserve EEPROM over chip erase)
+# | | | +-------------- WDTON (if 0: watchdog always on)
+# | | +---------------- SPIEN (allow serial programming)
+# | +------------------ DWEN (debug wire enable)
+# +-------------------- RSTDISBL (reset pin is enabled)
+# Fuse low byte:
+# 0xdf = 1 1 0 1 1 1 1 1
+# ^ ^ \ / \--+--/
+# | | | +------- CKSEL 3..0 (external >8M crystal)
+# | | +--------------- SUT 1..0 (crystal osc, BOD enabled)
+# | +------------------ CKOUT (if 0: Clock output enabled)
+# +-------------------- CKDIV8 (if 0: divide by 8)
+
+
+# Lock Bits
+# 0x3f = - - 1 1 1 1 1 1
+# \ / \-/ \-/
+# | | +----- LB 2..1 (No memory lock features enabled)
+# | +--------- BLB0 2..1 (No restrictions for SPM or LPM accessing the Application section)
+# +--------------- BLB1 2..1 (No restrictions for SPM or LPM accessing the Boot Loader section)
diff --git a/hhkb/Makefile.iwrap b/hhkb/Makefile.iwrap
new file mode 100644
index 0000000000..cf020b94aa
--- /dev/null
+++ b/hhkb/Makefile.iwrap
@@ -0,0 +1,91 @@
+#
+# Makefile for iWRAP
+#
+
+
+# Target file name (without extension).
+TARGET = hhkb_iwrap
+
+# Directory common source filess exist
+COMMON_DIR = ..
+
+# Directory keyboard dependent files exist
+TARGET_DIR = .
+
+# keyboard dependent files
+SRC = main.c \
+ keymap.c \
+ matrix.c \
+ led.c
+
+CONFIG_H = config_iwrap.h
+
+
+# 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 = atmega168p
+# avrdude doesn't know atmega168p
+AVRDUDE_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 = 12000000
+
+
+# Build Options
+# comment out to disable the options.
+#
+MOUSEKEY_ENABLE = yes # Mouse keys
+EXTRAKEY_ENABLE = yes # Audio control and System control
+#NKRO_ENABLE = yes # USB Nkey Rollover
+
+
+
+#---------------- Programming Options --------------------------
+AVRDUDE = avrdude
+# Type: avrdude -c ? to get a full listing.
+AVRDUDE_PROGRAMMER = usbasp
+AVRDUDE_PORT =
+AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
+#AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
+
+# Uncomment the following if you want avrdude's erase cycle counter.
+# Note that this counter needs to be initialized first using -Yn,
+# see avrdude manual.
+#AVRDUDE_ERASE_COUNTER = -y
+
+# Uncomment the following if you do /not/ wish a verification to be
+# performed after programming the device.
+#AVRDUDE_NO_VERIFY = -V
+
+# Increase verbosity level. Please use this when submitting bug
+# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
+# to submit bug reports.
+#AVRDUDE_VERBOSE = -v -v
+
+#AVRDUDE_FLAGS = -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
+AVRDUDE_FLAGS = -p $(AVRDUDE_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)
+
+
+
+# Search Path
+VPATH = $(TARGET_DIR)
+
+include $(COMMON_DIR)/iwrap.mk
+# To be swatchable btween Bluetooth and USB. Comment out if you don't need USB.
+include $(COMMON_DIR)/vusb.mk
+include $(COMMON_DIR)/common.mk
diff --git a/hhkb/Makefile b/hhkb/Makefile.pjrc
index e1cc2f2106..17aa865ddc 100644
--- a/hhkb/Makefile
+++ b/hhkb/Makefile.pjrc
@@ -13,10 +13,10 @@ COMMON_DIR = ..
TARGET_DIR = .
# keyboard dependent files
-TARGET_SRC = main_pjrc.c \
- keymap.c \
- matrix.c \
- led.c
+SRC = main.c \
+ keymap.c \
+ matrix.c \
+ led.c
CONFIG_H = config_pjrc.h
@@ -41,8 +41,8 @@ F_CPU = 16000000
# comment out to disable the options.
MOUSEKEY_ENABLE = yes # Mouse keys
#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
-USB_EXTRA_ENABLE = yes # Audio control and System control
-USB_NKRO_ENABLE = yes # USB Nkey Rollover
+EXTRAKEY_ENABLE = yes # Audio control and System control
+NKRO_ENABLE = yes # USB Nkey Rollover
@@ -51,5 +51,8 @@ PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
-include $(COMMON_DIR)/Makefile.pjrc
-include $(COMMON_DIR)/Makefile.common
+# Search Path
+VPATH = $(TARGET_DIR)
+
+include $(COMMON_DIR)/pjrc.mk
+include $(COMMON_DIR)/common.mk
diff --git a/hhkb/Makefile.vusb b/hhkb/Makefile.vusb
index 77841b824c..5bfc233df8 100644
--- a/hhkb/Makefile.vusb
+++ b/hhkb/Makefile.