diff --git a/keyboards/vial_example/vial_rp2040/config.h b/keyboards/vial_example/vial_rp2040/config.h new file mode 100644 index 000000000000..4b7012113c21 --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/config.h @@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Vial +#define PRODUCT RP2040 example + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 2 + +#define MATRIX_ROW_PINS { 0, 1 } +#define MATRIX_COL_PINS { 2, 3 } + +#define DIODE_DIRECTION COL2ROW + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET +#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U + +// #define TAPPING_TERM_PER_KEY \ No newline at end of file diff --git a/keyboards/vial_example/vial_rp2040/keymaps/default/keymap.c b/keyboards/vial_example/vial_rp2040/keymaps/default/keymap.c new file mode 100644 index 000000000000..6c76cbf73d5f --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/default/keymap.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_1, KC_2, + KC_3, KC_4 + ), + + [1] = LAYOUT( + KC_A, KC_B, + KC_C, KC_D + ) +}; diff --git a/keyboards/vial_example/vial_rp2040/keymaps/vial/config.h b/keyboards/vial_example/vial_rp2040/keymaps/vial/config.h new file mode 100644 index 000000000000..b8d1d729ffb5 --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/vial/config.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#define VIAL_KEYBOARD_UID {0x03, 0x35, 0x69, 0xE1, 0x5C, 0x42, 0xD9, 0x5E} +#define VIAL_UNLOCK_COMBO_ROWS {0, 1} +#define VIAL_UNLOCK_COMBO_COLS {0, 1} diff --git a/keyboards/vial_example/vial_rp2040/keymaps/vial/keymap.c b/keyboards/vial_example/vial_rp2040/keymaps/vial/keymap.c new file mode 100644 index 000000000000..c8fb892589cf --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/vial/keymap.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_1, KC_2, + KC_3, KC_4 + ), + + [1] = LAYOUT( + KC_A, KC_B, + KC_C, KC_D + ), + + [2] = LAYOUT( + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS + ), + + [3] = LAYOUT( + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/vial_example/vial_rp2040/keymaps/vial/rules.mk b/keyboards/vial_example/vial_rp2040/keymaps/vial/rules.mk new file mode 100644 index 000000000000..cb18d476bdb2 --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/vial/rules.mk @@ -0,0 +1,4 @@ +VIA_ENABLE = yes +VIAL_ENABLE = yes +# DYNAMIC_TAPPING_TERM_ENABLE = no +VIAL_TAP_DANCE_ENABLE = no diff --git a/keyboards/vial_example/vial_rp2040/rules.mk b/keyboards/vial_example/vial_rp2040/rules.mk new file mode 100644 index 000000000000..837663f58a3b --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/rules.mk @@ -0,0 +1,20 @@ +# MCU name +MCU = RP2040 +BOOTLOADER = rp2040 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output diff --git a/keyboards/vial_example/vial_rp2040/vial_rp2040.c b/keyboards/vial_example/vial_rp2040/vial_rp2040.c new file mode 100644 index 000000000000..2ffcfd355d3d --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/vial_rp2040.c @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "vial_rp2040.h" diff --git a/keyboards/vial_example/vial_rp2040/vial_rp2040.h b/keyboards/vial_example/vial_rp2040/vial_rp2040.h new file mode 100644 index 000000000000..12c2bedb5f6f --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/vial_rp2040.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, \ + K10, K11 \ +) { \ + { K00, K01 }, \ + { K10, K11 } \ +} diff --git a/quantum/action.c b/quantum/action.c index 215ba1ca0d72..6a7ef312d486 100644 --- a/quantum/action.c +++ b/quantum/action.c @@ -115,7 +115,7 @@ void action_exec(keyevent_t event) { clear_oneshot_swaphands(); } # endif -} +# endif } #endif diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index 12f112c0152e..6e4ec9dbb175 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -22,10 +22,10 @@ #include "via.h" // for default VIA_EEPROM_ADDR_END #include -<<<<<<< HEAD #ifdef VIAL_ENABLE #include "vial.h" -======= +#endif + #ifdef ENCODER_ENABLE # include "encoder.h" #else @@ -34,7 +34,6 @@ #ifndef DYNAMIC_KEYMAP_LAYER_COUNT # define DYNAMIC_KEYMAP_LAYER_COUNT 4 ->>>>>>> 5d67c4d908 (Fix missing definition for non-encoder case. (#16593)) #endif #ifndef DYNAMIC_KEYMAP_MACRO_COUNT @@ -70,6 +69,11 @@ # endif #endif +// Dynamic encoders starts after dynamic keymaps +#ifndef DYNAMIC_KEYMAP_ENCODER_EEPROM_ADDR +# define DYNAMIC_KEYMAP_ENCODER_EEPROM_ADDR (DYNAMIC_KEYMAP_EEPROM_ADDR + (DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2)) +#endif + // Dynamic macro starts after dynamic encoders, but only when using ENCODER_MAP #ifdef ENCODER_MAP_ENABLE # ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR @@ -127,6 +131,7 @@ // Dynamic macro #ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR # define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR (VIAL_KEY_OVERRIDE_EEPROM_ADDR + VIAL_KEY_OVERRIDE_SIZE) +#endif // Sanity check that dynamic keymaps fit in available EEPROM // If there's not 100 bytes available for macros, then something is wrong. @@ -163,7 +168,7 @@ void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint if (layer >= DYNAMIC_KEYMAP_LAYER_COUNT || row >= MATRIX_ROWS || column >= MATRIX_COLS) return; #ifdef VIAL_ENABLE - if (keycode == RESET && !vial_unlocked) + if (keycode == QK_BOOT && !vial_unlocked) return; #endif @@ -173,7 +178,6 @@ void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint eeprom_update_byte(address + 1, (uint8_t)(keycode & 0xFF)); } -======= #ifdef ENCODER_MAP_ENABLE void *dynamic_keymap_encoder_to_eeprom_address(uint8_t layer, uint8_t encoder_id) { return ((void *)DYNAMIC_KEYMAP_ENCODER_EEPROM_ADDR) + (layer * NUM_ENCODERS * 2 * 2) + (encoder_id * 2 * 2); @@ -283,7 +287,7 @@ int dynamic_keymap_set_key_override(uint8_t index, const vial_key_override_entry void dynamic_keymap_reset(void) { #ifdef VIAL_ENABLE - /* temporarily unlock the keyboard so we can set hardcoded RESET keycode */ + /* temporarily unlock the keyboard so we can set hardcoded QK_BOOT keycode */ int vial_unlocked_prev = vial_unlocked; vial_unlocked = 1; #endif @@ -310,7 +314,7 @@ void dynamic_keymap_reset(void) { #endif #ifdef VIAL_TAP_DANCE_ENABLE - vial_tap_dance_entry_t td = { KC_NO, KC_NO, KC_NO, KC_NO, TAPPING_TERM }; + vial_tap_dance_entry_t td = { KC_NO, KC_NO, KC_NO, KC_NO }; for (size_t i = 0; i < VIAL_TAP_DANCE_ENTRIES; ++i) { dynamic_keymap_set_tap_dance(i, &td); } @@ -362,7 +366,7 @@ void dynamic_keymap_set_buffer(uint16_t offset, uint16_t size, uint8_t *data) { return; #ifndef VIAL_INSECURE - /* Check whether it is trying to send a RESET keycode; only allow setting these if unlocked */ + /* Check whether it is trying to send a QK_BOOT keycode; only allow setting these if unlocked */ if (!vial_unlocked) { /* how much of the input array we'll have to check in the loop */ uint16_t chk_offset = 0; @@ -371,7 +375,7 @@ void dynamic_keymap_set_buffer(uint16_t offset, uint16_t size, uint8_t *data) { /* initial byte misaligned -- this means the first keycode will be a combination of existing and new data */ if (offset % 2 != 0) { uint16_t kc = (eeprom_read_byte((uint8_t*)target - 1) << 8) | data[0]; - if (kc == RESET) + if (kc == QK_BOOT) data[0] = 0xFF; /* no longer have to check the first byte */ @@ -381,17 +385,17 @@ void dynamic_keymap_set_buffer(uint16_t offset, uint16_t size, uint8_t *data) { /* final byte misaligned -- this means the last keycode will be a combination of new and existing data */ if ((offset + size) % 2 != 0) { uint16_t kc = (data[size - 1] << 8) | eeprom_read_byte((uint8_t*)target + size); - if (kc == RESET) + if (kc == QK_BOOT) data[size - 1] = 0xFF; /* no longer have to check the last byte */ chk_sz -= 1; } - /* check the entire array, replace any instances of RESET with invalid keycode 0xFFFF */ + /* check the entire array, replace any instances of QK_BOOT with invalid keycode 0xFFFF */ for (uint16_t i = chk_offset; i < chk_sz; i += 2) { uint16_t kc = (data[i] << 8) | data[i + 1]; - if (kc == RESET) { + if (kc == QK_BOOT) { data[i] = 0xFF; data[i + 1] = 0xFF; } diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 2611d51df00a..1ffc71cddbde 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -15,8 +15,12 @@ */ #include "quantum.h" -static uint16_t active_td; -static uint16_t last_tap_time; +#ifndef NO_ACTION_ONESHOT +uint8_t get_oneshot_mods(void); +#endif + +static uint16_t last_td; +static int16_t highest_td = -1; void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; @@ -30,14 +34,18 @@ void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data) void qk_tap_dance_pair_finished(qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; - register_code16(pair->kc1); + if (state->count == 1) { + register_code16(pair->kc1); + } else if (state->count == 2) { + register_code16(pair->kc2); + } } void qk_tap_dance_pair_reset(qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; + wait_ms(TAP_CODE_DELAY); if (state->count == 1) { - wait_ms(TAP_CODE_DELAY); unregister_code16(pair->kc1); } else if (state->count == 2) { unregister_code16(pair->kc2); @@ -79,16 +87,9 @@ static inline void _process_tap_dance_action_fn(qk_tap_dance_state_t *state, voi } static inline void process_tap_dance_action_on_each_tap(qk_tap_dance_action_t *action) { - action->state.count++; - action->state.weak_mods = get_mods(); - action->state.weak_mods |= get_weak_mods(); -#ifndef NO_ACTION_ONESHOT - action->state.oneshot_mods = get_oneshot_mods(); -#endif _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_each_tap); } -<<<<<<< HEAD void process_tap_dance_action_on_dance_finished(qk_tap_dance_action_t *action) { if (action->state.finished) return; action->state.finished = true; @@ -98,33 +99,11 @@ void process_tap_dance_action_on_dance_finished(qk_tap_dance_action_t *action) { _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_dance_finished); } -======= ->>>>>>> 1706da9054 (tap-dance: Restructure code and document in more detail (#16394)) static inline void process_tap_dance_action_on_reset(qk_tap_dance_action_t *action) { _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_reset); - del_weak_mods(action->state.weak_mods); -#ifndef NO_ACTION_ONESHOT del_mods(action->state.oneshot_mods); -#endif + del_weak_mods(action->state.weak_mods); send_keyboard_report(); - action->state = (const qk_tap_dance_state_t){0}; -} - -static inline void process_tap_dance_action_on_dance_finished(qk_tap_dance_action_t *action) { - if (!action->state.finished) { - action->state.finished = true; - add_weak_mods(action->state.weak_mods); -#ifndef NO_ACTION_ONESHOT - add_mods(action->state.oneshot_mods); -#endif - send_keyboard_report(); - _process_tap_dance_action_fn(&action->state, action->user_data, action->fn.on_dance_finished); - } - active_td = 0; - if (!action->state.pressed) { - // There will not be a key release event, so reset now. - process_tap_dance_action_on_reset(action); - } } void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { @@ -132,33 +111,51 @@ void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) return; - if (!active_td || keycode == active_td) return; - - action = &tap_dance_actions[TD_INDEX(active_td)]; - action->state.interrupted = true; - action->state.interrupting_keycode = keycode; - process_tap_dance_action_on_dance_finished(action); - - // Tap dance actions can leave some weak mods active (e.g., if the tap dance is mapped to a keycode with - // modifiers), but these weak mods should not affect the keypress which interrupted the tap dance. - clear_weak_mods(); + if (highest_td == -1) return; + + for (int i = 0; i <= highest_td; i++) { + action = &tap_dance_actions[i]; + if (action->state.count) { + if (keycode == action->state.keycode && keycode == last_td) continue; + action->state.interrupted = true; + action->state.interrupting_keycode = keycode; + process_tap_dance_action_on_dance_finished(action); + reset_tap_dance(&action->state); + + // Tap dance actions can leave some weak mods active (e.g., if the tap dance is mapped to a keycode with + // modifiers), but these weak mods should not affect the keypress which interrupted the tap dance. + clear_weak_mods(); + } + } } bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { + uint16_t idx = keycode - QK_TAP_DANCE; qk_tap_dance_action_t *action; switch (keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: - action = &tap_dance_actions[TD_INDEX(keycode)]; + if ((int16_t)idx > highest_td) highest_td = idx; + action = &tap_dance_actions[idx]; action->state.pressed = record->event.pressed; if (record->event.pressed) { - last_tap_time = timer_read(); + action->state.keycode = keycode; + action->state.count++; + action->state.timer = timer_read(); +#ifndef NO_ACTION_ONESHOT + action->state.oneshot_mods = get_oneshot_mods(); +#else + action->state.oneshot_mods = 0; +#endif + action->state.weak_mods = get_mods(); + action->state.weak_mods |= get_weak_mods(); process_tap_dance_action_on_each_tap(action); - active_td = action->state.finished ? 0 : keycode; + + last_td = keycode; } else { - if (action->state.finished) { - process_tap_dance_action_on_reset(action); + if (action->state.count && action->state.finished) { + reset_tap_dance(&action->state); } } @@ -169,17 +166,39 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { } void tap_dance_task() { - qk_tap_dance_action_t *action; - - if (!active_td || timer_elapsed(last_tap_time) <= GET_TAPPING_TERM(active_td, &(keyrecord_t){})) return; - - action = &tap_dance_actions[TD_INDEX(active_td)]; - if (!action->state.interrupted) { - process_tap_dance_action_on_dance_finished(action); + if (highest_td == -1) return; + uint16_t tap_user_defined; + + for (uint8_t i = 0; i <= highest_td; i++) { + qk_tap_dance_action_t *action = &tap_dance_actions[i]; + if (action->custom_tapping_term > 0) { + tap_user_defined = action->custom_tapping_term; + } else { +#ifdef TAPPING_TERM_PER_KEY + tap_user_defined = get_tapping_term(action->state.keycode, &(keyrecord_t){}); +#else + tap_user_defined = TAPPING_TERM; +#endif + } + if (action->state.count && timer_elapsed(action->state.timer) > tap_user_defined) { + process_tap_dance_action_on_dance_finished(action); + reset_tap_dance(&action->state); + } } } void reset_tap_dance(qk_tap_dance_state_t *state) { - active_td = 0; - process_tap_dance_action_on_reset((qk_tap_dance_action_t *)state); + qk_tap_dance_action_t *action; + + if (state->pressed) return; + + action = &tap_dance_actions[state->keycode - QK_TAP_DANCE]; + + process_tap_dance_action_on_reset(action); + + state->count = 0; + state->interrupted = false; + state->finished = false; + state->interrupting_keycode = 0; + last_td = 0; } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index d97900d96b3c..d9ffb1e73db7 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -22,27 +22,30 @@ # include typedef struct { - uint16_t interrupting_keycode; uint8_t count; + uint8_t oneshot_mods; uint8_t weak_mods; -# ifndef NO_ACTION_ONESHOT - uint8_t oneshot_mods; -# endif - bool pressed : 1; - bool finished : 1; - bool interrupted : 1; + uint16_t keycode; + uint16_t interrupting_keycode; + uint16_t timer; + bool interrupted; + bool pressed; + bool finished; } qk_tap_dance_state_t; +# define TD(n) (QK_TAP_DANCE | ((n)&0xFF)) + typedef void (*qk_tap_dance_user_fn_t)(qk_tap_dance_state_t *state, void *user_data); typedef struct { - qk_tap_dance_state_t state; struct { qk_tap_dance_user_fn_t on_each_tap; qk_tap_dance_user_fn_t on_dance_finished; qk_tap_dance_user_fn_t on_reset; } fn; - void *user_data; + qk_tap_dance_state_t state; + uint16_t custom_tapping_term; + void * user_data; } qk_tap_dance_action_t; typedef struct { @@ -59,31 +62,31 @@ typedef struct { # define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) \ { .fn = {qk_tap_dance_pair_on_each_tap, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset}, .user_data = (void *)&((qk_tap_dance_pair_t){kc1, kc2}), } -# define ACTION_TAP_DANCE_LAYER_MOVE(kc, layer) \ +# define ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) \ { .fn = {qk_tap_dance_dual_role_on_each_tap, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset}, .user_data = (void *)&((qk_tap_dance_dual_role_t){kc, layer, layer_move}), } # define ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer) \ { .fn = {NULL, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset}, .user_data = (void *)&((qk_tap_dance_dual_role_t){kc, layer, layer_invert}), } +# define ACTION_TAP_DANCE_LAYER_MOVE(kc, layer) ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) + # define ACTION_TAP_DANCE_FN(user_fn) \ { .fn = {NULL, user_fn, NULL}, .user_data = NULL, } # define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset) \ { .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset}, .user_data = NULL, } -# define TD(n) (QK_TAP_DANCE | TD_INDEX(n)) -# define TD_INDEX(code) ((code)&0xFF) -# define TAP_DANCE_KEYCODE(state) TD(((qk_tap_dance_action_t *)state) - tap_dance_actions) +# define ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term) \ + { .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset}, .user_data = NULL, .custom_tapping_term = tap_specific_tapping_term, } extern qk_tap_dance_action_t tap_dance_actions[]; -void reset_tap_dance(qk_tap_dance_state_t *state); - /* To be used internally */ void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record); bool process_tap_dance(uint16_t keycode, keyrecord_t *record); void tap_dance_task(void); +void reset_tap_dance(qk_tap_dance_state_t *state); void qk_tap_dance_pair_on_each_tap(qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_pair_finished(qk_tap_dance_state_t *state, void *user_data); diff --git a/quantum/via.c b/quantum/via.c index 10a6a12c7aae..e81155074b41 100644 --- a/quantum/via.c +++ b/quantum/via.c @@ -342,6 +342,7 @@ void raw_hid_receive(uint8_t *data, uint8_t length) { #endif #if defined(VIALRGB_ENABLE) vialrgb_set_value(data, length); +#endif #if defined(VIA_QMK_RGB_MATRIX_ENABLE) via_qmk_rgb_matrix_set_value(command_data); #endif diff --git a/quantum/vial.c b/quantum/vial.c index 23d62a2fa538..823d7b204762 100644 --- a/quantum/vial.c +++ b/quantum/vial.c @@ -75,7 +75,7 @@ void vial_init(void) { } __attribute__((unused)) static uint16_t vial_keycode_firewall(uint16_t in) { - if (in == RESET && !vial_unlocked) + if (in == QK_BOOT && !vial_unlocked) return 0; return in; } diff --git a/quantum/vial.h b/quantum/vial.h index 28831e01c096..5e8a02f89b53 100644 --- a/quantum/vial.h +++ b/quantum/vial.h @@ -187,4 +187,8 @@ enum { #if defined(VIAL_ENCODERS_ENABLE) && !defined(ENCODER_MAP_ENABLE) #error VIAL_ENCODERS_ENABLE=yes requires ENCODER_MAP_ENABLE=yes -#endif \ No newline at end of file +#endif + +// #if defined(VIAL_TAP_DANCE_ENABLE) && !defined(DYNAMIC_TAPPING_TERM_ENABLE) +// #error VIAL_TAP_DANCE_ENABLE=yes requires DYNAMIC_TAPPING_TERM_ENABLE=yes +// #endif \ No newline at end of file