summaryrefslogtreecommitdiff
path: root/keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'keyboard')
-rw-r--r--keyboard/gh60/Makefile.lufa21
-rw-r--r--keyboard/gh60/Makefile.pjrc22
-rw-r--r--keyboard/gh60/config.h19
-rw-r--r--keyboard/gh60/keymap.c6
-rw-r--r--keyboard/gh60/matrix.c2
-rw-r--r--keyboard/hhkb/Makefile.lufa7
-rw-r--r--keyboard/hhkb/config.h13
-rw-r--r--keyboard/hhkb/config_iwrap.h13
8 files changed, 59 insertions, 44 deletions
diff --git a/keyboard/gh60/Makefile.lufa b/keyboard/gh60/Makefile.lufa
index 7a83032969..a5ff609a77 100644
--- a/keyboard/gh60/Makefile.lufa
+++ b/keyboard/gh60/Makefile.lufa
@@ -47,8 +47,7 @@ TOP_DIR = ../..
# Directory keyboard dependent files exist
TARGET_DIR = .
-
-# List C source files here. (C dependencies are automatically generated.)
+# project specific files
SRC += keymap.c \
matrix.c \
led.c
@@ -93,23 +92,23 @@ ARCH = AVR8
# 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
+
# 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
+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)
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
-# Boot Section Size in bytes
-# Teensy halfKay 512
-# Atmel DFU loader 4096
-# LUFA bootloader 4096
-OPT_DEFS += -DBOOT_SIZE=4096
-
+# Optimize size but this may cause error "relocation truncated to fit"
+EXTRALDFLAGS = -Wl,--relax
# Search Path
VPATH += $(TARGET_DIR)
diff --git a/keyboard/gh60/Makefile.pjrc b/keyboard/gh60/Makefile.pjrc
index af6ef63ec4..f03ca9416d 100644
--- a/keyboard/gh60/Makefile.pjrc
+++ b/keyboard/gh60/Makefile.pjrc
@@ -47,7 +47,7 @@ TOP_DIR = ../..
# Directory keyboard dependent files exist
TARGET_DIR = .
-# keyboard dependent files
+# project specific files
SRC = keymap.c \
matrix.c \
led.c
@@ -57,10 +57,8 @@ CONFIG_H = config.h
# MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt
-#MCU = at90usb162 # Teensy 1.0
-MCU = atmega32u4 # Teensy 2.0
-#MCU = at90usb646 # Teensy++ 1.0
-#MCU = at90usb1286 # Teensy++ 2.0
+MCU = atmega32u4
+#MCU = at90usb1286
# Processor frequency.
@@ -70,15 +68,21 @@ MCU = atmega32u4 # Teensy 2.0
# examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000
+# Boot Section Size in bytes
+# Teensy halfKay 512
+# Atmel DFU loader 4096
+# LUFA bootloader 4096
+OPT_DEFS += -DBOOT_SIZE=4096
# Build Options
# comment out to disable the options.
#
-MOUSEKEY_ENABLE = yes # Mouse keys
-#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
-EXTRAKEY_ENABLE = yes # Audio control and System control
-NKRO_ENABLE = yes # USB Nkey Rollover
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes # Mouse keys(+5000)
+EXTRAKEY_ENABLE = yes # Audio control and System control(+600)
+NKRO_ENABLE = yes # USB Nkey Rollover(+500)
CONSOLE_ENABLE = yes # Console for debug
+#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
# Search Path
diff --git a/keyboard/gh60/config.h b/keyboard/gh60/config.h
index ef0c9a1735..cd98395eb5 100644
--- a/keyboard/gh60/config.h
+++ b/keyboard/gh60/config.h
@@ -25,12 +25,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEVICE_VER 0x0001
#define MANUFACTURER geekhack
#define PRODUCT GH60
-
-
-/* message strings */
#define DESCRIPTION t.m.k. keyboard firmware for GH60
-
/* matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 14
@@ -41,14 +37,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Set 0 if need no debouncing */
#define DEBOUNCE 5
-/* To use new keymap framework */
-#define USE_KEYMAP_V2
-
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
+/* Boot Section Size in *BYTEs*
+ * Teensy halfKay 512
+ * Teensy++ halfKay 1024
+ * Atmel DFU loader 4096
+ * LUFA bootloader 4096
+ * USBaspLoader 2048
+ */
+#define BOOTLOADER_SIZE 4096
+
/*
* Boot magic keys
* call some function by pressing key when pluging cable or powering on.
@@ -56,10 +58,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* key position on matrix(ROW:COL) */
#define KEY_FN 0x4A
#define KEY_D 0x23
+#define KEY_ESC 0x00
#define KEY_IS_ON(key) matrix_is_on((key)>>4, (key)&0xF)
/* kick up bootloader */
#define IS_BOOTMAGIC_BOOTLOADER() KEY_IS_ON(KEY_FN)
/* debug on */
#define IS_BOOTMAGIC_DEBUG() KEY_IS_ON(KEY_D)
+/* eeprom clear */
+#define IS_BOOTMAGIC_EEPROM_CLEAR() KEY_IS_ON(KEY_ESC)
#endif
diff --git a/keyboard/gh60/keymap.c b/keyboard/gh60/keymap.c
index 1f5344d4c6..d6af16961c 100644
--- a/keyboard/gh60/keymap.c
+++ b/keyboard/gh60/keymap.c
@@ -231,7 +231,8 @@ uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
if (layer < OVERLAYS_SIZE) {
return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]);
} else {
- debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n");
+ // XXX: this may cuaes bootlaoder_jump incositent fail.
+ //debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n");
return KC_TRANSPARENT;
}
}
@@ -240,8 +241,9 @@ uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
if (layer < KEYMAPS_SIZE) {
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
} else {
+ // XXX: this may cuaes bootlaoder_jump incositent fail.
+ //debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n");
// fall back to layer 0
- debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n");
return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
}
diff --git a/keyboard/gh60/matrix.c b/keyboard/gh60/matrix.c
index 85e58fe361..09a051aa66 100644
--- a/keyboard/gh60/matrix.c
+++ b/keyboard/gh60/matrix.c
@@ -120,7 +120,7 @@ bool matrix_has_ghost(void)
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
- return (matrix[row] & (1<<col));
+ return (matrix[row] & ((matrix_row_t)1<<col));
}
inline
diff --git a/keyboard/hhkb/Makefile.lufa b/keyboard/hhkb/Makefile.lufa
index afd413d019..e8b2414d39 100644
--- a/keyboard/hhkb/Makefile.lufa
+++ b/keyboard/hhkb/Makefile.lufa
@@ -107,13 +107,6 @@ CONSOLE_ENABLE = yes # Console for debug
#PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
-# Boot Section Size in bytes
-# Teensy halfKay 512
-# Atmel DFU loader 4096
-# LUFA bootloader 4096
-#OPT_DEFS += -DBOOT_SIZE=4096
-
-
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TOP_DIR)
diff --git a/keyboard/hhkb/config.h b/keyboard/hhkb/config.h
index 72e4d26e92..ef2958981c 100644
--- a/keyboard/hhkb/config.h
+++ b/keyboard/hhkb/config.h
@@ -27,18 +27,23 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEVICE_VER 0x0103
#define MANUFACTURER t.m.k.
#define PRODUCT HHKB mod
+#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod
-#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod
+/* Boot Section Size in *BYTEs*
+ * Teensy halfKay 512
+ * Teensy++ halfKay 1024
+ * Atmel DFU loader 4096
+ * LUFA bootloader 4096
+ * USBaspLoader 2048
+ */
+#define BOOTLOADER_SIZE 1024
/* matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 8
-/* To use new keymap framework */
-#define USE_KEYMAP_V2
-
/*
* Boot magic keys
* call some function by pressing key when pluging cable or powering on.
diff --git a/keyboard/hhkb/config_iwrap.h b/keyboard/hhkb/config_iwrap.h
index d50b704d72..7a4ec37118 100644
--- a/keyboard/hhkb/config_iwrap.h
+++ b/keyboard/hhkb/config_iwrap.h
@@ -27,13 +27,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DESCRIPTION t.m.k. keyboard firmware for HHKB mod
+/* Boot Section Size in *BYTEs*
+ * Teensy halfKay 512
+ * Teensy++ halfKay 1024
+ * Atmel DFU loader 4096
+ * LUFA bootloader 4096
+ * USBaspLoader 2048
+ */
+#define BOOTLOADER_SIZE 2048
+
+
/* matrix size */
#define MATRIX_ROWS 8
#define MATRIX_COLS 8
-/* To use new keymap framework */
-#define USE_KEYMAP_V2
-
/* key combination for command */
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))