drivers/sensor: lis2dw12: fix for wrong gpio_callback handling
It seems that gpio_pin_disable_callback() has never been working for that sensor as it was expected. We used there argument 'dev' as its own (lis2dw12) device pointer. While this argument is a gpio_port device pointer not lis2dw12 sensor device pointer. So cfg->int_gpio_pin always tries to disable callback for some random pin read from accidental data sector. Signed-off-by: Michał Oleszczyk <oleszczyk.m@gmail.com>
This commit is contained in:
parent
2dfbf21410
commit
2663f71c6a
2 changed files with 7 additions and 3 deletions
|
@ -112,6 +112,7 @@ struct lis2dw12_data {
|
|||
lis2dw12_ctx_t *ctx;
|
||||
#ifdef CONFIG_LIS2DW12_TRIGGER
|
||||
struct device *gpio;
|
||||
u8_t gpio_pin;
|
||||
struct gpio_callback gpio_cb;
|
||||
sensor_trigger_handler_t drdy_handler;
|
||||
#ifdef CONFIG_LIS2DW12_PULSE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue