diff options
author | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
---|---|---|
committer | William Chang <william@factual.com> | 2019-11-20 22:17:07 -0800 |
commit | e7f4d56592b3975c38af329e77b4efd9108495e8 (patch) | |
tree | 0a416bccbf70bfdbdb9ffcdb3bf136b47378c014 /keyboards/converter/usb_usb | |
parent | 71493b2f9bbd5f3d18373c518fa14ccafcbf48fc (diff) | |
parent | 8416a94ad27b3ff058576f09f35f0704a8b39ff3 (diff) | |
download | qmk_firmware-e7f4d56592b3975c38af329e77b4efd9108495e8.tar.gz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'keyboards/converter/usb_usb')
-rw-r--r-- | keyboards/converter/usb_usb/README.md | 48 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/ble/rules.mk | 5 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/custom_matrix.cpp | 12 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/hasu/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/keymaps/narze/README.md | 10 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/keymaps/narze/config.h | 48 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/keymaps/narze/keymap.c | 167 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/keymaps/narze/rules.mk | 3 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/pro_micro/rules.mk | 1 | ||||
-rw-r--r-- | keyboards/converter/usb_usb/rules.mk | 57 |
10 files changed, 268 insertions, 84 deletions
diff --git a/keyboards/converter/usb_usb/README.md b/keyboards/converter/usb_usb/README.md index 64334a85f..594a9be87 100644 --- a/keyboards/converter/usb_usb/README.md +++ b/keyboards/converter/usb_usb/README.md @@ -36,18 +36,18 @@ https://geekhack.org/index.php?topic=69169.0 ### Build one yourself using Arduino Leonardo + Circuit@Home USB Host Shield 2.0 Buying Arduino Leonardo and USB Host Shield 2.0(from Circuit@home) will be better, you won't need even soldering iron. -http://arduino.cc/en/Main/ArduinoBoardLeonardo -https://www.circuitsathome.com/arduino_usb_host_shield_projects/ +- http://arduino.cc/en/Main/ArduinoBoardLeonardo +- https://www.circuitsathome.com/arduino_usb_host_shield_projects/ Other compatible boards like Arduino's Shield will also work well but I think Sparkfun's needs to be modified. -http://arduino.cc/en/Main/ArduinoUSBHostShield -https://www.sparkfun.com/products/9947 +- http://arduino.cc/en/Main/ArduinoUSBHostShield +- https://www.sparkfun.com/products/9947 Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with some fixes on signal/power routing. -[Build guide](https://geekhack.org/index.php?topic=80421.0) -https://www.circuitsathome.com/arduino_usb_host_shield_projects/ -https://www.sparkfun.com/products/12587 -https://www.pjrc.com/teensy/td_libs_USBHostShield.html +- [Build guide](https://geekhack.org/index.php?topic=80421.0) +- https://www.circuitsathome.com/arduino_usb_host_shield_projects/ +- https://www.sparkfun.com/products/12587 +- https://www.pjrc.com/teensy/td_libs_USBHostShield.html Limitations ---------- @@ -56,24 +56,14 @@ Note that the converter can host only USB "boot protocol" keyboard(6KRO), not NK Resources -------- -Hasu's main thread for the converter - https://geekhack.org/index.php?topic=69169.0 -Build guide for the Pro Micro variant - https://geekhack.org/index.php?topic=80421.0 -Original TMK version of the converter - https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb -USB Host Shield 2.0 - https://www.circuitsathome.com/arduino_usb_host_shield_projects/ -USB Host Shield 2.0 source - https://github.com/felis/USB_Host_Shield_2.0 -Arduino USB Host Shield (with bootst converter) - http://arduino.cc/en/Main/ArduinoUSBHostShield -Arduino source - https://github.com/arduino/Arduino -Initial release of TMK USB-USB converter - https://geekhack.org/index.php?topic=33057.msg653549#msg653549 - http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html#p74854 -Arduino-based hardware keyboard remapper - Colemak forum - http://forum.colemak.com/viewtopic.php?id=1561 -Teensy + Host Shield - http://www.pjrc.com/teensy/td_libs_USBHostShield.html +- [Hasu's main thread for the converter](https://geekhack.org/index.php?topic=69169.0) +- [Build guide for the Pro Micro variant](https://geekhack.org/index.php?topic=80421.0) +- [Original TMK version of the converter](https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb) +- [USB Host Shield 2.0](https://www.circuitsathome.com/arduino_usb_host_shield_projects/) +- [USB Host Shield 2.0 source](https://github.com/felis/USB_Host_Shield_2.0) +- [Arduino USB Host Shield (with bootst converter)](http://arduino.cc/en/Main/ArduinoUSBHostShield) +- [Arduino source](https://github.com/arduino/Arduino) +- [Initial release of TMK USB-USB converter](https://geekhack.org/index.php?topic=33057.msg653549#msg653549) +- [Teensy/Arduino + Host Shield](http://deskthority.net/workshop-f7/is-remapping-a-usb-keyboard-using-teensy-possible-t2841-30.html#p74854) +- [Arduino-based hardware keyboard remapper - Colemak forum](http://forum.colemak.com/viewtopic.php?id=1561) +- [Teensy + Host Shield](http://www.pjrc.com/teensy/td_libs_USBHostShield.html) diff --git a/keyboards/converter/usb_usb/ble/rules.mk b/keyboards/converter/usb_usb/ble/rules.mk index f5ab3880b..a882bd145 100644 --- a/keyboards/converter/usb_usb/ble/rules.mk +++ b/keyboards/converter/usb_usb/ble/rules.mk @@ -1,5 +1,4 @@ -BLUETOOTH = AdafruitBLE -ADAFRUIT_BLE_ENABLE = yes +# Processor frequency F_CPU = 8000000 BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) @@ -19,5 +18,7 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) +BLUETOOTH = AdafruitBLE +ADAFRUIT_BLE_ENABLE = yes EXTRAFLAGS += -flto diff --git a/keyboards/converter/usb_usb/custom_matrix.cpp b/keyboards/converter/usb_usb/custom_matrix.cpp index 6f381aabf..296f7fcd0 100644 --- a/keyboards/converter/usb_usb/custom_matrix.cpp +++ b/keyboards/converter/usb_usb/custom_matrix.cpp @@ -74,8 +74,6 @@ static bool matrix_is_mod = false; * This supports two cascaded hubs and four keyboards */ USB usb_host; -USBHub hub1(&usb_host); -USBHub hub2(&usb_host); HIDBoot<HID_PROTOCOL_KEYBOARD> kbd1(&usb_host); HIDBoot<HID_PROTOCOL_KEYBOARD> kbd2(&usb_host); HIDBoot<HID_PROTOCOL_KEYBOARD> kbd3(&usb_host); @@ -84,6 +82,8 @@ KBDReportParser kbd_parser1; KBDReportParser kbd_parser2; KBDReportParser kbd_parser3; KBDReportParser kbd_parser4; +USBHub hub1(&usb_host); +USBHub hub2(&usb_host); extern "C" @@ -252,10 +252,10 @@ extern "C" void led_set(uint8_t usb_led) { - kbd1.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); - kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); + if (kbd1.isReady()) kbd1.SetReport(0, 0, 2, 0, 1, &usb_led); + if (kbd2.isReady()) kbd2.SetReport(0, 0, 2, 0, 1, &usb_led); + if (kbd3.isReady()) kbd3.SetReport(0, 0, 2, 0, 1, &usb_led); + if (kbd4.isReady()) kbd4.SetReport(0, 0, 2, 0, 1, &usb_led); led_set_kb(usb_led); } diff --git a/keyboards/converter/usb_usb/hasu/rules.mk b/keyboards/converter/usb_usb/hasu/rules.mk index 27d8af768..c2ee0bc86 100644 --- a/keyboards/converter/usb_usb/hasu/rules.mk +++ b/keyboards/converter/usb_usb/hasu/rules.mk @@ -1 +1,2 @@ +# Processor frequency F_CPU = 16000000 diff --git a/keyboards/converter/usb_usb/keymaps/narze/README.md b/keyboards/converter/usb_usb/keymaps/narze/README.md new file mode 100644 index 000000000..a089568d2 --- /dev/null +++ b/keyboards/converter/usb_usb/keymaps/narze/README.md @@ -0,0 +1,10 @@ +# narze's layout for usb-usb converter + +## Key features +- Qwerty + [Colemak](https://colemak.com) layouts, and you can type Qwerty on software-level Colemak as well. Very useful for gaming or when your friend wanna type something but don't use Colemak. +- [(S)uper (D)uper Mode](https://github.com/jasonrudolph/keyboard#super-duper-mode) inspired by [jasonrudolph](https://github.com/jasonrudolph), with [some extensions](https://gist.github.com/narze/861e2167784842d38771) such as backspace & forward delete. + +## Build instructions +- `cd /path/to/qmk_firmware` +- Ensure latest libraries are loaded `make git-submodule` +- Build & flash : `make converter/usb_usb:narze:flash` diff --git a/keyboards/converter/usb_usb/keymaps/narze/config.h b/keyboards/converter/usb_usb/keymaps/narze/config.h new file mode 100644 index 000000000..cbdb7d94e --- /dev/null +++ b/keyboards/converter/usb_usb/keymaps/narze/config.h @@ -0,0 +1,48 @@ +#pragma once + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#undef TAPPING_TERM +#define TAPPING_TERM 100 + +#define COMBO_TERM 20 +#define COMBO_COUNT 1 + +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD + +#define SUPER_DUPER_SOUND S__NOTE(_B1) + +#define MOUSEKEY_DELAY 100 + +#define USB_POLLING_INTERVAL_MS 1 + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif diff --git a/keyboards/converter/usb_usb/keymaps/narze/keymap.c b/keyboards/converter/usb_usb/keymaps/narze/keymap.c new file mode 100644 index 000000000..b5938fa35 --- /dev/null +++ b/keyboards/converter/usb_usb/keymaps/narze/keymap.c @@ -0,0 +1,167 @@ +#include QMK_KEYBOARD_H +#include "narze.h" +#include "keymap_colemak.h" + +enum usb_usb_layers { + _QWERTY, + _COLEMAK, + _QWOC, + _SUPERDUPER, +}; + +enum usb_usb_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + QWOC, + SUPERDUPER, + SDTOGG, // Toggle SuperDuper + GUI_UNDS, + LSFT_LPRN, + RSFT_RPRN, +}; + +#define HPR_ESC ALL_T(KC_ESC) +#define SFT_ENT SFT_T(KC_ENT) +#define BRWS_L S(LGUI(KC_LBRC)) +#define BRWS_R S(LGUI(KC_RBRC)) + +enum process_combo_event { + CB_SUPERDUPER, +}; + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + /* 0: plain Qwerty without layer switching + * ,---------------. ,---------------. ,---------------. + * |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24| + * ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help | + * `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------' + * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| |Stp|Agn| + * |-----------------------------------------------------------| |-----------| |---------------| |-------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| |Mnu|Und| + * |-----------------------------------------------------------| `-----------' |---------------| |-------| + * |CapsL | A| S| D| F| G| H| J| K| L| ;| :| #|Retn| | 4| 5| 6|KP,| |Sel|Cpy| + * |-----------------------------------------------------------| ,---. |---------------| |-------| + * |Shft| <| Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|KP=| |Exe|Pst| + * |-----------------------------------------------------------| ,-----------. |---------------| |-------| + * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| + * `-----------------------------------------------------------' `-----------' `---------------' `-------' + */ + [_QWERTY] = LAYOUT_all( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + 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, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + KC_GRV, 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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, + 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_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO, + HPR_ESC, 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_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, + LSFT_LPRN,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, RSFT_RPRN, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE, + KC_LCTL, KC_LALT, GUI_UNDS,KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_BSPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT + ), + [_COLEMAK] = LAYOUT_all( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + 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, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + KC_GRV, 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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, + 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_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO, + HPR_ESC, 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_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, + LSFT_LPRN,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, RSFT_RPRN, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE, + KC_LCTL, KC_LALT, GUI_UNDS,KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_BSPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT + ), + [_QWOC] = LAYOUT_all( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + 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, KC_PSCR, KC_SLCK, KC_PAUS, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + KC_GRV, 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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, + 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_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_MENU, KC_UNDO, + HPR_ESC, 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_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, + LSFT_LPRN,KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, RSFT_RPRN, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE, + KC_LCTL, KC_LALT, GUI_UNDS,KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_BSPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT + ), + [_SUPERDUPER] = LAYOUT_all( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + RESET, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, + ______, ______, ______, ______, ______, ______, ______, ______, BRWS_L, BRWS_R, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, + KC_SPC, KC_LALT, _______, _______, KC_BSPC,KC_LGUI,KC_LEFT, KC_DOWN, KC_UP,KC_RGHT, KC_DEL, ______, ______, ______, ______,______,______,______, ______,______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______,______, ______,______, + ______, ______, ______, ______, ______, KC_LSFT, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______, ______,______, ______,______ + ), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + + set_superduper_key_combo_layer(_QWERTY); + } + return false; + + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + + set_superduper_key_combo_layer(_COLEMAK); + } + return false; + + case QWOC: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWOC); + + set_superduper_key_combo_layer(_QWOC); + } + return false; + + case SDTOGG: + if (record->event.pressed) { + toggle_superduper_mode(); + } + return false; + + // Macros + + // 1. Hold for LGUI, tap for Underscore + case GUI_UNDS: + perform_space_cadet(record, KC_LGUI, KC_LSFT, KC_MINS); + return false; + + // 2. Hold for LSHIFT, tap for Parens open + case LSFT_LPRN: + perform_space_cadet(record, KC_LSFT, KC_LSFT, KC_9); + return false; + + // 3. Hold for RSHIFT, tap for Parens close + case RSFT_RPRN: + perform_space_cadet(record, KC_RSFT, KC_RSFT, KC_0); + return false; + + default: + return true; + } + return true; +} + +void matrix_setup(void) { + set_superduper_key_combos(); +} + +void process_combo_event(uint8_t combo_index, bool pressed) { + if (pressed) { + switch(combo_index) { + case CB_SUPERDUPER: + layer_on(_SUPERDUPER); + break; + } + } else { + layer_off(_SUPERDUPER); + unregister_mods(MOD_BIT(KC_LGUI) | MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); // Sometimes mods are held, unregister them + } +} diff --git a/keyboards/converter/usb_usb/keymaps/narze/rules.mk b/keyboards/converter/usb_usb/keymaps/narze/rules.mk new file mode 100644 index 000000000..657773e84 --- /dev/null +++ b/keyboards/converter/usb_usb/keymaps/narze/rules.mk @@ -0,0 +1,3 @@ +EXTRAKEY_ENABLE = no +NKRO_ENABLE = yes +COMBO_ENABLE = yes diff --git a/keyboards/converter/usb_usb/pro_micro/rules.mk b/keyboards/converter/usb_usb/pro_micro/rules.mk index 7c04fa34f..3437a35bd 100644 --- a/keyboards/converter/usb_usb/pro_micro/rules.mk +++ b/keyboards/converter/usb_usb/pro_micro/rules.mk @@ -1 +1,2 @@ +# Processor frequency F_CPU = 8000000 diff --git a/keyboards/converter/usb_usb/rules.mk b/keyboards/converter/usb_usb/rules.mk index dfe89ee7d..b4f37d3ad 100644 --- a/keyboards/converter/usb_usb/rules.mk +++ b/keyboards/converter/usb_usb/rules.mk @@ -1,55 +1,16 @@ # 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. - -# Since there are different hardware variations of these adapters and since these -# have different CPU clocks, the clock speed should be set in the rules.mk file of the -# respective hardware variantion (i.e. subproject). For example, in /pro_micro/rules.mk -# this is set to 8000000. -# The value here is only a fallback and is ignored if it is defined in the subproject. -F_CPU ?= 16000000 - -DEFAULT_FOLDER = converter/usb_usb/hasu - -# -# 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) - -# Bootloader -# This definition is optional, and if your keyboard supports multiple bootloaders of -# different sizes, comment this out, and the correct address will be loaded -# automatically (+60). See bootloader.mk for all options. +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp BOOTLOADER = caterina -# Interrupt driven control endpoint task -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - # Build Options # comment out to disable the options. # @@ -65,3 +26,5 @@ USB_HID_ENABLE = yes CUSTOM_MATRIX = yes SRC = custom_matrix.cpp + +DEFAULT_FOLDER = converter/usb_usb/hasu |