summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2022-12-25 03:22:11 -0500
committerMan, Jianting (Meco) <[email protected]>2022-12-26 02:10:30 -0500
commit20a6f14e893c8339654bdda08c967454e3b2c688 (patch)
tree477c87685c2a798df7d3e46c223868bf531aea75 /components
parent2570fab0e1c4456e4384c1ed17f186431f0d0596 (diff)
use PIN_IRQ_PIN_NONE to replace RT_PIN_NONE
Diffstat (limited to 'components')
-rw-r--r--components/drivers/include/drivers/sensor.h1
-rw-r--r--components/drivers/include/drivers/touch.h2
-rw-r--r--components/drivers/sensor/sensor.c4
-rw-r--r--components/drivers/touch/touch.c6
4 files changed, 5 insertions, 8 deletions
diff --git a/components/drivers/include/drivers/sensor.h b/components/drivers/include/drivers/sensor.h
index f1bdf0c600..30d114fa47 100644
--- a/components/drivers/include/drivers/sensor.h
+++ b/components/drivers/include/drivers/sensor.h
@@ -25,7 +25,6 @@ extern "C" {
#define rt_sensor_get_ts() rt_tick_get() /* API for the sensor to get the timestamp */
#endif
-#define RT_PIN_NONE 0xFFFF /* RT PIN NONE */
#define RT_DEVICE_FLAG_FIFO_RX 0x200 /* Flag to use when the sensor is open by fifo mode */
#define RT_SENSOR_MODULE_MAX (3) /* The maximum number of members of a sensor module */
diff --git a/components/drivers/include/drivers/touch.h b/components/drivers/include/drivers/touch.h
index 318f307081..367d132016 100644
--- a/components/drivers/include/drivers/touch.h
+++ b/components/drivers/include/drivers/touch.h
@@ -24,8 +24,6 @@ extern "C" {
#define rt_touch_get_ts() rt_tick_get() /* API for the touch to get the timestamp */
#endif
-#define RT_PIN_NONE 0xFFFF /* RT PIN NONE */
-
/* Touch vendor types */
#define RT_TOUCH_VENDOR_UNKNOWN (0) /* unknown */
#define RT_TOUCH_VENDOR_GT (1) /* GTxx series */
diff --git a/components/drivers/sensor/sensor.c b/components/drivers/sensor/sensor.c
index e877237621..a3d84d670f 100644
--- a/components/drivers/sensor/sensor.c
+++ b/components/drivers/sensor/sensor.c
@@ -96,7 +96,7 @@ static void _irq_callback(void *args)
/* Sensor interrupt initialization function */
static rt_err_t _sensor_irq_init(rt_sensor_t sensor)
{
- if (sensor->config.irq_pin.pin == RT_PIN_NONE)
+ if (sensor->config.irq_pin.pin == PIN_IRQ_PIN_NONE)
{
return -RT_EINVAL;
}
@@ -269,7 +269,7 @@ static rt_err_t _sensor_close(rt_device_t dev)
if (RT_SENSOR_MODE_GET_FETCH(sensor->info.mode) != RT_SENSOR_MODE_FETCH_POLLING)
{
/* Sensor disable interrupt */
- if (sensor->config.irq_pin.pin != RT_PIN_NONE)
+ if (sensor->config.irq_pin.pin != PIN_IRQ_PIN_NONE)
{
rt_pin_irq_enable(sensor->config.irq_pin.pin, RT_FALSE);
}
diff --git a/components/drivers/touch/touch.c b/components/drivers/touch/touch.c
index 2b292e3ec0..6f5b73a7cb 100644
--- a/components/drivers/touch/touch.c
+++ b/components/drivers/touch/touch.c
@@ -43,7 +43,7 @@ static void touch_irq_callback(void *param)
static rt_err_t rt_touch_irq_init(rt_touch_t touch)
{
#ifdef RT_TOUCH_PIN_IRQ
- if (touch->config.irq_pin.pin == RT_PIN_NONE)
+ if (touch->config.irq_pin.pin == PIN_IRQ_PIN_NONE)
{
return -RT_EINVAL;
}
@@ -73,7 +73,7 @@ static rt_err_t rt_touch_irq_init(rt_touch_t touch)
static void rt_touch_irq_enable(rt_touch_t touch)
{
#ifdef RT_TOUCH_PIN_IRQ
- if (touch->config.irq_pin.pin != RT_PIN_NONE)
+ if (touch->config.irq_pin.pin != PIN_IRQ_PIN_NONE)
{
rt_pin_irq_enable(touch->config.irq_pin.pin, RT_TRUE);
}
@@ -86,7 +86,7 @@ static void rt_touch_irq_enable(rt_touch_t touch)
static void rt_touch_irq_disable(rt_touch_t touch)
{
#ifdef RT_TOUCH_PIN_IRQ
- if (touch->config.irq_pin.pin != RT_PIN_NONE)
+ if (touch->config.irq_pin.pin != PIN_IRQ_PIN_NONE)
{
rt_pin_irq_enable(touch->config.irq_pin.pin, RT_FALSE);
}