From ef8398c2bb48b691d16cf40fec69ca27954efa4a Mon Sep 17 00:00:00 2001 From: luo jiao Date: Tue, 26 Jun 2018 22:18:58 +0800 Subject: [PATCH] [components][drivers][pin module]:typo fix for pin_detach_irq --- bsp/allwinner_tina/drivers/drv_gpio.c | 4 ++-- bsp/imxrt1052-evk/drivers/drv_pin.c | 4 ++-- bsp/ls1cdev/drivers/drv_gpio.c | 4 ++-- bsp/stm32f10x-HAL/drivers/drv_gpio.c | 4 ++-- bsp/stm32f10x/drivers/gpio.c | 4 ++-- bsp/stm32f40x/drivers/gpio.c | 4 ++-- bsp/stm32f429-apollo/drivers/drv_gpio.c | 4 ++-- bsp/stm32f4xx-HAL/drivers/drv_gpio.c | 4 ++-- bsp/stm32l476-nucleo/drivers/drv_gpio.c | 4 ++-- components/drivers/include/drivers/pin.h | 6 ++---- components/drivers/misc/pin.c | 6 +++--- 11 files changed, 23 insertions(+), 25 deletions(-) diff --git a/bsp/allwinner_tina/drivers/drv_gpio.c b/bsp/allwinner_tina/drivers/drv_gpio.c index ba31cca0e9..cd650ed009 100644 --- a/bsp/allwinner_tina/drivers/drv_gpio.c +++ b/bsp/allwinner_tina/drivers/drv_gpio.c @@ -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 diff --git a/bsp/imxrt1052-evk/drivers/drv_pin.c b/bsp/imxrt1052-evk/drivers/drv_pin.c index 7d553f5f3d..5e0406f780 100644 --- a/bsp/imxrt1052-evk/drivers/drv_pin.c +++ b/bsp/imxrt1052-evk/drivers/drv_pin.c @@ -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); diff --git a/bsp/ls1cdev/drivers/drv_gpio.c b/bsp/ls1cdev/drivers/drv_gpio.c index a4be5b2e4d..3a21b54a33 100644 --- a/bsp/ls1cdev/drivers/drv_gpio.c +++ b/bsp/ls1cdev/drivers/drv_gpio.c @@ -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 }; diff --git a/bsp/stm32f10x-HAL/drivers/drv_gpio.c b/bsp/stm32f10x-HAL/drivers/drv_gpio.c index 6a0db74018..911a5aee49 100644 --- a/bsp/stm32f10x-HAL/drivers/drv_gpio.c +++ b/bsp/stm32f10x-HAL/drivers/drv_gpio.c @@ -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, }; diff --git a/bsp/stm32f10x/drivers/gpio.c b/bsp/stm32f10x/drivers/gpio.c index fa46c71349..e0778f35d5 100755 --- a/bsp/stm32f10x/drivers/gpio.c +++ b/bsp/stm32f10x/drivers/gpio.c @@ -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, }; diff --git a/bsp/stm32f40x/drivers/gpio.c b/bsp/stm32f40x/drivers/gpio.c index 4462f2847e..61fb8b3977 100644 --- a/bsp/stm32f40x/drivers/gpio.c +++ b/bsp/stm32f40x/drivers/gpio.c @@ -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, }; diff --git a/bsp/stm32f429-apollo/drivers/drv_gpio.c b/bsp/stm32f429-apollo/drivers/drv_gpio.c index a5158eeade..fe26d0027a 100644 --- a/bsp/stm32f429-apollo/drivers/drv_gpio.c +++ b/bsp/stm32f429-apollo/drivers/drv_gpio.c @@ -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, }; diff --git a/bsp/stm32f4xx-HAL/drivers/drv_gpio.c b/bsp/stm32f4xx-HAL/drivers/drv_gpio.c index 0218c05e03..4906315ddd 100644 --- a/bsp/stm32f4xx-HAL/drivers/drv_gpio.c +++ b/bsp/stm32f4xx-HAL/drivers/drv_gpio.c @@ -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, }; diff --git a/bsp/stm32l476-nucleo/drivers/drv_gpio.c b/bsp/stm32l476-nucleo/drivers/drv_gpio.c index 316c0c9874..6d8c785193 100644 --- a/bsp/stm32l476-nucleo/drivers/drv_gpio.c +++ b/bsp/stm32l476-nucleo/drivers/drv_gpio.c @@ -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, }; diff --git a/components/drivers/include/drivers/pin.h b/components/drivers/include/drivers/pin.h index d21fc28bd9..de8fd21acc 100644 --- a/components/drivers/include/drivers/pin.h +++ b/components/drivers/include/drivers/pin.h @@ -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 diff --git a/components/drivers/misc/pin.c b/components/drivers/misc/pin.c index dc2137eb17..ce78f97f87 100644 --- a/components/drivers/misc/pin.c +++ b/components/drivers/misc/pin.c @@ -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; }