diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f405/f405.c b/keyboards/handwired/tractyl_manuform/5x6_right/f405/f405.c index 8382c2d8bfd8..71dd54b50e8d 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f405/f405.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f405/f405.c @@ -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. diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c index c37a67b15791..111b3739cd42 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.c +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.c @@ -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 diff --git a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h index 48020c89bd7a..0c473517c7d1 100644 --- a/keyboards/handwired/tractyl_manuform/tractyl_manuform.h +++ b/keyboards/handwired/tractyl_manuform/tractyl_manuform.h @@ -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. */ @@ -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