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 fc1d2b5 commit f2e8abb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/module/drivers/kscan/kscan_mock.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ static int kscan_mock_configure(const struct device *dev, kscan_callback_t callb
struct k_work_delayable *d_work = k_work_delayable_from_work(work); \
struct kscan_mock_data *data = CONTAINER_OF(d_work, struct kscan_mock_data, work); \
const struct kscan_mock_config_##n *cfg = data->dev->config; \
if (data->event_index >= DT_INST_PROP_LEN(n, events)) { \
if (cfg->exit_after) \
exit(0); \
else \
return; \
} \
uint32_t ev = cfg->events[data->event_index]; \
LOG_DBG("ev %u row %d column %d state %d\n", ev, ZMK_MOCK_ROW(ev), ZMK_MOCK_COL(ev), \
ZMK_MOCK_IS_PRESS(ev)); \
Expand Down

0 comments on commit f2e8abb

Please sign in to comment.