1
0
Fork 0

[TractylM] Add changes from PR

This commit is contained in:
Drashna Jael're 2024-12-31 12:25:31 -08:00
parent 6bf3f6b868
commit b09ff15d8e
Signed by: drashna
GPG key ID: DBA1FD3A860D1B11
12 changed files with 40 additions and 168 deletions

View file

@ -21,6 +21,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define ROTATIONAL_TRANSFORM_ANGLE -25
#define POINTING_DEVICE_INVERT_X
#define LAYER_STATE_16BIT
#define POINTING_DEVICE_RIGHT

View file

@ -71,7 +71,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define POINTING_DEVICE_CS_PIN B8
#define POINTING_DEVICE_ROTATION_270
#undef ROTATIONAL_TRANSFORM_ANGLE
#define PMW33XX_SPI_DIVISOR 8
#define PMW33XX_SPI_DIVISOR 16
// lcd
#define DISPLAY_RST_PIN NO_PIN
@ -82,5 +82,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DRV2605L_FB_ERM_LRA 0
#define DRV2605L_GREETING DRV2605L_EFFECT_750_MS_ALERT_100
#define DRV2605L_DEFAULT_MODE DRV2605L_EFFECT_BUZZ_1_100
#define VIA_FIRMWARE_VERSION 0x00000001

View file

@ -40,7 +40,9 @@ bool check_user_button_state(void) {
}
void board_init(void) {
// unset improper SPI pins
// Board setup sets these pins as SPI, but we aren't using them as such.
// So to prevent them from misbehaving, we need to set them to a different, non-spi mode.
// This is a bit of a hack, but nothing else runs soon enough, without re-implementing spi_init().
gpio_set_pin_input(A5);
gpio_set_pin_input(A6);
gpio_set_pin_input(A7);

View file

@ -17,9 +17,17 @@
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "A15", "pin_b": "C0"}
{"pin_a": "C0", "pin_b": "A15"}
]
},
"eeprom": {
"driver": "wear_leveling",
"wear_leveling": {
"driver": "spi_flash",
"backing_size": 16384,
"logical_size": 4096
}
},
"features": {
"console": true,
"haptic": true
@ -51,11 +59,6 @@
}
}
},
"usb": {
"shared_endpoint": {
"keyboard": true
}
},
"ws2812": {
"driver": "pwm",
"pin": "C6"

View file

@ -1,2 +0,0 @@
MOUSE_SHARED_EP = yes

View file

@ -75,4 +75,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* pmw3360 config */
#define PMW33XX_CS_PIN B0
#define PMW33XX_SPI_DIVISOR 8
#define PMW33XX_SPI_DIVISOR 8

View file

@ -1,2 +0,0 @@
KEYBOARD_SHARED_EP = yes
MOUSE_SHARED_EP = yes

View file

@ -0,0 +1 @@
POINTING_DEVICE_DRIVER = pmw3360

View file

@ -18,18 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
/* disable debug print */
// #define NO_DEBUG
/* disable print */
// #define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
#define SPLIT_POINTING_ENABLE
#define POINTING_DEVICE_TASK_THROTTLE_MS 1

View file

@ -2,6 +2,10 @@
"manufacturer": "QMK Community",
"maintainer": "Drashna Jael're",
"usb": {
"vid": "0x44DD"
"vid": "0x44DD",
"shared_endpoint": {
"keyboard": true,
"mouse": true
}
}
}

View file

@ -1,112 +0,0 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// mouse config
#ifdef MOUSEKEY_ENABLE
# ifndef MOUSEKEY_MOVE_DELTA
# ifndef MK_KINETIC_SPEED
# define MOUSEKEY_MOVE_DELTA 5
# else
# define MOUSEKEY_MOVE_DELTA 25
# endif
# endif
# ifndef MOUSEKEY_DELAY
# ifndef MK_KINETIC_SPEED
# define MOUSEKEY_DELAY 300
# else
# define MOUSEKEY_DELAY 8
# endif
# endif
# ifndef MOUSEKEY_INTERVAL
# ifndef MK_KINETIC_SPEED
# define MOUSEKEY_INTERVAL 50
# else
# define MOUSEKEY_INTERVAL 20
# endif
# endif
# ifndef MOUSEKEY_MAX_SPEED
# define MOUSEKEY_MAX_SPEED 7
# endif
# ifndef MOUSEKEY_TIME_TO_MAX
# define MOUSEKEY_TIME_TO_MAX 60
# endif
# ifndef MOUSEKEY_INITIAL_SPEED
# define MOUSEKEY_INITIAL_SPEED 100
# endif
# ifndef MOUSEKEY_BASE_SPEED
# define MOUSEKEY_BASE_SPEED 1000
# endif
# ifndef MOUSEKEY_DECELERATED_SPEED
# define MOUSEKEY_DECELERATED_SPEED 400
# endif
# ifndef MOUSEKEY_ACCELERATED_SPEED
# define MOUSEKEY_ACCELERATED_SPEED 3000
# endif
// mouse scroll config
# ifndef MOUSEKEY_WHEEL_DELAY
# define MOUSEKEY_WHEEL_DELAY 15
# endif
# ifndef MOUSEKEY_WHEEL_DELTA
# define MOUSEKEY_WHEEL_DELTA 1
# endif
# ifndef MOUSEKEY_WHEEL_INTERVAL
# define MOUSEKEY_WHEEL_INTERVAL 50
# endif
# ifndef MOUSEKEY_WHEEL_MAX_SPEED
# define MOUSEKEY_WHEEL_MAX_SPEED 8
# endif
# ifndef MOUSEKEY_WHEEL_TIME_TO_MAX
# define MOUSEKEY_WHEEL_TIME_TO_MAX 80
# endif
# ifndef MOUSEKEY_WHEEL_INITIAL_MOVEMENTS
# define MOUSEKEY_WHEEL_INITIAL_MOVEMENTS 8
# endif
# ifndef MOUSEKEY_WHEEL_BASE_MOVEMENTS
# define MOUSEKEY_WHEEL_BASE_MOVEMENTS 48
# endif
# ifndef MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS
# define MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS 48
# endif
# ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS
# define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8
# endif
#endif
#ifndef DEBOUNCE
# define DEBOUNCE 5
#endif
#if defined(RGBLIGHT_ENABLE) && !defined(RGBLIGHT_LIMIT_VAL)
# if defined(OLED_ENABLE)
# define RGBLIGHT_LIMIT_VAL 100
# else
# define RGBLIGHT_LIMIT_VAL 150
# endif
#endif
#if !defined(OLED_BRIGHTNESS)
# if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
# define OLED_BRIGHTNESS 80
# else
# define OLED_BRIGHTNESS 150
# endif
#endif

View file

@ -15,11 +15,9 @@
*/
#include "tractyl_manuform.h"
#include "keyboard.h"
#ifdef POINTING_DEVICE_ENABLE
#include "pointing_device.h"
# include "pointing_device.h"
#endif
#include "quantum.h"
#include "transactions.h"
#include <string.h>
@ -317,10 +315,6 @@ void eeconfig_init_kb(void) {
eeconfig_init_user();
}
void matrix_init_kb(void) {
read_charybdis_config_from_eeprom(&g_charybdis_config);
matrix_init_user();
}
void matrix_power_up(void) {
pointing_device_task();
}
@ -360,16 +354,21 @@ void keyboard_post_init_kb(void) {
void keyboard_pre_init_kb(void) {
user_button_init();
read_charybdis_config_from_eeprom(&g_charybdis_config);
keyboard_pre_init_user();
}
__attribute__((weak)) void execute_user_button_action(void) {
if (is_keyboard_master()) {
reset_keyboard();
} else {
soft_reset_keyboard();
}
}
void housekeeping_task_kb(void) {
if (check_user_button_state()) {
if (is_keyboard_master()) {
reset_keyboard();
} else {
soft_reset_keyboard();
}
execute_user_button_action();
}
#ifdef POINTING_DEVICE_ENABLE
@ -401,16 +400,14 @@ void housekeeping_task_kb(void) {
}
#ifdef USER_BUTTON_PIN
__attribute__((weak)) void bootmagic_scan(void) {
// We need multiple scans because debouncing can't be turned off.
matrix_scan();
# if defined(DEBOUNCE) && DEBOUNCE > 0
wait_ms(DEBOUNCE * 2);
# else
wait_ms(30);
# endif
matrix_scan();
/**
* @brief Replace and add upon the default bootmagic reset function.
* In this case, we also check the user button.
*
* @return true if the user button is pressed, or normal bootmagic key position.
* @return false if the user button is not pressed and normal bootmagic key position is not pressed.
*/
__attribute__((weak)) bool bootmagic_should_reset(void) {
uint8_t row = BOOTMAGIC_ROW;
uint8_t col = BOOTMAGIC_COLUMN;
@ -421,10 +418,7 @@ __attribute__((weak)) void bootmagic_scan(void) {
}
# endif
if (matrix_get_row(row) & (1 << col) || (is_keyboard_master() && check_user_button_state())) {
eeconfig_disable();
bootloader_jump();
}
return matrix_get_row(row) & (1 << col) || check_user_button_state();
}
#endif // USER_BUTTON_PIN