Fix makefile, debug print and keymap of HHKB

master
tmk 2013-05-14 23:06:07 +09:00
parent cbb9c408e4
commit 92b0674a7f
3 changed files with 15 additions and 39 deletions

View File

@ -97,6 +97,15 @@ F_USB = $(F_CPU)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT 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 # Build Options
# comment out to disable the options. # comment out to disable the options.
# #

View File

@ -67,7 +67,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \
LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT,FN4, \ LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT,FN4, \
FN5,Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,FN1, \ FN5,Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,FN1, \
LGUI,LALT, FN6, RALT,FN7), LGUI,LALT, FN6, RALT,NO),
/* Layer 1: HHKB mode (HHKB Fn) /* Layer 1: HHKB mode (HHKB Fn)
* ,-----------------------------------------------------------. * ,-----------------------------------------------------------.
@ -150,7 +150,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,-----------------------------------------------------------. * ,-----------------------------------------------------------.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del| * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Ins|Del|
* |-----------------------------------------------------------| * |-----------------------------------------------------------|
* |Tab | | | | | |MwL|MwD|MwU|MwR| | | |Backs| * |Tab | | | | | |MwL|MwD|MwU|MwR| |Wbk|Wfr|Close|
* |-----------------------------------------------------------| * |-----------------------------------------------------------|
* |Contro| | | | | |McL|McD|McU|McR|Fn0| |Return | * |Contro| | | | | |McL|McD|McU|McR|Fn0| |Return |
* |-----------------------------------------------------------| * |-----------------------------------------------------------|
@ -161,7 +161,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel
*/ */
KEYMAP(ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, \ KEYMAP(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,NO, NO, NO, BSPC, \ TAB, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,WSTP,WBAK,WFWD,FN8, \
LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,NO, NO, ENT, \ LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,NO, NO, ENT, \
LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT,NO, \ LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT,NO, \
LGUI,LALT, TRNS, RALT,RGUI), LGUI,LALT, TRNS, RALT,RGUI),
@ -194,6 +194,7 @@ static const uint16_t PROGMEM fn_actions[] = {
[5] = ACTION_MODS_ONESHOT(MOD_LSFT), // Oneshot Shift* [5] = ACTION_MODS_ONESHOT(MOD_LSFT), // Oneshot Shift*
[6] = ACTION_LAYER_TAP_KEY(5, KC_SPC), // Mousekey layer with Space [6] = ACTION_LAYER_TAP_KEY(5, KC_SPC), // Mousekey layer with Space
[7] = ACTION_LAYER_TOGGLE(3), // Mousekey layer(toggle) [7] = ACTION_LAYER_TOGGLE(3), // Mousekey layer(toggle)
[8] = ACTION_MODS_KEY(MOD_LCTL, KC_W), // Close Tab
// [8] = ACTION_LMOD_TAP_KEY(KC_LCTL, KC_BSPC), // LControl with tap Backspace // [8] = ACTION_LMOD_TAP_KEY(KC_LCTL, KC_BSPC), // LControl with tap Backspace
// [9] = ACTION_LMOD_TAP_KEY(KC_LCTL, KC_ESC), // LControl with tap Esc // [9] = ACTION_LMOD_TAP_KEY(KC_LCTL, KC_ESC), // LControl with tap Esc

View File

@ -35,13 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# error "Timer resolution(>20us) is not enough for HHKB matrix scan tweak on V-USB." # error "Timer resolution(>20us) is not enough for HHKB matrix scan tweak on V-USB."
#endif #endif
#if (MATRIX_COLS > 16)
# error "MATRIX_COLS must not exceed 16"
#endif
#if (MATRIX_ROWS > 255)
# error "MATRIX_ROWS must not exceed 255"
#endif
// matrix state buffer(1:on, 0:off) // matrix state buffer(1:on, 0:off)
static matrix_row_t *matrix; static matrix_row_t *matrix;
@ -226,42 +219,15 @@ bool matrix_is_on(uint8_t row, uint8_t col)
} }
inline inline
#if (MATRIX_COLS <= 8) matrix_row_t matrix_get_row(uint8_t row)
uint8_t matrix_get_row(uint8_t row)
#else
uint16_t matrix_get_row(uint8_t row)
#endif
{ {
return matrix[row]; return matrix[row];
} }
void matrix_print(void) void matrix_print(void)
{ {
#if (MATRIX_COLS <= 8)
print("\nr/c 01234567\n"); print("\nr/c 01234567\n");
#else
print("\nr/c 0123456789ABCDEF\n");
#endif
for (uint8_t row = 0; row < matrix_rows(); row++) { for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": "); xprintf("%02X: %08b\n", row, bitrev(matrix_get_row(row)));
#if (MATRIX_COLS <= 8)
pbin_reverse(matrix_get_row(row));
#else
pbin_reverse16(matrix_get_row(row));
#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;
}