From ab8b25bcd3ddec9069417403084b158819ff4809 Mon Sep 17 00:00:00 2001 From: tangweikang Date: Thu, 23 Jul 2020 18:37:35 +0800 Subject: [PATCH] [bsp][stm32][wdt] Optimize code style. --- bsp/stm32/libraries/HAL_Drivers/drv_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bsp/stm32/libraries/HAL_Drivers/drv_wdt.c b/bsp/stm32/libraries/HAL_Drivers/drv_wdt.c index dad7db9be4..fe5d20c757 100644 --- a/bsp/stm32/libraries/HAL_Drivers/drv_wdt.c +++ b/bsp/stm32/libraries/HAL_Drivers/drv_wdt.c @@ -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;