fix:watchdog redefinition error

This commit is contained in:
Guohezu001 2024-10-29 09:58:39 +08:00
parent e83b8fd820
commit b6102ccb34
2 changed files with 15 additions and 15 deletions

View File

@ -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
{
@ -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;
@ -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);
@ -174,7 +174,7 @@ static rt_err_t imx6ull_wdog_control(rt_watchdog_t *wdt, int cmd, void *args)
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,

View File

@ -21,28 +21,28 @@
#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);
rt_err_t watchdog_register( watchdog_t *wdt,
const char *name,
rt_uint32_t flag,
void *data);
#endif /* __WATCHDOG_H__ */