From ad94c36e47c3c15faba8ec9ec45e46dc44305609 Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Sat, 23 Mar 2024 15:49:33 -0400 Subject: [PATCH 1/2] Added the ability to specify a serial number suffix. Just pass it in as an environment variable, SERIAL_SUFFIX like is done with CDEFS and THUMB..DARK... --- builddefs/build_vial.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builddefs/build_vial.mk b/builddefs/build_vial.mk index ce31d2956254..594cd00ceb8e 100644 --- a/builddefs/build_vial.mk +++ b/builddefs/build_vial.mk @@ -3,13 +3,14 @@ QMK_SETTINGS ?= yes TAP_DANCE_ENABLE ?= yes +SERIAL_SUFFIX ?= "" ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) OPT_DEFS += -DTAPPING_TERM_PER_KEY endif COMBO_ENABLE ?= yes KEY_OVERRIDE_ENABLE ?= yes SRC += $(QUANTUM_DIR)/vial.c -OPT_DEFS += -DVIAL_ENABLE -DNO_DEBUG -DSERIAL_NUMBER=\"vial:f64c2b3c\" +OPT_DEFS += -DVIAL_ENABLE -DNO_DEBUG -DSERIAL_NUMBER=\"vial:f64c2b3c$(SERIAL_SUFFIX)\" ifeq ($(strip $(VIAL_INSECURE)), yes) OPT_DEFS += -DVIAL_INSECURE From 28415ad20da66c45a1ed59460c6712fbc31225d9 Mon Sep 17 00:00:00 2001 From: Ira Cooper Date: Sat, 23 Mar 2024 17:30:35 -0400 Subject: [PATCH 2/2] First ballpoint board working. Called ballpoint because there is a trackball, then a trackpoint. --- .../svalboard/{tbrtpl => ballpoint}/.noci | 0 .../svalboard/{tbrtpl => ballpoint}/config.h | 3 +- .../{tbrtpl => ballpoint}/left/config.h | 2 +- .../{tbrtpl => ballpoint/left}/halconf.h | 0 keyboards/svalboard/ballpoint/left/info.json | 116 ++++++++++++++++++ .../{tbrtpl => ballpoint/left}/mcuconf.h | 3 +- .../{tbrtpl => ballpoint}/left/rules.mk | 2 +- .../{tbrtpl => ballpoint}/right/config.h | 2 + .../{tbrtpl => ballpoint/right}/info.json | 0 .../{tbrtpl => ballpoint}/right/rules.mk | 7 +- .../svalboard/{tbrtpl => ballpoint}/rules.mk | 0 keyboards/svalboard/keymaps/vial/keymap.c | 34 ++++- keyboards/svalboard/trackball/config.h | 8 +- keyboards/svalboard/trackball/left/config.h | 2 +- keyboards/svalboard/trackball/right/config.h | 2 +- 15 files changed, 164 insertions(+), 17 deletions(-) rename keyboards/svalboard/{tbrtpl => ballpoint}/.noci (100%) rename keyboards/svalboard/{tbrtpl => ballpoint}/config.h (97%) rename keyboards/svalboard/{tbrtpl => ballpoint}/left/config.h (77%) rename keyboards/svalboard/{tbrtpl => ballpoint/left}/halconf.h (100%) create mode 100644 keyboards/svalboard/ballpoint/left/info.json rename keyboards/svalboard/{tbrtpl => ballpoint/left}/mcuconf.h (98%) rename keyboards/svalboard/{tbrtpl => ballpoint}/left/rules.mk (95%) rename keyboards/svalboard/{tbrtpl => ballpoint}/right/config.h (62%) rename keyboards/svalboard/{tbrtpl => ballpoint/right}/info.json (100%) rename keyboards/svalboard/{tbrtpl => ballpoint}/right/rules.mk (65%) rename keyboards/svalboard/{tbrtpl => ballpoint}/rules.mk (100%) diff --git a/keyboards/svalboard/tbrtpl/.noci b/keyboards/svalboard/ballpoint/.noci similarity index 100% rename from keyboards/svalboard/tbrtpl/.noci rename to keyboards/svalboard/ballpoint/.noci diff --git a/keyboards/svalboard/tbrtpl/config.h b/keyboards/svalboard/ballpoint/config.h similarity index 97% rename from keyboards/svalboard/tbrtpl/config.h rename to keyboards/svalboard/ballpoint/config.h index 1a51bac1f629..076ae8501da1 100644 --- a/keyboards/svalboard/tbrtpl/config.h +++ b/keyboards/svalboard/ballpoint/config.h @@ -25,6 +25,7 @@ along with this program. If not, see . // Pointing device stuff #define SPLIT_POINTING_ENABLE #define POINTING_DEVICE_LEFT + #define POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE #if defined(POINTING_DEVICE_IS_PIMORONI) @@ -67,7 +68,7 @@ along with this program. If not, see . #define PMW33XX_CS_PIN GP17 #endif #define PMW33XX_CS_DIVISOR 4 - #define PMW33XX_CPI 400 + #define PMW33XX_CPI 2000 #define POINTING_DEVICE_LEFT #define POINTING_DEVICE_INVERT_Y #define ROTATIONAL_TRANSFORM_ANGLE 90 diff --git a/keyboards/svalboard/tbrtpl/left/config.h b/keyboards/svalboard/ballpoint/left/config.h similarity index 77% rename from keyboards/svalboard/tbrtpl/left/config.h rename to keyboards/svalboard/ballpoint/left/config.h index e9cd266fe398..8a81b4f30c8f 100644 --- a/keyboards/svalboard/tbrtpl/left/config.h +++ b/keyboards/svalboard/ballpoint/left/config.h @@ -1,4 +1,4 @@ #define SERIAL_USART_TX_PIN GP0 #define SERIAL_USART_RX_PIN GP1 #define SERIAL_USART_FULL_DUPLEX -#define SERIAL_PIO_USE_PIO0 +#define SERIAL_PIO_USE_PIO0 \ No newline at end of file diff --git a/keyboards/svalboard/tbrtpl/halconf.h b/keyboards/svalboard/ballpoint/left/halconf.h similarity index 100% rename from keyboards/svalboard/tbrtpl/halconf.h rename to keyboards/svalboard/ballpoint/left/halconf.h diff --git a/keyboards/svalboard/ballpoint/left/info.json b/keyboards/svalboard/ballpoint/left/info.json new file mode 100644 index 000000000000..63f16dc65c5c --- /dev/null +++ b/keyboards/svalboard/ballpoint/left/info.json @@ -0,0 +1,116 @@ +{ + "manufacturer": "Svalboard", + "keyboard_name": "svalboard", + "maintainer": "MorganVenable", + "url": "http://svalboard.com", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "audio": false, + "backlight": false, + "bluetooth": false, + "bootmagic": false, + "command": true, + "console": true, + "extrakey": true, + "fauxclicky": false, + "midi": false, + "mousekey": true, + "nkro": true, + "rgblight": false, + "sleep_led": false, + "unicode": false + }, + "height": 10, + "matrix_pins": { + "cols": ["GP14", "GP13", "GP12", "GP11", "GP10", "GP9"], + "rows": ["GP8", "GP7", "GP6", "GP5", "GP4"] + }, + "mousekey": { + "delay": 150, + "interval": 60, + "max_speed": 5, + "time_to_max": 7 + }, + "processor": "RP2040", + "split": { + "enabled": true, + "transport": { + "protocol": "serial", + "sync_matrix_state": false, + "sync_modifiers": false + } + }, + "tapping": { + "term": 200 + }, + "ps2": { + "enabled": false, + "driver": "vendor" + }, + "usb": { + "device_version": "0.0.2", + "pid": "0x4044", + "polling_interval": 1, + "vid": "0x303A" + }, + "width": 20.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label": "r1c", "matrix": [1, 2], "x": 0.5, "y": 1.5}, + {"label": "r1n", "matrix": [1, 3], "x": 0.5, "y": 1, "h": 0.5}, + {"label": "r1e", "matrix": [1, 1], "x": 1.5, "y": 1.5, "w": 0.5}, + {"label": "r1s", "matrix": [1, 0], "x": 0.5, "y": 2.5, "h": 0.5}, + {"label": "r1w", "matrix": [1, 4], "x": 0, "y": 1.5, "w": 0.5}, + {"label": "r2c", "matrix": [2, 2], "x": 2.5, "y": 1}, + {"label": "r2n", "matrix": [2, 3], "x": 2.5, "y": 0.5, "h": 0.5}, + {"label": "r2e", "matrix": [2, 1], "x": 3.5, "y": 1, "w": 0.5}, + {"label": "r2s", "matrix": [2, 0], "x": 2.5, "y": 2, "h": 0.5}, + {"label": "r2w", "matrix": [2, 4], "x": 2, "y": 1, "w": 0.5}, + {"label": "r3c", "matrix": [3, 2], "x": 4.5, "y": 0.5}, + {"label": "r3n", "matrix": [3, 3], "x": 4.5, "y": 0, "h": 0.5}, + {"label": "r3e", "matrix": [3, 1], "x": 5.5, "y": 0.5, "w": 0.5}, + {"label": "r3s", "matrix": [3, 0], "x": 4.5, "y": 1.5, "h": 0.5}, + {"label": "r3w", "matrix": [3, 4], "x": 4, "y": 0.5, "w": 0.5}, + {"label": "r4c", "matrix": [4, 2], "x": 6.5, "y": 1}, + {"label": "r4n", "matrix": [4, 3], "x": 6.5, "y": 0.5, "h": 0.5}, + {"label": "r4e", "matrix": [4, 1], "x": 7.5, "y": 1, "w": 0.5}, + {"label": "r4s", "matrix": [4, 0], "x": 6.5, "y": 2, "h": 0.5}, + {"label": "r4w", "matrix": [4, 4], "x": 6, "y": 1, "w": 0.5}, + {"label": "l1c", "matrix": [6, 2], "x": 8.5, "y": 4, "h": 2}, + {"label": "l1n", "matrix": [6, 3], "x": 8, "y": 3.5, "w": 0.5, "h": 1.5}, + {"label": "l1e", "matrix": [6, 1], "x": 7.5, "y": 3.5, "w": 0.5}, + {"label": "l1w", "matrix": [6, 0], "x": 9.5, "y": 3.5, "w": 0.5, "h": 1.5}, + {"label": "l1s", "matrix": [6, 4], "x": 9.5, "y": 5, "w": 0.5, "h": 1.5}, + {"label": "l2c", "matrix": [7, 2], "x": 8.5, "y": 5, "w": 0.5, "h": 1.5}, + {"label": "l2n", "matrix": [7, 3], "x": 11, "y": 4, "h": 2}, + {"label": "l2e", "matrix": [7, 1], "x": 12, "y": 3.5, "w": 0.5, "h": 1.5}, + {"label": "l2w", "matrix": [7, 0], "x": 12.5, "y": 3.5, "w": 0.5}, + {"label": "l2s", "matrix": [7, 4], "x": 10.5, "y": 3.5, "w": 0.5, "h": 1.5}, + {"label": "l3c", "matrix": [8, 2], "x": 10.5, "y": 5, "w": 0.5, "h": 1.5}, + {"label": "l3n", "matrix": [8, 3], "x": 11, "y": 5, "w": 0.5, "h": 1.5}, + {"label": "l3e", "matrix": [8, 1], "x": 13, "y": 1}, + {"label": "l3w", "matrix": [8, 0], "x": 13, "y": 0.5, "h": 0.5}, + {"label": "l3s", "matrix": [8, 4], "x": 12.5, "y": 1, "w": 0.5}, + {"label": "l4c", "matrix": [9, 2], "x": 13, "y": 2, "h": 0.5}, + {"label": "l4n", "matrix": [9, 3], "x": 14, "y": 1, "w": 0.5}, + {"label": "l4e", "matrix": [9, 1], "x": 15, "y": 0.5}, + {"label": "l4s", "matrix": [9, 0], "x": 15, "y": 0, "h": 0.5}, + {"label": "l4w", "matrix": [9, 4], "x": 16, "y": 0.5, "w": 0.5}, + {"label": "rtd", "matrix": [0, 2], "x": 15, "y": 1.5, "h": 0.5}, + {"label": "rti", "matrix": [0, 3], "x": 14.5, "y": 0.5, "w": 0.5}, + {"label": "rtu", "matrix": [0, 4], "x": 17, "y": 1}, + {"label": "rtuo", "matrix": [0, 1], "x": 17, "y": 0.5, "h": 0.5}, + {"label": "rtlo", "matrix": [0, 0], "x": 18, "y": 1, "w": 0.5}, + {"label": "rtdd", "matrix": [0, 5], "x": 17, "y": 2, "h": 0.5}, + {"label": "ltd", "matrix": [5, 2], "x": 16.5, "y": 1, "w": 0.5}, + {"label": "lti", "matrix": [5, 3], "x": 19, "y": 1.5}, + {"label": "ltu", "matrix": [5, 4], "x": 19, "y": 1, "h": 0.5}, + {"label": "ltuo", "matrix": [5, 1], "x": 20, "y": 1.5, "w": 0.5}, + {"label": "ltlo", "matrix": [5, 0], "x": 19, "y": 2.5, "h": 0.5}, + {"label": "ltdd", "matrix": [5, 5], "x": 18.5, "y": 1.5, "w": 0.5} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/svalboard/tbrtpl/mcuconf.h b/keyboards/svalboard/ballpoint/left/mcuconf.h similarity index 98% rename from keyboards/svalboard/tbrtpl/mcuconf.h rename to keyboards/svalboard/ballpoint/left/mcuconf.h index c61ba2fcdb6d..231550b36729 100644 --- a/keyboards/svalboard/tbrtpl/mcuconf.h +++ b/keyboards/svalboard/ballpoint/left/mcuconf.h @@ -1,5 +1,4 @@ #pragma once - #include_next "mcuconf.h" #if defined(POINTING_DEVICE_IS_PIMORONI) @@ -17,4 +16,4 @@ #undef RP_SPI_USE_SPI0 #define RP_SPI_USE_SPI0 TRUE #endif -#endif +#endif \ No newline at end of file diff --git a/keyboards/svalboard/tbrtpl/left/rules.mk b/keyboards/svalboard/ballpoint/left/rules.mk similarity index 95% rename from keyboards/svalboard/tbrtpl/left/rules.mk rename to keyboards/svalboard/ballpoint/left/rules.mk index 6ed622b3802e..fcf25389f73c 100644 --- a/keyboards/svalboard/tbrtpl/left/rules.mk +++ b/keyboards/svalboard/ballpoint/left/rules.mk @@ -4,4 +4,4 @@ POINTING_DEVICE_ENABLE = yes # this selects trackball driver POINTING_DEVICE_DRIVER = pmw3360 # pimoroni_trackball -# pmw3389 \ No newline at end of file +# pmw3389 diff --git a/keyboards/svalboard/tbrtpl/right/config.h b/keyboards/svalboard/ballpoint/right/config.h similarity index 62% rename from keyboards/svalboard/tbrtpl/right/config.h rename to keyboards/svalboard/ballpoint/right/config.h index d714bcc0c0c5..1cfd34e9459e 100644 --- a/keyboards/svalboard/tbrtpl/right/config.h +++ b/keyboards/svalboard/ballpoint/right/config.h @@ -2,3 +2,5 @@ #define SERIAL_USART_RX_PIN GP0 #define SERIAL_USART_FULL_DUPLEX #define SERIAL_PIO_USE_PIO0 +#define SPLIT_POINTING_ENABLE +#define POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE \ No newline at end of file diff --git a/keyboards/svalboard/tbrtpl/info.json b/keyboards/svalboard/ballpoint/right/info.json similarity index 100% rename from keyboards/svalboard/tbrtpl/info.json rename to keyboards/svalboard/ballpoint/right/info.json diff --git a/keyboards/svalboard/tbrtpl/right/rules.mk b/keyboards/svalboard/ballpoint/right/rules.mk similarity index 65% rename from keyboards/svalboard/tbrtpl/right/rules.mk rename to keyboards/svalboard/ballpoint/right/rules.mk index 3ba2a4983313..7ab04b882f90 100644 --- a/keyboards/svalboard/tbrtpl/right/rules.mk +++ b/keyboards/svalboard/ballpoint/right/rules.mk @@ -1,10 +1,11 @@ OPT_DEFS += -DINIT_EE_HANDS_RIGHT # # this turns on trackpoint: -# PS2_MOUSE_ENABLE = yes +PS2_MOUSE_ENABLE = yes # # this turns on Manna-Harbour's automousekeys: -# MH_AUTO_BUTTONS = yes +MH_AUTO_BUTTONS = yes # # this selects trackball driver POINTING_DEVICE_ENABLE = yes +POINTING_DEVICE_DRIVER = custom # this selects trackball driver -POINTING_DEVICE_DRIVER = pmw3360 \ No newline at end of file +#POINTING_DEVICE_DRIVER = pmw3360 \ No newline at end of file diff --git a/keyboards/svalboard/tbrtpl/rules.mk b/keyboards/svalboard/ballpoint/rules.mk similarity index 100% rename from keyboards/svalboard/tbrtpl/rules.mk rename to keyboards/svalboard/ballpoint/rules.mk diff --git a/keyboards/svalboard/keymaps/vial/keymap.c b/keyboards/svalboard/keymaps/vial/keymap.c index 58245ac9af6d..e6ee09a62cfe 100644 --- a/keyboards/svalboard/keymaps/vial/keymap.c +++ b/keyboards/svalboard/keymaps/vial/keymap.c @@ -164,13 +164,33 @@ const uint16_t PROGMEM keymaps[NUM_LAYERS][MATRIX_ROWS][MATRIX_COLS] = { }; -#if defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE -void mouse_mode(bool); +#if (defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE) || defined(POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE) static uint16_t mh_auto_buttons_timer; extern int tp_buttons; // mousekey button state set in action.c and used in ps2_mouse.c +void mouse_mode(bool); + +#endif + +#if defined(POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE) +report_mouse_t pointing_device_task_user(report_mouse_t reportMouse) { + print("mh_auto_buttons: called\n"); + if (reportMouse.x == 0 && reportMouse.y == 0) + return reportMouse; + + if (mh_auto_buttons_timer) { + mh_auto_buttons_timer = timer_read(); + } else { + mouse_mode(true); +#if defined CONSOLE_ENABLE + print("mh_auto_buttons: on\n"); #endif + } + return reportMouse; +} +#endif + bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -179,14 +199,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %u, time: %5u, int: %u, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count); #endif -#if defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE +#if (defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE) || defined(POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE) if (mh_auto_buttons_timer) { switch (keycode) { case KC_BTN1: case KC_BTN2: case KC_BTN3: + case KC_BTN4: + case KC_BTN5: case KC_WH_U: case KC_WH_D: + case KC_WH_R: + case KC_WH_L: break; default: mouse_mode(false); @@ -234,7 +258,11 @@ void ps2_mouse_moved_user(report_mouse_t *mouse_report) { } } } +#endif + + +#if (defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && defined MOUSEKEY_ENABLE) || defined(POINTING_DEVICE_AUTO_MOUSE_MH_ENABLE) void matrix_scan_user(void) { if (mh_auto_buttons_timer && (timer_elapsed(mh_auto_buttons_timer) > MH_AUTO_BUTTONS_TIMEOUT)) { if (!tp_buttons) { diff --git a/keyboards/svalboard/trackball/config.h b/keyboards/svalboard/trackball/config.h index 7918f379e2a5..d53eb5504959 100644 --- a/keyboards/svalboard/trackball/config.h +++ b/keyboards/svalboard/trackball/config.h @@ -19,7 +19,6 @@ along with this program. If not, see . #undef PS2_MOUSE_ENABLE // in config.h: -#define POINTING_DEVICE_AUTO_MOUSE_ENABLE #ifdef PS2_MOUSE_ENABLE //#define SERIAL_PIO_USE_PIO1 @@ -35,6 +34,7 @@ along with this program. If not, see . // Pointing device stuff #define SPLIT_POINTING_ENABLE #define POINTING_DEVICE_COMBINED + #define POINTING_DEVICE_AUTO_MOUSE_ENABLE #if defined(POINTING_DEVICE_IS_PIMORONI) @@ -77,7 +77,7 @@ along with this program. If not, see . #define PMW33XX_CS_PIN GP17 #endif #define PMW33XX_CS_DIVISOR 4 - #define PMW33XX_CPI 400 + #define PMW33XX_CPI 2000 #define POINTING_DEVICE_COMBINED #define POINTING_DEVICE_INVERT_Y_RIGHT //#define POINTING_DEVICE_INVERT_X_RIGHT @@ -88,7 +88,7 @@ along with this program. If not, see . #if defined MH_AUTO_BUTTONS #define MH_AUTO_BUTTONS_LAYER MBO #define MH_AUTO_BUTTONS_TIMEOUT 5000 - #define PS2_MOUSE_SCROLL_BTN_MASK 0 - //(1<