[MERGE] Update tractyl
This commit is contained in:
parent
b09ff15d8e
commit
3009a2e152
3 changed files with 24 additions and 25 deletions
|
@ -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.
|
||||
|
|
|
@ -358,17 +358,22 @@ void keyboard_pre_init_kb(void) {
|
|||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
__attribute__((weak)) void execute_user_button_action(void) {
|
||||
__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
|
||||
|
|
|
@ -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. */
|
||||
|
@ -104,6 +105,3 @@ bool charybdis_get_pointer_dragscroll_enabled(void);
|
|||
*/
|
||||
void charybdis_set_pointer_dragscroll_enabled(bool enable);
|
||||
#endif // POINTING_DEVICE_ENABLE
|
||||
|
||||
void matrix_init_sub_kb(void);
|
||||
void matrix_scan_sub_kb(void);
|
||||
|
|
Loading…
Add table
Reference in a new issue