/* lis2du12_handle_interrupt - handle the drdy event read data and call handler if registered any  */
static void lis2du12_handle_interrupt(const struct device *dev)
/* lis2du12_handle_interrupt - handle the drdy event read data and call handler if registered any  */
static void lis2du12_handle_interrupt(const struct device *dev)
{
	struct lis2du12_data *lis2du12 = dev->data;
	const struct lis2du12_config *cfg = dev->config;
	stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
	lis2du12_status_t status;
	while (1) {
		if (lis2du12_status_get(ctx, &status) < 0) {
			LOG_ERR("failed reading status reg");
			return;
		}
		if (status.drdy_xl == 0) {
			break;
		}
		if ((status.drdy_xl) && (lis2du12->handler_drdy_acc != NULL)) {
			lis2du12->handler_drdy_acc(dev, lis2du12->trig_drdy_acc);
		}
	}
	gpio_pin_interrupt_configure_dt(lis2du12->drdy_gpio,
					GPIO_INT_EDGE_TO_ACTIVE);
}