Merge pull request #1574 from misonyo/dev

[components][drivers][pin module]:typo fix for pin_detach_irq
This commit is contained in:
Bernard Xiong 2018-06-27 13:30:56 +08:00 committed by GitHub
commit cf73f3a3c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 23 additions and 25 deletions

View File

@ -493,7 +493,7 @@ static rt_err_t pin_attach_irq(struct rt_device *device, rt_int32_t pin, rt_uint
gpio_set_irq_type(pin_index[pin].pin_port, pin_index[pin].pin, mode);
return RT_EOK;
}
static rt_err_t pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
static rt_err_t pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
if ((pin > PIN_NUM(pin_index)) || (pin_index[pin].magic != PIN_MAGIC))
{
@ -539,7 +539,7 @@ static const struct rt_pin_ops ops =
pin_write,
pin_read,
pin_attach_irq,
pin_dettach_irq,
pin_detach_irq,
pin_irq_enable,
};
#endif

View File

@ -536,7 +536,7 @@ static rt_err_t rt1052_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return RT_EOK;
}
static rt_err_t rt1052_pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
static rt_err_t rt1052_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
struct rt1052_pin* pin_map = RT_NULL;
struct rt1052_irq* irq_map = RT_NULL;
@ -675,7 +675,7 @@ int rt_hw_pin_init(void)
rt1052_pin_ops.pin_read = rt1052_pin_read;
rt1052_pin_ops.pin_write = rt1052_pin_write;
rt1052_pin_ops.pin_attach_irq = rt1052_pin_attach_irq;
rt1052_pin_ops.pin_dettach_irq = rt1052_pin_dettach_irq;
rt1052_pin_ops.pin_detach_irq = rt1052_pin_detach_irq;
rt1052_pin_ops.pin_irq_enable = rt1052_pin_irq_enable;
ret = rt_device_pin_register("pin", &rt1052_pin_ops, RT_NULL);

View File

@ -95,7 +95,7 @@ rt_err_t ls1c_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return RT_EOK;
}
rt_err_t ls1c_pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
rt_err_t ls1c_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
return RT_EOK;
}
@ -119,7 +119,7 @@ const static struct rt_pin_ops _ls1c_pin_ops =
ls1c_pin_read,
ls1c_pin_attach_irq,
ls1c_pin_dettach_irq,
ls1c_pin_detach_irq,
ls1c_pin_irq_enable
};

View File

@ -695,7 +695,7 @@ rt_err_t stm32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return RT_EOK;
}
rt_err_t stm32_pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
rt_err_t stm32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
const struct pin_index *index;
rt_base_t level;
@ -798,7 +798,7 @@ const static struct rt_pin_ops _stm32_pin_ops =
stm32_pin_write,
stm32_pin_read,
stm32_pin_attach_irq,
stm32_pin_dettach_irq,
stm32_pin_detach_irq,
stm32_pin_irq_enable,
};

View File

@ -622,7 +622,7 @@ rt_err_t stm32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return RT_EOK;
}
rt_err_t stm32_pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
rt_err_t stm32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
const struct pin_index *index;
rt_base_t level;
@ -742,7 +742,7 @@ const static struct rt_pin_ops _stm32_pin_ops =
stm32_pin_write,
stm32_pin_read,
stm32_pin_attach_irq,
stm32_pin_dettach_irq,
stm32_pin_detach_irq,
stm32_pin_irq_enable,
};

View File

@ -667,7 +667,7 @@ rt_err_t stm32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return RT_EOK;
}
rt_err_t stm32_pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
rt_err_t stm32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
const struct pin_index *index;
rt_base_t level;
@ -787,7 +787,7 @@ const static struct rt_pin_ops _stm32_pin_ops =
stm32_pin_write,
stm32_pin_read,
stm32_pin_attach_irq,
stm32_pin_dettach_irq,
stm32_pin_detach_irq,
stm32_pin_irq_enable,
};

View File

@ -1698,7 +1698,7 @@ rt_err_t stm32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return RT_EOK;
}
rt_err_t stm32_pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
rt_err_t stm32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
const struct pin_index *index;
rt_base_t level;
@ -1802,7 +1802,7 @@ const static struct rt_pin_ops _stm32_pin_ops =
stm32_pin_write,
stm32_pin_read,
stm32_pin_attach_irq,
stm32_pin_dettach_irq,
stm32_pin_detach_irq,
stm32_pin_irq_enable,
};

View File

@ -1701,7 +1701,7 @@ rt_err_t stm32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return RT_EOK;
}
rt_err_t stm32_pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
rt_err_t stm32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
rt_uint16_t gpio_pin;
rt_base_t level;
@ -1802,7 +1802,7 @@ const static struct rt_pin_ops _stm32_pin_ops =
stm32_pin_write,
stm32_pin_read,
stm32_pin_attach_irq,
stm32_pin_dettach_irq,
stm32_pin_detach_irq,
stm32_pin_irq_enable,
};

View File

@ -682,7 +682,7 @@ rt_err_t stm32_pin_attach_irq(struct rt_device *device, rt_int32_t pin,
return RT_EOK;
}
rt_err_t stm32_pin_dettach_irq(struct rt_device *device, rt_int32_t pin)
rt_err_t stm32_pin_detach_irq(struct rt_device *device, rt_int32_t pin)
{
const struct pin_index *index;
rt_base_t level;
@ -786,7 +786,7 @@ const static struct rt_pin_ops _stm32_pin_ops =
stm32_pin_write,
stm32_pin_read,
stm32_pin_attach_irq,
stm32_pin_dettach_irq,
stm32_pin_detach_irq,
stm32_pin_irq_enable,
};

View File

@ -86,7 +86,7 @@ struct rt_pin_ops
/* TODO: add GPIO interrupt */
rt_err_t (*pin_attach_irq)(struct rt_device *device, rt_int32_t pin,
rt_uint32_t mode, void (*hdr)(void *args), void *args);
rt_err_t (*pin_dettach_irq)(struct rt_device *device, rt_int32_t pin);
rt_err_t (*pin_detach_irq)(struct rt_device *device, rt_int32_t pin);
rt_err_t (*pin_irq_enable)(struct rt_device *device, rt_base_t pin, rt_uint32_t enabled);
};
@ -97,11 +97,9 @@ void rt_pin_write(rt_base_t pin, rt_base_t value);
int rt_pin_read(rt_base_t pin);
rt_err_t rt_pin_attach_irq(rt_int32_t pin, rt_uint32_t mode,
void (*hdr)(void *args), void *args);
rt_err_t rt_pin_dettach_irq(rt_int32_t pin);
rt_err_t rt_pin_detach_irq(rt_int32_t pin);
rt_err_t rt_pin_irq_enable(rt_base_t pin, rt_uint32_t enabled);
int rt_device_pin_irq_register(const char *name, const struct rt_pin_ops *ops,
void *user_data);
#ifdef __cplusplus
}
#endif

View File

@ -124,12 +124,12 @@ rt_err_t rt_pin_attach_irq(rt_int32_t pin, rt_uint32_t mode,
}
return RT_ENOSYS;
}
rt_err_t rt_pin_dettach_irq(rt_int32_t pin)
rt_err_t rt_pin_detach_irq(rt_int32_t pin)
{
RT_ASSERT(_hw_pin.ops != RT_NULL);
if(_hw_pin.ops->pin_dettach_irq)
if(_hw_pin.ops->pin_detach_irq)
{
return _hw_pin.ops->pin_dettach_irq(&_hw_pin.parent, pin);
return _hw_pin.ops->pin_detach_irq(&_hw_pin.parent, pin);
}
return RT_ENOSYS;
}