summaryrefslogtreecommitdiff
path: root/app/drivers/zephyr
diff options
context:
space:
mode:
authorCrossR <r.cross@lancaster.ac.uk>2020-09-01 18:27:40 +0100
committerCrossR <r.cross@lancaster.ac.uk>2020-09-01 18:27:40 +0100
commit21875cde884a4acdd22864cb0690baa9595c945a (patch)
tree690def9599da22add8df8c2f07eefec87f204668 /app/drivers/zephyr
parent6be07b5b243d62fd6c531c4c8d6e81e61147eac6 (diff)
parent4202db5a01e04e2e403941f40aea47a11f668853 (diff)
Merge remote-tracking branch 'upstream/main' into CrossR/Sofle
Diffstat (limited to 'app/drivers/zephyr')
-rw-r--r--app/drivers/zephyr/kscan_gpio_direct.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/drivers/zephyr/kscan_gpio_direct.c b/app/drivers/zephyr/kscan_gpio_direct.c
index 6e0beb0..a3aa8c4 100644
--- a/app/drivers/zephyr/kscan_gpio_direct.c
+++ b/app/drivers/zephyr/kscan_gpio_direct.c
@@ -156,7 +156,6 @@ static int kscan_gpio_read(struct device *dev)
struct kscan_gpio_data *data = dev->driver_data;
const struct kscan_gpio_config *cfg = dev->config_info;
u32_t read_state = data->pin_state;
- LOG_DBG("Scanning the pins for updated state");
for (int i = 0; i < cfg->num_of_inputs; i++)
{
struct device *in_dev = kscan_gpio_input_devices(dev)[i];
@@ -165,8 +164,9 @@ static int kscan_gpio_read(struct device *dev)
}
for (int i = 0; i < cfg->num_of_inputs; i++)
{
+ bool prev_pressed = BIT(i) & data->pin_state;
bool pressed = BIT(i) & read_state;
- if (pressed != (BIT(i) & data->pin_state))
+ if (pressed != prev_pressed)
{
LOG_DBG("Sending event at %d,%d state %s",
0, i, (pressed ? "on" : "off"));