Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:watchdog redefinition error #9588

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions bsp/nxp/imx/imx6ull-smart/drivers/drv_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static wdog_config_t WDOG_3_config =
};
#endif

static rt_watchdog_t imx6ull_watchdog[DEV_MAX] =
static watchdog_t imx6ull_watchdog[DEV_MAX] =
{
#ifdef RT_USING_WDT1
{
Expand Down Expand Up @@ -122,7 +122,7 @@ static rt_watchdog_t imx6ull_watchdog[DEV_MAX] =

};

static rt_err_t imx6ull_wdog_init(rt_watchdog_t *wdt)
static rt_err_t imx6ull_wdog_init(watchdog_t *wdt)
{
WDOG_Type *base = RT_NULL;
base = (WDOG_Type *)wdt->vaddr;
Expand All @@ -131,7 +131,7 @@ static rt_err_t imx6ull_wdog_init(rt_watchdog_t *wdt)
return RT_EOK;
}

static rt_err_t imx6ull_wdog_control(rt_watchdog_t *wdt, int cmd, void *args)
static rt_err_t imx6ull_wdog_control(watchdog_t *wdt, int cmd, void *args)
{
RT_ASSERT(wdt != NULL);

Expand Down Expand Up @@ -168,13 +168,13 @@ static rt_err_t imx6ull_wdog_control(rt_watchdog_t *wdt, int cmd, void *args)
}
break;
default:
return RT_EINVAL;
return -RT_ERROR;
}

return RT_EOK;
}

static struct rt_watchdog_ops imx6ull_wdog_ops =
static struct rwatchdog_ops imx6ull_wdog_ops =
{
.init = imx6ull_wdog_init,
.control = imx6ull_wdog_control,
Expand Down
19 changes: 7 additions & 12 deletions bsp/nxp/imx/imx6ull-smart/drivers/drv_wdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,23 @@
#define RT_DEVICE_CTRL_WDT_START (5) /* start watchdog */
#define RT_DEVICE_CTRL_WDT_STOP (6) /* stop watchdog */

struct rt_watchdog_ops;
struct rt_watchdog_device
struct rwatchdog_ops;
struct watchdog_device
{
struct rt_device parent;
const struct rt_watchdog_ops *ops;
const struct rwatchdog_ops *ops;
const char *name;
rt_uint32_t paddr;
rt_uint32_t vaddr;
rt_uint32_t irqno;
wdog_config_t *config;
};
typedef struct rt_watchdog_device rt_watchdog_t;
typedef struct watchdog_device watchdog_t;

struct rt_watchdog_ops
struct rwatchdog_ops
{
rt_err_t (*init)(rt_watchdog_t *wdt);
rt_err_t (*control)(rt_watchdog_t *wdt, int cmd, void *arg);
rt_err_t (*init)(watchdog_t *wdt);
rt_err_t (*control)(watchdog_t *wdt, int cmd, void *arg);
};

rt_err_t rt_hw_watchdog_register(rt_watchdog_t *wdt,
const char *name,
rt_uint32_t flag,
void *data);

#endif /* __WATCHDOG_H__ */
Loading