From 50a12c06b9c3dd4bda1fbe6dac1f692fade2d4d1 Mon Sep 17 00:00:00 2001 From: Charly Delay <0xcharly@users.noreply.github.com> Date: Mon, 25 Jul 2022 18:11:28 +0900 Subject: [keyboard] bastardkb: restructure folder hierarchy (#16778) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bastardkb: restructure folder hierarchy ahead of supporting other adapters/mcus Upcoming support for the following (adapter, mcu) pairs will be submitted in follow-up PRs: - `v2/elitec` - `v2/stemcell` - `blackpill` This PR contains the following changes: - Move previous implementation to an inner `v1/elitec` folder - Move keyboard USB IDs and strings to data driven - Update headers to update maintainers list - Run `qmk format-c` * bastardkb/charybdis: remove broken acceleration implementation * bastardkb/charybdis: fix debug output * bastardkb: add support for BastardKb the `v2/elitec` (adapter, mcu) pair * bastardkb: add Blackpill support * bastardkb/charybdis/3x5: add `bstiq` keymap * bastardkb/charybdis: add fake LEDs to the configuration For the Charybdis 3x5 (respectively 4x6), the LED config now simulates 36 (respectively 58) LEDs instead of the actual 35 (respectively 56) to prevent confusion when testing LEDs during assembly when handedness is not set correctly. Those fake LEDs are bound to the physical bottom-left corner. * bastardkbk/charybdis/readme.md: update build commands Merge pull request #5 from Nathancooke7/update_charybdis_readme_v2_shield. * bastardkb/charybdis: fix Via keymap with blackpill * bastardkb/charybdis: add 3x6 configuration * bastardkb/charybdis: remove unnecessary files * bastardkb/charybdis: remove obsolete code * bastardkb/charybdis/3x6: add Via keymap * bastardkb: add support for Splinky (RP2040) board * bastardkb: initial configuration for the Splinky (SPI not working yet) * bastardkb/charybdis/3x5/v2/splinky: tentative change to enable trackball * bastardkb/charybdis/3x5/v2/splinky: fix SCK, MISO, MOSI pins * bastardkb/charybdis/3x5/v2/splinky: fix SCK, MISO, MOSI pins * bastardkb/charybdis/4x6/v2/splinky: add SPI configuration and enable trackball * bastardkb/charybdis/3x6: add splinky config * bastardkb/*/v2/splinky: update drivers to `vendor` * bastardkb/dilemma: add new board * bastardkb/charybdis: fix infinite loop in `layer_state_set_user(…)` in the `via` keymaps * bastardkb/dilemma: add `bstiq` keymap * bastardkb: specify blackpill boards * bastardkb/charybdis: fix blackpill-specific define syntax * bastardkb: remove `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION` which are no longer valid options * bastardkb: fix `QK_BOOT` keycodes * bastardkb/dilemma: fix mouse direction on X axis * bastardkb/charybdis/3x6: adjust CS * bastardkb/dilemma: adjust trackpad configuration * charybdis: fix `PWM33XX_CS_PIN` defines This is a follow-up of https://github.com/qmk/qmk_firmware/pull/17613. * bastardkb: remove Vial mentions from `bstiq` keymaps * Cleanup unnecessary comments Co-authored-by: Nathan Co-authored-by: Charly Delay <0xcharly@codesink.dev> --- .../bastardkb/charybdis/3x5/keymaps/via/config.h | 13 +++---- .../bastardkb/charybdis/3x5/keymaps/via/keymap.c | 42 ++++++++++++---------- 2 files changed, 28 insertions(+), 27 deletions(-) (limited to 'keyboards/bastardkb/charybdis/3x5/keymaps/via') diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h b/keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h index f515d85334..d20131e9cf 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/via/config.h @@ -19,7 +19,7 @@ #ifdef VIA_ENABLE /* VIA configuration. */ # define DYNAMIC_KEYMAP_LAYER_COUNT 7 -#endif // VIA_ENABLE +#endif // VIA_ENABLE /* Disable unused features. */ #define NO_ACTION_ONESHOT @@ -33,7 +33,7 @@ * See docs.qmk.fm/using-qmk/software-features/tap_hold#tapping-term */ # define TAPPING_TERM 200 -#endif // TAPPING_TERM +#endif // TAPPING_TERM /** * \brief Enable rapid switch from tap to hold. @@ -84,16 +84,11 @@ /* Charybdis-specific features. */ #ifdef POINTING_DEVICE_ENABLE -// Enable pointer acceleration, which increases the speed by ~2x for large -// displacement, while maintaining 1x speed for slow movements. See also: -// - `CHARYBDIS_POINTER_ACCELERATION_FACTOR` -# define CHARYBDIS_POINTER_ACCELERATION_ENABLE - // Automatically enable the pointer layer when moving the trackball. See also: // - `CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS` // - `CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD` // #define CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE -#endif // POINTING_DEVICE_ENABLE +#endif // POINTING_DEVICE_ENABLE /* RGB Matrix. */ @@ -115,4 +110,4 @@ # define RGB_MATRIX_STARTUP_SAT 255 # define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS # define RGB_MATRIX_STARTUP_HSV RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT, RGB_MATRIX_STARTUP_VAL -#endif // RGB_MATRIX_ENABLE +#endif // RGB_MATRIX_ENABLE diff --git a/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c b/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c index dc02ed34c6..b54c58cf0c 100644 --- a/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c +++ b/keyboards/bastardkb/charybdis/3x5/keymaps/via/keymap.c @@ -18,7 +18,7 @@ #ifdef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE # include "timer.h" -#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE +#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE enum charybdis_keymap_layers { LAYER_BASE = 0, @@ -38,12 +38,12 @@ static uint16_t auto_pointer_layer_timer = 0; # ifndef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS # define CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS 1000 -# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS +# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS # ifndef CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD # define CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD 8 -# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD -#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE +# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD +#endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE #define ESC_MED LT(LAYER_MEDIA, KC_ESC) #define SPC_NAV LT(LAYER_NAVIGATION, KC_SPC) @@ -52,6 +52,13 @@ static uint16_t auto_pointer_layer_timer = 0; #define BSP_NUM LT(LAYER_NUMERAL, KC_BSPC) #define _L_PTR(KC) LT(LAYER_POINTER, KC) +#ifndef POINTING_DEVICE_ENABLE +# define DRGSCRL KC_NO +# define DPI_MOD KC_NO +# define S_D_MOD KC_NO +# define SNIPING KC_NO +#endif // !POINTING_DEVICE_ENABLE + // clang-format off /** \brief QWERTY layout (3 rows, 10 columns). */ #define LAYOUT_LAYER_BASE \ @@ -98,14 +105,14 @@ static uint16_t auto_pointer_layer_timer = 0; #define LAYOUT_LAYER_MEDIA \ XXXXXXX,RGB_RMOD, RGB_TOG, RGB_MOD, XXXXXXX, XXXXXXX,RGB_RMOD, RGB_TOG, RGB_MOD, XXXXXXX, \ KC_MPRV, KC_VOLD, KC_MUTE, KC_VOLU, KC_MNXT, KC_MPRV, KC_VOLD, KC_MUTE, KC_VOLU, KC_MNXT, \ - XXXXXXX, XXXXXXX, XXXXXXX, EEP_RST, QK_BOOT, QK_BOOT, EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, EEP_RST, QK_BOOT, QK_BOOT, EEP_RST, XXXXXXX, XXXXXXX, XXXXXXX, \ _______, KC_MPLY, KC_MSTP, KC_MSTP, KC_MPLY /** \brief Mouse emulation and pointer functions. */ #define LAYOUT_LAYER_POINTER \ XXXXXXX, XXXXXXX, XXXXXXX, DPI_MOD, S_D_MOD, S_D_MOD, DPI_MOD, XXXXXXX, XXXXXXX, XXXXXXX, \ ______________HOME_ROW_GACS_L______________, ______________HOME_ROW_GACS_R______________, \ - _______, DRGSCRL, SNIPING, EEP_RST, QK_BOOT, QK_BOOT, EEP_RST, SNIPING, DRGSCRL, _______, \ + _______, DRGSCRL, SNIPING, EEP_RST, QK_BOOT, QK_BOOT, EEP_RST, SNIPING, DRGSCRL, _______, \ KC_BTN2, KC_BTN1, KC_BTN3, KC_BTN3, KC_BTN1 /** @@ -217,36 +224,35 @@ report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) { # ifdef RGB_MATRIX_ENABLE rgb_matrix_mode_noeeprom(RGB_MATRIX_NONE); rgb_matrix_sethsv_noeeprom(HSV_GREEN); -# endif // RGB_MATRIX_ENABLE +# endif // RGB_MATRIX_ENABLE } auto_pointer_layer_timer = timer_read(); } return mouse_report; } -void matrix_scan_kb(void) { +void matrix_scan_user(void) { if (auto_pointer_layer_timer != 0 && TIMER_DIFF_16(timer_read(), auto_pointer_layer_timer) >= CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS) { auto_pointer_layer_timer = 0; layer_off(LAYER_POINTER); # ifdef RGB_MATRIX_ENABLE rgb_matrix_mode_noeeprom(RGB_MATRIX_STARTUP_MODE); -# endif // RGB_MATRIX_ENABLE +# endif // RGB_MATRIX_ENABLE } - matrix_scan_user(); } -# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE +# endif // CHARYBDIS_AUTO_POINTER_LAYER_TRIGGER_ENABLE # ifdef CHARYBDIS_AUTO_SNIPING_ON_LAYER -layer_state_t layer_state_set_kb(layer_state_t state) { - state = layer_state_set_user(state); +layer_state_t layer_state_set_user(layer_state_t state) { charybdis_set_pointer_sniping_enabled(layer_state_cmp(state, CHARYBDIS_AUTO_SNIPING_ON_LAYER)); return state; } -# endif // CHARYBDIS_AUTO_SNIPING_ON_LAYER -#endif // POINTING_DEVICE_ENABLE +# endif // CHARYBDIS_AUTO_SNIPING_ON_LAYER +#endif // POINTING_DEVICE_ENABLE #ifdef RGB_MATRIX_ENABLE -// Forward-declare this helper function since it is defined in rgb_matrix.c. +// Forward-declare this helper function since it is defined in +// rgb_matrix.c. void rgb_matrix_update_pwm_buffers(void); #endif @@ -255,9 +261,9 @@ void shutdown_user(void) { rgblight_enable_noeeprom(); rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); rgblight_setrgb_red(); -#endif // RGBLIGHT_ENABLE +#endif // RGBLIGHT_ENABLE #ifdef RGB_MATRIX_ENABLE rgb_matrix_set_color_all(RGB_RED); rgb_matrix_update_pwm_buffers(); -#endif // RGB_MATRIX_ENABLE +#endif // RGB_MATRIX_ENABLE } -- cgit v1.2.3