{"action":"created","issue":{"url":"https://api.github.com/repos/RT-Thread/rt-thread/issues/1769","repository_url":"https://api.github.com/repos/RT-Thread/rt-thread","labels_url":"https://api.github.com/repos/RT-Thread/rt-thread/issues/1769/labels{/name}","comments_url":"https://api.github.com/repos/RT-Thread/rt-thread/issues/1769/comments","events_url":"https://api.github.com/repos/RT-Thread/rt-thread/issues/1769/events","html_url":"https://github.com/RT-Thread/rt-thread/issues/1769","id":356347020,"node_id":"MDU6SXNzdWUzNTYzNDcwMjA=","number":1769,"title":"stm32f1_wdg.c驱动建议","user":{"login":"rockjg0917","id":31535181,"node_id":"MDQ6VXNlcjMxNTM1MTgx","avatar_url":"https://avatars0.githubusercontent.com/u/31535181?v=4","gravatar_id":"","url":"https://api.github.com/users/rockjg0917","html_url":"https://github.com/rockjg0917","followers_url":"https://api.github.com/users/rockjg0917/followers","following_url":"https://api.github.com/users/rockjg0917/following{/other_user}","gists_url":"https://api.github.com/users/rockjg0917/gists{/gist_id}","starred_url":"https://api.github.com/users/rockjg0917/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rockjg0917/subscriptions","organizations_url":"https://api.github.com/users/rockjg0917/orgs","repos_url":"https://api.github.com/users/rockjg0917/repos","events_url":"https://api.github.com/users/rockjg0917/events{/privacy}","received_events_url":"https://api.github.com/users/rockjg0917/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-03T03:27:08Z","updated_at":"2018-09-03T03:29:40Z","closed_at":null,"author_association":"NONE","body":"rt_uint32_t timeout = 1000;\r\nrt_device_control(watchdog_device, RT_DEVICE_CTRL_WDT_SET_TIMEOUT, (rt_uint32_t*)timeout);\r\nstatic rt_err_t stm32f1_wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)\r\n{\r\n     rt_uint32_t timeout_ms = 0;\r\n     rt_uint32_t timeout_pow = 1;\r\n     switch(cmd)\r\n     {\r\n     case RT_DEVICE_CTRL_WDT_SET_TIMEOUT:\r\n          timeout_ms = (rt_uint32_t) arg;\r\n**上面是原来的驱动，timeout参数值需要转换为指针，但不是其地址，改成如下会不会好点？主要是传参习惯**\r\nrt_uint32_t timeout = 1000;\r\nrt_device_control(watchdog_device, RT_DEVICE_CTRL_WDT_SET_TIMEOUT, &timeout);\r\nstatic rt_err_t stm32f1_wdg_control(rt_watchdog_t *wdt, int cmd, void *arg)\r\n{\r\n     rt_uint32_t timeout_ms = 0;\r\n     rt_uint32_t timeout_pow = 1;\r\n     switch(cmd)\r\n     {\r\n     case RT_DEVICE_CTRL_WDT_SET_TIMEOUT:\r\n          //timeout_ms = (rt_uint32_t) arg;\r\n\ttimeout_ms = *(rt_uint32_t*) arg;\r\n"},"comment":{"url":"https://api.github.com/repos/RT-Thread/rt-thread/issues/comments/417991153","html_url":"https://github.com/RT-Thread/rt-thread/issues/1769#issuecomment-417991153","issue_url":"https://api.github.com/repos/RT-Thread/rt-thread/issues/1769","id":417991153,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzk5MTE1Mw==","user":{"login":"uestczyh222","id":6795060,"node_id":"MDQ6VXNlcjY3OTUwNjA=","avatar_url":"https://avatars3.githubusercontent.com/u/6795060?v=4","gravatar_id":"","url":"https://api.github.com/users/uestczyh222","html_url":"https://github.com/uestczyh222","followers_url":"https://api.github.com/users/uestczyh222/followers","following_url":"https://api.github.com/users/uestczyh222/following{/other_user}","gists_url":"https://api.github.com/users/uestczyh222/gists{/gist_id}","starred_url":"https://api.github.com/users/uestczyh222/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uestczyh222/subscriptions","organizations_url":"https://api.github.com/users/uestczyh222/orgs","repos_url":"https://api.github.com/users/uestczyh222/repos","events_url":"https://api.github.com/users/uestczyh222/events{/privacy}","received_events_url":"https://api.github.com/users/uestczyh222/received_events","type":"User","site_admin":false},"created_at":"2018-09-03T03:29:40Z","updated_at":"2018-09-03T03:29:40Z","author_association":"CONTRIBUTOR","body":"你这不就bug了吗，void*是一个无明确意义的四字节变量，直接传会不会好一些"}}
{"actor":{"display_login":"uestczyh222"}}