summaryrefslogtreecommitdiff
path: root/quantum/via.c
diff options
context:
space:
mode:
authorIlya Zhuravlev <whatever@xyz.is>2021-01-07 09:17:18 -0500
committerIlya Zhuravlev <whatever@xyz.is>2021-01-07 12:52:56 -0500
commitcc43ad2b4192f833bce1bd41d4646d5c0da80e68 (patch)
tree211ff906ec69a69b714f1a7333e18d19a17fb2e6 /quantum/via.c
parente2447a0eea5b109102e8860cd75e2b57c6220b19 (diff)
vial: allow resuming an interrupted unlock sequence
Diffstat (limited to 'quantum/via.c')
-rw-r--r--quantum/via.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/quantum/via.c b/quantum/via.c
index 9772ea2b5e..20f33e889e 100644
--- a/quantum/via.c
+++ b/quantum/via.c
@@ -220,9 +220,14 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
uint8_t *command_data = &(data[1]);
#ifdef VIAL_ENABLE
- /* When unlock is in progress, only command we react to is unlock_poll */
- if (vial_unlock_in_progress && (data[0] != id_vial_prefix || data[1] != vial_unlock_poll))
- goto skip;
+ /* When unlock is in progress, we can only react to a subset of commands */
+ if (vial_unlock_in_progress) {
+ if (data[0] != id_vial_prefix)
+ goto skip;
+ uint8_t cmd = data[1];
+ if (cmd != vial_get_keyboard_id && cmd != vial_get_size && cmd != vial_get_def && cmd != vial_get_unlock_status && cmd != vial_unlock_start && cmd != vial_unlock_poll)
+ goto skip;
+ }
#endif
switch (*command_id) {