summaryrefslogtreecommitdiff
path: root/components/drivers/touch
diff options
context:
space:
mode:
authorlizhirui <[email protected]>2021-05-18 09:54:11 +0800
committerlizhirui <[email protected]>2021-05-18 09:54:11 +0800
commit9a4e270f9770f778128ffdabe94f101416ce8c61 (patch)
tree9df43fbcc25c3f288ed6fdecd65909d4094d849f /components/drivers/touch
parente7fc0c89d2367533dcd1b77e46acaeea7bc3f876 (diff)
parent4e9e3f79a565bb4fdc1d96deda18f9c771aeb0c9 (diff)
Merge branch 'RT-Thread:master' into master
Diffstat (limited to 'components/drivers/touch')
-rw-r--r--components/drivers/touch/touch.c33
-rw-r--r--components/drivers/touch/touch.h2
2 files changed, 10 insertions, 25 deletions
diff --git a/components/drivers/touch/touch.c b/components/drivers/touch/touch.c
index e9595e9f8f..1a747d8669 100644
--- a/components/drivers/touch/touch.c
+++ b/components/drivers/touch/touch.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -77,6 +77,8 @@ static void rt_touch_irq_enable(rt_touch_t touch)
{
rt_pin_irq_enable(touch->config.irq_pin.pin, RT_TRUE);
}
+#else
+ touch->ops->touch_control(touch, RT_TOUCH_CTRL_ENABLE_INT, RT_NULL);
#endif
}
@@ -88,6 +90,8 @@ static void rt_touch_irq_disable(rt_touch_t touch)
{
rt_pin_irq_enable(touch->config.irq_pin.pin, RT_FALSE);
}
+#else
+ touch->ops->touch_control(touch, RT_TOUCH_CTRL_DISABLE_INT, RT_NULL);
#endif
}
@@ -144,28 +148,6 @@ static rt_err_t rt_touch_control(rt_device_t dev, int cmd, void *args)
switch (cmd)
{
- case RT_TOUCH_CTRL_GET_ID:
- if (args)
- {
- result = touch->ops->touch_control(touch, RT_TOUCH_CTRL_GET_ID, args);
- }
- else
- {
- result = -RT_ERROR;
- }
-
- break;
- case RT_TOUCH_CTRL_GET_INFO:
- if (args)
- {
- result = touch->ops->touch_control(touch, RT_TOUCH_CTRL_GET_INFO, args);
- }
- else
- {
- result = -RT_ERROR;
- }
-
- break;
case RT_TOUCH_CTRL_SET_MODE:
result = touch->ops->touch_control(touch, RT_TOUCH_CTRL_SET_MODE, args);
@@ -206,8 +188,11 @@ static rt_err_t rt_touch_control(rt_device_t dev, int cmd, void *args)
case RT_TOUCH_CTRL_ENABLE_INT:
rt_touch_irq_enable(touch);
break;
+
+ case RT_TOUCH_CTRL_GET_ID:
+ case RT_TOUCH_CTRL_GET_INFO:
default:
- return -RT_ERROR;
+ return touch->ops->touch_control(touch, cmd, args);
}
return result;
diff --git a/components/drivers/touch/touch.h b/components/drivers/touch/touch.h
index be12c24206..3d2e885e13 100644
--- a/components/drivers/touch/touch.h
+++ b/components/drivers/touch/touch.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2018, RT-Thread Development Team
+ * Copyright (c) 2006-2021, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*