From fc91bf4a659d3cdfc0712b2aa7dcadb32674ca6d Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 1 Feb 2018 14:48:25 -0500 Subject: [PATCH] updated matrix and keymap --- keyboards/_qmk_handwire/_qmk_handwire.h | 22 ++-- keyboards/_qmk_handwire/config.h | 8 +- keyboards/_qmk_handwire/halconf.h | 2 +- .../_qmk_handwire/keymaps/default/keymap.c | 39 ++---- keyboards/_qmk_handwire/led.c | 12 +- keyboards/_qmk_handwire/matrix.c | 119 +++++++----------- keyboards/_qmk_handwire/mcuconf.h | 2 +- keyboards/_qmk_handwire/rules.mk | 2 +- 8 files changed, 79 insertions(+), 127 deletions(-) diff --git a/keyboards/_qmk_handwire/_qmk_handwire.h b/keyboards/_qmk_handwire/_qmk_handwire.h index 886b9201..e16ae3ba 100644 --- a/keyboards/_qmk_handwire/_qmk_handwire.h +++ b/keyboards/_qmk_handwire/_qmk_handwire.h @@ -29,17 +29,19 @@ /* The fully-featured KEYMAP() that has every single key available in the matrix. */ #define KEYMAP(\ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, \ - k40, k41, k42, k47, k4a, k4b, k4c, k4e \ + k00, k01, k02, k03, k04, k05, k06, \ + k10, k11, k12, k13, k14, k15, k16, \ + k20, k21, k22, k23, k24, k25, k26, \ + k31, k32, k33, k34, k35, k36, \ + k42, k43, k44, k45, k46, \ + k50, k51, k52 \ ) { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, KC_NO, k1e, }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, KC_NO, k2e, }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, KC_NO, k3e, }, \ - { k40, k41, k42, KC_NO, KC_NO, KC_NO, KC_NO, k47, KC_NO, KC_NO, k4a, k4b, k4c, KC_NO, k4e, }, \ + { k00, k01, k02, k03, k04, k05, k06 }, \ + { k10, k11, k12, k13, k14, k15, k16 }, \ + { k20, k21, k22, k23, k24, k25, k26 }, \ + { 0, k31, k32, k33, k34, k35, k36 }, \ + { 0, 0, k42, k43, k44, k45, k46 }, \ + { k50, k51, k52, 0, 0, 0, 0 } \ } #endif \ No newline at end of file diff --git a/keyboards/_qmk_handwire/config.h b/keyboards/_qmk_handwire/config.h index 0832fffc..70930b25 100644 --- a/keyboards/_qmk_handwire/config.h +++ b/keyboards/_qmk_handwire/config.h @@ -19,8 +19,8 @@ #define CONFIG_H /* USB Device descriptor parameter */ -#define VENDOR_ID 0xC1ED -#define PRODUCT_ID 0x2350 +#define VENDOR_ID 0x125A +#define PRODUCT_ID 0x1770 #define DEVICE_VER 0x0001 #define MANUFACTURER "QMK" #define USBSTR_MANUFACTURER 'Q', '\x00', 'M', '\x00', 'K', '\x00' @@ -29,8 +29,8 @@ #define DESCRIPTION "Handwire protoboard" /* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 +#define MATRIX_ROWS 6 +#define MATRIX_COLS 7 /* * Keyboard Matrix Assignments diff --git a/keyboards/_qmk_handwire/halconf.h b/keyboards/_qmk_handwire/halconf.h index 254470cb..d2a7653f 100644 --- a/keyboards/_qmk_handwire/halconf.h +++ b/keyboards/_qmk_handwire/halconf.h @@ -76,7 +76,7 @@ * @brief Enables the I2C subsystem. */ #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) -#define HAL_USE_I2C FALSE +#define HAL_USE_I2C TRUE #endif /** diff --git a/keyboards/_qmk_handwire/keymaps/default/keymap.c b/keyboards/_qmk_handwire/keymaps/default/keymap.c index 96b50787..01af5340 100644 --- a/keyboards/_qmk_handwire/keymaps/default/keymap.c +++ b/keyboards/_qmk_handwire/keymaps/default/keymap.c @@ -33,37 +33,14 @@ enum custom_keycodes { #endif const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Default Layer - * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| - * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| - * |-----------------------------------------------------------| - * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0| - * |-----------------------------------------------------------' - * |Ctrl |Gui|Alt | Space |Alt |Gui|Fn |Ctrl | - * `-----------------------------------------------------------' - */ - [_BL] = KEYMAP( - KC_GESC,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_GRV, KC_BSPC,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS, KC_ENT, \ - KC_LSFT, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_BSLS, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL), - [_FL] = KEYMAP( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,_______,\ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ - _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ - _______,_______,_______, _______, _______, _______, MO(_FL), _______), - [_CL] = KEYMAP( - BL_STEP,S_BSKTC,S_ODEJY,S_RCKBY,S_DOEDR,S_SCALE,S_ONEUP,S_COIN, S_SONIC,S_ZELDA,_______,_______,_______,_______,_______,\ - _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, \ - _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______, _______, _______, _______, _______, _______, MO(_FL), _______) + [0] = KEYMAP( + KC_INS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + KC_PGDN, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_QUOT, + KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_RCTL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + MO(2), MO(1), KC_SPC + ) }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/_qmk_handwire/led.c b/keyboards/_qmk_handwire/led.c index 35069673..42cbe0d4 100644 --- a/keyboards/_qmk_handwire/led.c +++ b/keyboards/_qmk_handwire/led.c @@ -23,8 +23,8 @@ void backlight_init_ports(void) { printf("backlight_init_ports()\n"); #ifdef BACKLIGHT_ENABLE - palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL); - palSetPad(GPIOB, 8); + // palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL); + // palSetPad(GPIOB, 8); #endif } @@ -33,10 +33,10 @@ void backlight_set(uint8_t level) { #ifdef BACKLIGHT_ENABLE if (level == 0) { // Turn backlight off - palSetPad(GPIOB, 8); + // palSetPad(GPIOB, 8); } else { // Turn backlight on - palClearPad(GPIOB, 8); + // palClearPad(GPIOB, 8); } #endif } @@ -45,9 +45,9 @@ void led_set_kb(uint8_t usb_led) { printf("led_set_kb(%d)\n", usb_led); if (usb_led & (1< DEBOUNCE) { for (int row = 0; row < MATRIX_ROWS; row++) { - matrix[row] = 0; - for (int col = 0; col < MATRIX_COLS; col++) { - matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col); - } + matrix[row] = matrix_debouncing[row]; } debouncing = false; } - matrix_scan_quantum(); return 1; diff --git a/keyboards/_qmk_handwire/mcuconf.h b/keyboards/_qmk_handwire/mcuconf.h index 94cb540e..226da48d 100644 --- a/keyboards/_qmk_handwire/mcuconf.h +++ b/keyboards/_qmk_handwire/mcuconf.h @@ -154,7 +154,7 @@ /* * I2C driver system settings. */ -#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C1 TRUE #define STM32_I2C_USE_I2C2 FALSE #define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_I2C1_IRQ_PRIORITY 10 diff --git a/keyboards/_qmk_handwire/rules.mk b/keyboards/_qmk_handwire/rules.mk index 2def050b..acabc0f9 100644 --- a/keyboards/_qmk_handwire/rules.mk +++ b/keyboards/_qmk_handwire/rules.mk @@ -36,7 +36,7 @@ USE_FPU = yes OPT_DEFS = # Options to pass to dfu-util when flashing -DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000 -R +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave # Build Options # comment out to disable the options.