Skip to content

Commit

Permalink
fix(kscan): Don't fire last mock event twice.
Browse files Browse the repository at this point in the history
Fix a bug where the kscan mock would raise the last mock event
twice before haltning processing.
  • Loading branch information
petejohanson committed Jan 13, 2025
1 parent 11b2c9e commit 40f5aa0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/module/drivers/kscan/kscan_mock.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int kscan_mock_configure(const struct device *dev, kscan_callback_t callb
static void kscan_mock_schedule_next_event_##n(const struct device *dev) { \
struct kscan_mock_data *data = dev->data; \
const struct kscan_mock_config_##n *cfg = dev->config; \
if (data->event_index < DT_INST_PROP_LEN(n, events)) { \
if (data->event_index < DT_INST_PROP_LEN(n, events) - 1) { \
uint32_t ev = cfg->events[data->event_index]; \
LOG_DBG("delaying next keypress: %d", ZMK_MOCK_MSEC(ev)); \
k_work_schedule(&data->work, K_MSEC(ZMK_MOCK_MSEC(ev))); \
Expand Down

0 comments on commit 40f5aa0

Please sign in to comment.