From 5b21f15a0a3e2d27d57b7a657d031a66d1124701 Mon Sep 17 00:00:00 2001 From: Cody McGinnis Date: Fri, 28 Aug 2020 16:21:31 -0400 Subject: [PATCH] fix(test): off by one error with kscan processing --- app/src/kscan_mock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/kscan_mock.c b/app/src/kscan_mock.c index 1bd8a748..d626c71e 100644 --- a/app/src/kscan_mock.c +++ b/app/src/kscan_mock.c @@ -72,12 +72,13 @@ static int kscan_mock_configure(struct device *dev, kscan_callback_t callback) struct kscan_mock_data *data = \ CONTAINER_OF(work, struct kscan_mock_data, work); \ const struct kscan_mock_config_##n *cfg = data->dev->config_info; \ - u32_t ev = cfg->events[data->event_index++]; \ + u32_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)); \ data->callback(data->dev, \ ZMK_MOCK_ROW(ev), ZMK_MOCK_COL(ev), ZMK_MOCK_IS_PRESS(ev)); \ kscan_mock_schedule_next_event_##n(data->dev); \ + data->event_index++; \ } \ static int kscan_mock_init_##n(struct device *dev) \ { \