1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/ft5x06: configure interrupt mode in any case

The interrupt mode has to be configured independent on whether the INT pin is initialized already by the `ft5x06_init` function if parameter `cb` is defined or later, for example by the `touch_dev` implementation.
This commit is contained in:
Gunar Schorcht 2023-08-28 18:49:54 +02:00
parent 7ac2865f7e
commit bf720c0b41

View File

@ -83,9 +83,10 @@ int ft5x06_init(ft5x06_t *dev, const ft5x06_params_t *params, ft5x06_event_cb_t
if (gpio_is_valid(dev->params->int_pin) && cb) {
DEBUG("[ft5x06] init: configuring touchscreen interrupt\n");
gpio_init_int(dev->params->int_pin, GPIO_IN, GPIO_RISING, cb, arg);
i2c_write_reg(FT5X06_BUS, FT5X06_ADDR, FT5X06_G_MODE_REG, FT5X06_G_MODE_INTERRUPT_TRIGGER & 0x01, 0);
}
i2c_write_reg(FT5X06_BUS, FT5X06_ADDR, FT5X06_G_MODE_REG, FT5X06_G_MODE_INTERRUPT_TRIGGER & 0x01, 0);
i2c_release(FT5X06_BUS);
return 0;