mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-18 11:53:53 +08:00
[bsp][stm32][wdt] Optimize code style.
This commit is contained in:
parent
1a42ca9035
commit
ab8b25bcd3
@ -18,12 +18,12 @@
|
||||
|
||||
struct stm32_wdt_obj
|
||||
{
|
||||
rt_watchdog_t watchdog;
|
||||
IWDG_HandleTypeDef hiwdg;
|
||||
rt_uint16_t is_start;
|
||||
};
|
||||
static struct stm32_wdt_obj stm32_wdt;
|
||||
static struct rt_watchdog_ops ops;
|
||||
static rt_watchdog_t watchdog;
|
||||
|
||||
static rt_err_t wdt_init(rt_watchdog_t *wdt)
|
||||
{
|
||||
@ -116,9 +116,9 @@ int rt_wdt_init(void)
|
||||
|
||||
ops.init = &wdt_init;
|
||||
ops.control = &wdt_control;
|
||||
watchdog.ops = &ops;
|
||||
stm32_wdt.watchdog.ops = &ops;
|
||||
/* register watchdog device */
|
||||
if (rt_hw_watchdog_register(&watchdog, "wdt", RT_DEVICE_FLAG_DEACTIVATE, RT_NULL) != RT_EOK)
|
||||
if (rt_hw_watchdog_register(&stm32_wdt.watchdog, "wdt", RT_DEVICE_FLAG_DEACTIVATE, RT_NULL) != RT_EOK)
|
||||
{
|
||||
LOG_E("wdt device register failed.");
|
||||
return -RT_ERROR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user