Skip to content

Commit

Permalink
[TractylM] Add changes from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Jan 9, 2025
1 parent 49ed984 commit 57209bf
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 167 deletions.
2 changes: 0 additions & 2 deletions keyboards/handwired/tractyl_manuform/5x6_right/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 1 addition & 3 deletions keyboards/handwired/tractyl_manuform/5x6_right/f405/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 3 additions & 1 deletion keyboards/handwired/tractyl_manuform/5x6_right/f405/f405.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
{"pin_a": "A15", "pin_b": "C0"}
]
},
"eeprom": {
"driver": "wear_leveling",
"wear_leveling": {
"driver": "spi_flash",
"backing_size": 16384,
"logical_size": 4096
}
},
"features": {
"console": true,
"haptic": true
Expand Down Expand Up @@ -51,11 +59,6 @@
}
}
},
"usb": {
"shared_endpoint": {
"keyboard": true
}
},
"ws2812": {
"driver": "pwm",
"pin": "C6"
Expand Down
2 changes: 0 additions & 2 deletions keyboards/handwired/tractyl_manuform/5x6_right/f405/rules.mk

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions keyboards/handwired/tractyl_manuform/5x6_right/f411/rules.mk

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
POINTING_DEVICE_DRIVER = pmw3360
12 changes: 0 additions & 12 deletions keyboards/handwired/tractyl_manuform/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion keyboards/handwired/tractyl_manuform/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"manufacturer": "QMK Community",
"maintainer": "Drashna Jael're",
"usb": {
"vid": "0x44DD"
"vid": "0x44DD",
"shared_endpoint": {
"keyboard": true,
"mouse": true
}
}
}
112 changes: 0 additions & 112 deletions keyboards/handwired/tractyl_manuform/post_config.h

This file was deleted.

46 changes: 20 additions & 26 deletions keyboards/handwired/tractyl_manuform/tractyl_manuform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand All @@ -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

Expand Down

0 comments on commit 57209bf

Please sign in to comment.