Skip to content

Commit

Permalink
[MERGE] Update tractyl
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Jan 11, 2025
1 parent 69e42c9 commit ebe621d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
8 changes: 2 additions & 6 deletions keyboards/handwired/tractyl_manuform/5x6_right/f405/f405.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,16 @@ bool usb_vbus_state(void) {
}
#endif

#ifdef USER_BUTTON_PIN
void user_button_init(void) {
// Pin needs to be configured as input low
#ifdef USER_BUTTON_PIN
gpio_set_pin_input_low(USER_BUTTON_PIN);
#endif // USER_BUTTON_PIN
}

bool check_user_button_state(void) {
gpio_write_pin(DEBUG_LED_PIN, is_keyboard_master());
#ifdef USER_BUTTON_PIN
return gpio_read_pin(USER_BUTTON_PIN);
#endif // USER_BUTTON_PIN
return false;
}
#endif // USER_BUTTON_PIN

void board_init(void) {
// Board setup sets these pins as SPI, but we aren't using them as such.
Expand Down
19 changes: 12 additions & 7 deletions keyboards/handwired/tractyl_manuform/tractyl_manuform.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,17 +358,22 @@ void keyboard_pre_init_kb(void) {
keyboard_pre_init_user();
}

__attribute__((weak)) void execute_user_button_action(void) {
if (is_keyboard_master()) {
reset_keyboard();
} else {
soft_reset_keyboard();
__attribute__((weak)) void execute_user_button_action(bool state) {
if (state) {
if (is_keyboard_master()) {
reset_keyboard();
} else {
soft_reset_keyboard();
}
}
}

void housekeeping_task_kb(void) {
if (check_user_button_state()) {
execute_user_button_action();
static bool last_state = false;
bool state = check_user_button_state();
if (state != last_state) {
last_state = state;
execute_user_button_action(state);
}

#ifdef POINTING_DEVICE_ENABLE
Expand Down
22 changes: 10 additions & 12 deletions keyboards/handwired/tractyl_manuform/tractyl_manuform.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ enum charybdis_keycodes {
DRAGSCROLL_MODE,
DRAGSCROLL_MODE_TOGGLE,
};
# define DPI_MOD POINTER_DEFAULT_DPI_FORWARD
# define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE
# define S_D_MOD POINTER_SNIPING_DPI_FORWARD
# define S_D_RMOD POINTER_SNIPING_DPI_REVERSE
# define SNIPING SNIPING_MODE
# define SNP_TOG SNIPING_MODE_TOGGLE
# define DRGSCRL DRAGSCROLL_MODE
# define DRG_TOG DRAGSCROLL_MODE_TOGGLE

#define DPI_MOD POINTER_DEFAULT_DPI_FORWARD
#define DPI_RMOD POINTER_DEFAULT_DPI_REVERSE
#define S_D_MOD POINTER_SNIPING_DPI_FORWARD
#define S_D_RMOD POINTER_SNIPING_DPI_REVERSE
#define SNIPING SNIPING_MODE
#define SNP_TOG SNIPING_MODE_TOGGLE
#define DRGSCRL DRAGSCROLL_MODE
#define DRG_TOG DRAGSCROLL_MODE_TOGGLE

#ifdef POINTING_DEVICE_ENABLE
/** \brief Return the current DPI value for the pointer's default mode. */
Expand Down Expand Up @@ -103,7 +104,4 @@ bool charybdis_get_pointer_dragscroll_enabled(void);
* are translated into horizontal and vertical scroll movements.
*/
void charybdis_set_pointer_dragscroll_enabled(bool enable);
#endif // POINTING_DEVICE_ENABLE

void matrix_init_sub_kb(void);
void matrix_scan_sub_kb(void);
#endif // POINTING_DEVICE_ENABLE

0 comments on commit ebe621d

Please sign in to comment.