mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-20 20:57:12 +08:00
Bypass controlling commands in touch class to driver.
This commit is contained in:
parent
be3b5a950f
commit
4ed550a96c
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user