use PIN_IRQ_PIN_NONE to replace RT_PIN_NONE
This commit is contained in:
parent
2570fab0e1
commit
20a6f14e89
|
@ -264,7 +264,7 @@ int rt_touch_init(void)
|
|||
else if (TOUCH_POLL_MODE == current_driver->check_mode)
|
||||
{
|
||||
rt_thread_t thread;
|
||||
irq_pin = RT_PIN_NONE; // No interrupt pins are used
|
||||
irq_pin = PIN_IRQ_PIN_NONE; // No interrupt pins are used
|
||||
thread = rt_thread_create("touch", touch_poll_entry, RT_NULL, 2048, 16, 20);
|
||||
if (thread == RT_NULL)
|
||||
{
|
||||
|
|
|
@ -167,7 +167,7 @@ int rt_hw_nct7717u_port(void)
|
|||
struct rt_sensor_config cfg;
|
||||
|
||||
cfg.intf.dev_name = "i2c2";
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
return rt_hw_nct7717u_init("nct7717u", &cfg);
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ int rt_hw_max31875_port(void)
|
|||
|
||||
cfg.intf.dev_name = "i2c1";
|
||||
cfg.intf.user_data = (void *)MAX31875_I2C_SLAVE_ADR_R0;
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
rt_hw_max31875_init("max31875", &cfg);
|
||||
return 0;
|
||||
|
@ -175,7 +175,7 @@ int rt_hw_bmx055_port(void)
|
|||
struct rt_sensor_config cfg;
|
||||
cfg.intf.dev_name = "i2c2";
|
||||
cfg.intf.user_data = (void *)0;
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
rt_hw_bmx055_init("bmx055", &cfg);
|
||||
return 0;
|
||||
|
|
|
@ -347,7 +347,7 @@ int rt_hw_nct7717u_port(void)
|
|||
struct rt_sensor_config cfg;
|
||||
|
||||
cfg.intf.dev_name = "i2c2";
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
return rt_hw_nct7717u_init("nct7717u", &cfg);
|
||||
}
|
||||
|
|
|
@ -183,7 +183,7 @@ int rt_hw_max31875_port(void)
|
|||
|
||||
cfg.intf.dev_name = "i2c1";
|
||||
cfg.intf.user_data = (void *)MAX31875_I2C_SLAVE_ADR_R0;
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
rt_hw_max31875_init("max31875", &cfg);
|
||||
return 0;
|
||||
|
@ -199,7 +199,7 @@ int rt_hw_mpu6500_port(void)
|
|||
|
||||
cfg.intf.dev_name = "i2c2";
|
||||
cfg.intf.user_data = (void *)MPU6XXX_ADDR_DEFAULT;
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
rt_hw_mpu6xxx_init("mpu", &cfg);
|
||||
return 0;
|
||||
|
|
|
@ -20,7 +20,7 @@ static int rt_hw_icm20608_port(void)
|
|||
cfg.intf.dev_name = "i2c3";
|
||||
cfg.intf.type = RT_SENSOR_INTF_I2C;
|
||||
cfg.intf.arg = (void *)MPU6XXX_ADDR_DEFAULT;
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
rt_hw_mpu6xxx_init("icm", &cfg);
|
||||
|
||||
|
@ -39,7 +39,7 @@ static int rt_hw_ap3216c_port(void)
|
|||
cfg.intf.dev_name = "i2c3";
|
||||
cfg.intf.type = RT_SENSOR_INTF_I2C;
|
||||
cfg.intf.arg = RT_NULL;
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
rt_hw_ap3216c_init("ap3216c", &cfg);
|
||||
|
||||
|
@ -58,7 +58,7 @@ static int rt_hw_aht10_port(void)
|
|||
cfg.intf.dev_name = "i2c4";
|
||||
cfg.intf.type = RT_SENSOR_INTF_I2C;
|
||||
cfg.intf.arg = (void *)AHT10_I2C_ADDR;
|
||||
cfg.irq_pin.pin = RT_PIN_NONE;
|
||||
cfg.irq_pin.pin = PIN_IRQ_PIN_NONE;
|
||||
|
||||
rt_hw_aht10_init("aht10", &cfg);
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue